Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
draws a popup box with lines inside it. retuns an html element (div)
function drawDetailBox(lambda) { var h = canvas.height; var ctx = canvas.getContext("2d"); for (var i = 1; i <= 100; i++) { ctx.beginPath(); ctx.moveTo(i * 4, 0); ctx.lineTo(i * 4, h); ctx.lineWidth = 2; if (lambda.includes(i)) ctx.strokeStyle = "black" else ctx.strokeStyle = "gray"; ctx.stroke(); } return wrapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPopup() {\n\tif (document.getElementById(\"blackOverlay\")) {\n\t\tdocument.body.removeChild(document.getElementById(\"blackOverlay\"));\n\t}\n\tvar popup = document.createElement(\"DIV\");\n\tpopup.id = \"blackOverlay\";\n\t\n\tvar prompt = document.createElement(\"DIV\");\n\tprompt.id = \"whitePrompt\";\n\tpopup.appendChild(prompt);\n\t\n\tdocument.body.appendChild(popup);\n}", "function ct_popupbox(type, l1, l2, l3) {\n /*\n type: Type of popup; Can be Error (err), Warning (wrn) or Information (inf). PARSE AS STRING! \"err\",\"inf\",\"wrn\"\n msg: Message shown to user, parse as string.\n */\n\n switch (type) {\n case 'err':\n var typereadable = \"Error\"; // type of popup as readable text, used in titlebar; \"err\" = \"Error\"\n var pubicon = 'status/16/error.png'; // Icon for popupbox movebar\n break;\n case 'wrn':\n var typereadable = \"Warning\";\n var pubicon = 'status/16/important.png';\n break;\n case 'inf':\n var typereadable = \"Information\";\n var pubicon = 'status/16/info.png';\n break;\n default:\n console.error(\"Did not parse type of popupbox correctly when called!\"); // happens when you dont enter options correctly\n return 1;\n }\n\n var dnctv_ctpopupbox = new cwindow('ctpopupbox', 50, 50, (ele) => {\n var blines = [], // temp\n clines = [l1, l2, l3];\n var textSize = 16;\n var lineHeight = 18;\n\n clines.forEach((e, i) => {\n wordWrap(e, dnctv_ctpopupbox.width / 7.2).split('\\n').forEach((ee, ii) => {\n blines.push(ee);\n });\n });\n\n blines.forEach((e, i) => {\n mctx.fillStyle = '#000';\n mctx.font = textSize + 'px Open Sans';\n mctx.fillText(e, dnctv_ctpopupbox.x + 20, dnctv_ctpopupbox.y + 60 + i * lineHeight);\n });\n\n var newHeight = textSize + 12 + blines.length * lineHeight;\n if (dnctv_ctpopupbox.minHeight <= newHeight) dnctv_ctpopupbox.height = newHeight\n else dnctv_ctpopupbox.height = dnctv_ctpopupbox.minHeight\n });\n\n // properties of titlebar of box\n dnctv_ctpopupbox.title = typereadable + \" | CT PopupBox\";\n dnctv_ctpopupbox.icon = pubicon;\n // Size of box\n dnctv_ctpopupbox.width = 400;\n dnctv_ctpopupbox.minHeight = 100;\n // setting the location of the box to the center of the enviornment\n dnctv_ctpopupbox.x = msize.w / 2 - dnctv_ctpopupbox.width / 2;\n dnctv_ctpopupbox.y = msize.h / 2 - dnctv_ctpopupbox.height / 2;\n\n\n return 0;\n\n}", "render() {\n return this.renderPart_popup();\n }", "function ctt_popupbox() { ct_popupbox(\"err\", \"Test popup box. The quick brown fox jumps over the lazy dog. Something something that is really long. Sprinkles on kittens and raindrops on noses something idk. Test popup box. The quick brown fox jumps over the lazy dog. Something something that is really long. Sprinkles on kittens and raindrops on noses something idk. Test popup box. The quick brown fox jumps over the lazy dog. Something something that is really long. Sprinkles on kittens and raindrops on noses something idk.\") }", "function makePopup(detail){\n\tdocument.getElementById('overlay').style.display = \"block\";\n\tdocument.getElementById('content').style.display = \"block\";\n\tdocument.getElementById('content').innerHTML = detail;\n}", "function writePopupMenu() {\n\t\tif (document.getElementById(this.id) == null) {\n\t\t\tvar pum = document.createElement(\"span\");\n\t\t\tpum.setAttribute(\"id\", this.id);\n\t\t\tvar pumsp = document.getElementById(MAP).appendChild(pum);\n\t\t\tpumsp.style.position = \"absolute\";\n\t\t\tpumsp.style.top = 0;\n\t\t\tpumsp.style.left = -1;\n\t\t\tpumsp.style.width = 220;\n\t\t\tpumsp.style.zIndex = 500;\n\t\t\tpumsp.style.backgroundColor = \"White\";\n\t\t\tpumsp.style.paddingTop = 2;\n\t\t\tpumsp.style.paddingRight = 10;\n\t\t\tpumsp.style.paddingLeft = 5;\n\t\t\tpumsp.style.visibility = \"hidden\";\n\t\t\tpumsp.style.borderBottomStyle = \"groove\";\n\t\t\tpumsp.style.borderBottomColor = \"Gray\";\n\t\t\tpumsp.style.borderBottomWidth = 3;\n\t\t\tpumsp.style.borderRightColor = \"Gray\";\n\t\t\tpumsp.style.borderRightStyle = \"groove\";\n\t\t\tpumsp.style.borderRightWidth = 3;\n\t\t\tpumsp.style.borderLeftColor = \"Gray\";\n\t\t\tpumsp.style.borderLeftStyle = \"solid\";\n\t\t\tpumsp.style.borderLeftWidth = 1;\n\t\t\tpumsp.style.borderTopColor = \"Gray\";\n\t\t\tpumsp.style.borderTopStyle = \"solid\";\n\t\t\tpumsp.style.borderTopWidth = 1;\n\t\t}\n\t\tvar popupMenuItem = null;\n\t\tvar html = \"\";\n\t\tfor (var i=0; i < this.items.getLength(); i++) {\n\t\t\tpopupMenuItem = this.items.get(i);\n\t\t\thtml += \"<p style=\\\"font-family:Arial,Helvetica,sans-serif; font-size:12px; color:#003366; \";\n\t\t\thtml += \"margin-top:0px; margin-bottom:0px; cursor:hand; \\\" \";\n\t\t\thtml += \"onmouseover=\\\"this.style.textDecoration = 'underline';\\\" onmouseout=\\\"this.style.textDecoration = 'none';\\\">\";\n\t\t\tif (rightClickedElementId.indexOf(CONNECTION) == 0) {\n\t\t\t\thtml += \"<nobr onclick=\\\"document.getElementById(rightClickedElementId).connection.executeAction('\" + popupMenuItem.action + \"');\\\">\";\n\t\t\t} else if (rightClickedElementId.indexOf(NETWORK_ELEMENT) == 0) {\n\t\t\t\thtml += \"<nobr onclick=\\\"document.getElementById(rightClickedElementId).parentObj.executeAction('\" + popupMenuItem.action + \"');\\\">\";\n\t\t\t} else if (rightClickedElementId.indexOf(MAP) == 0) {\n\t\t\t\thtml += \"<nobr onclick=\\\"document.getElementById(rightClickedElementId).map.executeAction('\" + popupMenuItem.action + \"');\\\">\";\n\t\t\t}\n\t\t\thtml += \"&raquo;&nbsp;\";\n\t\t\tif (popupMenuItem.img != null) {\n\t\t\t\thtml += \"<img border=0 src=\\\"\" + popupMenuItem.img + \"\\\">&nbsp;\";\n\t\t\t}\n\t\t\thtml += popupMenuItem.text;\n\t\t\thtml += \"</nobr></p>\";\n\t\t}\n\t\tdocument.getElementById(this.id).innerHTML = html;\n\t}", "function printingInfoContainer() {\n jQuery('<div id=\"ksp_printing_info\" class=\"popupinfo\"> \\\n <a class=\"viewerClose\" style=\"float: right; z-index: 100\" href=\"#\" onclick=\"shadowViewer.hide();return false;\"><img alt=\"close\" title=\"close\" src=\"/stores/realmadrid/artwork/english/interface/close_v1.jpg\"></a> \\\n <div class=\"content\"> \\\n <p class=\"printing_popup_title\">'+ ksp_popup_title +'</p> \\\n '+ ksp_popup_content +' \\\n </div> \\\n </div>').appendTo('body');\n}", "function newDiv(){\n\tlet randomNumber = Math.floor( Math.random() * (quotes.length) )\n\tlet quote = quotes[ randomNumber ]\n\tlet d = document.createElement( 'span' )\n\td.textContent = quote\n\td.className = 'popup'\n\td.style.top = Math.random()* ( window.innerHeight ) / 3 + \"px\"\n\td.style.left = Math.random() * ( window.innerWidth ) / 3 + \"px\"\n\td.style.fontSize = Math.random() * 14 + 7 + \"px\"\n\n\tdocument.body.appendChild( d )\n\tsetTimeout(() => {\n\t\tdocument.body.removeChild( d )\n\t}, 5*1000)\n}", "function createBox(){\r\n var linebreak = document.createElement(\"br\");\r\n document.body.appendChild(linebreak);\r\n\r\n var gradeBox = document.getElementById(\"gradeBox\");\r\n var clone = gradeBox.cloneNode();\r\n document.body.appendChild(clone);\r\n}", "function createPopup () {\n var popup = $('<div id=\"' + popupId + '\"><div class=\"marker-points\"></div><div class=\"marker-button-wrapper\"><button class=\"marker-button-download\">Download Points</button><button class=\"marker-button-clear\">Clear Points</button></div></div>');\n\n $(\"body\").append(popup);\n\n $(\".marker-button-download\").click(exportFileHandler);\n $(\".marker-button-clear\").click(clearPointsHandler);\n\n popup.dialog({\n width : 300,\n height : 400,\n resizable : false,\n position : { my: \"right top\", at: \"right-5 top+120\" },\n title : \"Mark areas of interest\",\n close : function (event, ui) {\n clearPointsHandler();\n $(this).remove();\n }\n });\n }", "function createPopup () {\n var popup = $('<div id=\"' + popupId + '\"><div class=\"marker-points\"></div><div class=\"marker-button-wrapper\"><button class=\"marker-button-download\">Download Points</button><button class=\"marker-button-clear\">Clear Points</button></div></div>');\n\n $(\"body\").append(popup);\n\n $(\".marker-button-download\").click(exportFileHandler);\n $(\".marker-button-clear\").click(clearPointsHandler);\n\n popup.dialog({\n width : 300,\n height : 400,\n resizable : false,\n position : { my: \"right top\", at: \"right-5 top+120\" },\n title : \"Mark areas of interest\",\n close : function (event, ui) {\n clearPointsHandler();\n $(this).remove();\n }\n });\n }", "function createPopup(type,containerId,containerClass,arrowHolderClass,arrowClass,arrowBorderHolderClass,arrowBorderClass)\n {\n var popup = createDiv(containerId,containerClass);\n \n // Need to expand for getting dynamic content\n var data = '';\n \n switch (type) {\n case 'info':\n data = \"Please use your knowledge and the extra information provided to make an informed, objective view on the legitimacy of this article. Things to consider: <ul><li>Is there an obvious bias?</li><li>Is the author giving evidence?</li><li>Does it read like opinion or fact?</li><li>Is it a balanced or one sided article?</li></ul>\";;\n break;\n case 'other':\n data = \"Here is some very helpful other information surrounding this news outlet\";\n break;\n case 'economical':\n data = \"Here is some very helpful economical information surrounding this news outlet\";\n break;\n case 'political':\n data = \"Here is some very helpful political information surrounding this news outlet\";\n break;\n default:\n data = \"Error loading text\";\n } \n \n \n //Creating background triangle to give border effect\n var arrowBackground = createDiv('',arrowBorderHolderClass);\n arrowBackground.className += \" \" + arrowBorderClass;\n popup.appendChild(arrowBackground);\n var arrow = createDiv('',arrowHolderClass);\n arrow.className += \" \" +arrowClass;\n popup.appendChild(arrow);\n var textDiv = document.createElement('div');\n textDiv.className = 'popupText';\n textDiv.innerHTML += data;\n popup.appendChild(textDiv);\n \n return popup; \n }", "function makeDialog( selected, event )\n {\n var boxOptions = $.chili.selection.box;\n var boxTag = $.browser.msie\n ? ('<textarea style=\"' + boxOptions.style + '\">')\n : ('<pre style=\"' + boxOptions.style + '\">');\n \n var boxElement = $(boxTag)\n .appendTo( 'body' )\n .text( selected )\n .attr( 'id', 'chili_selection' )\n .click( function() { $(this).remove(); } )\n ;\n var top = boxOptions.top(event.pageX, event.pageY, \n boxElement.width(), boxElement.height());\n var left = boxOptions.left(event.pageX, event.pageY, \n boxElement.width(), boxElement.height());\n boxElement.css( { top: top, left: left } );\n \n return boxElement;\n }", "function popup_open(x, y, title, content)\r\n{\r\n\tpopup_left = x;\r\n\tpopup_top = y;\r\n\tdocument.write('<div class=\"dhtml_popup\" id=\"popup_id\" style=\"top: ' + popup_top + 'px; left: ' + popup_left + 'px; z-index: 10;\" onmouseup=\"popup_click(false)\" onmousedown=\"popup_click(true)\">');\r\n\tdocument.write('<div class=\"dhtml_popup_title\">' + title + '</div>');\r\n\tdocument.write('<div class=\"error\">' + content + '</div>');\r\n\tdocument.write('</div>');\r\n\r\n\tsetTimeout('popup_position()', 10);\r\n}", "function startDiv(layerID) \r\n{\r\n\tif (browserOK)\t// We can make the interactive elements available ...\r\n\t{\r\n\t\tdocument.write('<A href=\\\"javascript: toggleDisplay(\\''+layerID+'\\')\\\" onMouseOver=\\\"showStatus(\\''+layerID+'\\'); return true\\\" onMouseOut=\\\"window.status=\\' \\';return true\\\")\\\"><IMG src=\\\"plus.gif\\\" border=\\\"0\\\" width=\\\"12\\\" height=\\\"12\\\" alt=\\\"+\\\" name=\\\"i'+layerID+'\\\"><\\/A>');\r\n\t\tdocument.write('<DIV id=\\\"'+layerID+'\\\" class=\\\"hidden\\\" style=\\\"display: none\\\">');\r\n\t}\r\n\telse\t\t\t// No interactive element available\r\n\t{\r\n\t\tdocument.write('<DIV id=\\\"'+layerID+'\\\" class=\\\"hidden\\\"><HR align=\\\"left\\\" width=\\\"25%\\\">');\r\n\t}\r\n\r\n}", "function insertEditFarmBox() {\r\n\r\n\tFM_log(3,\"insertEditFarmBox() called\");\r\n\r\n\tvar i;\r\n\r\n\tdiv = document.createElement('div');\r\n\r\n\tdiv.id = \"popupFarmEditBox\";\r\n\r\n\tdiv.style.visibility = 'hidden';\r\n\r\n\tdiv.style.zIndex = 100;\r\n\r\n\tdiv.style.position = 'absolute';\r\n\r\n\tdiv.style.borderWidth = '1px';\r\n\r\n\tdiv.style.top = '600px';\r\n\r\n\tdiv.style.left = '150px';\r\n\t\r\n\t//getting default troops\t\r\n\ttempTroops = defTroops.split(',');\r\n\tFM_log(4,\"tempTroops arraysize=\"+tempTroops.length);\r\n\tif(tempTroops.length!=11) {\r\n\t\tdefTroops = \"0,0,0,0,0,0,0,0,0,0,0\";\r\n\t\ttempTroops = defTroops.split(',');\r\n\t}\r\n\t\r\n\r\n\tvar text = \"<fieldset style='background-color: #c2d9ec; border: 1px solid #C0C0C0; -moz-border-radius: 10px;'>\"\r\n\r\n\t\t\t+ \"<legend style='background-color: #c2d9ec; border-top: 1px solid #C0C0C0; -moz-border-radius: 2px;'>Add/Edit Farm</legend>\"\r\n\r\n\t\t\t+ \"<img src='img/x.gif' class='unit u\" + (user_race)\r\n\r\n\t\t\t\t+ \"'>:<input type='text' size='1' value='\" + tempTroops[0] + \"' id='t1'>\";\r\n\t\r\n\t\r\n\r\n\tfor (i = 1; i < 10; i++) {\r\n\r\n\t\ttext += \"<img src='/img/x.gif' class='unit u\" + (user_race + i)\r\n\r\n\t\t\t\t+ \"'>:<input type='text' size='1' value='\" + tempTroops[i] + \"' id='t\"\r\n\r\n\t\t\t\t+ (i + 1) + \"'>\";\r\n\r\n\t}\r\n\ttext += \"<img src='/img/x.gif' class='unit uhero'>:<input type='text' size='1' value='\" + tempTroops[10] + \"' id='t\"\r\n\r\n\t\t\t+ (10 + 1) + \"'>\";\r\n\r\n\ttext += \"<br/>\"\r\n\r\n\t\t\t+ \"<input type='radio' id='radio2' name='AttackType' value='2' />\"\r\n\r\n\t\t\t+ T(\"Reinforce\")\r\n\r\n\t\t\t+ \"<input type='radio' id='radio3' name='AttackType' value='3' />\"\r\n\r\n\t\t\t+ T(\"Attack\")\r\n\r\n\t\t\t+ \"<input type='radio' id='radio4' name='AttackType' checked='true' value='4' />\"\r\n\r\n\t\t\t+ T(\"Raid\")\r\n\r\n\t\t\t+ \"<br />\"\r\n\r\n\t\t\t+ \"<input type='checkbox' checked='true' id='activeCheck' />\"\r\n\r\n\t\t\t+ T(\"Active_Farm\")\r\n\r\n\t\t\t+ \"<br />\"\r\n\r\n\t\t\t+ \"<input style='float: right;' id='FMcancelButton' type='submit' value=\"\r\n\r\n\t\t\t+ T('Cancel')\r\n\r\n\t\t\t+ \" />\"\r\n\r\n\t\t\t+ \"<input style='float: right;' id='FMsaveButton' type='submit' value=\"\r\n\r\n\t\t\t+ T('Save') + \" /></fieldset>\";\r\n\r\n\r\n\r\n\tdiv.innerHTML = text;\r\n\r\n\tdocument.body.appendChild(div);\r\n\r\n\tdom.get('FMcancelButton').addEventListener('click', hidePopupFarmEditBox,\r\n\r\n\t\t\ttrue);\r\n\r\n\tFM_log(3,\"FarmEditBox Insert done\");\r\n\r\n\t//Add the event listener for Save button in appropiate place :)\r\n\r\n}", "function createSquare(boxPos, squarePos, numOfNotes) {\n let notes = '';\n\n for (let i = 0; i < numOfNotes; i++) {\n notes += createNote();\n }\n\n return '<div class=\"square\" onclick=\"OpenPopup(' + boxPos + ', ' + squarePos + ')\"> \\n <span> </span> \\n ' + notes + '</div> \\n';\n}", "function createPopBox() {\n var parent = jQuery('<div/>').addClass('popbox');\n var open = jQuery('<button/>').addClass('open').text('Click Here!');\n var collapse = jQuery('<div/>').addClass('collapse');\n collapse.html(\n '<div class=\"box\">' +\n ' <div class=\"arrow\"></div>' +\n ' <div class=\"arrow-border\"></div>' +\n ' <div class=\"popbox-content\">' +\n ' </div>' +\n ' <a href=\"#\" class=\"close\">close</a>' +\n '</div>');\n parent.append(open).append(collapse);\n\n var content = collapse.find('.popbox-content');\n content.text('Content Here :)');\n\n parent.data('onPopBox', function() {\n parent.find('.viewport').parent().width(content.width() + 20);\n });\n\n return {\n parent: parent,\n button: open,\n content: content\n };\n }", "function displayPopup(){\n var add = $(\"body\").append(\"<div id='popup'></div>\");\n $(\"#popup\")\n .css(\"background-color\",\"gray\")\n .css(\"opacity\",\"1\")\n .css(\"width\",\"300px\")\n .css(\"height\",\"100px\")\n .css(\"position\",\"fixed\")\n .css(\"z-index\", \"9999999\")\n .css(\"top\",\"1em\")\n .css(\"right\",\"1em\")\n .css(\"border-radius\",\"3px\")\n .attr(\"id\",\"box\");\n\n // The \"Add Some\" button allows the user to manually add\n // the highlighted elements one by one by hovering over a\n // highlighted element.\n $(\"<center>\" + \n \"<p id='selectText'>Add all to selected table?</p>\" +\n \"<button class='popupButton' id='okButton'>Add All</button>\" +\n \"<button class='popupButton' id='addOneButton'>Add Some</button>\" + \n \"<button class='popupButton' id='cancelButton'>Deselect All</button>\" +\n \"</center>\").appendTo(\"#box\");\n}", "function UIgenerate() {\n var o = document.getElementById( 'overlay' );\n\n for ( var u = 0; u < ui.length; u++ ) {\n o.appendChild( ui[ u ].dom() );\n var s = document.createElement( 'span' );\n s.innerHTML = '&nbsp&nbsp'\n o.appendChild( s );\n }\n\n\n}", "function create_popup(text,target)\n {\n //alert(text);\n var status_window = $('acts_as_monitor_status_window');\n status_window.update(text);\n Position.clone(target,\n status_window, {\n offsetLeft: 20\n });\n new Effect.Appear(status_window);\n //alert(\"Fatto\");\n }", "function includePopupHTML(){\n\n\t// variable containg all the popup html\n\n\tvar html = \"<div id='vis-popup'><span id='close' onclick='closePopUp()'><img id='npop' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAA4JGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMwNjcgNzkuMTU3NzQ3LCAyMDE1LzAzLzMwLTIzOjQwOjQyICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoV2luZG93cyk8L3htcDpDcmVhdG9yVG9vbD4KICAgICAgICAgPHhtcDpDcmVhdGVEYXRlPjIwMTgtMTAtMThUMTg6MTA6MTcrMDU6MzA8L3htcDpDcmVhdGVEYXRlPgogICAgICAgICA8eG1wOk1vZGlmeURhdGU+MjAxOC0xMC0xOFQxODozNjozMiswNTozMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTgtMTAtMThUMTg6MzY6MzIrMDU6MzA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2UvcG5nPC9kYzpmb3JtYXQ+CiAgICAgICAgIDxwaG90b3Nob3A6Q29sb3JNb2RlPjM8L3Bob3Rvc2hvcDpDb2xvck1vZGU+CiAgICAgICAgIDx4bXBNTTpJbnN0YW5jZUlEPnhtcC5paWQ6NDU4NjE0OTYtM2E5Ni00YjRkLThkMDQtNGYyYjQ4ZjM3M2RlPC94bXBNTTpJbnN0YW5jZUlEPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD54bXAuZGlkOjQ1ODYxNDk2LTNhOTYtNGI0ZC04ZDA0LTRmMmI0OGYzNzNkZTwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD54bXAuZGlkOjQ1ODYxNDk2LTNhOTYtNGI0ZC04ZDA0LTRmMmI0OGYzNzNkZTwveG1wTU06T3JpZ2luYWxEb2N1bWVudElEPgogICAgICAgICA8eG1wTU06SGlzdG9yeT4KICAgICAgICAgICAgPHJkZjpTZXE+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNyZWF0ZWQ8L3N0RXZ0OmFjdGlvbj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0Omluc3RhbmNlSUQ+eG1wLmlpZDo0NTg2MTQ5Ni0zYTk2LTRiNGQtOGQwNC00ZjJiNDhmMzczZGU8L3N0RXZ0Omluc3RhbmNlSUQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDp3aGVuPjIwMTgtMTAtMThUMTg6MTA6MTcrMDU6MzA8L3N0RXZ0OndoZW4+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpzb2Z0d2FyZUFnZW50PkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1IChXaW5kb3dzKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+NDA8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NDA8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAKPD94cGFja2V0IGVuZD0idyI/PjWYDx4AAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA2JJREFUeNrsWEtIVVEUXX6LInGgVEghIhRSGhaplNGHMLAcFVSYQQZNCtMIIyGaNmhSElqmRA6iIKQPr8L+EGVZDUoJapL4SamoSO2jq8l9cDjsc+859z3BQRvu4N299t7rnXv2OXvvBJKYzpKIaS7JMdjmA1gPYDWAYgBpmn4MwDMAXQA6ATwHMOEchaTLM4tkNcm3dJePJGtJZrrEdCFXQXKQsct3krvjTfA84y/3SWYExU4IyOJsAB0ACgz6AQCvADwC0K3plgIoBbAMQI7BfgTAFm+vOu/BTJI/DP/+Dck9JFMctkeXz2quCPOJewzOjjgmlvpUkRwTfP4kmeZC8KLgZIJkUQzkok8OySHB/wtbgmWC8V+ShQpmQwhiqs1cw4nQEEQwkeQ3wXC5gjnsvbvgQO6gYDOf5B8hVpofwV2CQb2nS1bIRaXJgtx+zaaZ5ExPt0mI12oimESyTwP3KfqNhqTxI1lnsKlVMPeEhBEJLhYcVSr6dJ8Du8mB3G2S8xRcnoDZLBE8oIFGDKvSbEHSRC5i8Plew92QCHZooJs+n85E8ijJ7Y7kpD/UKxH8rIEOBWz+Zod7tzPAV4mG/yoR/K2B1lhkqA3JBxZ+cjWb0ahOrajHQ1Tb+wA0+OjbAKy18JOk/f5rQ8K2HfjgoxuOZ0+Squl+WdjXAbjko68H0GLhZ8K0on6feIkFuZMWwasBnAvAzLH5xE80UHkIcm0ATgjv9wJo8vFXatwaSiYd1zJpwPJujcpDBdNqwDQafL7WcHekY2al4LBM0Sd7d6gkt4SgZw3YU0qxAJILBMwOiWCCcFj3WhQLkRDnpFosXNZ0437llrRCO32KhYjFIdzoUyyUCPGu+RFMIzkpGGUpmBbv3V2HgvWMYJNK8osQKzuo5K8SjAa1EqnGC+BS8tcoXWAiyW7D/rRqmp4KxkMkF8ahaUon+dKwCNZd3WxvRKHLGMnyGMitIzlsSJw817640KdCiZAsdiCWT7Ldx19F2NHHKm/0kWHQ9wBo926hT5ouA0ARgK3eeE6SSQDbAFyNZfyWSfLxFAyPekgWxHP8dszruOIhp6diPgjvqGkh2R+C1Ihnu8glZtAeNEmKV+1UAsgFkAVghlAy9QN4B+A6gCsARl0DhSX4f8oflX8DAGOkpj9CZ2J7AAAAAElFTkSuQmCC' alt=''></span><img id='mainPopImage' src='https://img00.deviantart.net/f33c/i/2011/139/f/c/vertical_panorama_by_verticaldubai-d3gp1ja.jpg' alt=''></div>\";\n\t\n\t// popup code added after body tag\n\n\tvar bodytag = document.body;\n\tvar popdiv = document.createElement(\"div\");\n\tpopdiv.innerHTML = html;\n\tbodytag.insertBefore(popdiv, bodytag.firstChild);\n}", "function buildPopup() {\n if ($('a.popup').length === 0) return;\n\n var popup_window = $('<div>').attr('class', 'popup_window draggable').css('display', 'none');\n var close = $('<div>').attr('class', 'close').html('X').click(function() { $(this).parents('.popup_window').fadeOut(); });\n var header = $('<div>').attr('class', 'header handle').append($('<div class=\"header_text\">Product Description</div>')).append(close).append($('<div class=\"clear\"></div>'));\n var body = $('<div>').attr('class', 'body');\n popup_window.append(header).append(body).appendTo($('body'));\n}", "function showPopup(myEvent, id, myElement,cID,pID) {\n var popup = getPopupObject(id);\n if (popup) {\n\n popup.style.visibility = 'hidden';\n var x = myEvent.clientX;\n var y = myEvent.clientY;\n\t\t\t\n x = parseInt(myEvent.clientX + document.body.scrollLeft);\n y = parseInt(myEvent.clientY + document.body.scrollTop);\t\t\t\n \n\t\t\tvar headerPopup = getPopupObject('popHeader');\n\t\t\tvar detailPopup = getPopupObject('popDetail');\n\n //Remove all children before append\n while (detailPopup.hasChildNodes()) {\n \n detailPopup.removeChild(detailPopup.firstChild);\n }\t\n\t\t\t\n\t\t\t//Remove all children before append\n while (headerPopup.hasChildNodes()) { \n \t headerPopup.removeChild(headerPopup.firstChild);\n }\t\t\t\t \t\n\t\t\t\t\tvar isHeader = true;\t\t\t\t\t\t\t\t\n\t\t\t\t\tfor (var i = 0; i < scoreProtein.length; i++) { \t\t\t\t\t \n\t\t\t\t\t\t\tvar scorePT = scoreProtein[i];\t\t\t\t\t\t\t \n\t\t\t\t\t\t \t //Showing protein popup\n\t\t\t\t\t\t\t\t \t if(isNotOneProtein)\n\t\t\t\t\t\t\t\t\t {\t\t\n\t\t\t\t\t\t\t\t\t \t\tif (cID == scorePT.proteinLocalization)\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\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(isHeader)\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\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 \n \t\t\t\t\t\t\t\t\t\t\t\t //Header\n \t\t\tvar rowHeaderProtein = document.createElement(\"tr\");\n rowHeaderProtein.setAttribute(\"id\", \"rowHeaderProtein\" + i);\n var columnHeaderProtein = document.createElement(\"td\");\n columnHeaderProtein.setAttribute(\"id\", \"columnHeaderProtein\" + i);\t\t\t\t\t\n //var innerHeaderTag = document.createElement(\"p\");\n //innerHeaderTag.setAttribute(\"id\", \"innerHeaderTag\" + i); \t\t\t\t \t\t\t\t\t\n columnHeaderProtein.innerHTML = \"<b>Localization = \" + scorePT.proteinLocalization + \"<br/>Protein ID : Score<br/> </b>\";\n \t\t\t\t\t\n //columnHeaderProtein.appendChild(innerHeaderTag); \n rowHeaderProtein.appendChild(columnHeaderProtein);\n headerPopup.appendChild(rowHeaderProtein);\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisHeader = false;\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\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t//Detail\t\t\t\t\t\t\t\t\t\t\t\t \n var rowProtein = document.createElement(\"tr\");\n rowProtein.setAttribute(\"id\", \"rowProtein\" + i);\n var columnProtein = document.createElement(\"td\");\n columnProtein.setAttribute(\"id\", \"columnProtein\" + i);\t\t\t\t\t\n \t\t\t\t\tvar innerTag = document.createElement(\"span\");\n \t\t\t\t\tinnerTag.setAttribute(\"id\", \"innnerText\" + i);\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 \t\t\t\t innerTag.setAttribute(\"onClick\", \"javaScript:showHighlightScore('\"+scorePT.proteinID+\"');\");\t\t\t\t\t\t\n \t\t\t\t\tinnerTag.innerHTML = \"<a href='#'>\" + scorePT.proteinID + \":<b>\" + scorePT.proteinScore+\"</b></a>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\n \t\t\t\t\tcolumnProtein.appendChild(innerTag); \n \t\t\t\t\trowProtein.appendChild(columnProtein);\n detailPopup.appendChild(rowProtein);\t\t \n\t\t\t\t\t\t\t\t\t\t \n \t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\telse {\n //Showing score popup\n\t\t\t\t\t\t\t\t\t \tif ((pID == scorePT.proteinID) && (cID == scorePT.proteinLocalization))\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 \n\t\t\t\t\t\t\t\t\t \t\t \t drawPopupScore(scorePT.proteinScore,detailPopup);\t\t\t\t\t\t \n \t\t\t\t\t\t \t break;\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 \n \t\t\t\t\t \n \t} \t\t\t\t \t\t\t\n \t\t\t\t\t\t\n\t\t\t\t\t\n popup.style.left = x;\n popup.style.top = y;\t\t\t\n popup.style.visibility = 'visible';\n\t\t\t\n }\n }", "function div_show(el){ \n\t\n\t\t\tpopup6(\"\");\n\t\t\n\t}", "function popup() {\r\n$(\".pesolight\").css(\"display\", \"block\");\r\n}", "function createPopup(lyrContent){\r\n\trunHook(\"createPopup\", FBEFORE);\r\n\t\r\n\tif (o3_wrap) {\r\n\t\tvar wd,ww,theObj = (olNs4 ? over : over.style);\r\n\t\ttheObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);\r\n\t\tlayerWrite(lyrContent);\r\n\t\twd = (olNs4 ? over.clip.width : over.offsetWidth);\r\n\t\tif (wd > (ww=windowWidth())) {\r\n\t\t\tlyrContent=lyrContent.replace(/\\&nbsp;/g, ' ');\r\n\t\t\to3_width=ww;\r\n\t\t\to3_wrap=0;\r\n\t\t} \r\n\t}\r\n\r\n\tlayerWrite(lyrContent);\r\n\t\r\n\t// Have to set o3_width for placeLayer() routine if o3_wrap is turned on\r\n\tif (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);\r\n\t\r\n\trunHook(\"createPopup\", FAFTER, lyrContent);\r\n\r\n\treturn true;\r\n}", "function createIntroPoppup(){\n /* Create DOM Elements for the Introduction Popup */\n introPopup = createDiv('');\n introPopup.id(\"introPopup\");\n introPopup.size(windowWidth/2,windowHeight/2);\n introPopup.position(windowWidth/2-windowWidth/4,windowHeight/2-windowHeight/4)\n\n // Add Header\n introPopup.child(createElement('h1','Oto 音'));\n\n // Add Tagline\n introPopup.child(createElement('h3', 'Bringing sound and joy to your browser'));\n\n // Add Instruction Text\n introPopup.child(createP('Help the wind make music! Blow into your microphone or click on the chimes.'));\n\n // Add Begin Button\n var button = createButton('Begin');\n button.mousePressed(function(event){\n introPopup.hide();\n event.stopPropagation(); //So it doesn't hit the chimes behind the popup\n mouseToPhysics = true; //OK, Now all clicks are for the physics model\n });\n\n introPopup.child(button);\n}", "function addItemPrompt() {\n var addBox = document.getElementById(\"addBox\")\n addBox.style.display = \"block\";\n addBox.style.display = \"block\";\n addBox.style.margin = \"auto\";\n addBox.style.position = \"absolute\";\n addBox.style.top = \"200px\";\n addBox.style.left = \"0px\";\n addBox.style.right = \"0px\";\n document.getElementById(\"over\").style.display = \"block\";\n}", "function drawBox () {\n\n\t\t\tvar $topBar = $('<div class=\"round-top back-right-image\"><div class=\"round-top-fill back-left-image\"></div></div>');\n\n\t\t\tif(opts.headerTitle != \"\" && opts.headerThickness == \"thick\") {\n\t\t\t\tvar $text = $('<span class=\"text-top\"></span>').html(opts.headerTitle)\n\n\t\t\t\t$topBar.find('.round-top-fill').html($text);\n\t\t\t}\n\n\t\t\tvar $bodyContent = $('<div class=\"round-body\"><div class=\"round-body-content\"></div></div>');\n\n\t\t\tif(opts.type != \"\" && !opts.wrapContent){\n\t\t\t\tvar content = \"\";\n\n\t\t\t\tcontent\t+= '<div class=\"message-body\">';\n\t\t\t\tfor (i in messages) {\n\t\t\t\t\tif (typeof i != typeof function(){}) {\n\t\t\t\t\t\tif(i > 0) {\n\t\t\t\t\t\t\tfor( j=0; j < messages[i].length; j++) {\n\t\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][j] + '</div>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-summary\">' + messages[i][0] + '</div>';\n\t\t\t\t\t\t\tcontent\t+= '<div class=\"message-detail\">' + messages[i][1] + '</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t};\n\t\t\t\tcontent\t+= '</div>';\n\n\t\t\t\t$bodyContent.children().append(content);\n\t\t\t}\n\n\t\t\tvar $bottomBar = $('<div class=\"round-bottom back-right-image\"><div class=\"round-bottom-fill back-left-image\"></div></div>');\n\n\t\t\t//for error/warning/success boxes that have no fill color specifications\n\t\t\tif(opts.fillColor != \"\")\n\t\t\t\topts.fillColor = opts.fillColor + \"-\";\n\n\t\t\tvar $container = $('<div class=\"round-container\"></div>')\n\t\t\t\t\t\t\t\t\t.addClass(opts.borderColor+\"-\"+opts.fillColor+\"container\")\n\t\t\t\t\t\t\t\t\t.append($topBar)\n\t\t\t\t\t\t\t\t\t.append($bodyContent)\n\t\t\t\t\t\t\t\t\t.append($bottomBar);\n\n\t\t\t//add an ID to the container if specified\n\t\t\tif(opts.containerId != \"\"){\n\t\t\t\t$container.attr('id',opts.containerId);\n\t\t\t}\n\n\t\t\t//add header thickness class to container if specified\n\t\t\tif(opts.headerThickness != \"\"){\n\t\t\t\t$container.addClass(opts.headerThickness+\"-top\");\n\t\t\t}\n\n\t\t\t//add more classes if specified\n\t\t\tif(opts.containerClass != \"\"){\t//FIX THIS...ONLY ADDS 1 CLASS\n\t\t\t\t$container.addClass(opts.containerClass);\n\t\t\t}\n\n\t\t\t$container.css({width : opts.width});\n\n\t\t\treturn $container;\n\t\t}", "function buildDialogPanel() {\n try {\n tintObscureNd = document.createElement(\"div\")\n tintObscureNd.className = \"dialogPanelTint\"\n dialogPanelNd = document.createElement(\"div\")\n tintObscureNd.className = \"dialogPanel\"\n titleBarNd = document.createElement(\"div\")\n titleBarNd.className = \"dialogPanelTitleBar\"\n dialogPanelNd.appendChild(titleBarNd)\n dialogPanelContentNd = document.createElement(\"div\")\n dialogPanelContentNd.className = \"dialogPanelContent\"\n\n document.body.appendChild(tintObscureNd)\n document.body.appendChild(dialogPanelNd)\n } catch(err) {\n console.dir(err)\n debugger \n } // end of try/catch\n }", "addHtml(content) {\n let e = document.getElementById(\"guiArea\");\n let line = document.createElement(\"div\");\n line.setAttribute(\"class\", \"guiBlock\");\n line.innerHTML = content;\n e.appendChild(line);\n }", "_createOuterWindow({ x, y, rectWidth, rectHeight }) {\n this.graphics.lineStyle(this.borderThickness, this.borderColor, this.borderAlpha);\n this.graphics.strokeRect(x, y, rectWidth, rectHeight);\n }", "function createMessageBox() {\n 'use strict';\n var element = document.createElement(\"div\"),\n box = document.getElementById(\"box\");\n\n element.id = \"message\";\n\n if (box === null) {\n box = document.body;\n }\n\n box.appendChild(element);\n element.appendChild(document.createTextNode(\"Click button to download the data...\"));\n}", "function draw_box(element, classes) {\n\n var element_p;\n\n if (typeof $(element) === 'undefined') {\n element_p = $(element);\n } else {\n element_p = iframe.find(element);\n }\n\n // Be sure this element have.\n if (element_p.length > 0) {\n\n var marginTop = element_p.css(\"margin-top\");\n var marginBottom = element_p.css(\"margin-bottom\");\n var marginLeft = element_p.css(\"margin-left\");\n var marginRight = element_p.css(\"margin-right\");\n\n var paddingTop = element_p.css(\"padding-top\");\n var paddingBottom = element_p.css(\"padding-bottom\");\n var paddingLeft = element_p.css(\"padding-left\");\n var paddingRight = element_p.css(\"padding-right\");\n\n //Dynamic boxes variables\n var element_offset = element_p.offset();\n var topBoxes = element_offset.top;\n var leftBoxes = element_offset.left;\n if (leftBoxes < 0) {\n leftBoxes = 0;\n }\n var widthBoxes = element_p.outerWidth(false);\n var heightBoxes = element_p.outerHeight(false);\n\n var bottomBoxes = topBoxes + heightBoxes;\n\n var rightExtra = 1;\n var rightS = 1;\n\n if (is_content_selected()) {\n rightExtra = 2;\n rightS = 2;\n }\n\n var rightBoxes = leftBoxes + widthBoxes - rightExtra;\n\n var windowWidth = $(window).width();\n\n // If right border left is more then screen\n if (rightBoxes > (windowWidth - window.scroll_width - rightS)) {\n rightBoxes = windowWidth - window.scroll_width - rightS;\n }\n\n // If bottom border left is more then screen\n if ((leftBoxes + widthBoxes) > windowWidth) {\n widthBoxes = windowWidth - leftBoxes - 1;\n }\n\n if (heightBoxes > 1 && widthBoxes > 1) {\n\n // Dynamic Box\n if (iframe.find(\".\" + classes + \"-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-top'></div><div class='\" + classes + \"-bottom'></div><div class='\" + classes + \"-left'></div><div class='\" + classes + \"-right'></div>\");\n }\n\n // Margin append\n if (iframe.find(\".\" + classes + \"-margin-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-margin-top'></div><div class='\" + classes + \"-margin-bottom'></div><div class='\" + classes + \"-margin-left'></div><div class='\" + classes + \"-margin-right'></div>\");\n }\n\n // Padding append.\n if (iframe.find(\".\" + classes + \"-padding-top\").length === 0) {\n iframeBody.append(\"<div class='\" + classes + \"-padding-top'></div><div class='\" + classes + \"-padding-bottom'></div><div class='\" + classes + \"-padding-left'></div><div class='\" + classes + \"-padding-right'></div>\");\n }\n\n // Dynamic Boxes position\n iframe.find(\".\" + classes + \"-top\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-bottom\").css(\"top\", bottomBoxes).css(\"left\", leftBoxes).css(\"width\", widthBoxes);\n\n iframe.find(\".\" + classes + \"-left\").css(\"top\", topBoxes).css(\"left\", leftBoxes).css(\"height\", heightBoxes);\n\n iframe.find(\".\" + classes + \"-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes).css(\"height\", heightBoxes);\n\n // Top Margin\n iframe.find(\".\" + classes + \"-margin-top\").css(\"top\", parseFloat(topBoxes) - parseFloat(marginTop)).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginTop);\n\n // Bottom Margin\n iframe.find(\".\" + classes + \"-margin-bottom\").css(\"top\", bottomBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"width\", parseFloat(widthBoxes) + parseFloat(marginRight) + parseFloat(marginLeft)).css(\"height\", marginBottom);\n\n // Left Margin\n iframe.find(\".\" + classes + \"-margin-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes) - parseFloat(marginLeft)).css(\"height\", heightBoxes).css(\"width\", marginLeft);\n\n // Right Margin\n iframe.find(\".\" + classes + \"-margin-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes + 2).css(\"height\", heightBoxes).css(\"width\", marginRight);\n\n // Top Padding\n iframe.find(\".\" + classes + \"-padding-top\").css(\"top\", parseFloat(topBoxes)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingTop);\n\n // Bottom Padding\n iframe.find(\".\" + classes + \"-padding-bottom\").css(\"top\", bottomBoxes - parseFloat(paddingBottom)).css(\"left\", parseFloat(leftBoxes)).css(\"width\", parseFloat(widthBoxes / 2)).css(\"height\", paddingBottom);\n\n // Left Padding\n iframe.find(\".\" + classes + \"-padding-left\").css(\"top\", topBoxes).css(\"left\", parseFloat(leftBoxes)).css(\"height\", heightBoxes / 2).css(\"width\", paddingLeft);\n\n // Right Padding\n iframe.find(\".\" + classes + \"-padding-right\").css(\"top\", topBoxes).css(\"left\", rightBoxes - parseFloat(paddingRight)).css(\"height\", heightBoxes / 2).css(\"width\", paddingRight);\n\n if (is_resizing() == false && is_dragging() == false) {\n iframe.find(\".yp-selected-handle\").css(\"left\", leftBoxes).css(\"top\", topBoxes);\n }\n\n }\n\n }\n\n }", "function appendHTML() {\n\t\tif (!$box) {\n\t\t\tinit = false;\n\t\t\t$window = $(window);\n\t\t\t$box = $tag(div).attr({\n\t\t\t\tid: colorbox,\n\t\t\t\t'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.\n\t\t\t\trole: 'dialog',\n\t\t\t\ttabindex: '-1'\n\t\t\t}).hide();\n\t\t\t$overlay = $tag(div, \"Overlay\").hide();\n\t\t\t$loadingOverlay = $([$tag(div, \"LoadingOverlay\")[0],$tag(div, \"LoadingGraphic\")[0]]);\n\t\t\t$wrap = $tag(div, \"Wrapper\");\n\t\t\t$content = $tag(div, \"Content\").append(\n\t\t\t\t$title = $tag(div, \"Title\"),\n\t\t\t\t$current = $tag(div, \"Current\"),\n\t\t\t\t$prev = $('<button type=\"button\"/>').attr({id:prefix+'Previous'}),\n\t\t\t\t$next = $('<button type=\"button\"/>').attr({id:prefix+'Next'}),\n\t\t\t\t$slideshow = $('<button type=\"button\"/>').attr({id:prefix+'Slideshow'}),\n\t\t\t\t$loadingOverlay\n\t\t\t);\n\n\t\t\t$close = $('<button type=\"button\"/>').attr({id:prefix+'Close'});\n\n\t\t\t$wrap.append( // The 3x3 Grid that makes up Colorbox\n\t\t\t\t$tag(div).append(\n\t\t\t\t\t$tag(div, \"TopLeft\"),\n\t\t\t\t\t$topBorder = $tag(div, \"TopCenter\"),\n\t\t\t\t\t$tag(div, \"TopRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$leftBorder = $tag(div, \"MiddleLeft\"),\n\t\t\t\t\t$content,\n\t\t\t\t\t$rightBorder = $tag(div, \"MiddleRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$tag(div, \"BottomLeft\"),\n\t\t\t\t\t$bottomBorder = $tag(div, \"BottomCenter\"),\n\t\t\t\t\t$tag(div, \"BottomRight\")\n\t\t\t\t)\n\t\t\t).find('div div').css({'float': 'left'});\n\n\t\t\t$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');\n\n\t\t\t$groupControls = $next.add($prev).add($current).add($slideshow);\n\t\t}\n\t\tif (document.body && !$box.parent().length) {\n\t\t\t$(document.body).append($overlay, $box.append($wrap, $loadingBay));\n\t\t}\n\t}", "function appendHTML() {\n\t\tif (!$box) {\n\t\t\tinit = false;\n\t\t\t$window = $(window);\n\t\t\t$box = $tag(div).attr({\n\t\t\t\tid: colorbox,\n\t\t\t\t'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.\n\t\t\t\trole: 'dialog',\n\t\t\t\ttabindex: '-1'\n\t\t\t}).hide();\n\t\t\t$overlay = $tag(div, \"Overlay\").hide();\n\t\t\t$loadingOverlay = $([$tag(div, \"LoadingOverlay\")[0],$tag(div, \"LoadingGraphic\")[0]]);\n\t\t\t$wrap = $tag(div, \"Wrapper\");\n\t\t\t$content = $tag(div, \"Content\").append(\n\t\t\t\t$title = $tag(div, \"Title\"),\n\t\t\t\t$current = $tag(div, \"Current\"),\n\t\t\t\t$prev = $('<button type=\"button\"/>').attr({id:prefix+'Previous'}),\n\t\t\t\t$next = $('<button type=\"button\"/>').attr({id:prefix+'Next'}),\n\t\t\t\t$slideshow = $('<button type=\"button\"/>').attr({id:prefix+'Slideshow'}),\n\t\t\t\t$loadingOverlay\n\t\t\t);\n\n\t\t\t$close = $('<button type=\"button\"/>').attr({id:prefix+'Close'});\n\n\t\t\t$wrap.append( // The 3x3 Grid that makes up Colorbox\n\t\t\t\t$tag(div).append(\n\t\t\t\t\t$tag(div, \"TopLeft\"),\n\t\t\t\t\t$topBorder = $tag(div, \"TopCenter\"),\n\t\t\t\t\t$tag(div, \"TopRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$leftBorder = $tag(div, \"MiddleLeft\"),\n\t\t\t\t\t$content,\n\t\t\t\t\t$rightBorder = $tag(div, \"MiddleRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$tag(div, \"BottomLeft\"),\n\t\t\t\t\t$bottomBorder = $tag(div, \"BottomCenter\"),\n\t\t\t\t\t$tag(div, \"BottomRight\")\n\t\t\t\t)\n\t\t\t).find('div div').css({'float': 'left'});\n\n\t\t\t$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');\n\n\t\t\t$groupControls = $next.add($prev).add($current).add($slideshow);\n\t\t}\n\t\tif (document.body && !$box.parent().length) {\n\t\t\t$(document.body).append($overlay, $box.append($wrap, $loadingBay));\n\t\t}\n\t}", "function appendHTML() {\n\t\tif (!$box) {\n\t\t\tinit = false;\n\t\t\t$window = $(window);\n\t\t\t$box = $tag(div).attr({\n\t\t\t\tid: colorbox,\n\t\t\t\t'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.\n\t\t\t\trole: 'dialog',\n\t\t\t\ttabindex: '-1'\n\t\t\t}).hide();\n\t\t\t$overlay = $tag(div, \"Overlay\").hide();\n\t\t\t$loadingOverlay = $([$tag(div, \"LoadingOverlay\")[0],$tag(div, \"LoadingGraphic\")[0]]);\n\t\t\t$wrap = $tag(div, \"Wrapper\");\n\t\t\t$content = $tag(div, \"Content\").append(\n\t\t\t\t$title = $tag(div, \"Title\"),\n\t\t\t\t$current = $tag(div, \"Current\"),\n\t\t\t\t$prev = $('<button type=\"button\"/>').attr({id:prefix+'Previous'}),\n\t\t\t\t$next = $('<button type=\"button\"/>').attr({id:prefix+'Next'}),\n\t\t\t\t$slideshow = $('<button type=\"button\"/>').attr({id:prefix+'Slideshow'}),\n\t\t\t\t$loadingOverlay\n\t\t\t);\n\n\t\t\t$close = $('<button type=\"button\"/>').attr({id:prefix+'Close'});\n\n\t\t\t$wrap.append( // The 3x3 Grid that makes up Colorbox\n\t\t\t\t$tag(div).append(\n\t\t\t\t\t$tag(div, \"TopLeft\"),\n\t\t\t\t\t$topBorder = $tag(div, \"TopCenter\"),\n\t\t\t\t\t$tag(div, \"TopRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$leftBorder = $tag(div, \"MiddleLeft\"),\n\t\t\t\t\t$content,\n\t\t\t\t\t$rightBorder = $tag(div, \"MiddleRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$tag(div, \"BottomLeft\"),\n\t\t\t\t\t$bottomBorder = $tag(div, \"BottomCenter\"),\n\t\t\t\t\t$tag(div, \"BottomRight\")\n\t\t\t\t)\n\t\t\t).find('div div').css({'float': 'left'});\n\n\t\t\t$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');\n\n\t\t\t$groupControls = $next.add($prev).add($current).add($slideshow);\n\t\t}\n\t\tif (document.body && !$box.parent().length) {\n\t\t\t$(document.body).append($overlay, $box.append($wrap, $loadingBay));\n\t\t}\n\t}", "function appendHTML() {\n\t\tif (!$box) {\n\t\t\tinit = false;\n\t\t\t$window = $(window);\n\t\t\t$box = $tag(div).attr({\n\t\t\t\tid: colorbox,\n\t\t\t\t'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.\n\t\t\t\trole: 'dialog',\n\t\t\t\ttabindex: '-1'\n\t\t\t}).hide();\n\t\t\t$overlay = $tag(div, \"Overlay\").hide();\n\t\t\t$loadingOverlay = $([$tag(div, \"LoadingOverlay\")[0],$tag(div, \"LoadingGraphic\")[0]]);\n\t\t\t$wrap = $tag(div, \"Wrapper\");\n\t\t\t$content = $tag(div, \"Content\").append(\n\t\t\t\t$title = $tag(div, \"Title\"),\n\t\t\t\t$current = $tag(div, \"Current\"),\n\t\t\t\t$prev = $('<button type=\"button\"/>').attr({id:prefix+'Previous'}),\n\t\t\t\t$next = $('<button type=\"button\"/>').attr({id:prefix+'Next'}),\n\t\t\t\t$slideshow = $('<button type=\"button\"/>').attr({id:prefix+'Slideshow'}),\n\t\t\t\t$loadingOverlay\n\t\t\t);\n\n\t\t\t$close = $('<button type=\"button\"/>').attr({id:prefix+'Close'});\n\n\t\t\t$wrap.append( // The 3x3 Grid that makes up Colorbox\n\t\t\t\t$tag(div).append(\n\t\t\t\t\t$tag(div, \"TopLeft\"),\n\t\t\t\t\t$topBorder = $tag(div, \"TopCenter\"),\n\t\t\t\t\t$tag(div, \"TopRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$leftBorder = $tag(div, \"MiddleLeft\"),\n\t\t\t\t\t$content,\n\t\t\t\t\t$rightBorder = $tag(div, \"MiddleRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$tag(div, \"BottomLeft\"),\n\t\t\t\t\t$bottomBorder = $tag(div, \"BottomCenter\"),\n\t\t\t\t\t$tag(div, \"BottomRight\")\n\t\t\t\t)\n\t\t\t).find('div div').css({'float': 'left'});\n\n\t\t\t$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');\n\n\t\t\t$groupControls = $next.add($prev).add($current).add($slideshow);\n\t\t}\n\t\tif (document.body && !$box.parent().length) {\n\t\t\t$(document.body).append($overlay, $box.append($wrap, $loadingBay));\n\t\t}\n\t}", "function s36_open_popup_widget(){\r\n\tvar s36_popupmodalbox \t= document.getElementById('s36PopupWidgetBox');\r\n\tvar s36_popupmodalshadow = document.getElementById('s36PopupWidgetShadow');\r\n\ts36_popupmodalbox.style.display = 'block';\r\n\ts36_popupmodalshadow.style.display \t= 'block';\t\r\n}", "function displayInPreview(string) {\r\n var newDiv = document.createElement(\"div\"); \r\n var newContent = document.createTextNode(string); \r\n newDiv.appendChild(newContent);\r\n document.body.appendChild(newDiv)\r\n}", "function popupGenCall(pgInfo){\n\n $(\"#gMain\").html(pgInfo);\n\n $(\"#popupDiv\").dialog({\n modal: true,\n width: 600,\n height: 400,\n dialogClass: 'ui-widget-shadow'\n });\n}", "function writeOverglass() {\n\t\tvar rect = document.createElement(\"v:rect\");\n\t\trect.setAttribute(\"id\", this.id + \"og\");\n\t\tvar elem = document.getElementById(this.id).appendChild(rect);\n\t\telem.style.position = \"absolute\";\n\t\telem.style.top = 0;\n\t\telem.style.left = 0;\n\t\telem.style.width = this.width;\n\t\telem.style.height = this.height;\n\t\telem.style.zIndex = 8;\n\t\telem.fill.type = \"solid\";\n\t\telem.fill.color = \"white\";\n\t\telem.fill.opacity = \"0%\";\n\t\telem.stroked = \"false\";\n\t\telem.style.cursor = \"move\";\n\t\tif (this.onClicked != null) {\n\t\t\telem.attachEvent(\"onclick\", this.onClicked);\n\t\t}\n\t\telem.parentObj = this;\n\t}", "function appendHTML() {\n\t\tif (!$box && document.body) {\n\t\t\tinit = false;\n\t\t\t$window = $(window);\n\t\t\t$box = $tag(div).attr({\n\t\t\t\tid: colorbox,\n\t\t\t\t'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.\n\t\t\t\trole: 'dialog',\n\t\t\t\ttabindex: '-1'\n\t\t\t}).hide();\n\t\t\t$overlay = $tag(div, \"Overlay\").hide();\n\t\t\t$loadingOverlay = $([$tag(div, \"LoadingOverlay\")[0],$tag(div, \"LoadingGraphic\")[0]]);\n\t\t\t$wrap = $tag(div, \"Wrapper\");\n\t\t\t$content = $tag(div, \"Content\").append(\n\t\t\t\t$title = $tag(div, \"Title\"),\n\t\t\t\t$current = $tag(div, \"Current\"),\n\t\t\t\t$prev = $('<button type=\"button\"/>').attr({id:prefix+'Previous'}),\n\t\t\t\t$next = $('<button type=\"button\"/>').attr({id:prefix+'Next'}),\n\t\t\t\t$slideshow = $tag('button', \"Slideshow\"),\n\t\t\t\t$loadingOverlay\n\t\t\t);\n\n\t\t\t$close = $('<button type=\"button\"/>').attr({id:prefix+'Close'});\n\t\t\t\n\t\t\t$wrap.append( // The 3x3 Grid that makes up Colorbox\n\t\t\t\t$tag(div).append(\n\t\t\t\t\t$tag(div, \"TopLeft\"),\n\t\t\t\t\t$topBorder = $tag(div, \"TopCenter\"),\n\t\t\t\t\t$tag(div, \"TopRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$leftBorder = $tag(div, \"MiddleLeft\"),\n\t\t\t\t\t$content,\n\t\t\t\t\t$rightBorder = $tag(div, \"MiddleRight\")\n\t\t\t\t),\n\t\t\t\t$tag(div, false, 'clear:left').append(\n\t\t\t\t\t$tag(div, \"BottomLeft\"),\n\t\t\t\t\t$bottomBorder = $tag(div, \"BottomCenter\"),\n\t\t\t\t\t$tag(div, \"BottomRight\")\n\t\t\t\t)\n\t\t\t).find('div div').css({'float': 'left'});\n\t\t\t\n\t\t\t$loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');\n\t\t\t\n\t\t\t$groupControls = $next.add($prev).add($current).add($slideshow);\n\n\t\t\t$(document.body).append($overlay, $box.append($wrap, $loadingBay));\n\t\t}\n\t}", "function PopupWin(_1,_2,_3,_4){\r\nthis.editor=_1;\r\nthis.handler=_3;\r\nvar _5=window.open(\"\",\"__ha_dialog\",\"toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40,scrollbars=no,resizable=yes\");\r\nthis.window=_5;\r\nvar _6=_5.document;\r\nthis.doc=_6;\r\nvar _7=this;\r\nvar _8=document.baseURI||document.URL;\r\nif(_8&&_8.match(/(.*)\\/([^\\/]+)/)){\r\n_8=RegExp.$1+\"/\";\r\n}\r\nif(typeof _editor_url!=\"undefined\"&&!(/^\\//.test(_editor_url))&&!(/http:\\/\\//.test(_editor_url))){\r\n_8+=_editor_url;\r\n}else{\r\n_8=_editor_url;\r\n}\r\nif(!(/\\/$/.test(_8))){\r\n_8+=\"/\";\r\n}\r\nthis.baseURL=_8;\r\n_6.open();\r\nvar _9=\"<html><head><title>\"+_2+\"</title>\\n\";\r\n_9+=\"<style type=\\\"text/css\\\">@import url(\"+_editor_url+\"Xinha.css);</style>\\n\";\r\nif(_editor_skin!=\"\"){\r\n_9+=\"<style type=\\\"text/css\\\">@import url(\"+_editor_url+\"skins/\"+_editor_skin+\"/skin.css);</style>\\n\";\r\n}\r\n_9+=\"</head>\\n\";\r\n_9+=\"<body class=\\\"dialog popupwin\\\" id=\\\"--HA-body\\\"></body></html>\";\r\n_6.write(_9);\r\n_6.close();\r\nfunction init2(){\r\nvar _a=_6.body;\r\nif(!_a){\r\nsetTimeout(init2,25);\r\nreturn false;\r\n}\r\n_5.title=_2;\r\n_6.documentElement.style.padding=\"0px\";\r\n_6.documentElement.style.margin=\"0px\";\r\nvar _b=_6.createElement(\"div\");\r\n_b.className=\"content\";\r\n_7.content=_b;\r\n_a.appendChild(_b);\r\n_7.element=_a;\r\n_4(_7);\r\n_5.focus();\r\n}\r\ninit2();\r\n}", "function displayInPreview(string) {\n var newDiv = document.createElement(\"div\"); \n var newContent = document.createTextNode(string); \n newDiv.appendChild(newContent);\n document.body.appendChild(newDiv)\n }", "function buildPopup(url, html, rectObject, title){\n // Init a new j$ node, and append the parsed HTML tree.\n let node = $(\"<div id='mdnthis'></div>\").append($.parseHTML(html));\n\n // Calculate the pop-ups css left and top properties, set to appropriate node.\n let cssLeft = Math.floor(rectObject.x + rectObject.width/2) - 150 + window.pageXOffset;\n let cssTop = Math.floor(rectObject.y + rectObject.height) + window.pageYOffset + 11;\n node.find(\"#mdnthis-bubble-host\").css(\"top\", cssTop).css(\"left\", cssLeft);\n\n // Set arrow position.\n node.find(\"#mdnthis-arrow-main\").css(\"left\", 150);\n node.find(\"#mdnthis-arrow-main\").css(\"top\", -11);\n\n // Init var to hold a request as a j$ tree.\n let requestTree = undefined;\n\n // Send GET request to provided URL.\n fetch(url)\n // Extract reponses text.\n .then((response) => {\n return response.text();\n })\n // Parse text and convert to j$ tree.\n .then((responseText) => {\n // Parse text and convert to j$ tree.\n requestTree = $(\"<div></div>\").append($.parseHTML(responseText));\n // Get the description.\n const descriptionText = requestTree.find(\"#wikiArticle\").find(\"p\").first().text();\n // set popup descriptionText to new text found\n node.find('#mdnthis-bubble-description').html(descriptionText);\n /// Get the syntax.\n const syntaxText = requestTree.find(\"#wikiArticle\").find(\".syntaxbox\").text();\n node.find('#mdnthis-bubble-syntax').html(syntaxText);\n // Set the title.\n node.find(\"#mdnthis-bubble-query\").html(title);\n // Get the example code.\n let exampleText = (requestTree.find(\"#wikiArticle\").find(\"#Example\").length !== 0) ?\n requestTree.find(\"#wikiArticle\").find(\"#Example\").nextAll(\"pre:first\").text() :\n requestTree.find(\"#wikiArticle\").find(\"#Examples\").nextAll(\"pre:first\").text();\n node.find('#mdnthis-bubble-example').html(exampleText);\n // Set the link\n node.find('#urltarget').attr('href', url);\n // Append node.\n node.css(\"display\",\"none\")\n $(\"html\").append(node);\n node.fadeIn();\n });\n}", "drawHTML(detail, color, line_width) {\n //detail: 0-100 [%]\n detail = 100 - Math.min(detail, 100);\n\n let html_data = '<div style=\"position:absolute\" class=\"vector\">';\n //*init_height/height\n\n let len = 0;\n while (len < this.length) {\n let x = this.x + this.cos() * len;\n let y = this.y + this.sin() * len;\n\n html_data += '<span style=\"position: absolute;top: ' + y + 'px;left:' + x + 'px;width:' + line_width + 'px;height:' + line_width + 'px;background-color:' + color + ';border-radius:50%;text-align:center\"></span>';\n\n len += (detail / 100);\n }\n html_data += '</div>';\n\n return html_data;\n }", "function onAddLine() {\n createNewLine('');\n renderLineBoxs()\n}", "function draw_rectangle()\r\n{\r\n\t//tips:24 dot matrix;x=112,y=112;show string is 'make block';1(red)\r\n\tvar str = \"DS24(112,112,'make block',1);\";\r\n\t//draw rectangle >>Upper left corner:x1=85,y1=45;Lower right corner:x2=235,y2=195;4(yellow)\r\n\tvar rectangle = \"BOX(85,45,235,195,4);\";\r\n\ttftlcd.send(clear);\t\r\n\ttftlcd.send(upright);\t\r\n\ttftlcd.send(str);\r\n\ttftlcd.send(rectangle);\r\n\ttftlcd.send(println);\t\r\n}", "function Popup(data) {\n var mywindow = window.open('', 'my div', 'height=400,width=650');\n mywindow.document.write('<html><head><title>Do I have Everything?</title>');\n mywindow.document.write(\"<link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'><link rel='stylesheet' href='css/mainPrint.css' type='text/css'>\");\n mywindow.document.write('</head><body >');\n mywindow.document.write(data);\n mywindow.document.write('</body></html>');\n}", "draw() {\n const divPosition = this.getProjection().fromLatLngToDivPixel(\n this.position\n );\n // Hide the popup when it is far out of view.\n const display =\n Math.abs(divPosition.x) < 4000 && Math.abs(divPosition.y) < 4000\n ? \"block\"\n : \"none\";\n\n if (display === \"block\") {\n this.containerDiv.style.left = divPosition.x + \"px\";\n this.containerDiv.style.top = divPosition.y + \"px\";\n }\n\n if (this.containerDiv.style.display !== display) {\n this.containerDiv.style.display = display;\n }\n }", "function createPopupBubble(event, acronym, definition) {\n let div = document.createElement('div');\n\n // Add popup box html to the user's current page\n div.setAttribute('id', 'gdx-bubble-host');\n let shadow = div.attachShadow({ mode: 'open' });\n let html = Style;\n html += '<div id=\"gdx-bubble-main\" style=\"left:' + getCoordinate(event.pageX, boxWidth, document.body.clientWidth) +\n 'px; top: ' + getCoordinate(event.pageY, boxHeight, document.body.scrollHeight) + 'px;\">' +\n '<div id=\"gdx-bubble-close\"></div><div id=\"gdx-bubble-query-row\" class=\"\">' +\n '<div id=\"gdx-bubble-query\">' + acronym + '</div>' +\n '<div id=\"gdx-bubble-points\" style=\"float: right; margin-right:8px; font-weight: bold;\"></div>' +\n '<button id=\"gdx-bubble-like\" style=\"float: right; margin-right:5px; display:none;\">Like</button>' +\n '</div>' +\n '<div id=\"gdx-bubble-meaning\">' + definition + '</div>' +\n '<button id=\"gdx-bubble-back\" style=\"display: none;\">«</button>' +\n '<button id=\"gdx-bubble-next\" style=\"display: none;\">»</button>' +\n '<button id=\"gdx-bubble-report\" style=\"float: right; display:none;\">Report</button>' +\n '<button id=\"gdx-bubble-more\" style=\"display: block;\">More »</button>' +\n '</div>';\n shadow.innerHTML = html;\n document.body.appendChild(div);\n}", "function plotBox(element, x, y, w, h) {\n var box = document.createElement(\"div\");\n element.parentNode.appendChild(box);\n box.classList.add(\"feature\");\n box.style.width = w + \"px\";\n box.style.height = h + \"px\";\n box.style.left = (element.offsetLeft + x) + \"px\";\n box.style.top = (element.offsetTop + y) + \"px\";\n\n}", "_createInnerWindow({ x, y, rectWidth, rectHeight }) {\n this.graphics.fillStyle(this.windowColor, this.windowAlpha);\n this.graphics.fillRect(x + 1, y + 1, rectWidth - 1, rectHeight - 1);\n }", "function CustomAlert() {\n this.render = function(dialog) {\n\n var winWidth = window.innerWidth;\n var winHeight = window.innerHeight;\n var overlay = document.getElementById('overlay');\n var box = document.getElementById('box')\n\n //display box in center\n box.style.display = 'block';\n overlay.style.height = winHeight + 'px'\n box.style.left = (winWidth / 2) - (550 * .5) + 'px';\n box.style.top = '175px';\n box.style.display = 'block'\n\n //add content\n document.getElementById('head').innerHTML = \"World Record Status\"\n document.getElementById('body').innerHTML = dialog;\n document.getElementById('foot').innerHTML = '<button id=\"ok-btn\" onclick= \"Alert.ok()\"> OK </button>'\n }\n this.ok = function() {\n document.getElementById('box').style.display = 'none';\n document.getElementById('overlay').style.display = 'none';\n }\n}", "function buildImportBox()\n{\n const importDiv = $(\"<div id='import-div'></div>\");\n const instructions = $(\"<button>Instructions</button>\");\n const buttonsSpan = makeSpan();\n buttonsSpan.attr(\"id\",\"import-buttons\");\n instructions.data(\"open\",0);\n instructions.click\n (\n function()\n {\n importInstructionsHandler(this);\n }\n )\n const close = $(\"<button>Close</button>\");\n close.click\n (\n function()\n {\n importCloseHandler(this)\n }\n );\n const submit = $(\"<button>Submit</button>\");\n submit.click\n (\n function()\n {\n importSubmitHandler(this);\n }\n )\n buttonsSpan.append(instructions);\n buttonsSpan.append(close);\n buttonsSpan.append(submit);\n const importArea = $(\"<textarea rows='10' cols='100' id='import-area'></textarea>\");\n importDiv.append(buttonsSpan);\n importDiv.append(\"<br>\");\n importDiv.append(importArea);\n return importDiv;\n}", "function popup(html,title,x,y) {\n\t var wPos = getFrameCenter(top);\n\t var posX = x ? Math.round( wPos[0] - ( x / 2 ) ) : wPos[0];\n\t var posY = y ? Math.round( wPos[1] - ( y / 2 ) ) : wPos[1];\n\t\n\t var popup = $('#OverlayPopup');\n\t var newPopup = false;\n\t if ( ! popup ) {\n\t newPopup = true;\n\t popup = document.createElement('div');\n\t popup.id='OverlayPopup';\n\t popup.className='OverlayPopup';\n\t if ( posX || posY ) {\n\t document.body.appendChild(popup);\n\t } else {\n\t document.body.appendChild(popup);\n\t }\n\t }\n\t if ( ! popup ) { return; }\n\t\n\t\tpopup.css({\n 'margin': 0,\n\t 'top': posY ? posY+'px' : '0px',\n\t 'left': posX ? posX+'px' : '0px',\n });\n\t if ( x ) popup.width(x);\n\t if ( y ) popup.height(y);\n\t\n\t popup.html(\n \"<div id='popup_header'>\" + title + \"</div>\" + \n \"<div id='popup_closer'><a onclick='closePopup(event);'><span class='glyphicon glyphicon-remove-sign'></span></a></div>\" + \n \"<div class='clearfix' id='popup_content'>\" + html + \"</div>\");\n\t\tpopup.show();\n\t\n\t}", "function displayInPreview(string) {\n var newDiv = document.createElement(\"div\"); \n var newContent = document.createTextNode(string); \n newDiv.appendChild(newContent);\n document.body.appendChild(newDiv)\n}", "function displayInPreview(string) {\n var newDiv = document.createElement(\"div\"); \n var newContent = document.createTextNode(string); \n newDiv.appendChild(newContent);\n document.body.appendChild(newDiv)\n}", "function displayInPreview(string) {\n var newDiv = document.createElement(\"div\"); \n var newContent = document.createTextNode(string); \n newDiv.appendChild(newContent);\n document.body.appendChild(newDiv)\n}", "function displayInPreview(string) {\n var newDiv = document.createElement(\"div\"); \n var newContent = document.createTextNode(string); \n newDiv.appendChild(newContent);\n document.body.appendChild(newDiv)\n}", "function displayInPreview(string) {\n var newDiv = document.createElement(\"div\"); \n var newContent = document.createTextNode(string); \n newDiv.appendChild(newContent);\n document.body.appendChild(newDiv)\n}", "function screenShot() {\n\n var photo = document.getElementById(\"svgdiv\").innerHTML;\n\n var wrap = \"<div class=\\\"row\\\"> \\n <svg width=\\\"\" + w + \"\\\" height=\\\"\" + h + \"\\\">\"; \n\n wrap = wrap + photo;\n\n output = wrap + \"\\n </svg> \\n </div>\";\n\n var dimensions = \"\\\"width=\" + w + \",height=\" + h + \"\\\"\";\n\n document.getElementById(\"photoTaken\").innerHTML = output;\n\n/*\n var myWindow = window.open(\"photobooth.html\", \"Photo Booth\", function () { return dimensions;});\n\n myWindow.document.write(output);\n*/\n}", "function renderBubble(mouseX, mouseY, selection) {\n\tconsole.log(\"OK SHOWING IT\");\n\tbubbleDOM.innerHTML = selection;\n\tbubbleDOM.style.top = mouseY + 'px';\n\tbubbleDOM.style.left = mouseX + 'px';\n\tbubbleDOM.style.visibility = 'visible';\n}", "show(){\n push();\n rectMode(CORNER);\n fill(this.color.x,this.color.y,this.color.z);\n rect(this.location.x,this.location.y,this.width,this.height);\n pop();\n }", "function appendHTML() {\n if (!$box) {\n init = false;\n $window = $(window);\n $box = $tag(div).attr({\n id: colorbox,\n 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.\n role: 'dialog',\n tabindex: '-1'\n }).hide();\n $overlay = $tag(div, \"Overlay\").hide();\n $loadingOverlay = $([$tag(div, \"LoadingOverlay\")[0],$tag(div, \"LoadingGraphic\")[0]]);\n $wrap = $tag(div, \"Wrapper\");\n $content = $tag(div, \"Content\").append(\n $title = $tag(div, \"Title\"),\n $current = $tag(div, \"Current\"),\n $prev = $('<button type=\"button\"/>').attr({id:prefix+'Previous'}),\n $next = $('<button type=\"button\"/>').attr({id:prefix+'Next'}),\n $slideshow = $('<button type=\"button\"/>').attr({id:prefix+'Slideshow'}),\n $loadingOverlay\n );\n\n $close = $('<button type=\"button\"/>').attr({id:prefix+'Close'});\n\n $wrap.append( // The 3x3 Grid that makes up Colorbox\n $tag(div).append(\n $tag(div, \"TopLeft\"),\n $topBorder = $tag(div, \"TopCenter\"),\n $tag(div, \"TopRight\")\n ),\n $tag(div, false, 'clear:left').append(\n $leftBorder = $tag(div, \"MiddleLeft\"),\n $content,\n $rightBorder = $tag(div, \"MiddleRight\")\n ),\n $tag(div, false, 'clear:left').append(\n $tag(div, \"BottomLeft\"),\n $bottomBorder = $tag(div, \"BottomCenter\"),\n $tag(div, \"BottomRight\")\n )\n ).find('div div').css({'float': 'left'});\n\n $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');\n\n $groupControls = $next.add($prev).add($current).add($slideshow);\n }\n if (document.body && !$box.parent().length) {\n $(document.body).append($overlay, $box.append($wrap, $loadingBay));\n }\n }", "function add_popup_box(){\n\t\t\t var pop_up = $('<div class=\"paulund_modal_box\"><span class=\"paulund_modal_close\" style=\"cursor:pointer;\"></span><div class=\"paulund_inner_modal_box\"><table width=\"200px\" height=\"30px\" style=\"position:absolute;\"><tr><td style=\"font-weight:bold;\">비밀번호&nbsp;<input type=\"password\" name=\"passwd\" id=\"passwd\" size=\"10\" maxlength=\"20\"></td><td><img src=\"/images/btn_confirm.gif\" onclick=\"pwConfirm();\" valign=\"absmiddle\" style=\"cursor:pointer;\"></td></tr></table></div></div>');\n\t\t\t $(pop_up).appendTo('.paulund_block_page');\n\t\t\t \t\t\t \n\t\t\t $('.paulund_modal_close').click(function(){\n\t\t\t\t$(this).parent().fadeOut().remove();\n\t\t\t\t$('.paulund_block_page').fadeOut().remove();\t\t\t\t \n\t\t\t });\n\t\t}", "function addBox(coin) {\nvar options = {\n width : \"18%\",\n height : \"25%\",\n content: \"Coin Pool Net Ratio\",\n tags: true,\n border: {\n type: 'line'\n },\n style: {\n fg: 'white',\n border: {\n fg: '#f0f0f0'\n },\n hover: {\n bg: 'green'\n }\n }\n}\nif (r == 1) {\n options.right = r\n} else {\n options.left = l\n}\noptions.label = \"{bold}\"+coin+\"{/bold}\";\nif (b == 1) {\n options.bottom = b;\n} else {\n options.top= t;\n}\nconsole.log(coin + t + b + l + r );\nbox[coin] = blessed.box( options);\n\n\n\nscreen.append(box[coin]);\n \n P++;\n l = P*20 + \"%\";\n \n if (P == '5' ) {\n r = '';\n rcount++;\n t = rcount * 25 + \"%\";\n l = '0%';\n P = 0;\n } \n \n \n\n}", "function drawBox(height, width, x = 0, y = 0) {\n\t\tterm.terminal.moveTo(x, y);\n\t\tconst leftSpaces = new Array(y).fill(\" \").join(\"\");\n\t\tconst horizLine = new Array(width - 2).fill(pipes.horizLine).join(\"\");\n\t\tconst top = pipes.topLeft + horizLine + pipes.topRight;\n\t\tconst bot = pipes.botLeft + horizLine + pipes.botRight;\n\t\tconst middleSpaces = new Array(top.length - 2).fill(\" \").join(\"\");\n\t\tconst middleRow = leftSpaces + pipes.vertLine + middleSpaces + pipes.vertLine + \"\\n\";\n\t\tconst middle = new Array(height - 1).fill(middleRow).join(\"\");\n\t\treturn \"\\n\" + leftSpaces + top + \"\\n\" + middle + leftSpaces + bot + \"\\n\";\n\t}", "function showPopup() {\n\t\thtml = '<div class=\"etheme-popup-overlay\"></div><div class=\"etheme-popup\"><div class=\"etheme-popup-content\"></div></div>';\n\t\tjQuery('body').prepend(html);\n\t\tpopupOverlay = jQuery('.etheme-popup-overlay');\n\t\tpopupWindow = jQuery('.etheme-popup');\n\t\tpopupOverlay.one('click', function() {\n\t\t\t\thidePopup(popupOverlay, popupWindow);\n\t\t});\n}", "function createStatusWindow() {\r\n var maindiv = document.body.appendChild(create(\"div\", {id:\"AEOPstatus\", style:\"position: fixed; width: 210px; bottom: 40px; left: 5px; padding: 2px; background: #3b5998; color: #FFFFFF; border: 3px solid #8b9dc3; font-weight: 600; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 0.92em; z-index: 99998; visibility: hidden\"}));\r\n\r\n var statusLine1 = maindiv.appendChild(create('DIV', {id:'statusLine1', textContent:'[AEOP] - Auto Expand Older Posts', style:\"text-align: center; font-size: 0.92em\", className:'statusLine1'}));\r\n\r\n var statusLine2 = maindiv.appendChild(create('DIV', {id:'statusLine2', textContent:'Posts Expanded 0 of 000 times', style:\"text-align: center; font-size: 0.92em\", className:'statusLine2'}));\r\n \r\n var pauseBtn = maindiv.appendChild(create('INPUT', {type:\"button\", value:\" Pause \", id:'pauseBtn', textContent:'pauseBtn', style:\"float: left; font-size: 0.95em; margin: 0.5em 0 0 5%; font-weight: 500; color: #000; background: #efefff;\", onclick:function(){pauseBtnhndlr();}, className:'pauseBtn'}));\r\n\r\n var optionsBtn = maindiv.appendChild(create('INPUT', {type:\"button\", value:\"Options\", id:'optionsBtn', textContent:'optionsBtn', style:\"float: right; font-size: 0.95em; margin: 0.5em 5% 0 0; font-weight: 500; color: #000; background: #efefff;\", onclick:function(){optionsBtnhndlr();}, className:'optionsBtn'}));\r\n\r\n var statusLine3 = maindiv.appendChild(create('DIV', {id:'statusLine3', textContent:' ', style:\"text-align: center; font-size: 0.80em; margin: 8px 0px 0px 15%; font-weight: 600; color: #FFFF00;\", className:'statusLine3'}));\r\n\r\n if (GM_config.get(\"GMopt_StatusWinPosition\"))\r\n {\r\n document.getElementById(\"AEOPstatus\").style.bottom = GM_config.get(\"GMopt_StatusWinPosition\") + \"px\";\r\n } \r\n\r\n\r\n}", "function printDivInPopUp() {\n var divToPrint = document.getElementById('code128');\n var newWindow = window.open('', 'Print-Window');\n newWindow.document.open();\n newWindow.document.write('<link rel=\"stylesheet\" type=\"text/css\" href=\"admin-panel.css\" />');\n newWindow.document.write('<html><body onload=\"window.print()\">' + divToPrint.outerHTML + '</body></html>');\n newWindow.document.close();\n setTimeout(function () { newWindow.close(); }, 10);\n}", "function displayBubble() {\n push();\n fill(0, 13, 200);\n ellipse(bubble.x, bubble.y, bubble.size);\n pop();\n}", "function newPromptBox() {\n column = 0;\n promptText = '';\n promptBox = $('<div class=\"jquery-console-prompt-box\"></div>');\n var label = $('<span class=\"jquery-console-prompt-label\"></span>');\n promptBox.append(label.text(promptLabel).show());\n prompt = $('<span class=\"jquery-console-prompt\"></span>');\n promptBox.append(prompt);\n inner.append(promptBox);\n updatePromptDisplay();\n }", "function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}", "function createEndPopup(message) {\r\n\t\tvar $popupWindow = $('<div id=\"popup\" class=\"popup\"/>').appendTo(\"body\");\r\n\t\t\r\n\t\t$popupWindow.css(\"z-index\", crtZIndex++);\r\n\t\t\r\n\t\tvar popupHTML = new String(\"\");\r\n\t\tpopupHTML += \"<center>\";\r\n\t\tpopupHTML += \"<p>\";\r\n\t\tpopupHTML += message;\r\n\t\tpopupHTML += \"</p>\";\r\n\t\tpopupHTML += \"<p>\";\r\n\t\tpopupHTML += \"<button id='quit2' style='font-size:14pt'>Back to Main Menu!</button>\";\r\n\t\tpopupHTML += \"</p>\";\r\n\t\tpopupHTML += \"</center>\";\r\n\t\t\r\n\t\t$popupWindow.html(popupHTML);\r\n\t\t\r\n\t\t$(\"#quit2\").click( function() {\r\n\t\t\twarnAtUnload = false;\r\n\t\t\twindow.location.replace(\".\");\r\n\t\t});\r\n\t\t\r\n\t\tvar boardTop = $(\"#board\").offset().top;\r\n\t\tvar boardLeft = $(\"#board\").offset().left;\r\n\t\tvar boardHeight = $(\"#board\").height();\r\n\t\tvar boardWidth = $(\"#board\").width();\r\n\t\tvar windowHeight = $(\"#popup\").height();\r\n\t\tvar windowWidth = $(\"#popup\").width();\r\n\t\t\r\n\t\t$popupWindow.offset( {\r\n\t\t\ttop : boardTop + boardHeight / 2 - windowHeight / 2,\r\n\t\t\tleft: boardLeft + boardWidth / 2 - windowWidth / 2\r\n\t\t});\r\n}", "function displayQuoteEnterprise(info, context){\n\n var hpaned = new StyledElements.StyledHPaned({\n \"handlerPosition\": 20\n });\n \n hpaned.getRightPanel().repaint = function(temporal){\n StyledElements.Container.prototype.repaint.call(this, temporal);\n \n if (this.wrapperElement.getElementsByClassName(\"imgQuote\").length > 0) {\n var divImage = this.wrapperElement.getElementsByClassName(\"imgQuote\")[0];\n var image = divImage.childNodes[0];\n image.style.cssText = \"\";\n image.style.cssText += \"width:\" + (this.wrapperElement.offsetWidth - 70) + \"px;\";\n image.style.cssText += \"height:\" + (this.wrapperElement.offsetHeight - 100) + \"px;\";\n }\n }\n \n var div = document.createElement(\"div\");\n div.setAttribute(\"class\", \"enterpriseInfo\");\n var divHpanned = document.createElement(\"div\");\n \n divHpanned.setAttribute(\"class\", \"infoEnterprise\");\n var divHeader = document.createElement(\"div\");\n divHeader.setAttribute(\"class\", \"headerInfoEnterprise\");\n var span = document.createElement(\"span\");\n span.appendChild(document.createTextNode(BolsaGadget.getTranslatedLabel(\"details\")));\n span.setAttribute(\"class\", \"alternative_title\");\n divHeader.appendChild(span);\n \n //botones de seguimiento\n var divButtonsDetails = document.createElement(\"div\");\n divButtonsDetails.setAttribute(\"class\", \"buttonsDetails\");\n \n\t\n // Comprobamos si se esta realizando seguimiento de la empresa\n var preferencesAux = eval('('+preferences.get()+')');\n \n if (inList(context.symbols[0].replace(/@/g, \"\"), preferencesAux.followUp, 0)) {\n\tvar imgRemoveFollowUp = document.createElement(\"img\");\n\tvar contextImg = {\"image\": imgRemoveFollowUp, \"symbol\":context.symbols[0].replace(/@/g, \"\")};\n\timgRemoveFollowUp.src = urlimage + \"remove.png\";\n\timgRemoveFollowUp.setAttribute(\"title\", BolsaGadget.getTranslatedLabel(\"removeToFollowUp\"));\n\timgRemoveFollowUp.addEventListener(\"click\", EzWebExt.bind(removeFollowUp, contextImg), false);\n\tdivButtonsDetails.appendChild(imgRemoveFollowUp);\n }\n else {\n\tvar imgAddFollowUp = document.createElement(\"img\");\n\tvar contextImg = {\"image\": imgAddFollowUp, \"symbol\":context.symbols[0].replace(/@/g, \"\")};\n\timgAddFollowUp.src = urlimage + \"add.png\";\n\t\timgAddFollowUp.setAttribute(\"title\", BolsaGadget.getTranslatedLabel(\"addToFollowUp\"));\n\t\timgAddFollowUp.addEventListener(\"click\", EzWebExt.bind(addFollowUp, contextImg), false);\n\t\tdivButtonsDetails.appendChild(imgAddFollowUp);\n }\n imgSendEvent = document.createElement(\"img\");\n imgSendEvent.src = \"/ezweb/images/wiring21px.png\";\n divButtonsDetails.appendChild(imgSendEvent);\n \n divHeader.appendChild(divButtonsDetails);\n div.appendChild(divHeader);\n hpaned.insertInto(divHpanned);\n div.appendChild(divHpanned);\n \n var divTable = document.createElement(\"div\");\n divTable.setAttribute(\"class\", \"InfoQuote\");\n var divContentImg = document.createElement(\"div\");\n divContentImg.setAttribute(\"class\", \"imgInfoQuote\");\n var table = document.createElement(\"table\");\n table.setAttribute(\"class\", \"tableInfoQuote\");\n var preferencesAux = eval(\"(\" + preferences.get() + ')');\n values = [];\n \n for (var i = 0; i < preferencesAux.enterprise.length; i++) {\n\tvar tr = document.createElement(\"tr\");\n\tvar td = document.createElement(\"td\");\n\ttd.appendChild(document.createTextNode(BolsaGadget.getTranslatedLabel(preferencesAux.enterprise[i])));\n\ttd.id = preferencesAux.enterprise[i];\n\ttd.setAttribute(\"class\", \"titleTableInfoQuote\");\n\ttr.appendChild(td);\n\t\n\tvar td = document.createElement(\"td\");\n\ttd.innerHTML = info[0][i];\n\t\n\tif ((i != 0) && (info[0][i].indexOf(\"+\") >= 0)) \n\t\ttd.setAttribute(\"class\", \"positive\");\n\telse \n if ((i != 0) && (info[0][i].indexOf(\"-\") >= 0) &&\n\t\t(info[0][i].indexOf(\"N/A -\") < 0) &&\n\t\t(preferencesAux.enterprise[i] != \"l\") &&\n\t\t(preferencesAux.enterprise[i] != \"m\") &&\n\t\t(preferencesAux.enterprise[i] != \"q\") &&\n\t\t(preferencesAux.enterprise[i] != \"r1\") &&\n\t\t(preferencesAux.enterprise[i] != \"w\")) \n td.setAttribute(\"class\", \"negative\");\n else \n td.setAttribute(\"class\", \"valueTableInfoQuote\");\n \n\tvalues[i] = [BolsaGadget.getTranslatedLabel(preferencesAux.enterprise[i]), info[0][i]];\n tr.appendChild(td); \n table.appendChild(tr);\n }\n \n divTable.appendChild(table);\n \n // Send Event Company\n // Company Name\n company = values[0][1]; \n sendEventCompany(company, values);\n contextEvent ={'company':company, 'info':values};\n imgSendEvent.addEventListener(\"click\", \n EzWebExt.bind(function(e){\n\t sendEventCompany(this.company,\n\t\t\t this.info); \n\t}, contextEvent), false);\n \n \n if (context.newTab) {\n\n\t// Check tabs\n\tenc = false;\n\tvar panelLength = panelMain.getNumberOfTabs();\n\tfor (var i = 0; ((i < panelLength) && (!enc)); i++) \n\t {\n\t\tcurrentTab = panelMain.getTabByIndex(i);\n\t\tsymbols1 = '';\n\t\tsymbols2 = '';\n\t\tif (currentTab.__context)\n\t\t {\n\t\t\tfor(var j = 0; j < currentTab.__context.symbols.length; j++)\n\t\t\t symbols1 += currentTab.__context.symbols[j];\n\t\t\t\n\t\t\tfor(var j = 0; j < context.symbols.length; j++)\n\t\t\t symbols2 += context.symbols[j];\n\t\t\tenc = (symbols1 == symbols2.replace(/@/g, \"\"));\n\t\t }\n\t }\n\tif(enc)\n\t {\n\t\tpanelMain.goToTab(currentTab.getId());\n\t\tremoveLoadingImage();\n\t\treturn;\n\t }\n\telse\n\t {\n\t\tvar tab = panelMain.createTab({\n\t\t\t\"name\": addTitle(value)\n\t\t });\n\t\ttab.appendChild(div);\n\t\ttab.__context = {};\n\t\ttab.__context[\"symbols\"] = [context.symbols[0].replace(/@/g, \"\")];\n\t\ttab.__context[\"tags\"] = context.tags;\n\t\ttab.__context[\"type\"] = 2; // Type Enterprises\n\t\tpanelMain.goToTab(tab.getId());\n\t }\n }\n else {\n var tab = panelMain.getTabByIndex(context.indexTab);\n tab.clear();\n tab.appendChild(div);\n }\n var divSettingsHidden = document.createElement(\"div\");\n\tvar divSettingsImage = document.createElement(\"div\");\n\t\n\tvar imgHidden = document.createElement(\"img\");\n\timgHidden.src = urlimage + \"close-details.png\";\n\timgHidden.title = BolsaGadget.getTranslatedLabel(\"hidden\");\n\tdivSettingsHidden.appendChild(imgHidden);\n\t\n\tvar contextHidden = {\"image\":imgHidden, \"settings\":divSettingsImage}\t\n imgHidden.addEventListener(\"click\", EzWebExt.bind(closeSettingsImage, contextHidden), false);\n\t\n\tdivSettingsHidden.setAttribute(\"class\", \"settingsHidden\");\n divSettingsImage.setAttribute(\"class\", \"settingsImage\");\n \n var table = document.createElement(\"table\");\n table.setAttribute(\"class\", \"rangeTable\");\n var tr = document.createElement(\"tr\");\n var td = document.createElement(\"td\");\n \n var span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"option_title_image\");\n span.appendChild(document.createTextNode(BolsaGadget.getTranslatedLabel(\"range\")));\n span.id = \"range\";\n td.appendChild(span);\n tr.appendChild(td);\n \n var td = document.createElement(\"td\");\n var entries = [[\"1d\", BolsaGadget.getTranslatedLabel(\"1d\")], [\"5d\", BolsaGadget.getTranslatedLabel(\"5d\")], [\"3m\", BolsaGadget.getTranslatedLabel(\"3m\")], [\"6m\", BolsaGadget.getTranslatedLabel(\"6m\")], [\"1y\", BolsaGadget.getTranslatedLabel(\"1y\")], [\"2y\", BolsaGadget.getTranslatedLabel(\"2y\")], [\"5y\", BolsaGadget.getTranslatedLabel(\"5y\")], [\"my\", BolsaGadget.getTranslatedLabel(\"my\")]];\n \n if (context.newTab) \n var imgContext = {\n \"range\": \"1d\",\n \"type\": \"l\",\n \"scale\": \"off\"\n }\n else \n var imgContext = tab.__context[\"img\"];\n \n var select = new StyledElements.StyledSelect({\n initialEntries: entries,\n initialValue: imgContext[\"range\"],\n \"class\": \"inputRange\"\n });\n var selectContext = {\n tab: tab,\n idSelect: 0\n };\n select.addEventListener(\"change\", EzWebExt.bind(refreshImage, selectContext));\n \n select.insertInto(td);\n tr.appendChild(td);\n table.appendChild(tr);\n divSettingsImage.appendChild(table);\n \n var table = document.createElement(\"table\");\n table.setAttribute(\"class\", \"typeTable\");\n var tr = document.createElement(\"tr\");\n var td = document.createElement(\"td\");\n \n var span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"option_title_image\");\n span.appendChild(document.createTextNode(BolsaGadget.getTranslatedLabel(\"type\")));\n span.id = \"type\";\n td.appendChild(span);\n tr.appendChild(td);\n \n var td = document.createElement(\"td\");\n var entries = [[\"b\", BolsaGadget.getTranslatedLabel(\"bar\")], [\"l\", BolsaGadget.getTranslatedLabel(\"lineal\")], [\"c\", BolsaGadget.getTranslatedLabel(\"candle\")]];\n \n var select = new StyledElements.StyledSelect({\n initialEntries: entries,\n initialValue: imgContext[\"type\"],\n \"class\": \"inputType\"\n });\n var selectContext = {\n tab: tab,\n idSelect: 1\n };\n select.addEventListener(\"change\", EzWebExt.bind(refreshImage, selectContext));\n select.insertInto(td);\n tr.appendChild(td);\n table.appendChild(tr);\n divSettingsImage.appendChild(table);\n \n var table = document.createElement(\"table\");\n table.setAttribute(\"class\", \"scaleTable\");\n var tr = document.createElement(\"tr\");\n var td = document.createElement(\"td\");\n \n var span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"option_title_image\");\n span.appendChild(document.createTextNode(BolsaGadget.getTranslatedLabel(\"scale\")));\n span.id = \"scale\";\n td.appendChild(span);\n tr.appendChild(td);\n \n var td = document.createElement(\"td\");\n var entries = [[\"off\", BolsaGadget.getTranslatedLabel(\"off\")], [\"on\", BolsaGadget.getTranslatedLabel(\"on\")]];\n \n var select = new StyledElements.StyledSelect({\n initialEntries: entries,\n initialValue: imgContext[\"scale\"],\n \"class\": \"inputScale\"\n });\n var selectContext = {\n tab: tab,\n idSelect: 1\n };\n select.addEventListener(\"change\", EzWebExt.bind(refreshImage, selectContext));\n select.insertInto(td);\n tr.appendChild(td);\n table.appendChild(tr);\n divSettingsImage.appendChild(table);\n\n divContentImg.appendChild(divSettingsHidden);\n divContentImg.appendChild(divSettingsImage);\n var divImg = document.createElement(\"div\");\n divImg.setAttribute(\"class\", \"imgQuote\");\n var img = document.createElement(\"img\");\n var aleatorio = Math.random();\n \n imgContext[\"imgage\"] = img;\n imgContext[\"url\"] = urlYahooImage + info[0][1].replace(/\\^/g, \"\").replace(/@/g, \"\");\n \n img.src = urlYahooImage + info[0][1].replace(/\\^/g, \"\").replace(/@/g, \"\") +\n \"&t=\" +\n imgContext[\"range\"] +\n \"&l=\" +\n imgContext[\"scale\"] +\n \"&z=m&q=\" +\n imgContext[\"type\"] +\n \"&aleatorio=\" +\n aleatorio;\n divImg.appendChild(img);\n divContentImg.appendChild(divImg);\n \n tab.__context[\"img\"] = imgContext;\n hpaned.getLeftPanel().appendChild(divTable);\n hpaned.getRightPanel().appendChild(divContentImg);\n \n removeLoadingImage();\n hpaned.repaint();\n}", "function getChartDetailsPopupHtml(chartName,chartDescrition,chartTags,chartAuthor,chartCopyright,ichartLogoPath,chartWidth,chartHeight)\n\t{\n\t\tvar tmpStr= \"<div style='font-family:Arial,Helvetica Neueu,Helvetica;font-size:11px;font-weight:bold'>\";\n\t\ttmpStr += \"<a id='popupChartClose' class='popupChartClose' onClick='showHideChartDetailsPopup(chartdetails,\"+chartWidth+\",\"+chartHeight+\")' style='cursor: pointer;'>x</a>\"\n\t\ttmpStr +=\"<h1 style='font-size:15px;font-weight:bold'>INFORMATION</h1>\"; \n\t\ttmpStr +=\"<div style='width:100%'>\";\n\t\ttmpStr +=\"<hr/>\";\t\t\n\t\ttmpStr +=\"<span style='height:20px;width:90px;float:left;'>TITLE</span><div id='chartTitle'><input type='text' class='chartInfoBox' style='font-family:Arial,Helvetica Neueu,Helvetica;font-size:12px;border:0px;background:#898989;color:#FFFFFF' readonly='true'value='\"+chartName+\"'/></div>\";\n\t\ttmpStr +=\"<hr/>\";\n\t\ttmpStr +=\"<span style='height:50px;width:90px;float:left;'>\";\n\t\ttmpStr +=\"DESCRIPTION </span>\";\n\t\t\n\t\ttmpStr +=\"<div id='chartDescription'><textarea class='chartTextArea' style='font-family:Arial,Helvetica Neueu,Helvetica;font-size:12px;border:0px;background:#898989;color:#FFFFFF' readonly='true'>\"+chartDescrition+\"</textarea>\";\n\t\ttmpStr +=\"</div>\";\n\t\ttmpStr +=\"<hr/>\"\n\t\ttmpStr +=\"<span style='height:50px;width:90px;float:left;'>\";\n\t\ttmpStr +=\"TAGS </span>\";\n\t\ttmpStr +=\"<div id='chartTags'><textarea class='chartTextArea' style='font-family:Arial,Helvetica Neueu,Helvetica;font-size:12px;border:0px;background:#898989;color:#FFFFFF' readonly='true'>\"+chartTags+\"</textarea>\";\n\t\ttmpStr +=\"</div>\";\n\t\ttmpStr +=\"<hr/>\";\t\n\n\t\ttmpStr +=\"<span style='height:20px;width:90px;float:left;'>AUTHOR</span><div id='chartAuthor'><input type='text' class='chartTextArea' style='border:0px;background:#898989;color:#FFFFFF' readonly='true'value='\"+chartAuthor+\"'/></div>\";\n\t\t \n\t\ttmpStr +=\"<hr/>\";\n\t\t \n\t\ttmpStr +=\"<span style='height:20px;width:90px;float:left;'>COPYRIGHT</span><div id='chartCopyright'><input type='text' class='chartTextArea' style='border:0px;background:#898989;color:#FFFFFF' readonly='true'value='\"+chartCopyright+\"'/></div>\";\n\t\ttmpStr +=\"<hr/>\";\n\t\ttmpStr +=\"</div>\";\n\t\ttmpStr +=\"<div id='popupiChartLogo' style='top:290px' class='popupiChartLogo'><img src='\"+ichartLogoPath+\"'/></div>\";\n\t\ttmpStr +=\"</div></div>\"; \t\t \n\t\treturn tmpStr\n\t\t\n\n\t\n\t}", "function setupPopupVisualHelper(prototype) {\r\n\r\n/**\r\n *\tCalculate the text bounds for a dialog, allowing for an icon,\r\n *\twrapping, and a range of allowed lines. This assumes the\r\n *\twidth of the dialog to start with.\r\n *\t@return bounds of text in dialog\r\n */\r\nprototype.calculateTextBounds = function(properties, laf, text, font, flags, minLines, maxLines) {\r\n\tvar rect = new Rectangle(0, 0, 0, 0);\r\n\t\r\n\tvar portrait = laf.getBoolean(\"is.portrait\", true);\r\n\tvar d = laf.getDimension(\"screen.size\");\r\n\tvar content = laf.getRectangle(\"content.pane.bounds\");\r\n\t\r\n\tvar padding = laf.getInteger(\"note.padding\", 2);\r\n\tif (portrait) {\r\n\t\trect.x = padding;\r\n\t\trect.width = d.x - padding*2;\r\n\t}\r\n\telse {\r\n\t\trect.x = d.x / 5;\r\n\t\trect.width = d.x - rect.x;\r\n\t}\r\n\t\t\r\n\tvar iconRect = this.getIconRect();\r\n\tvar maxWidth = rect.width - iconRect.x - padding*(3+2);\r\n\t\r\n\tvar lineGap = laf.getInteger(\"note.text.lineGap\", 0);\r\n\t\r\n\tvar minExtent = font.formattedStringExtent(\"Hello\", new Point(maxWidth, 0), flags, lineGap);\r\n\tminExtent.y *= minLines;\r\n\t\r\n\tvar text = chooseScalableText(properties.text, font, maxWidth);\r\n\tvar extent;\r\n\t\r\n\tif ((flags & Font.WRAPPING_ENABLED) != 0)\r\n\t\textent = calculateWrappedTextSize(text, maxWidth, font, flags, lineGap, maxLines);\r\n\telse\r\n\t\textent = font.formattedStringExtent(text, \r\n\t\t\tnew Point(maxWidth, 0), flags, lineGap);\r\n\t\r\n\t//println(\"extent=\"+extent);\r\n\tif (extent.y < minExtent.y)\r\n\t\textent.y = minExtent.y;\r\n\r\n\treturn new Rectangle(rect.x, rect.y, extent.x, extent.y);\r\n}\r\n\r\n/**\r\n *\tCalculate the bounding rectangle for the dialog so it contains the\r\n *\ttext, icon, and editor.\r\n *\t@param textExtent size of text\r\n *\t@param editRect rect for editor content at bottom (only size used)\r\n *\t@return Rectangle (0, 0, width, height)\r\n */\r\nprototype.calculateDialogBounds = function(properties, laf, textExtent, editRect) {\r\n\tvar rect = new Rectangle(0, 0, 0, 0);\r\n\t\r\n\tvar portrait = laf.getBoolean(\"is.portrait\", true);\r\n\tvar d = laf.getDimension(\"screen.size\");\r\n\tvar content = laf.getRectangle(\"content.pane.bounds\");\r\n\t\r\n\tvar padding = laf.getInteger(\"note.padding\", 2);\r\n\tif (portrait) {\r\n\t\trect.x = padding;\r\n\t\trect.width = d.x - padding*2;\r\n\t}\r\n\telse {\r\n\t\trect.x = d.x / 5;\r\n\t\trect.width = d.x - rect.x;\r\n\t}\r\n\t\t\r\n\tvar lineGap = laf.getInteger(\"note.text.lineGap\", 0);\r\n\tvar height = textExtent.y + 7*2 + lineGap\r\n\t\r\n\tif (editRect)\r\n\t\theight += editRect.height + lineGap*2;\r\n\t\r\n\trect.height = height;\r\n\t\r\n\t// adjust for insets\r\n\tvar inset = laf.getDimension(\"note.inset\");\r\n\trect.x += inset.x;\r\n\trect.width -= (2 * inset.x);\r\n\trect.height -= (2 * inset.y);\r\n\t\r\n\treturn rect;\r\n}\r\n\r\n\r\n//\tDraw a simple dialog with using the 'text' property and the label font\r\nprototype.drawPopupDialog = function(instance, laf, graphics, font, flags, textRect, bounds) {\r\n\tvar properties = instance.properties;\r\n\r\n\tthis.drawPopupDialogBorder(instance, laf, graphics, bounds);\r\n\r\n\tvar text = chooseScalableText(properties.text, font, textRect.width);\r\n\t\r\n\tvar offset = new Point(bounds.x, bounds.y);\r\n\tthis.drawPopupDialogPromptAndIcon(instance, laf, graphics, text, font, flags, offset, textRect);\r\n}\r\n\r\n/**\r\n *\tDraw dialog prompt and icon.\r\n *\t@param flags text flags\r\n *\t@param offset Point offset at which to bias the iconRect and textRect\r\n */\r\nprototype.drawPopupDialogPromptAndIcon = function(instance, laf, graphics, text, font, flags, offset, textRect) {\r\n\tvar properties = instance.properties;\r\n\tgraphics.setFont(font);\r\n\r\n\tvar padding = laf.getInteger(\"note.padding\", 8);\r\n\t\r\n\tgraphics.setForeground(laf.getColor(\"listitem.text\"));\r\n\r\n\t// draw text\r\n\ttextRect.x = properties.location.x + offset.x;\r\n\ttextRect.y = properties.location.y + offset.y;\r\n\t\r\n\t//println(\"drawPopupDialogPromptAndIcon textRect = \" + textRect);\r\n\tgraphics.drawFormattedString(text,\r\n\t\t\ttextRect,\r\n\t\t\tflags | Font.OVERFLOW_ELLIPSIS,\r\n\t\t\tlaf.getInteger(\"note.text.lineGap\", 0));\r\n\r\n\t// draw icon\r\n\tvar iconRect = this.getIconRect();\r\n\tvar image = getIcon(instance, laf);\r\n\tif (image != null) {\r\n\t\tvar imageData = image.getImageData();\r\n\t\tgraphics.drawImage(image, 0, 0, imageData.width, imageData.height,\r\n\t\t\ticonRect.x, offset.y + iconRect.y, iconRect.width, iconRect.height);\r\n\t}\r\n}\r\n\r\n/**\r\n *\tDraw dialog border, with shadows. The bounds should enclose only\r\n *\tthe contents of the dialog (shadows drawn outside).\r\n */\r\nprototype.drawPopupDialogBorder = function(instance, laf, graphics, bounds) {\r\n\tvar padding = laf.getInteger(\"note.padding\", 8);\r\n\t\r\n\t// get bounding rects\r\n\t\r\n\tvar x = bounds.x;\r\n\tvar y = bounds.y;\r\n\tvar width = bounds.width;\r\n\tvar height = bounds.height;\r\n\r\n\t// fill \r\n\tgraphics.setBackground(getBackgroundColor(instance, laf))\r\n\tgraphics.fillRectangle(new Rectangle(x, y, width, height))\r\n\t\r\n\t// edge\r\n\tgraphics.setForeground(Colors.getColor(0, 0, 0))\r\n\tgraphics.drawRectangle(new Rectangle(x, y, width, height))\r\n\r\n\t// shadows\r\n\tgraphics.setForeground(laf.getColor(\"control.shadow.inner\"))\r\n\tgraphics.drawLine(x + 1, y + height + 1, x + width + 1, y + height + 1)\r\n\tgraphics.drawLine(x + width + 1, y + 1, x + width + 1, y + height + 1)\r\n\t\r\n\tgraphics.setForeground(laf.getColor(\"control.shadow.outer\"))\r\n\tgraphics.drawLine(x + 2, y + height + 2, x + width + 2, y + height + 2)\r\n\tgraphics.drawLine(x + width + 2, y + 2, x + width + 2, y + height + 2)\r\n}\r\n\r\n} // setupPopupVisualHelper", "generateStatsPopup() {\n let popup = this.game.doc.createElement(\"div\");\n popup.class = \"hud-stats-display\";\n popup.style.position = \"absolute\";\n popup.style.visibility = \"hidden\";\n popup.style.backgroundColor = \"white\";\n popup.style.border = \"1px solid black\";\n popup.style.zIndex = 10000;\n\n let x1 = 0;\n let y1 = 0;\n let x2 = 0;\n let y2 = 0;\n\n function dragMouseDown(e) {\n e = e || this.game.doc.defaultView.event;\n e.preventDefault();\n\n x2 = e.clientX;\n y2 = e.clientY;\n this.game.doc.onmouseup = closeDrag.bind(this);\n this.game.doc.onmousemove = mouseDrag.bind(this);\n }\n\n function mouseDrag(e) {\n e = e || this.game.doc.defaultView.event;\n e.preventDefault();\n\n x1 = x2 - e.clientX;\n y1 = y2 - e.clientY;\n x2 = e.clientX;\n y2 = e.clientY;\n\n popup.style.left = (popup.offsetLeft-x1)+\"px\";\n popup.style.top = (popup.offsetTop-y1)+\"px\";\n }\n\n function closeDrag() {\n this.game.doc.onmouseup = null;\n this.game.doc.onmousemove = null;\n }\n\n popup.onmousedown = dragMouseDown.bind(this);\n\n return popup\n }", "function DomPrompt(msg){\n\n \n\n\tvar div = document.createElement (\"div\");\n\tdiv.innerHTML = msg;\n\tdocument.body.appendChild(div);\n\n\n}", "function constructBox(text) {\n var $newBox = document.createElement(\"div\");\n $newBox.classList.add(\"resultBox\");\n var $textArea = document.createElement(\"div\");\n\t$textArea.classList.add(\"STTResultText\");\n $textArea.innerHTML = text;\n $newBox.appendChild($textArea);\n return $newBox;\n}", "function displayInfoBox(node) {\n\t\tvar nodeName = node.attr(\"name\")\n var infoX = infoBoxWidth/2*0.6 \n var infoY = infoBoxHeight/2*1.05\n\t\tvar infoBox = svg.append(\"g\")\n\t\tinfoBox\n .attr(\"class\", \"popup\")\n .attr(\"transform\", function(d) {return \"translate(\" + infoX + \",\" + infoY + \")\";})\n\n\t\tinfoBox\n .append(\"text\")\n .attr(\"y\", function(d) {return -infoBoxHeight/2 + fontSize + 2*lineSpace;})\n .attr(\"text-anchor\", \"middle\")\n .text(nodeName)\n .attr(\"font-size\", fontSize + 8 + \"px\")\n\n \tinfoBox.append(\"rect\")\n .attr('id', 'performancebar')\n .attr(\"width\", infoBoxWidth*0.99)\n .style(\"fill\", \"red\")\n .style(\"stroke\", \"red\")\n .attr(\"y\", boxHeight/0)\n .attr(\"height\", 0)\n\t\n\t\n var imgOffsetX = -infoBoxWidth/2 * 0.95\n var imgOffsetY = -infoBoxHeight/2 + fontSize+8 + 2*lineSpace\n\t\tinfoBox\n .append(\"svg:image\")\n \t.attr(\"xlink:href\", \"sample_patches/\"+nodeName+\".png\")\n .attr(\"width\", infoBoxWidth*0.99)\n .attr(\"height\", infoBoxHeight*0.99)\n .attr(\"transform\", function(d) {return \"translate(\" + imgOffsetX + \",\" + imgOffsetY + \")\";})\n\t}", "function showTimeredPopup()\r\n\t{\r\n\t\t\tvar content;\r\n\t\t\tvar theProgressDivStyle;\r\n\t\r\n\t\t\tvar arrayPageSize = getPageSize();\r\n\t\t\t// need to take the scroll into account\r\n\t\t\tvar offsetArray = getScrollXY() \r\n\t\t\tvar dsocleft = offsetArray[0]; \r\n\t\t\tvar dsoctop = offsetArray[1]; \r\n\t\r\n\t\t\tif ( 0 === popupMsg.length )\r\n\t\t\t{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tthis.popupTimer = null;\r\n\t\r\n\t\t\tcontent = getPopupContent( popupMsg, popupBak, \"\" );\r\n\t\r\n\t\t\t// populate the Cells\r\n\t\t\ttheProgressDiv = document.getElementById(\"progressPopupDiv\");\r\n\t\r\n\t\t\ttheProgressDiv.innerHTML = content;\r\n\t\r\n\t\t\tvar theProgressImg=document.getElementById(\"prgImg\");\r\n\t\t\ttheProgressImg.src = progessImg.src;\r\n\t\r\n\t\t\ttheProgressDivStyle = theProgressDiv.style;\r\n\t\t\ttheProgressDivStyle.display = \"\";\r\n\t\t\ttheProgressDivStyle.top = (Math.round (((arrayPageSize[3] - 35 ) / 2)+dsoctop) + 'px');\r\n\t\t\ttheProgressDivStyle.left = ( Math.round (((arrayPageSize[2] - 221 ) / 2)+dsocleft) + 'px') ;\r\n\t}", "function createCustomPopup(status, msg) {\r\n if (document.querySelector('.custom-popup')) {\r\n document.querySelector('.custom-popup').remove();\r\n }\r\n let div = document.createElement('div');\r\n div.className = 'overlay-full custom-popup position-fixed justify-content-center align-items-center';\r\n if (status) { // true => with overlay\r\n div.classList.add('layer');\r\n }\r\n div.innerHTML = '<div class=\"popup-box content position-relative\"><div class=\"close-icon d-flex justify-content-center align-items-center position-absolute rounded-circle\"><i class=\"far fa-times-circle\"></i></div><div class=\"popupbox-content text-center\"><div class=\"popup-msg\"><p class=\"bold\">' + msg +'</p></div><div class=\"popup-control d-flex justify-content-center\"><button class=\"btn cancel-btn\" type=\"button\">Cancel</button><button class=\"btn accept-btn\" type=\"button\">Yes</button></div></div></div>';\r\n document.body.appendChild(div);\r\n}", "function popup(msg,bak)\n{\n delay(800);\n\n var content=\"<table class=\\\"tooltip\\\"><tr><td class=\\\"tooltip\\\">\"+msg+\"</td></tr></table>\";\n\n if(old)\n {\n alert(msg);\n return;\n } \n \n yyy=Yoffset; \n skin.width=popwidth;\n\n if(nav)\n { \n skin.document.open();\n skin.document.write(content);\n skin.document.close();\n skin.visibility=\"visible\";\n }\n\n if(iex)\n { \n pup.innerHTML=content;\n skin.visibility=\"visible\";\n } \n\n if(n_6)\n { \n document.getElementById(\"pup\").innerHTML=content;\n skin.visibility=\"visible\";\n }\n}", "function drawBigPV(type,json){\n \n if(!arguments[2]){\n var fun = weavePv;\n var jsonCall = json;\n } else{\n var fun = arguments[2];\n var jsonCall = arguments[3];\n }\n var div = createBigDiv(type, type,fun, jsonCall);\n div.setAttribute(\"comptype\",type);\n json = JSON.parse(json)[\"conf\"];\n\tjson = findKeysValues(json, type);\n\tvar filled = json.length > 0;\n \n\tfor(var i in json){\n\t\tvar text = json[i];\n\t\tvar tmp = document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"a\");\n\t\ttmp.appendChild(document.createTextNode(text));\n\t\tdiv.appendChild(tmp);\n\t\tdiv.appendChild(document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"br\"));\n\t}\n\n\tif(filled)\n\t\tdiv.addEventListener(\"mouseover\", function(){\n\t\t\tdiv.style.height =\"auto\";\n\t\t\tdiv.style.zIndex = 102;\n\t\t},false);\n\t\t\n\n\t\n\tif(arguments[2]){\n\t\tif(div.childNodes.length < 2){\n\t\t\tdiv.style.height = BigfixHeight+\"px\";\n\t\t}\n\t\tdiv.addEventListener(\"mouseout\", function(){\n\t\t\tdiv.style.height =BigfixHeight+\"px\";\n\t\t\tdiv.style.zIndex =101;\n\t\t},false);\n return div;\n }\n\tif(filled)\n\t\tdiv.addEventListener(\"mouseout\", function(){\n\t\t\tdiv.style.height =BigfixHeightPV+\"px\";\n\t\t\tdiv.style.zIndex =101;\n\t\t},false);\n\tdiv.style.left = \"45px\";\n\tdiv.style.height =BigfixHeightPV+\"px\";\n\tdiv.style.width =BigfixWidthPV+\"px\";\n\treturn null;\n}", "function createConsoleBoxStyle() {\n var style = document.createElement(\"style\");\n style.type = \"text/css\";\n style.innerHTML = \".debugConsoleDiv { \" +\n \"pointer-events: none; \" + // old browsers don't support this\n \"position: fixed; \" +\n \"z-index: 999999;\" +\n \"background-color: rgba(0,0,0,0.6); \" +\n \"border-style: ridge;\" +\n \"border-color: #FFFFFF;\" +\n \"border-width: 2px;\" +\n \"margin-top:50px;\" +\n \"right:50px;\" +\n \"height: \"+(14*MAX_LOG_LENGTH+50)+\"px;\" +\n \"width: \"+(CHAR_WIDTH*MAX_MESSAGE_LENGTH+HORIZONTAL_OFFSET)+\"px;\" +\n \"display: inline-block;\" +\n \"transition: opacity .35s ease-in-out; }\";\n document.getElementsByTagName('head')[0].appendChild(style);\n}", "createDialogue() {\n var dialogue = document.createElement(\"div\");\n dialogue.id = \"dialogue\";\n document.getElementsByTagName(\"body\")[0].appendChild(dialogue);\n }", "function endDiv(layerID)\t\r\n{\r\n\tif (browserOK)\t\r\n\t{\r\n\t\tdocument.write('<A href=\\\"javascript: toggleDisplay(\\''+layerID+'\\')\\\" onMouseOver=\\\"showStatus(\\''+layerID+'\\'); return true\\\" onMouseOut=\\\"window.status=\\' \\';return true\\\")\\\"><IMG src=\\\"minus.gif\\\" border=\\\"0\\\" width=\\\"12\\\" height=\\\"12\\\" alt=\\\"-\\\"><\\/A><\\/DIV>');\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdocument.write('<HR align=\\\"left\\\" width=\\\"25%\\\"><\\/DIV>');\r\n\t}\r\n}", "function CPopup (prefix, x, y, width, height, enableDrag, onClose) {\r\n var pop = WinManager.get(prefix);\r\n if (pop){\r\n pop.show (false);\r\n return pop;\r\n }\r\n this.BASE_ZINDEX = 111111;\r\n \r\n // protos ...\r\n this.show = show;\r\n this.toggleHide = toggleHide;\r\n this.getTopDiv = getTopDiv;\r\n this.getMainTopDiv = getMainTopDiv;\r\n this.getMainDiv = getMainDiv;\r\n this.getLayer = getLayer;\r\n this.setLayer = setLayer;\r\n this.setEnableDrag = setEnableDrag;\r\n this.getLocation = getLocation;\r\n this.setLocation = setLocation;\r\n this.focusMe = focusMe;\r\n this.isShown = isShown;\r\n this.unfocusMe = unfocusMe;\r\n this.centerMe = centerMe;\r\n this.destroy = destroy;\r\n this.autoHeight = autoHeight;\r\n\r\n // object vars ...\r\n this.div = document.createElement('div');\r\n this.prefix = prefix;\r\n this.onClose = onClose;\r\n \r\n var t = this;\r\n this.div.className = 'CPopup '+ prefix +'_CPopup';\r\n this.div.id = prefix +'_outer';\r\n this.div.style.background = \"#fff\";\r\n this.div.style.zIndex = this.BASE_ZINDEX // KOC modal is 100210 ?\r\n this.div.style.display = 'none';\r\n this.div.style.width = width + 'px';\r\n this.div.style.height = height + 'px';\r\n this.div.style.maxHeight = height + 'px';\r\n this.div.style.overflowY = 'hidden';\r\n this.div.style.position = \"absolute\";\r\n this.div.style.top = y +'px';\r\n this.div.style.left = x + 'px';\r\n \r\n if (CPopUpTopClass==null)\r\n topClass = 'CPopupTop '+ prefix +'_CPopupTop';\r\n else\r\n topClass = CPopUpTopClass +' '+ prefix +'_'+ CPopUpTopClass;\r\n \r\n var m = '<TABLE cellspacing=0 width=100% height=100%><TR id=\"'+ prefix +'_bar\" class=\"'+ topClass +'\"><TD width=99% valign=bottom><SPAN id=\"'+ prefix +'_top\"></span></td>\\\r\n <TD id='+ prefix +'_X align=right valign=middle onmouseover=\"this.style.cursor=\\'pointer\\'\" style=\"color:#fff; background:#333; font-weight:bold; font-size:14px; padding:0px 5px\">X</td></tr>\\\r\n <TR><TD height=100% valign=top class=\"CPopMain '+ prefix +'_CPopMain\" colspan=2 id=\"'+ prefix +'_main\"></td></tr></table>';\r\n document.body.appendChild(this.div);\r\n this.div.innerHTML = m;\r\n document.getElementById(prefix+'_X').addEventListener ('click', e_XClose, false);\r\n this.dragger = new CWinDrag (document.getElementById(prefix+'_bar'), this.div, enableDrag);\r\n \r\n this.div.addEventListener ('mousedown', e_divClicked, false);\r\n WinManager.add(prefix, this);\r\n \r\n function e_divClicked (){\r\n t.focusMe();\r\n } \r\n function e_XClose (){\r\n t.show(false);\r\n if (t.onClose != null)\r\n t.onClose();\r\n }\r\n function autoHeight (onoff){\r\n if (onoff)\r\n t.div.style.height = ''; \r\n else\r\n t.div.style.height = t.div.style.maxHeight;\r\n }\r\n function focusMe (){\r\n t.setLayer(5);\r\n for (k in unsafeWindow.cpopupWins){\r\n if (k != t.prefix)\r\n unsafeWindow.cpopupWins[k].unfocusMe();\r\n }\r\n }\r\n function unfocusMe (){\r\n t.setLayer(-5);\r\n }\r\n function getLocation (){\r\n return {x: parseInt(this.div.style.left), y: parseInt(this.div.style.top)};\r\n }\r\n function setLocation (loc){\r\n t.div.style.left = loc.x +'px';\r\n t.div.style.top = loc.y +'px';\r\n }\r\n function destroy (){\r\n document.body.removeChild(t.div);\r\n WinManager.delete (t.prefix);\r\n }\r\n function centerMe (parent){\r\n if (parent == null){\r\n var coords = getClientCoords(document.body);\r\n } else\r\n var coords = getClientCoords(parent);\r\n var x = ((coords.width - parseInt(t.div.style.width)) / 2) + coords.x;\r\n var y = ((coords.height - parseInt(t.div.style.height)) / 2) + coords.y;\r\n if (x<0)\r\n x = 0;\r\n if (y<0)\r\n y = 0;\r\n t.div.style.left = x +'px';\r\n t.div.style.top = y +'px';\r\n }\r\n function setEnableDrag (tf){\r\n t.dragger.setEnable(tf);\r\n }\r\n function setLayer(zi){\r\n t.div.style.zIndex = ''+ (this.BASE_ZINDEX + zi);\r\n }\r\n function getLayer(){\r\n return parseInt(t.div.style.zIndex) - this.BASE_ZINDEX;\r\n }\r\n function getTopDiv(){\r\n return document.getElementById(this.prefix+'_top');\r\n }\r\n function getMainDiv(){\r\n return document.getElementById(this.prefix+'_main');\r\n }\r\n function getMainTopDiv(){\r\n \treturn document.getElementById(this.prefix+'_top');\r\n }\r\n function isShown (){\r\n return t.div.style.display == 'block';\r\n }\r\n function show(tf){\r\n if (tf){\r\n t.div.style.display = 'block';\r\n t.focusMe ();\r\n } else {\r\n t.div.style.display = 'none';\r\n }\r\n return tf;\r\n }\r\n function toggleHide(t){\r\n if (t.div.style.display == 'block') {\r\n return t.show (false);\r\n } else {\r\n return t.show (true);\r\n }\r\n }\r\n}", "function show_box(element, rectangle, height, y, color) {\n aframe_coord(rectangle, element);\n let box = document.createElement('a-box');\n box.setAttribute('position', {x: rectangle.aframe_x, y: y, z: rectangle.aframe_z});\n box.setAttribute('depth', rectangle.depth);\n box.setAttribute('width', rectangle.width);\n box.setAttribute('height', height);\n box.setAttribute('color', color);\n box.setAttribute('id', rectangle.id);\n element.appendChild(box);\n return box;\n}", "function displayBubble() {\n push();\n noStroke();\n fill(100, 100, 200, 150);\n ellipse(bubble.x, bubble.y, bubble.size);\n pop();\n}", "function createSmallDiv(text, compType){\n var div = document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\");\n var label = document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"div\");\n div.setAttribute(\"compType\", compType);\n var fun = arguments[2];\n var type = arguments[3];\n var json = arguments[4];\n var funDblClick = arguments[5];\n\n div.addEventListener(\"dblclick\", function (){\n if(json)\n funDblClick(json);\n else\n funDblClick(type);\n },false);\n body.appendChild(div);\n\tdiv.style.top = \"5px\";\n\tdiv.appendChild(label);\n\t//div.style.left = parseInt(body.style.width)/2-(parseInt(body.style.width)/2);\n\tsetSmallDivsProperties(div);\n\tsetSmallLabelsProperties(label, text);\n return div;\n}", "function drawDetails(message, line, player)\n{\n\tvar x1, y1;\n\t\n\t//...specifying dimensions...\n\t\n\tvar width = 100;\n\tvar height = 40;//This is line height\n\t//... a new id is created for each element...\n\tvar textId = \"e_\" + textIdCounter;\n\ttextIdCounter++;\n\t//...deciding position based on the player's name...\n\tif (player == \"dealer\")\n\t{\n\t\tx1 = 30;\n\t\ty1 = 60 + line * height;\n\t}\n\telse if (player == \"player\")\n\t{\n\t\tx1 = 30;\n\t\ty1 = 399 + line * height;\n\t}\n\telse if (player == \"bot\")\n\t{\n\t\tx1 = 30;\n\t\ty1 = 230 + line * height;\n\t}\n\t//Having decided the postion, the next text element is being created...\n\t\n\tvar newTextElement = createSVGElement(\"text\");\n\t//Specifing coordinates...\n\t\tnewTextElement.setAttributeNS(null, \"x\", x1);\n\t\tnewTextElement.setAttributeNS(null, \"y\", y1);\n\t//Specifying style...\n\t\tnewTextElement.setAttributeNS(null, \"style\", \"fill:white; font-size:16px\");\n\t//Adding id\t...\n\t\tnewTextElement.setAttributeNS(null, \"id\", textId);\n\t//Creating the textNode...\n\tvar newTextNode = document.createTextNode(message);\n\t//Appending the textNode to the SVG Text element...\n\t\tnewTextElement.appendChild(newTextNode);\n\t//Appending te SVG text element to the main SVG element...\n\tmySVG.appendChild(newTextElement);\n\t//...returning the ID for later use.\n\treturn textId;\n}", "function displayOverlay(){\n var $overlay = $('<div id=\"overlay\" class=\"row\"></div>');\n var $msg1 = $('<div class=\"span12\"><h1 id=\"lightbox-text\" class=\"text-center\">you need to be logged in to vote!</h1></div>');\n var $msg2 = $('<div class=\"span12\"><p id=\"lightbox-text\" class=\"text-center\">Please login with Facebook or Google+</p></div>');\n var $socialIcons = $('<div class=\"span3 offset3\"><a href=\"/login/facebook/?next=/stats/\"><img class=\"lightbox-icon1\" src=\"/static/img/facebookicon.png\" alt=\"facebookicon\"></a><a href=\"/login/google-oauth2/?next=/stats/\"><img class=\"lightbox-icon2\" src=\"/static/img/googleicon.png\" alt=\"googleicon\"></a></div>');\n $overlay.append($msg1);\n $overlay.append($msg2);\n $overlay.append($socialIcons);\n $overlay.lightbox_me({\n centered: true\n });\n}", "function addElement () {\n // generate new div ElementdefaultLayer\n var newDiv = document.createElement(\"div\");\n // insert to DOM\n document.body.insertBefore(newDiv, null);\n //provide ID and style\n newDiv.id = 'lnlt';\n newDiv.style.cssText = 'position: relative; bottomleft: 0px; background-color: rgba(255, 255, 255, 0.7);box-shadow: 0 0 2px #bbb; background-clip: padding-box; margin:0; color: #333; font: 9px/1.5 \"Helvetica Neue\", Arial, Helvetica, sans-serif; ></div>;';\n}", "function addElement () {\n // generate new div ElementdefaultLayer\n var newDiv = document.createElement(\"div\");\n // insert to DOM\n document.body.insertBefore(newDiv, null);\n //provide ID and style\n newDiv.id = 'lnlt';\n newDiv.style.cssText = 'position: relative; bottomleft: 0px; background-color: rgba(255, 255, 255, 0.7);box-shadow: 0 0 2px #bbb; background-clip: padding-box; margin:0; color: #333; font: 9px/1.5 \"Helvetica Neue\", Arial, Helvetica, sans-serif; ></div>;';\n}", "function createOverlay(){\n\t// change message and page state\n\tif (this.className == \"correct\") {\n\t\tmessageHTML = \"You are correct!\";\n\t\tstate = true;\n\t}else{\n\t\tmessageHTML = \"You are wrong, please try again.\";\n\t}\n\t// create and add the overlay\n\toverlay = document.createElement(\"div\");\n\toverlay.setAttribute(\"id\", \"overlay\");\n\tdocument.body.appendChild(overlay);\n\tfadeIn(overlay, 0.7);\n\n\t// create the text area...\n\toverText = document.createElement(\"div\");\n\toverText.setAttribute(\"id\", \"overText\");\n\toverText.innerHTML= messageHTML;\n\tdocument.body.appendChild(overText);\n\tfadeIn(overText, 1);\n\t// bind a click to remove it.\n\toverlay.addEventListener('click', removeNode);\n}", "show() {\n stroke(0);\n noFill();\n this.makeShape()\n if (this.revealed) {\n if (this.mine) {\n fill(127);\n ellipse(this.x + this.mineOffsetX, this.y + this.mineOffsetY, this.w * 0.5);\n } \n else {\n fill(200);\n this.makeShape()\n if (this.neighborCount > 0) {\n textAlign(CENTER);\n fill(0);\n text(this.neighborCount, this.x + this.textOffsetX, this.y + this.textOffsetY);\n }\n }\n }\n }" ]
[ "0.6487277", "0.6350732", "0.6260988", "0.62387156", "0.62269163", "0.6212835", "0.6211153", "0.6169823", "0.61305827", "0.61226046", "0.61226046", "0.6115224", "0.60810894", "0.6063727", "0.5980384", "0.59793425", "0.59627765", "0.59517384", "0.5947049", "0.5933405", "0.5891942", "0.58431995", "0.5839897", "0.5803839", "0.57988507", "0.5793333", "0.5787942", "0.576705", "0.57629246", "0.57579195", "0.5741115", "0.5738633", "0.5716789", "0.571655", "0.5712195", "0.5708828", "0.5708828", "0.5708828", "0.5708828", "0.570373", "0.56908715", "0.56830955", "0.56796634", "0.56698626", "0.5664454", "0.5659158", "0.5657702", "0.56532127", "0.5650382", "0.5649887", "0.5647685", "0.564744", "0.5646159", "0.5642922", "0.563722", "0.56327564", "0.56235135", "0.5593968", "0.5591909", "0.5591909", "0.5591909", "0.5591909", "0.5591909", "0.5587113", "0.5586415", "0.5586071", "0.558559", "0.5582597", "0.5581848", "0.55797964", "0.5577729", "0.5569144", "0.55598956", "0.55582166", "0.55491114", "0.55460006", "0.5544916", "0.55425316", "0.5540107", "0.5539569", "0.553297", "0.5532757", "0.5532067", "0.5531108", "0.5528563", "0.5518101", "0.5508929", "0.5505467", "0.5505372", "0.5504256", "0.549946", "0.54992527", "0.54987216", "0.54953283", "0.5486616", "0.54855686", "0.54853487", "0.5481762", "0.5481762", "0.54810643", "0.5477089" ]
0.0
-1
adds a number to the bootom of the popup box when mouse is over the corresponding line
function showLineNumberInBox(e, lambdaList) { x = e.clientX; y = e.clientY; var lineNum = 0; const xOff = e.offsetX; if (xOff % 4 <= 2) { cursor = " "; lineNum = parseInt(xOff / 4); if (lambdaList.includes(lineNum)) { cursor = lineNum; } } else { cursor = " "; } document.getElementById("displayArea").style.display = 'block'; document.getElementById("displayArea").innerHTML = 'Wavelength Number: ' + cursor; document.getElementById("displayArea").style.right = x + 'px'; document.getElementById("displayArea").style.top = y + 'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showLineNumberInBox(e, lambdaList) {\n // console.log(e.target.getContext(\"2d\"));\n x = e.clientX;\n y = e.clientY;\n var lineNum = 0;\n const xOff = e.offsetX;\n if (xOff % 4 <= 2) {\n cursor = \" \";\n lineNum = parseInt(xOff / 4);\n if (lambdaList.includes(lineNum)) {\n cursor = lineNum;\n }\n } else {\n cursor = \" \";\n }\n document.getElementById(\"displayArea\").style.display = 'block';\n document.getElementById(\"displayArea\").innerHTML = 'Wavelength Number: ' + cursor;\n document.getElementById(\"displayArea\").style.right = x + 'px';\n document.getElementById(\"displayArea\").style.top = y + 'px';\n}", "function addHover(num) {\n\tmagHolder[num].addEventListener('mouseover', function() {\n\t\tmagText[num].setAttribute(\"style\", \"background-color: white; display: block; border: solid 1px #d5d6d7; z-index: 15; position: absolute; width: 160px; text-align: center; padding: 5px 5px 5px 7px\");\n\t}, false);\n\tmagHolder[num].addEventListener('mouseleave', function() {\n\t\tmagText[num].style.display = 'none';\n\t}, false);\n}", "function mouseoverTrainLine() {\n var lineID = d3.select(this).attr(\"id\");\n d3.select(this).attr(\"style\", \"cursor:pointer\");\n\n var circleID = lineID.replace(\"line\", \"circle\");\n var circle = d3.select(\"#\" + circleID);\n\n if ((popupOpen && circleID != currentCircleID) || editting)\n return;\n\n currentCircleID = circleID;\n currentCircle = circle;\n\n // currentCircle\n // .transition().duration(200)\n // .attr(\"style\", \"cursor:pointer\")\n // .attr(\"r\", 5);\n\n defineChangesFromLine(circleID);\n\n popupOpen = true;\n\n // updatePopupCircleSize(currentCircle);\n // updatePopupCircleContent();\n}", "function rect_mouseover() {\n\t\t\tpercentText.style(\"opacity\", 1)\n\t\t\tapproveText.style(\"opacity\", 1)\n\t\t\tfocusDate.style(\"opacity\", 1)\n\t\t}", "function popup35 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Jul+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup19 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de enero:\"+feature.properties.ene+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup34 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Mortalidad_Ago+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function lineMouseOver(l, i) {\n var major = getMajorAsClass(l[0].major);\n\n changeElementOpacityForDifferentMajors(\"vis2-line\", major, '.1');\n changeElementOpacityForDifferentMajors(\"vis2-dot\", major, '.1');\n\n // this makes the tooltip visible\n div.transition()\n .duration(50)\n .style(\"opacity\", .9);\n\n var string = \"Women majoring in <i>\" + l[0]['major'] + '</i>';\n\n // this sets the location and content of the tooltip to the point's location/coordinates\n div.html(string)\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n}", "function popup22 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de abril:\"+feature.properties.abr+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup32 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Ago+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup25 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>índice de aglomeración urbano-poblacional:\"+feature.properties.pce+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup29 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Junio:\"+feature.properties.Tasa_Contagios+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup17(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Hacinamiento Crítico (%):\"+feature.properties.hac_cri+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function popup27 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Junio:\"+feature.properties.Tasa_Contagios+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup24 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Tasa de mortalidad (cada 100 mil hab.):\"+feature.properties.Tasa_Mortalidad+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup20 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de febrero:\"+feature.properties.feb+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup33 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Agosto:\"+feature.properties.Tasa_Mortalidad_Jul+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup36 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Ago+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup31 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Julio:\"+feature.properties.Tasa_Contagios_Jul+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup23 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de mayo:\"+feature.properties.may+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup28 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Tasa de mortalidad (cada 100 mil hab.):\"+feature.properties.Tasa_Mortalidad+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup21 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de marzo:\"+feature.properties.mar+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup26 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.NOMBRE+\n \"</p> Casos:\"+feature.properties.nuevos_casos+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popup30 (feature, layer) {\n\tlayer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+\n \"</p>Casos cada cien mil (100.000) habitantes, mes de Mayo:\"+feature.properties.may+\"</p>\",\n \n {minWidth: 150, maxWidth: 200});\n \n layer.on('mouseover', function () { this.openPopup(); })\n\n\n}", "function popupH (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de julio:\"+feature.properties.jul+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function popupN(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Proximidad (Distancia) Km.:\"+feature.properties.Distancia+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function increasePoints(){\n points += 1;\n $('#box').text(points);\n }", "function pop_ALICE_COUNTY(feature, layer) {\r\n layer.on({\r\n mouseout: function(e) {\r\n for (i in e.target._eventParents) {\r\n e.target._eventParents[i].resetStyle(e.target);\r\n }\r\n },\r\n mouseover: highlightFeature,\r\n });\r\n var popupContent = '<table>\\\r\n <tr>\\\r\n <th>' + (feature.properties['NAMELSAD'] !== null ? autolinker.link(feature.properties['NAMELSAD'].toLocaleString()) : '') +', '+ (feature.properties['STATE_NAME'] !== null ? autolinker.link(feature.properties['STATE_NAME'].toLocaleString()) : '')+ '</th>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Total:</th>\\\r\n <td>' + (feature.properties['TOTAL'] !== null ? autolinker.link(feature.properties['TOTAL'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Poverty:</th>\\\r\n <td>' + (feature.properties['POVERTY'] !== null ? autolinker.link(feature.properties['POVERTY'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">ALICE:</th>\\\r\n <td>' + (feature.properties['ALICE'] !== null ? autolinker.link(feature.properties['ALICE'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Above ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['ABOVE AT'] !== null ? autolinker.link(feature.properties['ABOVE AT'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">% Below ALICE Threshold:</th>\\\r\n <td>' + (feature.properties['perBAT'] !== null ? autolinker.link(feature.properties['perBAT'].toLocaleString(\"en-US\", {style:\"percent\"})) : '') + '</td>\\\r\n </tr>\\\r\n <tr>\\\r\n <th scope=\"row\">Selection</th>\\\r\n <td>' + (feature.properties['GroupName'] !== null ? autolinker.link(feature.properties['GroupName'].toLocaleString()) : '') + '</td>\\\r\n </tr>\\\r\n </table>';\r\n layer.bindPopup(popupContent, {maxHeight: 400});\r\n}", "function popupL(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de noviembre:\"+feature.properties.nov+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function popupK(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de octubre:\"+feature.properties.oct+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function mouseoverFunction(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 3,\n color: 'blue',\n dashArray: '',\n fillOpacity: 1\n });\n\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n\n //update the text in the infowindow with whatever was in the data\n //console.log(layer.feature.properties.NTAName);\n $('#infoWindow').html(layer.feature.properties.ntaname+'<br />REDI Score: '+Math.round(layer.feature.properties[redi_column]));\n}", "function mouseOver(e) {\r\n var layer_marker = e.target;\r\n // layer_marker.openPopup();\r\n }", "function mouseOver(e) {\r\n\t\t\t\tvar layer_marker = e.target;\r\n\t\t layer_marker.setStyle({\r\n\t\t radius: radius + 1,\r\n\t\t fillColor: fill_color_hover,\r\n\t\t color: border_color_hover,\r\n\t\t weight: 2,\r\n\t\t opacity: 1,\r\n\t\t fillOpacity: 1\r\n\t\t\t\t});\r\n\t\t\t\t// layer_marker.openPopup();\r\n\t\t }", "function setLineNum(num)\r\n{\r\n var box1 = document.getElementById('lineBox1');\r\n var box2 = document.getElementById('lineBox2');\r\n if(box1 == null || box2 == null)\r\n return;\r\n if(lastPick == null)\r\n {\r\n box1.value = num;\r\n }\r\n else if(lastPick >= num)\r\n {\r\n box1.value = num;\r\n box2.value = lastPick;\r\n }\r\n else if(lastPick < num)\r\n {\r\n box1.value = lastPick;\r\n box2.value = num;\r\n }\r\n lastPick = num;\r\n addButtonEnable();\r\n}", "function handleMouseOver(d, i) { // Add interactivity\n\n // Specify where to put label of text\n svg.append(\"text\")\n .attr(\"id\", \"t\" + d.date.getTime() + \"-\" + d.time + \"-\" + i)\n .attr(\"x\", function() { return x(d.date) + left; })\n .attr(\"y\", function() { return y(d.time) + top - 5; })\n .attr(\"font-size\", \"12px\")\n .text(function() {\n var month = d.date.getMonth() + 1;\n var day = d.date.getDate();\n var year = d.date.getFullYear();\n var toPrintDate = month + \"/\" + day + \"/\" + year;\n return d.name + \": \" + toPrintDate + \", \" + ticks(d.time); // Value of the text\n });\n }", "e_mouseOver(e)\n\t{\n\n\t}", "function popupM(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de diciembre:\"+feature.properties.dic+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function drapal_mouseover() {\n if(mass_opener && (max_tab > 1)) {\n this.style.backgroundColor = \"rgba(255,255,255,0.7)\";\n this.style.color = \"black\";\n }\n}", "function mouseOver(x, y) {\r\n\t//debugOut(\"mouse over, x=\"+x+\" y=\"+y);\r\n\t\r\n\t//*** Your Code Here\r\n}", "function popupI (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de agosto:\"+feature.properties.ago+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function mouseOverWhich(x, pic, picX, set1, set2, set3){\n push();\n rectMode(CENTER);\n rect(x, height/2+height/6, width/10, height);\n noTint();\n image(pic, picX, height/2, width/13, width/13);\n setText(set1, set2, set3);\n pop();\n\n}", "function showNum(posX, posY,value){\n $(\"#num_\"+posX+posY).css({\n backgroundColor:getBGColor(value),\n color:getColor(value),\n }).text(value).animate({\n // position:'absolute',\n width:\"100px\",\n height:\"100px\",\n opacity:1.0,\n top:20*(posX+1)+100*posX,\n left:20*(posY+1)+100*posY,\n },80);\n // console.log(posX+' '+posY+' '+value);\n }", "function handleMouseOverLines(lambdaList) {\n\n canvas.addEventListener(\"mousemove\", e => showLineNumberInBox(e, lambdaList));\n canvas.addEventListener(\"mouseleave\", unshowLineNumberInBox);\n}", "function handleMouseOverLines(lambdaList) {\n\n canvas.addEventListener(\"mousemove\", e => showLineNumberInBox(e, lambdaList));\n canvas.addEventListener(\"mouseleave\", unshowLineNumberInBox);\n}", "function step2() {\t \t\r\n \tdocument.getElementById(\"gm-bubble-content\").onmouseover=step3;\r\n}", "function _mouse_over_handler(ev, d, i)\n {\n g.append('svg:text')\n .attr('id', \"t\" + parent_name + d.rssi + \"-\" + i)\n .attr('x', function(){ return xScale(d.time); })\n .attr('y', function(){ return yScale(d.rssi) - 8; })\n .attr('text-anchor', 'middle')\n .text(function(){ return `${d.rssi}(${date_scale_format(d.time)})`; });\n }", "function handleMouseOver (d,i){\n d3.select(this).attr('stroke', 'yellow');\n\n // Specify where to put label of text\n Svg.append(\"text\")\n .attr('id', \"t\" + i)\n .attr(\"x\", x(d.x) )\n .attr('y', y(d.y) )\n .text(d.id)\n .style('fill', 'white');\n }", "function popupC (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de marzo:\"+feature.properties.mar+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function doneTypingNum() {\n var newnumber = $('#temp').val();\n $('#temp').closest('td').html(\"<a style='color:#cccdce;'><font class='set_number'>\"+newnumber+\"</font></a>\");\n $('.set_number').parent().mouseover(function(){$(this).removeAttr('style').addClass('float')})\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function onPopupMouseEnter() {\n forceUpdate({});\n }", "function popupJ (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de septiembre:\"+feature.properties.sep+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function mouseUp() { }", "function putNumber(num){ // for buttons\n line.value = line.value + num.toString();\n}", "function addspan(e)\r\n{\r\n\tif($.browser.msie)\r\n\t{\r\n\t\ty_ = e.y;\r\n\t\tx_ = e.x;\r\n\t}\r\n\telse\r\n\t{\r\n\t\ty_ = e.clientY;\r\n\t\tx_ = e.clientX;\r\n\t}\r\n\tflag_hint=1;\t\r\n\thspan = $(document.body).find(\"span.hover_span\")[0];\r\n\ttimespan(x_,y_);\r\n}", "function MouseOver(d, i) { // Add interactivity\r\n\r\n // Use D3 to select element, change color and size\r\n d3.select(this).attr({\r\n fill: \"green\",\r\n r: radius * 4\r\n });\r\n\r\n // Specify where to put label of text\r\n svg.append(\"text\").attr({\r\n id: \"t\" + d.Year + \"-\" + d.Value + \"-\" + i, // Create an id for text so we can select it later for removing on mouseout\r\n x: function() { return xScale(d.Year) - 30; }, \r\n y: function() { return yScale(d.Value) - 15; }\r\n })\r\n .text(function() {\r\n return [\"Year: \"+d.Year+\" Population: \"+d.Value]; // Value of the text\r\n });\r\n }", "function overSkill0() {\r\n\tget(\"tooltip-display\").style.display = \"block\";\r\n\tget(\"tooltip-text\").innerHTML = skillsDescArray[0]\r\n}", "function siMouseOver(e){\n //on mouse over, add class to bottom line of content card which widens it\n e.parentNode.children[3].classList.add('content-line-hover');\n}", "function handleMouseOver(d, i) { // Add interactivity\n // Use D3 to select element, change color and size\n d3.select(this).style(\"fill\",\"orange\")\n .attr(\"r\", radius*2)\n\n // Specify where to put label of text\n svg.append(\"text\").attr(\"id\", \"t1337\")\n .attr(\"x\", x(d.x) - 30)\n .attr(\"y\", y(d.y) - 15)\n .text([d.x, d.y]);\n}", "function handleMouseOverDist(e) {\n\t\t\t\te.currentTarget.addClassName('active');\n\t\t\t\tvar parent = $(e.currentTarget).parent().get(0);\n\n\t\t\t\ttheInterface.emit('ui:emphElement', {\n\t\t\t\t\tid : e.currentTarget.getAttribute('id'),\n\t\t\t\t\tlayer : parent.getAttribute('data-layer')\n\t\t\t\t});\n\n\t\t\t}", "function unshowLineNumberInBox() {\n document.getElementById(\"displayArea\").innerHTML = \"Wavelength Number: \";\n}", "function unshowLineNumberInBox() {\n document.getElementById(\"displayArea\").innerHTML = \"Wavelength Number: \";\n}", "function mouseOver(){\n\t\t\t\tconsole.log(\"mouseOver by EventListener. \"+ this.$rectRed);\n\t\t\t\t//this.$rectRed.innerHTML = '<rect y=\"66\" x=\"0\" height=\"81\" width=\"80\" id=\"rect3\" style=\"display:inline;fill:#e23b3b;fill-opacity:1;stroke-width:1.26025\" />';\n\t\t\t}", "function moreLineWidth(e){\n\n\n\t$(\".portMore\").attr(\"id\",\"moreWidthClass\");\n\n\n\n}", "function lineType(){\n $('#linesolid').click(function(){\n context.setLineDash([0]);\n\n });\n\n $('#linedash').click(function(){\n context.setLineDash([2,30]);\n \n\n });\n }", "function popupD (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de abril:\"+feature.properties.abr+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function mouseEnterAnchor(obj, idVal, event) {\n\tvar position = obj.position();\n\n\tvar p = obj.position();\n\t$(\"span[id='taxesAndFeesPopUp-\" + idVal + \"']\").css('position', \"absolute\");\n\t$(\"span[id='taxesAndFeesPopUp-\" + idVal + \"']\").css('display', \"\");\n\t$(\"span[id='taxesAndFeesPopUp-\" + idVal + \"']\").css('left', ( p.left - 160 +'px'));\n\t$(\"span[id='taxesAndFeesPopUp-\" + idVal + \"']\").css('z-index', \"99999\");\n\n//\tvar topVal = obj.offset().top+32;\n//\tvar leftVal = obj.offset().left - 190;\n//\tshowOverlay($(\"span[id='taxesAndFeesPopUp-\" + idVal + \"']\"), leftVal, topVal,9000);\n}", "function updateMouseHoverLine() {\r\n for (var i=0; i<lineSegments.length; ++i) {\r\n ls = lineSegments[i];\r\n //determine if cursor position is on or very near a line\r\n var TOLERANCE = CELL_SIZE/2;\r\n var mousePos = {x:mouseX,y:mouseY};\r\n var closestPoint = Geometry.getClosestPointOnLineSegment(ls.p1, ls.p2, mousePos, TOLERANCE)\r\n if (closestPoint != false) {\r\n ls.hover = true;\r\n if (debug && currentTool == \"select-line\" || currentTool == \"delete-line\") {\r\n //draw dot for p2\r\n ctx.beginPath();\r\n ctx.arc(closestPoint.x, closestPoint.y, 2, 0, Math.PI*2, true); \r\n ctx.closePath();\r\n ctx.fillStyle = \"purple\";\r\n ctx.fill();\r\n }\r\n } else {\r\n ls.hover = false;\r\n }\r\n }\r\n}", "function mouseOver() {\n setMouseOver(true);\n }", "function overbar(a) { return \"<span style='text-decoration: overline'>\"+a+\"</span>\"; }", "function popupO(feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Superficie urbana (%):\"+feature.properties.indiceurb+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function showSaleCount(saleCount) {\n //$('#pipeSale').mouseenter(function () {\n var getDiv = document.getElementById(\"hoverSale\");\n getDiv.innerText = saleCount;\n\n var getwondiv = document.getElementById(\"wonOpp\");\n getwondiv.innerText = \"\";\n var wonCountLabel = document.createElement(\"DIV\");\n wonCountLabel.className = \"wonLostLabel\";\n wonCountLabel.appendChild(document.createTextNode(saleCount));\n $('#wonOpp').append(wonCountLabel); \n}", "function mouse(kind, pt, id) {\n \n}", "mouseUp(pt) {}", "mouseUp(pt) {}", "function doneTypingNum() {\n var newnumber = $('#temp').val();\n $('#temp').closest('td').html(\"<a style='color:#cccdce;'><font class='set_number'>\"+newnumber+\"</font></a>\");\n $('.set_number').parent().mouseover(function(){$(this).removeAttr('style').addClass('float')});\n }", "_updateLevelLinesBox() {\n\t\tthis.levelLinesBox.changeText('LEVEL: ' + this.level + '\\nLINES: ' + this.lines);\n\t}", "function mouseover() {\n\ttiptool_div.style(\"display\", \"inline\");\n\t}", "mouseDown(pt) {}", "mouseDown(pt) {}", "function opacityIncrease(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n opa = 0.1\n $('.square').css(\"opacity\", opa);\n $('.square').css(\"background-color\", \"black\");\n $('.square').mouseenter(function(){\n opaval = $(this).css(\"opacity\");\n if (opaval < 1){\n $(this).css(\"opacity\", opaval*1.3);\n }\n });\n}", "activateLineRipple() {}", "function MouseOverItem(idPoint, e) {\n idItemOver = idPoint.replace(\"item\", \"\");\n if (InfoEdiMode == \"Info\") {\n ShowInfoFromPoint(idItemOver, e);\n }\n}", "function updateTooltip() {\n d3.selectAll('.mouse-per-line')\n .remove();\n }", "function popupF (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de mayo:\"+feature.properties.may+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function powerUpOverlay() {\n push();\n fill(255, 255, 0, 20);\n rect(0, 0, width, height);\n textAlign(CENTER);\n textFont(font, 12);\n fill(100);\n text(\"Points 5x\", width / 2, height / 2 - 50);\n pop();\n}", "function mouseUpQ5(){\n \n document.getElementById('storeScore').style.display = 'inline';\n}", "function mousePressed() {\n\nclicks = clicks + 1; \nconsole.log(\" CLicks =\" + \" \" + clicks);\n}", "function mouseMove2(){\n header1.style.fontSize=counter1-- +\"px\";\n}", "function handleMouseOver(d, i) { // Add interactivity\n // Use D3 to select element, change color and size\n d3.select(this).attr(\"fill\", \"orange\");\n\n // Specify where to put label of text\n svg.append(\"text\").attr({\n id: \"t\" + d.x + \"-\" + d.y + \"-\" + i, // Create an id for text so we can select it later for removing on mouseout\n x: function() {\n return xScale(d.x) - 30;\n },\n y: function() {\n return yScale(d.y) - 15;\n }\n })\n}", "function popupG (feature,layer){\n layer.bindPopup(\n \"</p>Nombre: \"+feature.properties.Nombre+ \n \"</p>Casos cada cien mil (100.000) habitantes, mes de junio:\"+feature.properties.jun+\"</p>\"\n);\n layer.on('mouseover', function () { this.openPopup(); })\n}", "function onEachfloodriskFeature(feature, layer) {\r\nbo_name = feature.properties.NAME ;\r\nfloodrisk = feature.properties.percent;\r\nonpopup = \"<b>Borough Name:</b>\"+bo_name +\"<br />\"+\"<b>Flood Risk Area:</b>\"+floodrisk +\"%\"\r\n\r\n\r\n\r\nlayer.on({\r\n\tmouseover: highlightFeature,\r\n\tmouseout: resetfloodriskHighlight,\r\n\tclick: selectpumpfloodriskFeature\r\n});\r\n\r\nlayer.bindPopup(onpopup);\r\n\r\n\r\n}", "showEggs() {\n this.UpdatePoppedEggCount();\n }", "function handleOnMouseOver(oTr)\n{\ndeselectAll();\noTr.className = \"highlightrow\";\nposition = oTr.id.substring(2, oTr.id.length);\n}", "function f_addMouseOver(){\n mxGraph.addMouseListener({\n //set tmp cell\n cell: null,\n mouseMove: function(sender, me) {\n //check, if selected cell changed\n var currentCell = me.getCell();\n if (me.getCell() !== this.cell) {\n if (this.cell !== null) {\n this.dragLeave(me.getEvent(), this.cell);\n }\n this.cell = currentCell;\n if (this.cell !== null) {\n this.dragEnter(me.getEvent(), this.cell);\n }\n }\n },\n dragEnter: function(evt, cell) {\n f_updateStyle(this.cell, true);\n f_highlightPublications(this.cell.id);\n },\n dragLeave: function(evt, cell) {\n f_clearHighlightPublications();\n f_updateStyle(cell, false);\n },\n mouseDown: function(sender, me) {\n //do nothing\n },\n mouseUp: function(sender, me) {\n //do nothing\n }\n });\n}", "mouseOver(panel) {\n\t}", "function onMouseOver() {\n ipc.send('electron-notify-mouseover', winId);\n }", "function mouseOver(mouse_over) {\r\n\tmouse_over.innerHTML= \"Thank You\";\r\n}" ]
[ "0.67592955", "0.6614352", "0.62537307", "0.6186476", "0.618575", "0.61709523", "0.61543155", "0.6144594", "0.6143707", "0.61396706", "0.61323035", "0.61254305", "0.6089654", "0.6072405", "0.6065777", "0.6059029", "0.6055843", "0.6055259", "0.6049621", "0.60314864", "0.6025963", "0.6017625", "0.6001186", "0.59379023", "0.59349144", "0.58720756", "0.58664113", "0.5863513", "0.5859782", "0.5843142", "0.58287966", "0.5826104", "0.5823467", "0.5807946", "0.5801414", "0.5795006", "0.57911664", "0.5772138", "0.57716113", "0.5768932", "0.5754755", "0.5752864", "0.574887", "0.574887", "0.5746842", "0.57350296", "0.572185", "0.5718848", "0.5710573", "0.57105446", "0.57105446", "0.57105446", "0.57105446", "0.57066405", "0.5696767", "0.56875736", "0.5681232", "0.56809026", "0.56764185", "0.5672484", "0.5664735", "0.5656381", "0.5651425", "0.5651425", "0.5641267", "0.56403047", "0.5634333", "0.5631889", "0.563162", "0.5618204", "0.5615931", "0.5602493", "0.559944", "0.55941874", "0.55934566", "0.5592299", "0.5592299", "0.55897987", "0.55866766", "0.55747855", "0.55737126", "0.55737126", "0.55723655", "0.5570242", "0.5568889", "0.5557104", "0.5550382", "0.5543666", "0.5538785", "0.5529655", "0.55259985", "0.5518057", "0.55167335", "0.55113864", "0.5510846", "0.5505237", "0.55049276", "0.55030155", "0.5500726", "0.5500304" ]
0.6657385
1
removes the line number created in method showLineNumberInBox when mouse leaves the line
function unshowLineNumberInBox() { document.getElementById("displayArea").innerHTML = "Wavelength Number: "; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "timelineUnmarkEvents() {\n this.line.setSelection();\n }", "function showLineNumberInBox(e, lambdaList) {\n // console.log(e.target.getContext(\"2d\"));\n x = e.clientX;\n y = e.clientY;\n var lineNum = 0;\n const xOff = e.offsetX;\n if (xOff % 4 <= 2) {\n cursor = \" \";\n lineNum = parseInt(xOff / 4);\n if (lambdaList.includes(lineNum)) {\n cursor = lineNum;\n }\n } else {\n cursor = \" \";\n }\n document.getElementById(\"displayArea\").style.display = 'block';\n document.getElementById(\"displayArea\").innerHTML = 'Wavelength Number: ' + cursor;\n document.getElementById(\"displayArea\").style.right = x + 'px';\n document.getElementById(\"displayArea\").style.top = y + 'px';\n}", "function showLineNumberInBox(e, lambdaList) {\n x = e.clientX;\n y = e.clientY;\n var lineNum = 0;\n const xOff = e.offsetX;\n if (xOff % 4 <= 2) {\n cursor = \" \";\n lineNum = parseInt(xOff / 4);\n if (lambdaList.includes(lineNum)) {\n cursor = lineNum;\n }\n } else {\n cursor = \" \";\n }\n document.getElementById(\"displayArea\").style.display = 'block';\n document.getElementById(\"displayArea\").innerHTML = 'Wavelength Number: ' + cursor;\n document.getElementById(\"displayArea\").style.right = x + 'px';\n document.getElementById(\"displayArea\").style.top = y + 'px';\n}", "function onDeleteLine() {\n changeCurrMeme('delete-row');\n initCanvasAndEditor();\n}", "function handleMouseOverLines(lambdaList) {\n\n canvas.addEventListener(\"mousemove\", e => showLineNumberInBox(e, lambdaList));\n canvas.addEventListener(\"mouseleave\", unshowLineNumberInBox);\n}", "function handleMouseOverLines(lambdaList) {\n\n canvas.addEventListener(\"mousemove\", e => showLineNumberInBox(e, lambdaList));\n canvas.addEventListener(\"mouseleave\", unshowLineNumberInBox);\n}", "function undoHighlightLine(code_mirror_box, css) {\n var identifier = \"_\" + css\n if (identifier in code_mirror_box) {\n var lineHandle = code_mirror_box[identifier]\n code_mirror_box.removeLineClass(lineHandle, \"background\", css);\n }\n}", "removeToLineStart() {\n if (this.selection.isEmpty())\n this.selection.selectLineStart();\n if (this.selection.isEmpty())\n this.selection.selectLeft();\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }", "function disable() {\n mouse_highlight.destroy();\n}", "function mouseoutTrainLine() {\n var lineID = d3.select(this).attr(\"id\");\n\n var circleID = lineID.replace(\"line\", \"circle\");\n var circle = d3.select(\"#\" + circleID);\n\n circle\n .transition().duration(200)\n .attr(\"r\", 2);\n if (!editting) {\n popup.style(\"visibility\", \"hidden\");\n popupRect.style(\"visibility\", \"hidden\");\n popupOpen = false;\n }\n}", "function deleteAndRaiseFN() {\n let sel = $('#' + $('.selected').attr('id'));\n let pos = sel.offset();\n let subTree = sel.detach();\n $('#' + sel.attr('line-target')).remove();\n subTree.appendTo('body');\n sel.css({\n 'top' : pos.top,\n 'left' : pos.left\n });\n calc_all_lines('#' + sel.attr('id'));\n }", "function getDeletedLine(event) {\n const isDeleted =\n event.changes[0].text === '' && event.changes[0].range.endColumn === 1;\n return isDeleted ? event.changes[0].range.endLineNumber : 0;\n }", "function updateTooltip() {\n d3.selectAll('.mouse-per-line')\n .remove();\n }", "deleteLine(ev){\n this.nameTarget(`lineCell-${ev.target.parentElement.id}`).remove()\n }", "deleteLine(ev){\n this.nameTarget(`lineCell-${ev.target.parentElement.id}`).remove()\n }", "doNotDisplayLineText() {\r\n this._ignoredLine = true;\r\n }", "function handleClick(event)\n {\n if($(_consoleSelector)[0].selectionStart <= _eraseLimit || $(_consoleSelector)[0].selectionEnd <= _eraseLimit)\n {\n $(_consoleSelector)[0].selectionStart = _eraseLimit;\n $(_consoleSelector)[0].selectionEnd = _eraseLimit;\n }\t\n }", "removeToLineEnd() {\n if (this.selection.isEmpty())\n this.selection.selectLineEnd();\n\n var range = this.getSelectionRange();\n if (range.start.column == range.end.column && range.start.row == range.end.row) {\n range.end.column = 0;\n range.end.row++;\n }\n\n this.session.remove(range);\n this.clearSelection();\n }", "function ae(e){var t=e.markedSpans;if(t){for(var a=0;a<t.length;++a)t[a].marker.detachLine(e);e.markedSpans=null}}", "function lineMouseOut(l, i) {\n var major = getMajorAsClass(l[0].major);\n\n changeElementOpacityForDifferentMajors(\"vis2-line\", major, '1');\n changeElementOpacityForDifferentMajors(\"vis2-dot\", major, '1');\n\n div.transition()\n .duration(100)\n .style(\"opacity\", 0);\n}", "function lineMouseOutHandler() {\n for (i = 0; i < dynamicFileList.length; i++) {\n var id = filenameToId(dynamicFileList[i]);\n if (\"line\" + id != this.id) {\n turnOn(filenameToId(dynamicFileList[i]), colorMap.get(id));\n\n }\n }\n}", "function cleanUpLine(line) {\r\n line.parent = null;\r\n detachMarkedSpans(line);\r\n}", "function lineMouseOverHandler() {\n for (i = 0; i < dynamicFileList.length; i++) {\n var id = filenameToId(dynamicFileList[i]);\n if (\"line\" + id != this.id) {\n turnOff(filenameToId(dynamicFileList[i]));\n }\n }\n}", "function handleMouseout(e){\n\t\t\t\tlet code = e.currentTarget.getAttribute(\"data-code\");\n\t\t\t\tdocument.querySelectorAll(`[data-code=${code}]`).forEach(el => {\n\t\t\t\t\tel.removeAttribute(\"stroke\");\n\t\t\t\t\tel.removeAttribute(\"stroke-width\");\n\t\t\t\t});\n\t\t\t\toutput.innerHTML = \"\";\n\t\t\t}", "function nodeOutFunction() {\n tooltip.style(\"visibility\", \"hidden\")\n if (clicked_node == null) {\n clearHighlights();\n node_tooltip.style(\"visibility\", \"hidden\")\n }\n highlight_layer.select('#current-node').remove()\n}", "resetDrawLines() {\n var ctx = this.modal_ctx;\n \n for (var dl of this.drawlines) {\n ctx.editor.removeDrawLine(dl);\n }\n \n this.drawlines.length = 0;\n }", "function cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}", "function cleanUpLine(line) {\n line.parent = null\n detachMarkedSpans(line)\n}", "_treeNodeEditLostFocus(e) {\n e.preventDefault();\n const seltext = e.currentTarget.nextElementSibling;\n seltext.removeAttribute('hidden');\n e.currentTarget.setAttribute('hidden', '');\n }", "function deselectInkwell()\n{\n // De-highlight any previously highlighted inkwell...\n if (selectedInkwell)\n selectedInkwell.style.strokeDasharray = null;\n\n // Stop remembering the inkwell...\n selectedInkwell = null;\n}", "function visualLineEndNo(doc, lineN) {\n\t\t if (lineN > doc.lastLine()) { return lineN }\n\t\t var line = getLine(doc, lineN), merged;\n\t\t if (!lineIsHidden(doc, line)) { return lineN }\n\t\t while (merged = collapsedSpanAtEnd(line))\n\t\t { line = merged.find(1, true).line; }\n\t\t return lineNo(line) + 1\n\t\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function visualLineEndNo(doc, lineN) {\n\t if (lineN > doc.lastLine()) return lineN;\n\t var line = getLine(doc, lineN), merged;\n\t if (!lineIsHidden(doc, line)) return lineN;\n\t while (merged = collapsedSpanAtEnd(line))\n\t line = merged.find(1, true).line;\n\t return lineNo(line) + 1;\n\t }", "function cleanUpLine(line) {\n\t\t line.parent = null;\n\t\t detachMarkedSpans(line);\n\t\t }", "function cleanUpLine(line) {\n\t\t line.parent = null;\n\t\t detachMarkedSpans(line);\n\t\t }", "function visualLineEndNo(doc, lineN) {\n\t\t if (lineN > doc.lastLine()) return lineN;\n\t\t var line = getLine(doc, lineN), merged;\n\t\t if (!lineIsHidden(doc, line)) return lineN;\n\t\t while (merged = collapsedSpanAtEnd(line))\n\t\t line = merged.find(1, true).line;\n\t\t return lineNo(line) + 1;\n\t\t }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }", "function cleanUpLine(line) {\r\n line.parent = null;\r\n detachMarkedSpans(line);\r\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n}", "function nodeMouseOut(){\n if(bOverrideMouseOver()) {\n return;\n }\n setState(STATE.HOVEREMPTY);\n setSelection({}, TYPE.EMPTY);\n}", "function removeSelectionHighlight() {\r\n hideSelectionRect();\r\n hideRotIndicator();\r\n }", "getLineAfterViewZone() {\n // TODO: abstract away the data, ids etc.\n const range = this.data.model.getDecorationRange(this.data.startEditDecId);\n // if the first decoration is missing, this implies the region reaches the\n // start of the editor.\n return range ? range.endLineNumber + 1 : 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) return lineN;\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) return lineN;\n while (merged = collapsedSpanAtEnd(line))\n line = merged.find(1, true).line;\n return lineNo(line) + 1;\n }", "function MouseUp(e){\n document.body.removeChild(pre);\n}", "function deleteLine(){\n\t\tul.removeChild(li);\n\t\tli.removeChild(btn);\n\t}", "removeHighlight() {\n if (this._highlight) {\n this._highlight.setStyle({\n fillOpacity: 0,\n });\n }\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }", "function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }" ]
[ "0.6328683", "0.63186103", "0.622773", "0.6204096", "0.6202259", "0.6202259", "0.6109514", "0.6082548", "0.5948113", "0.5938224", "0.59150827", "0.58933675", "0.5865645", "0.58542687", "0.58542687", "0.5800403", "0.5773268", "0.57700723", "0.5767764", "0.57254225", "0.5677842", "0.5673657", "0.56544775", "0.5631028", "0.56255573", "0.5621427", "0.5605511", "0.5605511", "0.5602476", "0.55963135", "0.5591657", "0.55897236", "0.55897236", "0.55897236", "0.5589647", "0.5589647", "0.558572", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.5578939", "0.55775464", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562556", "0.5562246", "0.5561757", "0.5556114", "0.55499893", "0.55499893", "0.55499893", "0.55499893", "0.55499893", "0.55499893", "0.55499893", "0.55366373", "0.5535243", "0.5534546", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524", "0.5531524" ]
0.6563106
1
check for links connected to marker, also delete the data. params? only works for new nodes now check for links connected to marker, also delete the data. params? only works for new nodes now
function deleteOnRightClick(event, featureGroup, markers, links, mymap) { closeAllPopups(); tempMarkerlist = []; if (event.layer instanceof L.Marker) { //delete data, connected links; marker = event.layer; var connectedLinks = []; getConnectedLinks(marker, featureGroup, connectedLinks); if (connectedLinks.length == 0) { deleteOnRightClickLayer(marker, markers, featureGroup); } else { popupAlert("Marker cannot be deleted - remove the connected links first.", mymap); } } else if (event.layer instanceof L.Polyline) { link = event.layer; deleteOnRightClickLayer(link, links, featureGroup); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processLinks(nodes, lookup) {\n var removeList = []\n\n nodes.forEach(function(node){\n if( node.geometry !== null ) return;\n\n if( node.properties.origin && node.properties.terminus ) {\n var origin = lookup[node.properties.origin];\n var terminus = lookup[node.properties.terminus];\n\n if( !origin || !terminus ) {\n return console.log('Found link but nodes are missing geo: '+node.properties.prmname);\n } else if( !origin.geometry || !terminus.geometry ) {\n return console.log('Found link but nodes are missing geo: '+node.properties.prmname);\n }\n\n node.geometry = {\n \"type\": \"LineString\",\n \"coordinates\": [\n origin.geometry.coordinates, terminus.geometry.coordinates\n ]\n };\n\n } else {\n console.log('Found node with missing geo but not link: '+node.properties.prmname);\n removeList.push(node);\n }\n });\n\n removeList.forEach(function(node){\n nodes.splice(nodes.indexOf(node), 1);\n });\n}", "function updateLink(num,add){//if add=1 -> add ; add=0 -> just delete not add after\n //local variables declaration\n var numinlist;\n var SphereList = [];\n var nom;\n for(let i=0;i<listLink.length;i++){//i varies in listLink array\n if(listLink[i].name == num){//if the number in the list equals the function parameter (the num of the link we want to remove)\n numinlist=i;//link number is the list = counter\n }\n }\n nom = listLink[numinlist].label[0].name;\n listLink[numinlist].geometry.dispose();//delete the geometry and the material from the property listLink for the link deleted\n listLink[numinlist].material.dispose();//-----------------------\n world.remove( listLink[numinlist] );//remove the link by his number\n world.remove(listLink[numinlist].label[0]);//delete link's label\n listLink.splice(numinlist,1);//remove the number of the link of the links list\n for(let i=0; i<listSpheres2.length; i++){\n for(let j=0; j<listSpheres2[i].link.length; j++){//in listSpheres2.link property = list\n if (listSpheres2[i].link[j] == num){//checked the number is ok\n SphereList.push(listSpheres2[i].label[0].name);//save spheres label \n listSpheres2[i].link.splice(j,1);//delete the link's number from the list\n }\n }\n } \n if(add==0){//link deleted\n updateConnectedLinks(nom);//delete his name from listSpheres2.linkName property = list\n for(let i=0;i<listSpheres2.length;i++){\n if(listSpheres2[i].label[0].name == SphereList[0] ){//first sphere's label OK\n for(let j=0;j<listSpheres2[i].connectedSphereName.length;j++){\n if(listSpheres2[i].connectedSphereName[j] == SphereList[1]){//second sphere's label is in listSpheres2.connectedSphereName property = list\n listSpheres2[i].connectedSphereName.splice(j,1);//delete the sphere's name from it\n }\n }\n }//same for the other sphere\n else if(listSpheres2[i].label[0].name == SphereList[1]){\n for(let j=0;j<listSpheres2[i].connectedSphereName.length;j++){\n if(listSpheres2[i].connectedSphereName[j] == SphereList[0]){\n listSpheres2[i].connectedSphereName.splice(j,1);\n }\n }\n }\n }\n }\n if(add==1){//add the link each time the sphere is dragged\n //updateConnectedLinks(nom);\n addLink(SphereList[0], SphereList[1], 1,nom);//add the link between the two spheres and her label\n \n }\n}", "function finalDataFiltering() {\n //Reset the mappings\n node_by_id = {};\n edge_by_id = {};\n linked_to_id = {}; //Filter out nodes without any remaining connections\n\n nodes = nodes.filter(function (d) {\n return d.degree > 0;\n });\n nodes.forEach(function (d) {\n node_by_id[d.id] = d;\n }); // nodes.sort((a,b) => types.indexOf(b.type) - types.indexOf(a.type))\n //Only keep the edges that exist in the node list\n\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n }); //Save all of the edges to a specific node\n\n edges.forEach(function (d) {\n edge_by_id[d.source + ',' + d.target] = true;\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]);\n }); //forEach\n } //function finalDataFiltering", "function finalDataFiltering() {\n //Reset the mappings\n node_by_id = {};\n edge_by_id = {};\n linked_to_id = {}; //Filter out nodes without any remaining connections\n\n nodes = nodes.filter(function (d) {\n return d.degree > 0;\n });\n nodes.forEach(function (d) {\n node_by_id[d.id] = d;\n }); // nodes.sort((a,b) => types.indexOf(b.type) - types.indexOf(a.type))\n //Only keep the edges that exist in the node list\n\n edges = edges.filter(function (d) {\n return node_by_id[d.source] && node_by_id[d.target];\n }); //Save all of the edges to a specific node\n\n edges.forEach(function (d) {\n edge_by_id[d.source + ',' + d.target] = true;\n if (!linked_to_id[d.source]) linked_to_id[d.source] = [];\n if (!linked_to_id[d.target]) linked_to_id[d.target] = [];\n linked_to_id[d.source].push(node_by_id[d.target]);\n linked_to_id[d.target].push(node_by_id[d.source]);\n }); //forEach\n } //function finalDataFiltering", "function updateConnectedLinks(nameLinkDeleted){\n for (let i=0;i<listSpheres2.length;i++){\n for(let j=0;j<listSpheres2[i].linkName.length;j++){\n if(listSpheres2[i].linkName[j] == nameLinkDeleted){\n //in the linkName property from listSpheres2\n //if the link deleted name is the same\n listSpheres2[i].linkName.splice(j,1);//delete his name from it \n //to update the linkName property = list \n }\n }\n }\n}", "function updateDummyLinks() {\n \n // read in data from dataset\n dummyPath = dummyPath.data(dataset.edges, (d) => d.id);\n \n ///////////////////////////\n // UPDATE EXISTING LINKS //\n ///////////////////////////\n\n // update existing link classes\n dummyPath.classed(\"selected\", (d) => d === selectedLink);\n // update link aesthetics\n dummyPath.select(\".link\").style(\"marker-start\", function(d) {return getMarkers(d, true, true)})\n .style(\"marker-end\", function(d) {return getMarkers(d, true, false)});\n\n // update hidden class for links and linklabels\n dummyPath.select(\".link\").classed(\"hidden\", (d) => !(d.left && d.right)); \n dummyPath.select(\".linklabel\").classed(\"hidden\", (d) => !(d.left && d.right));\n\n // update cost text\n dummyPath.select(\".textId\").text(function(d) { return \"R Cost: \" + d.rightCost;});\n\n // remove old links\n dummyPath.exit().remove();\n\n ///////////////////\n // ADD NEW LINKS //\n ///////////////////\n // add new links\n var dummyPathContainer = dummyPath.enter().append(\"svg:g\").attr(\"class\", \"dummyPathClass\")\n .classed(\"selected\", (d) => d === selectedLink)\n\n // add actual link paths\n dummyPathContainer.append(\"svg:path\")\n .attr(\"class\", \"link dummy\")\n .attr(\"id\", function(d) { return \"dummyLinkId_\" + d.id})\n .classed(\"hidden\", (d) => !(d.left && d.right))\n .style(\"marker-start\", function(d) {return getMarkers(d, true, true)})\n .style(\"marker-end\", function(d) {return getMarkers(d, true, false)})\n .on(\"mousedown\", (d) => {\n if (d3.event.shiftKey) return;\n\n // select link\n mousedownLink = d;\n selectedLink = (mousedownLink === selectedLink) ? null : mousedownLink;\n selectedNode = null;\n update();\n })\n\n // add edge labels\n dummyPathContainer.append(\"svg:text\")\n .attr(\"class\", \"linklabel\")\n .classed(\"hidden\", (d) => !(d.left && d.right))\n .attr(\"id\", function(d, i) { return \"dummylinklabelId_\" + d.id})\n .attr(\"dy\", \"-0.6em\")\n .attr(\"font-size\", 10)\n .attr(\"font-weight\", \"bold\")\n .attr(\"text-anchor\", \"middle\")\n // add textPath\n .append(\"svg:textPath\")\n .attr(\"class\", \"textId\")\n .classed(\"hidden\", (d) => !(d.left && d.right))\n .attr(\"href\", function(d, i) { return \"#dummyLinkId_\" + d.id})\n .attr(\"pointer-events\", \"none\")\n .attr(\"startOffset\", \"50%\")\n .text(function(d, i) { return \"R Cost: \" + d.rightCost});\n\n dummyPath = dummyPathContainer.merge(dummyPath);\n}", "function resetData() {\n var nodeIds = nodes.map(function (node) {\n return node.id\n })\n baseNodes.forEach(function (node) {\n if (nodeIds.indexOf(node.id) === -1) {\n nodes.push(node)\n }\n })\n links = baseLinks\n}", "function deleteMarkers() {\n clearMarkers();\n route_markers = [];\n update_route_buttons ();\n}", "function graphRemove() {\r\n svg.selectAll(\"*\").remove();\r\n d3nodes = [];\r\n d3links = [];\r\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n if (markerCluster != undefined)\n markerCluster.clearMarkers();\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n deleteClusters();\n deleteLegend();\n}", "function connectNodes() {\n\n for (var key in workflowNodes) {\n $('#' + workflowNodes[key].id).append('<div class=\"deleteNode\" data-placement=\"bottom\" data-container=\"body\"></div>');\n $('#' + workflowNodes[key].id + ' .deleteNode').append('<span class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></span>');\n }\n\n $('body').on('click', '.item', function (e) {\n if (e.target !== this)\n return;\n\n if (srcClick == \"\") {\n srcClick = $(this).attr(\"id\");\n firstNode = $(this);\n firstNode.addClass('borderHighlight');\n console.log(\"set src: \" + $(this).attr(\"id\"));\n } else if (srcClick == $(this).attr(\"id\")) {\n srcClick = \"\";\n firstNode.removeClass('borderHighlight');\n console.log(\"make src empty: \" + $(this).attr(\"id\"));\n } else if (trgClick == \"\") {\n trgClick = $(this).attr(\"id\");\n for (var key in arrConnect) {\n if (srcClick == arrConnect[key].sourceId && trgClick == arrConnect[key].targetId) {\n console.log(\"FOUND\");\n found = true;\n }\n }\n if (found == true) {\n console.log(\"already set!\");\n // $(\"#connectionExistsAlert\").alert('open');\n $(\"#connectionExistsAlert\").show();\n $(\"#connectionExistsAlert\").fadeTo(2000, 500).slideUp(500, function () {\n $(\"#connectionExistsAlert\").hide();\n });\n srcClick = \"\";\n trgClick = \"\";\n console.log(\"make both empty\");\n found = false;\n firstNode.removeClass('borderHighlight');\n\n } else { // create the arrow\n var label = \"\";\n\n createArrow(srcClick, trgClick);\n\n // create an arrow between 2 nodes\n arrConnect.push(jsPlumb.connect({\n type: \"edit\",\n source: srcClick,\n target: trgClick,\n detachable: false\n }, common));\n\n srcClick = \"\";\n trgClick = \"\";\n console.log(\"make both empty\");\n firstNode.removeClass('borderHighlight');\n }\n }\n });\n\n var arrowIdTemp;\n var cSourceId;\n var cTargetId;\n var cObject;\n // click on arrow to get the arrowId\n jsPlumb.bind(\"click\", function (c) {\n console.log(c.sourceId + \" \" + c.targetId);\n cObject = c;\n cSourceId = c.sourceId;\n cTargetId = c.targetId;\n // look for the right node in local array\n var found;\n for (var key in workflowNodes) {\n // console.log(\"iterate workflow: \" + workflowNodes[key].id + workflowNodes[key].arrows);\n if (workflowNodes[key].id == c.sourceId) {\n // console.log(\"found: \" + workflowNodes[key].id);\n found = key;\n }\n }\n // look for the arrow that has been clicked\n for (var key in workflowNodes[found].arrows) {\n //console.log(\"iterate arrow: \" + workflowNodes[found].arrows[key].id);\n if (c.sourceId == workflowNodes[found].arrows[key].sourceNode && c.targetId == workflowNodes[found].arrows[key].targetNode) {\n // console.log(\"THIS ARROW ID: \" + workflowNodes[found].arrows[key].id);\n arrowIdTemp = workflowNodes[found].arrows[key].id;\n }\n }\n // TODO Maybe if no arrow is set -> warning\n });\n //////////////////////////////////////////////////Update Arrow//////////////////////////////////////////////////////\n // clicklistener on arrow to show option to add a label or delete the arrow\n $('path').off().on('click', function (e) {\n var offset = $(this).offset();\n var left = e.pageX;\n var top = e.pageY;\n var theHeight = $('.popoverArrow').height();\n $('.popoverArrow').show();\n $('.popoverArrow').css('left', (left + 10) + 'px');\n $('.popoverArrow').css('top', (top - (theHeight / 2) - 10) + 'px');\n });\n\n\n $('.btnSaveLabel').off().on('click', function () {\n var inputLabelVal = $(\".inputLabel\").val();\n var arrconnLabel;\n updateArrow(arrowIdTemp, cSourceId, cTargetId, inputLabelVal);\n\n for (var key in arrConnect) {\n if (cSourceId == arrConnect[key].sourceId && cTargetId == arrConnect[key].targetId) {\n arrconnLabel = arrConnect[key].getOverlay(\"label\");\n }\n }\n arrconnLabel.setLabel(inputLabelVal);\n\n $('.popoverArrow').hide();\n });\n // delete arrow\n $('.btnDeleteArrow').off().on('click', function (c) {\n console.log(arrowIdTemp + \" | \" + cSourceId + \" | \" + cTargetId);\n deleteArrow(arrowIdTemp);\n for (var key in arrConnect) {\n if (cSourceId == arrConnect[key].sourceId && cTargetId == arrConnect[key].targetId) {\n delete arrConnect[key];\n }\n }\n // delete arrow in UI\n jsPlumb.detach(cObject);\n $('.popoverArrow').hide();\n });\n\n $('.btnCloseLabel').off().on('click', function () {\n $('.popoverArrow').hide();\n });\n } // content()", "updateArticleNeighboursPlot(nodes, links, article_name) {\n\n // From: https://stackoverflow.com/a/20114692/5553845\n function generateRandomDarkColor() {\n\n var letters = '0123456789ABCDEF';\n var color = '#';\n // modified from original 16 to 14 to get more darker colors.\n for (var i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 14)];\n }\n return color;\n }\n\n let linkColor = generateRandomDarkColor();\n\n // Highlight selected circle and neighbours\n nodes.forEach(function (n) {\n \n const c = d3.select(\"#article_\" + n)\n .classed(\"article-clicked\", true)\n .classed(\"neighbour-of-\" +\n convertToID(article_name), true)\n .attr(\"data-color\", linkColor);\n c.transition()\n .attr(\"r\", circle_radius + 0.2)\n .style(\"stroke\", linkColor)\n .style(\"stroke-width\", \"0.8\");\n\n })\n\n // Generate links\n const line = d3.line()\n .x(d => this.xScale(d.peak_date))\n .y(d => this.yScale(d.view_count));\n\n // Animate addition of new links\n const path = this.links_area\n .append(\"path\")\n .attr(\"d\", line(links))\n .classed(\"link\", true)\n .classed(\"link-of-\" + convertToID(article_name),\n true)\n .attr(\"id\", (d, i) => \"link_\" + i)\n .attr(\"stroke\", (d, i) => linkColor)\n .attr(\"stroke-opacity\", 0.6)\n .attr(\"stroke-width\", 1);\n\n const totalLength = path.node().getTotalLength();\n\n path.attr(\"stroke-dasharray\", totalLength + \" \" + totalLength)\n .attr(\"stroke-dashoffset\", totalLength)\n .transition()\n .duration(500)\n .attr(\"stroke-dashoffset\", 0);\n }", "function verifyAllNodesAreConnected(range){\n\t\tglobalData.links = globalData.links.filter((link) => { // For delete links which are from a node to the same\n\t\t\treturn link.source !== link.target\n\t\t})\n\t\tlet complement = { // unadded items complement used for verifying all nodes are connected\n\t\t\tcsources: arrayRange(0, range-1, 1),// A container of all available numbers\n\t\t\tctargets: arrayRange(0, range-1, 1),// A container of all available numbers\n\t\t}\n\t\tlet sources = globalData.links.map(function(link){\n\t\t\treturn link.source\n\t\t})\n\t\tlet targets = globalData.links.map(function(link){\n\t\t\treturn link.target\n\t\t})\n\t\tsources.map(function(index){complement.csources.splice(index, 1)})\n\t\ttargets.map(function(index){complement.ctargets.splice(index, 1)})\n\t\tcomplement.csources.map(function(source){\n\t\t\tglobalData.links.push({\n\t\t\t\tsource: source,\n\t\t\t\ttarget:~~d3.randomUniform(range)()\n\t\t\t})\n\t\t})\n\t\tcomplement.ctargets.map(function(target){\n\t\t\tglobalData.links.push({\n\t\t\t\tsource: ~~d3.randomUniform(range)(),\n\t\t\t\ttarget: target\n\t\t\t})\n\t\t})\n\t\tglobalData.links = globalData.links.filter((link) => { // For delete links which are from a node to the same\n\t\t\treturn link.source !== link.target\n\t\t})\n\t\tglobalData.links = [...new Set(globalData.links.flat(1))] // For getting uniques arrays \n\t}", "function isConnectedLink(node, link) {\n //link.source and link.target is invalid as it had been automatically replaced with real data.\n if (link.target.index == node.index || link.source.index == node.index)\n return true;\n return false;\n }", "function checkLinkValidity(markerList, featureGroup) {\n\n if (markerList.length === 0) {\n return {\n \"isValid\": false,\n \"msg\": \"No chosen nodes.\"\n };\n }\n else if (markerList.length === 1) {\n return {\n \"isValid\": false,\n \"msg\": \"Chose a destination node.\"\n };\n }\n\n if (markerList[markerList.length - 1] === markerList[markerList.length - 2]) {\n return {\n \"isValid\": false,\n \"msg\": \"Chose a destination node.\"\n };\n }\n\n latlngs = [\n markerList[markerList.length - 1].getLatLng(),\n markerList[markerList.length - 2].getLatLng(),\n ];\n\n featureGroup.eachLayer(layer => {\n if (layer instanceof L.Polyline) {\n if (layer.getLatLngs().includes(latlngs[0]) && layer.getLatLngs().includes(latlngs[1])) {\n console.log(\"rep\", layer.getLatLngs(), latlngs[0], latlngs[1]);\n return {\n \"isValid\": false,\n \"msg\": \"rep\"\n };\n }\n }\n\n });\n\n return {\n \"isValid\": true,\n \"msg\": \"\"\n };\n\n}", "function removeAllEdgesOnto(index){\n for(var i = 0;i<link_dataOnto.length;i++){\n if(link_dataOnto[i].target.index==index || link_dataOnto[i].source.index==index){\n link_dataOnto.splice(i,1);\n removeAllEdgesOnto(index);\n return;\n }\n }\n}", "function deleteOverlays() {\r\n clearOverlays();\r\n mm.markers = [];\r\n}", "function deleteMarkers() {\n\n clearMarkers();\n markers = [];\n\n}", "function deleteMarkers() {\n clearMarkers();\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n marker_count = 0;\n}", "function deletePortMarkers() {\n //Loop through all the markers and remove\n\n if (portmarker != null) {\n\n for (var i = 0; i < portmarker.length; i++) {\n\n portmarker[i].setMap(null);\n }\n portmarker = [];\n }\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteOverlays() {\n clearOverlays();\n markers = [];\n}", "function deleteOverlays()\r\r\n{\r\r\n\tclearOverlays();\r\r\n\tmarker = null;\r\r\n}", "deleteInstanceData(workList) {\n\n this.updateGraphInfoBar();\n this.stopLayout();\n\n if (!workList || workList.length == 0) {\n return;\n }\n\n IIDXHelper.progressBarCreate(this.progressDiv, \"progress-info progress-striped active\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, 0, \"\");\n this.busy(true);\n\n var vNodesLostEdgesList = [];\n var vEdgesToDelete = [];\n \n var i = 0;\n // first pass: remove edges\n for (var w of workList) {\n var vEdgeList = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.get();\n if (w.length == 2) {\n // delete edges\n var domainUri = w[0];\n var predicateUri = w[1];\n // for all edges\n for (vEdge of vEdgeList) {\n\n if (++i % 100 == 1) {\n var percent = 0 + 40 * i++ / (workList.length * vEdgeList.length);\n\n //console.log(\"first pass \" + percent + \"%\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_edges\");\n }\n\n // for all potential matches\n\n var spo = vEdge.id.split(',');\n // if predicate matches\n if (spo[1] == predicateUri) {\n // if fromNode is a member of domainUri\n var fromNode = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get(spo[0]);\n if (fromNode.group.split(\",\").indexOf(domainUri) > -1) {\n vNodesLostEdgesList.push(vEdge.from);\n vNodesLostEdgesList.push(vEdge.to);\n vEdgesToDelete.push(vEdge);\n }\n }\n }\n }\n }\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.remove(vEdgesToDelete);\n\n // count edges for each node\n var edgeCountHash = {};\n for (var vEdge of this.networkHash[ExploreTab.MODE_INSTANCE].body.data.edges.get()) {\n //console.log(\"edge hash\");\n edgeCountHash[vEdge.from] = (edgeCountHash[vEdge.from] ? edgeCountHash[vEdge.from] : 0) + 1;\n edgeCountHash[vEdge.to] = (edgeCountHash[vEdge.to] ? edgeCountHash[vEdge.to] : 0) + 1;\n }\n\n // second pass: remove nodes (must also have no edges)\n i=0;\n for (var w of workList){\n //console.log(\"remove nodes\");\n // delete nodes\n if (w.length == 1) {\n var classUri = w[0];\n var vNodeList = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get();\n for (var vNode of vNodeList) {\n\n if (++i % 200 == 1) {\n var percent = 40 + 40 * i++ / (workList.length * vNodeList.length);\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_nodes\");\n }\n\n if (vNode.group == classUri) {\n // simple single-class exact match if no edges remain\n if (!(vNode.id in edgeCountHash)) {\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.remove(vNode.id);\n }\n } else if (vNode.group.indexOf(classUri) > -1) {\n // remove class from multi-class nodes\n vNode.group = vNode.group.split(\",\").filter(function(uri, x) {return x != uri;}.bind(this, classUri)).toString();\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.update(vNode);\n }\n }\n }\n }\n\n var vNodesToRemove = [];\n var vNodesLostEdgesSet = new Set(vNodesLostEdgesList);\n // third pass: remove orphan nodes\n var selectedClasses = this.oTree.getSelectedClassNames();\n i=0;\n for (var vNodeId of vNodesLostEdgesSet) {\n if (++i % 200 == 1) {\n var percent = 80 + 20 * i / vNodesLostEdgesSet.size;\n //console.log(\"third pass \" + percent + \"%\");\n IIDXHelper.progressBarSetPercent(this.progressDiv, percent, \"Removing_orphans\");\n }\n var vNode = this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.get(vNodeId);\n // remove iff still exists, only one class, class is not selected in oTree, no edges\n if (vNode && vNode.group.split(\",\").length == 1 && !(vNode.id in edgeCountHash) && selectedClasses.indexOf(vNode.group) == -1) {\n vNodesToRemove.push(vNode);\n }\n }\n this.networkHash[ExploreTab.MODE_INSTANCE].body.data.nodes.remove(vNodesToRemove);\n\n IIDXHelper.progressBarSetPercent(this.progressDiv, 100);\n IIDXHelper.progressBarRemove(this.progressDiv);\n this.busy(false);\n this.updateGraphInfoBar();\n this.startLayout();\n }", "function deleteMarkers() {\n clearMarkers()\n markerArr = []\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers1 = [];\n }", "function updateData() {\n d3.json('/api/aggregate/', (error, data) => {\n if (error) {\n console.error(error);\n setTimeout(updateData, 3000);\n return;\n }\n\n const newNodes = [];\n\n data.nodes.forEach((node) => {\n newNodes.push({label: node.hostname, id: node.id, group: 'nodes', node, radius: 15});\n if (Array.isArray(node.containers)) {\n node.containers.forEach((container) => {\n newNodes.push({label: container.name, id: container.id, group: 'containers', container, radius: 10});\n });\n }\n });\n\n const diff = {\n removed: nodes.filter((node) => {\n let inNewNodes = false\n newNodes.forEach((newNode) => {\n if (node.id === newNode.id) {\n inNewNodes = true\n }\n })\n\n return !inNewNodes && node.id !== 'swarm';\n }),\n added: newNodes.filter((newNode) => {\n let inNodes = false\n nodes.forEach((node) => {\n if (newNode.id === node.id) {\n inNodes = true\n }\n })\n\n return !inNodes;\n })\n }\n\n if (diff.removed.length || diff.added.length) {\n diff.removed.forEach((node) => {\n nodes.splice(nodes.indexOf(node), 1)\n for (const i = links.length; i >= 0; i--) {\n const link = links[i]\n if (link && (node.id === link.source.id || node.id === link.target.id)) {\n links.splice(i, 1)\n }\n }\n })\n\n diff.added.forEach((node) => {nodes.push(node)})\n diff.added.forEach((node) => {\n if (node.container) {\n let source;\n nodes.forEach((sourceCandidate) => {\n if (sourceCandidate.id === node.container.nodeId) {\n source = sourceCandidate\n }\n })\n if (source) {\n links.push({source, target: node, strength: 25})\n }\n } else if (node.node) {\n links.push({source: nodes[0], target: node, strength: 50})\n }\n })\n\n restart();\n }\n\n setTimeout(updateData, 3000);\n })\n}", "function deleteMarkers() {\n\n // for (var i = 0; i < markers.length; i++) {\n // markers[i].setMap(null);\n // }\n // markers = [];\n\n while (markers.length) {\n var pop = markers.pop();\n pop.setMap(null);\n }\n\n if (markerCluster) {\n markerCluster.clearMarkers();\n }\n\n console.debug(\"Markers cleared\");\n}", "function removePlots() {\n d3.selectAll(\".nodes\").remove();\n d3.selectAll(\".link\").remove();\n}", "function deleteMarkers() {\n clearMarkers();\n clearRows();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function computeNodeLinks() {\r\n var count = 0;\r\n\r\n nodes.forEach(function(node) {\r\n \r\n node.sourceLinks = [];\r\n node.targetLinks = [];\r\n console.log(node.targetLinks);\r\n // console.log(\"success\" + count + node.name);\r\n // count++;\r\n });\r\n links.forEach(function(link) {\r\n var source = link.source,\r\n target = link.target;\r\n if (typeof source === \"number\") source = link.source = nodes[link.source];\r\n if (typeof target === \"number\") target = link.target = nodes[link.target];\r\n console.log(\"Count: \" + count + \" Source: \" + link.source);\r\n source.sourceLinks.push(link);\r\n target.targetLinks.push(link);\r\n });\r\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n\t\t\t\t clearMarkers();\n\t\t\t\t markers = [];\n\t\t\t\t}", "function deleteMarkers() {\n\t\t\t clearMarkers();\n\t\t\t markers = [];\n\t\t\t}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"a\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function clearLinks(grid) {\n for (let y = 0; y < grid.length; y++) {\n for (let x = 0; x < grid[0].length; x++) {\n grid[y][x].linked = false;\n grid[y][x].links = [];\n }\n }\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n choiceMarkers = [];\n searchResMarkers = [];\n}//deleteMarkers", "function updateLinks(key) {\n var isSource = key === 'sources';\n var neighbours = edge.get(key);\n neighbours.forEach(\n function(d) {\n // get number of time we meet d\n var neighbour_count = neighbour_counts[key][d];\n if (neighbour_count === undefined) {\n neighbour_count = 0;\n neighbour_counts[key][d] = neighbour_count;\n }\n // increment neighbour count\n neighbour_count++;\n neighbour_counts[key][d] = neighbour_count;\n // get d links\n var links_by_id = d3_edge[key][d];\n if (links_by_id === undefined) {\n links_by_id = {};\n d3_edge[key][d] = links_by_id;\n }\n // if a link is missing\n var links_by_id_length = Object.keys(links_by_id).length;\n if (links_by_id_length < neighbour_count) {\n // create it\n link = {\n isSource: isSource,\n source: isSource? d : d3_edge.id,\n target: (!isSource)? d : d3_edge.id,\n elt: edge, // save edge\n id: this.uuid(), // uuid\n view_pos: d3_graph.links.length // pos in view\n };\n // add in view\n d3_graph.links.push(link);\n d3_graph.data_by_id[link.id] = link;\n // try to inject references to sources\n var source = d3_graph.data_by_id[link.source];\n if (source !== undefined) {\n link.source = source;\n }\n // and targets\n var target = d3_graph.data_by_id[link.target];\n if (target !== undefined) {\n link.target = target;\n }\n // push link in d3_edge model\n links_by_id[link.id] = link;\n }\n },\n this\n );\n // remove useless links\n for (vertice_id in d3_edge[key]) {\n var neighbour_count = neighbour_counts[key][vertice_id];\n var index = 0; // index to start to remove links\n if (neighbour_count !== undefined) {\n index = neighbour_count;\n }\n // delete links from model\n var link_id_to_delete = Object.keys(d3_edge[key][vertice_id]).splice(index);\n link_id_to_delete.forEach(\n function(link_id) {\n var link = d3_graph.data_by_id[link_id];\n // delete from model\n delete d3_edge[key][vertice_id][link_id];\n // delete from view\n delete d3_graph.data_by_id[link_id];\n link_pos_to_delete.push(link.view_pos);\n },\n this\n );\n }\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"c\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = Object(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"c\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n }", "function removeMarkers()\n {\n var next;\n while (markerHead)\n {\n next = markerHead[marker].prev;\n delete markerHead[marker];\n markerHead = next;\n }\n }", "function filterMissing(data, geo) {\n let missing = []\n data.nodes = data.nodes.filter(d => {\n try {\n geo.centroids[d.id]['x']\n geo.centroids[d.id]['y']\n\n return true\n } catch (e) {\n missing.push(d.id)\n return false\n }\n })\n\n data.links = data.links.filter(d => {\n if (!(missing.includes(d.source) || missing.includes(d.target))) {\n return d\n }\n })\n\n return data\n}", "removeEdge(node, port, node2, port2) {\n this.checkTransactionStart();\n port = this.getPortName(port);\n port2 = this.getPortName(port2);\n let toRemove = [];\n let toKeep = [];\n if (node2 && port2) {\n for (var index = 0; index < this.edges.length; index++) {\n var edge = this.edges[index];\n if (edge.from.node === node && edge.from.port === port && edge.to.node === node2 && edge.to.port === port2) {\n this.setEdgeMetadata(edge.from.node, edge.from.port, edge.to.node, edge.to.port, {});\n toRemove.push(edge);\n } else {\n toKeep.push(edge);\n }\n }\n } else {\n for (var index = 0; index < this.edges.length; index++) {\n var edge = this.edges[index];\n if ((edge.from.node === node && edge.from.port === port) || (edge.to.node === node && edge.to.port === port)) {\n this.setEdgeMetadata(edge.from.node, edge.from.port, edge.to.node, edge.to.port, {});\n toRemove.push(edge);\n } else {\n toKeep.push(edge);\n }\n }\n }\n\n this.edges = toKeep;\n for (let i = 0; i < toRemove.length; i++) {\n var edge = toRemove[i];\n this.emit('removeEdge', edge);\n }\n\n return this.checkTransactionEnd();\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n infoViews = [];\n}", "function deleteMarkers() {\r\n setMapOnAll(null);\r\n markers = [];\r\n }", "function deleteMarkers() {\n\tclearMarkers();\n\tmarkers = [];\n}", "function deleteMarkers() {\n\tclearMarkers();\n\tmarkers = [];\n}", "function checkLinkValidity(featureGroup) {\n\n if (tempMarkerlist.length === 0) {\n return {\n \"isValid\": false,\n \"msg\": \"No chosen nodes.\"\n };\n }\n else if (tempMarkerlist.length === 1) {\n return {\n \"isValid\": false,\n \"msg\": \"Chose a destination node.\"\n };\n }\n\n if (tempMarkerlist[tempMarkerlist.length - 1] === tempMarkerlist[tempMarkerlist.length - 2]) {\n return {\n \"isValid\": false,\n \"msg\": \"Chose a destination node.\"\n };\n }\n\n latlngs = [\n tempMarkerlist[tempMarkerlist.length - 1].getLatLng(),\n tempMarkerlist[tempMarkerlist.length - 2].getLatLng(),\n ];\n\n featureGroup.eachLayer(layer => {\n if (layer instanceof L.Polyline) {\n if (layer.getLatLngs().includes(latlngs[0]) && layer.getLatLngs().includes(latlngs[1])) {\n // console.log(\"rep\", layer.getLatLngs(), latlngs[0], latlngs[1]);\n return {\n \"isValid\": false,\n \"msg\": \"rep\"\n };\n }\n }\n\n });\n\n return {\n \"isValid\": true,\n \"msg\": \"\"\n };\n\n}", "function clearMapMarkers() {\n for (index in markers) {\n markers[index].setMap(null);\n }\n nodes = [];\n if (polylinePath != undefined) {\n polylinePath.setMap(null);\n }\n markers = [];\n }", "function computeNodeLinks(graph) {\n graph.nodes.forEach(function(node, i) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n });\n var nodeById = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_d3_collection__[\"a\" /* map */])(graph.nodes, id);\n graph.links.forEach(function(link, i) {\n link.index = i;\n var source = link.source, target = link.target;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n });\n }", "function filterNodeData() {\n // //Create a node -> node id mapping\n // node_by_id = {}\n // nodes.forEach(d => { node_by_id[d.id] = d })\n // //Test to see if any nodes exist in the edges, but not the nodes list\n // let lost_edges = []\n // edges.forEach(d => {\n // //Check which node id's in the edges is not in the node list\n // if(!node_by_id[d.source]) lost_edges.push(d.source)\n // if(!node_by_id[d.target]) lost_edges.push(d.target)\n // })//forEach\n // if(lost_edges.length > 0) console.log(\"WARNING -- Missing node id's not in node list:\", [...new Set(lost_edges)])\n nodes = nodes.filter(function (d) {\n //Filter out any node that is an NGO or project\n if (d.type === 'ngo' || d.type === 'project') return false;else if (d.type === 'element') {\n //Filter out any elements that are on the UL\n return d.meta.list === 'RL' || d.meta.list === 'USL' ? true : false;\n } else if (d.type === 'concept') {\n //Filter out any node that is a concept that isn't of group: nature or biome\n return d.group === 'nature' || d.group === 'biome' ? true : false;\n } else {\n return true;\n } //else\n }); //filter\n } //function filterNodeData" ]
[ "0.64207", "0.63151026", "0.6297795", "0.6297795", "0.62342083", "0.6112339", "0.60563415", "0.60457855", "0.6022371", "0.5996544", "0.5932092", "0.58405936", "0.5814767", "0.5805265", "0.57879716", "0.5785061", "0.57657623", "0.57478344", "0.5737907", "0.5735337", "0.57283604", "0.5723586", "0.5717673", "0.57026404", "0.5699462", "0.5696356", "0.5693314", "0.5690482", "0.5690482", "0.5690482", "0.5690482", "0.5690482", "0.5690482", "0.56805825", "0.56736207", "0.5671549", "0.56702805", "0.56601614", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.5658485", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56500703", "0.56459385", "0.5644839", "0.56426275", "0.5634613", "0.56332576", "0.56332576", "0.56332576", "0.5627648", "0.56259954", "0.5623166", "0.56230974", "0.56209457", "0.5616204", "0.5616204", "0.56117296", "0.56079274", "0.56079274", "0.56021476", "0.5602095", "0.55964845", "0.5596175", "0.5595274", "0.5595123", "0.559421", "0.559421", "0.5591567", "0.55856436", "0.558554", "0.558523" ]
0.5966008
10
not using this now codes's acting strange
function checkLinkValidity(featureGroup) { if (tempMarkerlist.length === 0) { return { "isValid": false, "msg": "No chosen nodes." }; } else if (tempMarkerlist.length === 1) { return { "isValid": false, "msg": "Chose a destination node." }; } if (tempMarkerlist[tempMarkerlist.length - 1] === tempMarkerlist[tempMarkerlist.length - 2]) { return { "isValid": false, "msg": "Chose a destination node." }; } latlngs = [ tempMarkerlist[tempMarkerlist.length - 1].getLatLng(), tempMarkerlist[tempMarkerlist.length - 2].getLatLng(), ]; featureGroup.eachLayer(layer => { if (layer instanceof L.Polyline) { if (layer.getLatLngs().includes(latlngs[0]) && layer.getLatLngs().includes(latlngs[1])) { // console.log("rep", layer.getLatLngs(), latlngs[0], latlngs[1]); return { "isValid": false, "msg": "rep" }; } } }); return { "isValid": true, "msg": "" }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "private public function m246() {}", "transient protected internal function m189() {}", "static private internal function m121() {}", "transient private protected internal function m182() {}", "transient final protected internal function m174() {}", "transient private internal function m185() {}", "static private protected internal function m118() {}", "static final private internal function m106() {}", "transient final private protected internal function m167() {}", "static transient private protected internal function m55() {}", "static protected internal function m125() {}", "transient final private internal function m170() {}", "static transient final private internal function m43() {}", "static private protected public internal function m117() {}", "static transient final protected internal function m47() {}", "static transient private protected public internal function m54() {}", "transient private protected public internal function m181() {}", "function StupidBug() {}", "static transient private internal function m58() {}", "static final private protected internal function m103() {}", "transient final private protected public internal function m166() {}", "transient private public function m183() {}", "static transient final private protected internal function m40() {}", "__previnit(){}", "function comportement (){\n\t }", "static transient final protected public internal function m46() {}", "static transient private public function m56() {}", "function Ze(){if(ea)t.innerHTML=ha;else if(ia)t.innerHTML=ia;$e();eb&&hb.call(window,eb);nb();eb=-1;bb=[];cb={};ac=j;Zb=0;$b=[];w.Cc();Bb=0;Cb=[];document.documentElement.className=\"js no-treesaver\";document.documentElement.style.display=\"block\"}", "static transient final private protected public internal function m39() {}", "static private public function m119() {}", "static final private protected public internal function m102() {}", "static final protected internal function m110() {}", "transient final private public function m168() {}", "static transient final private protected public function m38() {}", "function wa(){}", "static transient final protected function m44() {}", "static final private public function m104() {}", "function TMP() {\n return;\n }", "preset () { return false }", "static transient protected internal function m62() {}", "function normal() {}", "function l(){t={},u=\"\",w=\"\"}", "function TMP(){return;}", "function TMP(){return;}", "function ea(){}", "function sb(){this.pf=[]}", "function fm(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function Ha(){}", "function _____SHARED_functions_____(){}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.70855063", "0.6764414", "0.65513563", "0.6338111", "0.6330737", "0.62323064", "0.61664426", "0.6143234", "0.61214405", "0.5926528", "0.59206116", "0.5834241", "0.5778488", "0.57752734", "0.57743365", "0.57153547", "0.5714668", "0.57003194", "0.56828666", "0.5673236", "0.5629116", "0.5571674", "0.5506689", "0.5505318", "0.5480973", "0.54636145", "0.5461551", "0.54421395", "0.5397575", "0.53503865", "0.53441894", "0.5324932", "0.52769816", "0.5247979", "0.5245316", "0.5244325", "0.52441925", "0.5239123", "0.5236887", "0.5231897", "0.5155732", "0.51299864", "0.5124282", "0.5098944", "0.50828284", "0.50828284", "0.5079909", "0.50542974", "0.5026586", "0.5023532", "0.5023532", "0.5023532", "0.5023532", "0.5020237", "0.5014477", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386", "0.50091386" ]
0.0
-1
replacement functions do not copy them into your code, you already have them.
function links_click_event(event) { console.log("works link"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funcReplacer(match, id) {\n return functions[id];\n }", "function applyModifiers() {\n\t\ttry {\n\t\t\tvar rt = this.funcOldString;\n\t\t\tvar active = false;\n\n\t\t\tfor (var i=0; i< this.modifiers.length; i++){\n\t\t\t\tif ( !this.modsActive[i]) continue;\n\n\t\t\t\tx = rt.replace(this.modifiers[i][0], this.modifiers[i][1]);\n\t\t\t\tif (x == rt) { // if not found\n\t\t\t\t\t// print out an error message when the match fails.\n\t\t\t\t\t// These messages get lost on a refresh, so wait a few seconds to put it in the error log.\n\t\t\t\t\tsetTimeout( function (fname, repStr, ftstr) {\n\t\t\t\t\t\treturn function () {\n\t\t\t\t\t\t\tlogit(\"Unable to replace string in function \" + fname);\n\t\t\t\t\t\t\tlogit(\"Replacement string:\" + repStr );\n\t\t\t\t\t\t\tlogit(\"Function listing: \" + ftstr);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}(this.funcName, this.modifiers[i][0], ft), 5000);\n\t\t\t\t}\n\t\t\t\telse { }\n\n\t\t\t\trt = x;\n\t\t\t\tactive = true;\n\t\t\t}\n\n\t\t\tthis.funcNew = rt;\n\t\t\tif (active) {\n\t\t\t\t// apply the new function\n\t\t\t\tuW.uWFunc(this.funcName +' = '+ this.funcNew);\n\t\t\t} else {\n\t\t\t\t// set to the original function\n\t\t\t\tvar x1 = this.funcName.split('.');\n\t\t\t\tvar f1 = uW;\n\t\t\t\tfor (var i=0; i<x1.length-1; i++)\n\t\t\t\tf1 = f1[x1[i]];\n\t\t\t\tf1[x1[x1.length-1]] = this.funcOld;\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tlogit(\"CalterFuncModifier \"+ this.funcName);\n\t\t\tlogerr(err);\n\t\t}\n\t}", "function replaceFunctionWhereNeeded(line, orig, funcname) {\n\tif(line.indexOf(orig) == -1)\n\t\treturn line;\n\tvar outputVal = line.replace(orig, funcname + \"(\");\n\toutputVal += \");\";\n\treturn outputVal;\n}", "get modificableByReplaceFn() {\n return [\n 'ts',\n 'js',\n 'css',\n 'sass',\n 'scss',\n 'less',\n ].map(function (f) { return \".\" + f; });\n }", "function processReplacements(body)\n{\n //make links clickable\n body = linkify(body);\n\n //add smileys\n body = smilify(body);\n\n return body;\n}", "function nonewFun() {}", "function replaceWriteFiles(func) {\n _writeFiles = func;\n }", "function insertFunctions(line) {\n\t\tvar firstWord = line.split(\" \",1)[0];\n\t\tif(functions.indexOf(firstWord) == -1) {\n\t\t\tfor(var i = 0; i < mappings.length; i++) {\t//not functions.length so we don't deal with delay here.\n\t\t\t\tline = replaceValWhereNeeded(line, functions[i], \"\\ntype(\" + mappings[i] + \",false);\");\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var i = 0; i < mappings.length; i++) {\t//not functions.length so we don't deal with delay here.\n\t\t\t\tline = replaceValWhereNeeded(line, functions[i], \"\\ntype(\" + mappings[i] + \",false);\");\n\t\t\t}\n\n\t\t}\n\t\treturn line\n}", "function patchFunction ( node, scriptIndex, funcIndex )\r\n{\r\n\tconst varName = \"__$_CodeControlVar\" + CodeControl.funcVars++;\r\n\r\n\t/* This is how we disable and override functions. It's pretty gross, huh?\r\n\r\n\t We have to wrap our code in a function because returns are not allowed outside\r\n\t of functions.\r\n\r\n\t The alternative to this would be to just build the AST nodes ourselves and then\r\n\t insert them into the target function, but that is way less flexible.\r\n\r\n\t This way, it's much easier to edit our code if we needed to. */\r\n\tconst code = parse (\r\n\t`\r\n\t(function ()\r\n\t{\r\n\t\t\tconst ${varName} = __Ext__CodeControl.scripts[${scriptIndex}].funcs[${funcIndex}];\r\n\r\n\t\t\tif ( ${varName}.isDisabled )\r\n\t\t\t{\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif ( ${varName}.useOverride )\r\n\t\t\t{\r\n\t\t\t\treturn ${varName}.override.apply (this, arguments);\r\n\t\t\t}\r\n\t});\r\n\t`, { ecmaVersion: 12 });\r\n\r\n\tlet patchBlock = null;\r\n\tlet patchBody = null;\r\n\r\n\t/* Extract the code from our wrapper function. */\r\n\r\n\twalkFunctions (code, func =>\r\n\t{\r\n\t\tif ( patchBody === null && patchBlock === null && func.body.type === \"BlockStatement\" )\r\n\t\t{\r\n\t\t\tpatchBlock = func.body;\r\n\t\t\tpatchBody = patchBlock.body;\r\n\t\t}\r\n\t});\r\n\r\n\t/* Now inject our code into the target function. */\r\n\r\n\t// Check if function has braces.\r\n\tif ( node.type !== \"ArrowFunctionExpression\" || !node.expression )\r\n\t{\r\n\t\tnode.body.body = patchBody.concat (node.body.body);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/* Handle braceless arrow functions by adding braces and returning the old code\r\n\t\t at the end. */\r\n\r\n\t\tpatchBody.push (\r\n\t\t{\r\n\t\t\ttype: \"ReturnStatement\",\r\n\t\t\targument: node.body,\r\n\t\t});\r\n\r\n\t\tnode.body = patchBlock;\r\n\t\tnode.expression = false;\r\n\t}\r\n}", "function f27() {}", "function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return meridiem ? meridiem(currentHours, currentMinutes, false) : (currentHours > 11 ? 'pm' : 'am');\n case 'A' :\n return meridiem ? meridiem(currentHours, currentMinutes, true) : (currentHours > 11 ? 'PM' : 'AM');\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // MILLISECONDS\n case 'S' :\n return ~~ (currentMilliseconds / 100);\n case 'SS' :\n return leftZeroFill(~~(currentMilliseconds / 10), 2);\n case 'SSS' :\n return leftZeroFill(currentMilliseconds, 3);\n // TIMEZONE\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }", "function monkeyPatch() {\n return {\n transform: (code, id) => {\n var file = id.split('/').pop()\n\n // Only one define call per module is allowed by requirejs so\n // we have to remove calls that other libraries make\n if (file === 'FileSaver.js') {\n code = code.replace(/define !== null\\) && \\(define.amd != null/g, '0')\n } else if (file === 'html2canvas.js') {\n code = code.replace(/&&\\s+define.amd/g, '&& define.amd && false')\n }\n\n return code\n }\n }\n}", "function replaceFunction(input) {\n // create a couple variables to be used later inside one of the cases.\n var a, b;\n switch (input) {\n // MONTH\n case 'M' :\n return currentMonth + 1;\n case 'Mo' :\n return (currentMonth + 1) + ordinal(currentMonth + 1);\n case 'MM' :\n return leftZeroFill(currentMonth + 1, 2);\n case 'MMM' :\n return moment.monthsShort[currentMonth];\n case 'MMMM' :\n return moment.months[currentMonth];\n // DAY OF MONTH\n case 'D' :\n return currentDate;\n case 'Do' :\n return currentDate + ordinal(currentDate);\n case 'DD' :\n return leftZeroFill(currentDate, 2);\n // DAY OF YEAR\n case 'DDD' :\n a = new Date(currentYear, currentMonth, currentDate);\n b = new Date(currentYear, 0, 1);\n return ~~ (((a - b) / 864e5) + 1.5);\n case 'DDDo' :\n a = replaceFunction('DDD');\n return a + ordinal(a);\n case 'DDDD' :\n return leftZeroFill(replaceFunction('DDD'), 3);\n // WEEKDAY\n case 'd' :\n return currentDay;\n case 'do' :\n return currentDay + ordinal(currentDay);\n case 'ddd' :\n return moment.weekdaysShort[currentDay];\n case 'dddd' :\n return moment.weekdays[currentDay];\n // WEEK OF YEAR\n case 'w' :\n a = new Date(currentYear, currentMonth, currentDate - currentDay + 5);\n b = new Date(a.getFullYear(), 0, 4);\n return ~~ ((a - b) / 864e5 / 7 + 1.5);\n case 'wo' :\n a = replaceFunction('w');\n return a + ordinal(a);\n case 'ww' :\n return leftZeroFill(replaceFunction('w'), 2);\n // YEAR\n case 'YY' :\n return leftZeroFill(currentYear % 100, 2);\n case 'YYYY' :\n return currentYear;\n // AM / PM\n case 'a' :\n return currentHours > 11 ? meridiem.pm : meridiem.am;\n case 'A' :\n return currentHours > 11 ? meridiem.PM : meridiem.AM;\n // 24 HOUR\n case 'H' :\n return currentHours;\n case 'HH' :\n return leftZeroFill(currentHours, 2);\n // 12 HOUR\n case 'h' :\n return currentHours % 12 || 12;\n case 'hh' :\n return leftZeroFill(currentHours % 12 || 12, 2);\n // MINUTE\n case 'm' :\n return currentMinutes;\n case 'mm' :\n return leftZeroFill(currentMinutes, 2);\n // SECOND\n case 's' :\n return currentSeconds;\n case 'ss' :\n return leftZeroFill(currentSeconds, 2);\n // TIMEZONE\n case 'zz' :\n // depreciating 'zz' fall through to 'z'\n case 'z' :\n return (m._d.toString().match(timezoneRegex) || [''])[0].replace(nonuppercaseLetters, '');\n case 'Z' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(Math.abs(currentZone) / 60), 2) + ':' + leftZeroFill(~~(Math.abs(currentZone) % 60), 2);\n case 'ZZ' :\n return (currentZone < 0 ? '-' : '+') + leftZeroFill(~~(10 * Math.abs(currentZone) / 6), 4);\n // LONG DATES\n case 'L' :\n case 'LL' :\n case 'LLL' :\n case 'LLLL' :\n case 'LT' :\n return formatMoment(m, moment.longDateFormat[input]);\n // DEFAULT\n default :\n return input.replace(/(^\\[)|(\\\\)|\\]$/g, \"\");\n }\n }", "function FunctionUtils() {}", "function monkeyPatch() {\n return {\n transform: (code, id) => {\n const file = path.parse(id).base;\n\n // Only one define call per module is allowed by requirejs so\n // we have to remove calls that other libraries make\n if (file === 'FileSaver.js') {\n code = code.replace(/define !== null\\) && \\(define.amd != null/g, '0')\n } else if (file === 'html2canvas.js') {\n code = code.replace(/&&\\s+define.amd/g, '&& define.amd && false')\n }\n\n return code\n }\n }\n}", "function addInjectedFunctionsToMeta() {\n const injectionWhitelist = _.uniq(this.validDependencyInjections.map(({ name }) => name));\n\n // Instrument injected functions\n this.validFunctions = this.validFunctions\n .map(funObj => _.merge(funObj, { injectionWhitelist }));\n\n // Instrument injected functions in exported objects\n Object.keys(this.capturedObjects).forEach((objName) => {\n const numFuns = this.capturedObjects[objName].funObjs.length;\n for (let i = 0; i < numFuns; i += 1) {\n const old = this.capturedObjects[objName].funObjs[i];\n this.capturedObjects[objName].funObjs[i] = _.merge(old, { injectionWhitelist });\n }\n });\n}", "function functionFindAndReplace(node, state) {\n var comp, parts, func\n parts = generators[node.type](node)\n for (var i = 0; i < parsed_dsl[node.type].length; i++) {\n comp = parsed_dsl[node.type][i]\n if (parts.length != comp.length) continue\n if (!~parts[0].indexOf(comp[0])) continue\n\n for (var j = 1; j < parts.length; j++) {\n if (parts[j] === comp[j]) continue\n func = getScope(parts[j], state)\n if (!func) console.log(state, parts[j], comp[j])\n replaceVar(func, parts[j], comp[j])\n }\n return\n }\n}", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function normal() {}", "function createReplacements() {\n\t return [\n\t // Remove anything but the contents within the BODY element\n\t [new RegExp(/^[\\s\\S]*<body[^>]*>\\s*|\\s*<\\/body[^>]*>[\\s\\S]*$/g), ''],\n\n\t // cleanup comments added by Chrome when pasting html\n\t [new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g), ''],\n\n\t // Trailing BR elements\n\t [new RegExp(/<br>$/i), ''],\n\n\t // replace two bogus tags that begin pastes from google docs\n\t [new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''],\n\t [new RegExp(/<\\/b>(<br[^>]*>)?$/gi), ''],\n\n\t // un-html spaces and newlines inserted by OS X\n\t [new RegExp(/<span class=\"Apple-converted-space\">\\s+<\\/span>/g), ' '],\n\t [new RegExp(/<br class=\"Apple-interchange-newline\">/g), '<br>'],\n\n\t // replace google docs italics+bold with a span to be replaced once the html is inserted\n\t [new RegExp(/<span[^>]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi), '<span class=\"replace-with italic bold\">'],\n\n\t // replace google docs italics with a span to be replaced once the html is inserted\n\t [new RegExp(/<span[^>]*font-style:italic[^>]*>/gi), '<span class=\"replace-with italic\">'],\n\n\t //[replace google docs bolds with a span to be replaced once the html is inserted\n\t [new RegExp(/<span[^>]*font-weight:bold[^>]*>/gi), '<span class=\"replace-with bold\">'],\n\n\t // replace manually entered b/i/a tags with real ones\n\t [new RegExp(/&lt;(\\/?)(i|b|a)&gt;/gi), '<$1$2>'],\n\n\t // replace manually a tags with real ones, converting smart-quotes from google docs\n\t [new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(((?!&quot;|&rdquo;|&ldquo;|\"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(?:(?!&gt;).)*&gt;/gi), '<a href=\"$1\">'],\n\n\t // Newlines between paragraphs in html have no syntactic value,\n\t // but then have a tendency to accidentally become additional paragraphs down the line\n\t [new RegExp(/<\\/p>\\n+/gi), '</p>'],\n\t [new RegExp(/\\n+<p/gi), '<p'],\n\n\t // Microsoft Word makes these odd tags, like <o:p></o:p>\n\t [new RegExp(/<\\/?o:[a-z]*>/gi), ''],\n\n\t // Microsoft Word adds some special elements around list items\n\t [new RegExp(/<!\\[if !supportLists\\]>(((?!<!).)*)<!\\[endif]\\>/gi), '$1']\n\t ];\n\t }", "_mapDeprecatedFunctionality(){\n\t\t//all previously deprecated functionality removed in the 5.0 release\n\t}", "function Func_s() {\n}", "static transform() {}", "function alterJSFunction(fn_str, to_add_txt) {\n let _fn_str = fn_str;\n const _fn_params = _fn_str.substring(_fn_str.indexOf(\"(\")+1, _fn_str.indexOf(\")\"));\n\n _fn_str = _fn_str.slice(_fn_str.indexOf(\"{\") + 1, _fn_str.lastIndexOf(\"}\"));\n _fn_str = _fn_str.replace( _fn_str,to_add_txt+_fn_str)\n\n const _fn = new Function(_fn_params, _fn_str);\n return _fn;\n}", "function normalizeFns(fns) {\n Object.keys(fns).forEach(function(key) {\n var handler = fns[key];\n if (typeof handler === 'function') {\n fns[key] = {\n enter: handler,\n leave: noop\n };\n }\n });\n}", "function setIconify(functions) {\n\t // Merge all functions, including _api\n\t [functions, functions._api].forEach((items) => {\n\t if (typeof items === 'object') {\n\t for (const key in items) {\n\t const value = items[key];\n\t if (typeof value === 'function') {\n\t exports.Iconify[key] = value;\n\t }\n\t }\n\t }\n\t });\n\t}", "applyAssign(plugInto, fnNames) {\n fnNames.forEach((fnName) => this.assign(plugInto, fnName));\n }", "function miFuncion (){}", "function transform_script(script) {\n idents.reset()\n scan_for_functions_to_transform(script).forEach(transform_function)\n\n // Post-processing. The script is already valid, but we clean up redundancies to improve readability of the output.\n replace_passthrough_callbacks(script)\n replace_passthrough_functions(script)\n inline_functions_only_called_once(script)\n}", "function tempConvert(){\n \n}", "function StupidBug() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function createReplacements() {\r\n return [\r\n // Remove anything but the contents within the BODY element\r\n [new RegExp(/^[\\s\\S]*<body[^>]*>\\s*|\\s*<\\/body[^>]*>[\\s\\S]*$/g), ''],\r\n\r\n // cleanup comments added by Chrome when pasting html\r\n [new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g), ''],\r\n\r\n // Trailing BR elements\r\n [new RegExp(/<br>$/i), ''],\r\n\r\n // replace two bogus tags that begin pastes from google docs\r\n [new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''],\r\n [new RegExp(/<\\/b>(<br[^>]*>)?$/gi), ''],\r\n\r\n // un-html spaces and newlines inserted by OS X\r\n [new RegExp(/<span class=\"Apple-converted-space\">\\s+<\\/span>/g), ' '],\r\n [new RegExp(/<br class=\"Apple-interchange-newline\">/g), '<br>'],\r\n\r\n // replace google docs italics+bold with a span to be replaced once the html is inserted\r\n [new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi), '<span class=\"replace-with italic bold\">'],\r\n\r\n // replace google docs italics with a span to be replaced once the html is inserted\r\n [new RegExp(/<span[^>]*font-style:italic[^>]*>/gi), '<span class=\"replace-with italic\">'],\r\n\r\n //[replace google docs bolds with a span to be replaced once the html is inserted\r\n [new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi), '<span class=\"replace-with bold\">'],\r\n\r\n // replace manually entered b/i/a tags with real ones\r\n [new RegExp(/&lt;(\\/?)(i|b|a)&gt;/gi), '<$1$2>'],\r\n\r\n // replace manually a tags with real ones, converting smart-quotes from google docs\r\n [new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(((?!&quot;|&rdquo;|&ldquo;|\"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(?:(?!&gt;).)*&gt;/gi), '<a href=\"$1\">'],\r\n\r\n // Newlines between paragraphs in html have no syntactic value,\r\n // but then have a tendency to accidentally become additional paragraphs down the line\r\n [new RegExp(/<\\/p>\\n+/gi), '</p>'],\r\n [new RegExp(/\\n+<p/gi), '<p'],\r\n\r\n // Microsoft Word makes these odd tags, like <o:p></o:p>\r\n [new RegExp(/<\\/?o:[a-z]*>/gi), ''],\r\n\r\n // Microsoft Word adds some special elements around list items\r\n [new RegExp(/<!\\[if !supportLists\\]>(((?!<!).)*)<!\\[endif]\\>/gi), '$1']\r\n ];\r\n }", "function unclobberInjections() {\n this.validDependencyInjections.forEach(({ name, paths }) => {\n const newFunctionName = newFunctionNameGenerator(name, this.fileName);\n // TODO: Make sure newFunctionName is not clobbering\n // another function\n paths.forEach((path) => {\n path.node.name = newFunctionName;\n });\n });\n}", "function aOverrides()\n{\n\n}", "function createReplacements() { // 4301\n return [ // 4302\n // replace two bogus tags that begin pastes from google docs\n [new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''], // 4304\n [new RegExp(/<\\/b>(<br[^>]*>)?$/gi), ''], // 4305\n // 4306\n // un-html spaces and newlines inserted by OS X // 4307\n [new RegExp(/<span class=\"Apple-converted-space\">\\s+<\\/span>/g), ' '],\n [new RegExp(/<br class=\"Apple-interchange-newline\">/g), '<br>'],\n // 4310\n // replace google docs italics+bold with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi), '<span class=\"replace-with italic bold\">'],\n // 4313\n // replace google docs italics with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*font-style:italic[^>]*>/gi), '<span class=\"replace-with italic\">'],\n // 4316\n //[replace google docs bolds with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*font-weight:bold[^>]*>/gi), '<span class=\"replace-with bold\">'],\n // 4319\n // replace manually entered b/i/a tags with real ones // 4320\n [new RegExp(/&lt;(\\/?)(i|b|a)&gt;/gi), '<$1$2>'], // 4321\n // 4322\n // replace manually a tags with real ones, converting smart-quotes from google docs\n [new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(((?!&quot;|&rdquo;|&ldquo;|\"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(?:(?!&gt;).)*&gt;/gi), '<a href=\"$1\">'],\n // 4325\n // Newlines between paragraphs in html have no syntactic value,\n // but then have a tendency to accidentally become additional paragraphs down the line\n [new RegExp(/<\\/p>\\n+/gi), '</p>'], // 4328\n [new RegExp(/\\n+<p/gi), '<p'], // 4329\n // 4330\n // Microsoft Word makes these odd tags, like <o:p></o:p> // 4331\n [new RegExp(/<\\/?o:[a-z]*>/gi), ''], // 4332\n // 4333\n // cleanup comments added by Chrome when pasting html // 4334\n ['<!--EndFragment-->', ''], // 4335\n ['<!--StartFragment-->', ''] // 4336\n ]; // 4337\n } // 4338", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "applyAssign(plugInto, fnNames) {\n fnNames.forEach(fnName => this.assign(plugInto, fnName));\n }", "function TMP(){return;}", "function TMP(){return;}", "function myNewFunction(a, b) {\n\t\treturn a + b;\n\t}", "function createReplacements() {\n return [\n // Remove anything but the contents within the BODY element\n [new RegExp(/^[\\s\\S]*<body[^>]*>\\s*|\\s*<\\/body[^>]*>[\\s\\S]*$/g), ''],\n\n // cleanup comments added by Chrome when pasting html\n [new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g), ''],\n\n // Trailing BR elements\n [new RegExp(/<br>$/i), ''],\n\n // replace two bogus tags that begin pastes from google docs\n [new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''],\n [new RegExp(/<\\/b>(<br[^>]*>)?$/gi), ''],\n\n // un-html spaces and newlines inserted by OS X\n [new RegExp(/<span class=\"Apple-converted-space\">\\s+<\\/span>/g), ' '],\n [new RegExp(/<br class=\"Apple-interchange-newline\">/g), '<br>'],\n\n // replace google docs italics+bold with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi), '<span class=\"replace-with italic bold\">'],\n\n // replace google docs italics with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*font-style:italic[^>]*>/gi), '<span class=\"replace-with italic\">'],\n\n //[replace google docs bolds with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi), '<span class=\"replace-with bold\">'],\n\n // replace manually entered b/i/a tags with real ones\n [new RegExp(/&lt;(\\/?)(i|b|a)&gt;/gi), '<$1$2>'],\n\n // replace manually a tags with real ones, converting smart-quotes from google docs\n [new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(((?!&quot;|&rdquo;|&ldquo;|\"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(?:(?!&gt;).)*&gt;/gi), '<a href=\"$1\">'],\n\n // Newlines between paragraphs in html have no syntactic value,\n // but then have a tendency to accidentally become additional paragraphs down the line\n [new RegExp(/<\\/p>\\n+/gi), '</p>'],\n [new RegExp(/\\n+<p/gi), '<p'],\n\n // Microsoft Word makes these odd tags, like <o:p></o:p>\n [new RegExp(/<\\/?o:[a-z]*>/gi), ''],\n\n // Microsoft Word adds some special elements around list items\n [new RegExp(/<!\\[if !supportLists\\]>(((?!<!).)*)<!\\[endif]\\>/gi), '$1']\n ];\n }", "function replaceImportFile(func) {\n _importFile = func;\n }", "function ourReuseableFunction() {\n console.log(\"Tony\", \"Obriku\");\n\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function replacer( text) {\n\treturn replacerBase(text, function(text) {\n\t\tvar str = translateDynamicImages(text);\n\t\tstr = translateSectionsMarkup(str);\n\t\tstr = translateGenericPairsMarkup(str);\n\t\tstr = translateGenericMarkup(str);\n\t\treturn str;\n\t}, shouldTranslate);\n}", "function Transform$7() {}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function EZglobal_mapFunctions(fromPrefix, toPrefix)\n\t{\n\t\tif (!fromPrefix || !toPrefix || fromPrefix == toPrefix) return;\n\t\tfromPrefix = fromPrefix + '';\n\t\ttoPrefix = toPrefix + '';\n\n\t\tvar oopsTo = toPrefix.right(1) == '.';\n\t\tif (oopsTo)\n\t\t{\n\t\t\ttoPrefix = toPrefix.clip();\n\t\t\toopsTo = window[toPrefix];\n\t\t\tif (!oopsTo) window[oopsTo] = {};\n\t\t}\n\t\tvar oopsFrom = fromPrefix.right(1) == '.';\n\t\tif (oopsFrom)\n\t\t{\n\t\t\tfromPrefix = fromPrefix.clip();\n\t\t\toopsFrom = window[fromPrefix];\n\t\t\tif (!oopsFrom) return;\n\n\t\t\tfor (var fn in oopsFrom)\t//for all from functions . . .\n\t\t\t{\n\t\t\t\tif (typeof(oopsFrom[fn]) != 'function') continue;\n\n\t\t\t\tif (!oopsTo)\n\t\t\t\t{\n\t\t\t\t\tvar name = fromPrefix + fn;\n\t\t\t\t\tif (window[name] == null)\n\t\t\t\t\t\twindow[name] = oopsFrom[fn];\n\t\t\t\t}\n\t\t\t\t//always true because oopsName undefined\n\t\t\t\t//else if (oopsTo[oopsName] == null)\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\toopsTo[fn] = oopsFrom[fn];\n\t\t\t\t\toopsTo[fn].displayName = fromPrefix + '.' + fn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//TODO: !oopsFrom ??\n\t}", "function myReusableFunction(){\n console.log(\"Heyya World\");\n}", "recreateFuncFromSource (funcSource, optFunc) {\n const closureVars = [];\n // let thisFound = false;\n const specificSuperHandling = this.firstParameter(funcSource) === '$super';\n for (const name in this.varMapping) {\n if (!this.varMapping.hasOwnProperty(name)) continue;\n if (name === 'this') { continue; }\n // closureVars.push(`var ${name} = this.varMapping.${name};\\n`);\n closureVars.push('var ' + name + ' = this.varMapping.' + name + ';\\n');\n }\n\n let src = '';\n if (closureVars.length > 0) src += closureVars.join('\\n');\n if (specificSuperHandling) src += '(function superWrapperForClosure() { return ';\n src += '(' + funcSource + ')';\n if (specificSuperHandling) {\n src += '.apply(this, [$super.bind(this)]' +\n '.concat(Array.from(arguments))) })';\n }\n try {\n const func = evalJS.call(this, src) || this.couldNotCreateFunc(src);\n this.addFuncProperties(func);\n this.originalFunc = func;\n return func;\n } catch (e) {\n // var msg = `Cannot create function ${e} src: ${src}`;\n const msg = 'Cannot create function ' + e + ' src: ' + src;\n console.error(msg);\n throw new Error(msg);\n }\n }", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n // we have an array of strings that we need to loop through and apply the modifyStings function through it\n // pass these strings through the moddified function\n var arr = [];\n for(var i = 0; i < strings.length; i++){\n arr.push(modify(strings[i]));\n \n }\n return arr;\n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "prep(src) {\n\n // console.log('Before -----> \\n', src)\n\n let h = this.src.use_for[0] // TODO: add props here\n src = '\\t\\t let _pref = `${_id}<-'+h+'<-`\\n' + src\n\n FDEFS2.lastIndex = 0\n let call_id = 0 // Function call id (to make each call unique)\n\n do {\n var m = FDEFS2.exec(src)\n if (m) {\n let fkeyword = m[1].trim()\n let fname = m[2]\n let fargs = m[3]\n\n if (fkeyword === 'function') {\n // TODO: add _ids to inline functions\n } else {\n let off = m.index + m[0].indexOf('(')\n if (this.std[fname]) {\n src = this.postfix(src, m, ++call_id)\n //console.log(src)\n off+=4 // 'std_'\n }\n // Quick fix\n FDEFS2.lastIndex = off\n }\n }\n } while (m)\n\n // console.log('After ----->\\n', u.wrap_idxs(src))\n\n return u.wrap_idxs(src, 'std_')\n }", "function makeFunctionWrapper(original, functionName) {\n //log(\"wrap fn: \" + functionName);\n var f = original[functionName];\n return function() {\n //log(\"call: \" + functionName);\n var result = f.apply(original, arguments);\n return result;\n };\n }", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n var newArr = [];\n for (var i = 0; i < strings.length; i++) {\n newArr.push(modify(strings[i]));\n} return newArr;\n\n\n \n // YOUR CODE ABOVE HERE //\n}", "function fn() {\n\t\t }", "function import_funcs(funcs) {\n \"use strict\";\n Dum_Dum_Boom_Boom.common.base.eachs(funcs, function (name, func) {\n window[name] = func;\n });\n }", "function traverseTree(replacementNode, functionName, ast) {\n console.log('traverse called');\n estraverse.replace(ast, {\n enter(node) {\n if (node.type === 'FunctionDeclaration') {\n if (node.id.name === functionName) {\n node.body = replacementNode.body[0].body;\n console.log('From parser. REPLACING!', node.id.name);\n }\n }\n },\n });\n}", "replace(...args) {\n const pairs = args2pairs(args)\n\n pairs.forEach(pair => that.replace.apply(that, pair))\n\n sync()\n return this\n }", "function updateDeclaredFunctions(declaredFunction) {\n currentFunction = declaredFunction;\n allFunctions.push(declaredFunction);\n}", "function replacer(key, value) {\n if (typeof value === 'function') {\n return String(value);\n }\n return value;\n }", "function Xuice() {\r\n}", "function replaceFunc(f) {\n return (...args) => { // args are [match, group1, group2, ..., offset, whole string, (some browsers:) named groups obj]\n const info = { // replace function will be called with this object\n match: args[0], // full matching string\n groups: [args[0]], // matched groups per index and, if available, by name\n offset: -1, // offset of match in all\n all: '', // full text in which match was found\n };\n let i=1;\n while(i<args.length && 'number' !== typeof args[i]) info.groups.push(args[i++]);\n info.offset = args[i];\n info.all = args[i+1];\n Object.entries(args[i+2] || {}).forEach(([k,v]) => info.groups[k] = v);\n return f.call(null, info);\n };\n}", "function patch(func, afterFunc, beforeFunc) {\n\t\tvar fn = $.ui.resizable.prototype[func];\n\t\t$.ui.resizable.prototype[func] = function () {\n\t\t\tif (beforeFunc) beforeFunc.apply(this, arguments);\n\t\t\tfn.apply(this, arguments);\n\t\t\tif (afterFunc) afterFunc.apply(this, arguments);\n\t\t}\n\t}", "function CustomReplacePlugin(replacements) {\n if (replacements === void 0) { replacements = defaultReplacements; }\n this.updateReplacements(replacements);\n }", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n// Strings is an array of strings\n//Modify is a function that takes a string and returns the string in upper case.\n\n// I need to run the modify function on each string in the array and return an array of modified strings.\n//First we need to create the array for modified strings\n\n \n// we need to loop through the original parameter of strings.\nfor(var i = 0; i <= strings.length -1; i++){\n \n // call modify for each string inside of strings array.\n strings[i] = modify(strings[i]);\n}\n \n \nreturn strings;\n}", "defineFn(name, words) {this.fnDefs[name] = words;}", "function imprimir4(fn){\n\n\t//Ejecutamos la funcion anonima\n\tfn();\n\n}", "function d3_rebind(target, source, method) {\n return function() {\n var value = method.apply(source, arguments);\n return value === source ? target : value;\n };\n }// Copies a variable number of methods from source to target.", "function setup() {\r\n link_find_and_replace = function(find, replace) {\r\n $.each($(\"a\"), function(index, item) {\r\n url = item.href;\r\n if (typeof url == \"string\" && url.indexOf(find) != -1){\r\n href = String(url.replace(find, replace));\r\n item.href = href;\r\n }\r\n });\r\n }\r\n \r\n link_find_and_replace(\"thepiratebay.se\", \"pirateproxy.net\");\r\n}", "apply () {}", "_onProcessReplaceableContent() {}", "function replaceCard(bgCard) { //function replaceCard defined \n var card = $(\"#myCard\").html(); \n\n\n card = card.replace(\"pic\", bgCard.photoUrl); \n card = card.replace(\"#loCate\", bgCard.place);\n card = card.replace(\"0\", bgCard.tempNow);\n card = card.replace(\"preCip\", bgCard.percip);\n\n\n return card; \n\n} // function replaceCard end", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function _genReplacer(nodeName) {\n\n reverts = [];\n\n var makeReplacementNode;\n\n if (typeof nodeName !== 'function') {\n var stencilNode = nodeName.nodeType ? nodeName : document.createElement(nodeName);\n makeReplacementNode = function(fill) {\n var clone = document.createElement('div'),\n el;\n clone.innerHTML = stencilNode.outerHTML || new window.XMLSerializer().serializeToString(stencilNode);\n el = clone.firstChild;\n if (fill) {\n el.appendChild(document.createTextNode(fill));\n }\n return el;\n };\n } else {\n makeReplacementNode = nodeName;\n }\n\n return function replace(range) {\n\n var startNode = range.startNode,\n endNode = range.endNode,\n matchIndex = range.matchIndex,\n before, after;\n\n if (startNode === endNode) {\n var node = startNode;\n if (range.startNodeIndex > 0) {\n // Add `before` text node (before the match)\n before = document.createTextNode(node.data.substring(0, range.startNodeIndex));\n node.parentNode.insertBefore(before, node);\n }\n\n // Create the replacement node:\n var el = makeReplacementNode(range.match[0], matchIndex);\n node.parentNode.insertBefore(el, node);\n if (range.endNodeIndex < node.length) {\n // Add `after` text node (after the match)\n after = document.createTextNode(node.data.substring(range.endNodeIndex));\n node.parentNode.insertBefore(after, node);\n }\n node.parentNode.removeChild(node);\n reverts.push(function() {\n var pnode = el.parentNode;\n pnode.insertBefore(el.firstChild, el);\n pnode.removeChild(el);\n pnode.normalize();\n });\n return el;\n } else {\n // Replace startNode -> [innerNodes...] -> endNode (in that order)\n before = document.createTextNode(startNode.data.substring(0, range.startNodeIndex));\n after = document.createTextNode(endNode.data.substring(range.endNodeIndex));\n var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);\n var innerEls = [];\n for (var i = 0, l = range.innerNodes.length; i < l; ++i) {\n var innerNode = range.innerNodes[i];\n var innerEl = makeReplacementNode(innerNode.data, matchIndex);\n innerNode.parentNode.replaceChild(innerEl, innerNode);\n innerEls.push(innerEl);\n }\n var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);\n startNode.parentNode.insertBefore(before, startNode);\n startNode.parentNode.insertBefore(elA, startNode);\n startNode.parentNode.removeChild(startNode);\n endNode.parentNode.insertBefore(elB, endNode);\n endNode.parentNode.insertBefore(after, endNode);\n endNode.parentNode.removeChild(endNode);\n reverts.push(function() {\n innerEls.unshift(elA);\n innerEls.push(elB);\n for (var i = 0, l = innerEls.length; i < l; ++i) {\n var el = innerEls[i];\n var pnode = el.parentNode;\n pnode.insertBefore(el.firstChild, el);\n pnode.removeChild(el);\n pnode.normalize();\n }\n });\n return elB;\n }\n };\n\n }", "function _____SHARED_functions_____(){}", "function update() {\n\n // Don't delete this function!\n\n}", "function addFunction() {\r\n element.appendChild(mouseSattelite);\r\n O$._mouseSatteliteTrackMouse(mouseSattelite);\r\n element.onmouseover = function () {\r\n O$._mouseSatteliteShow(mouseSattelite);\r\n };\r\n element.onmouseout = function () {\r\n O$._mouseSatteliteHide(mouseSattelite);\r\n };\r\n O$._bugFix_IEPng(mouseSattelite);\r\n }", "function partiallyApplied(handler){var args=[].slice.call(arguments,1);return function(){if(typeof handler===\"function\"){handler.apply(undefined,args);}else{new Function(\"\"+handler)();}};}", "function doOtherStuff() {}", "function wrapFunction(functionDescribtor, newFunction) {\n\t\tvar reference = window;\n\t\tvar describtorParts = functionDescribtor.split(\".\");\n\t\tdescribtorParts.forEach(function(describtor, i) {\n\t\t\tif (describtorParts.length - 1 > i ) {\n\t\t\t\treference = reference[describtor];\n\t\t\t} else {\n\t\t\t\treference[describtor] = newFunction;\n\t\t\t}\n\t\t});\n\t}", "function initCustomForms() {\n jcf.replaceAll();\n}", "function\nmap0$fopr_2343_(a5x1)\n{\nlet xtmp57;\n;\n{\nxtmp57 = a1x2(a5x1);\n}\n;\nreturn xtmp57;\n}", "static _functionToCode(fn, name) {\r\n var txt = fn.toString()\r\n .replace(/\\/\\/.*/g, '')\r\n .replace(/\\s+/g, '')\r\n .replace(/var/g,'var ')\r\n .replace('return','return ') + ';';\r\n return txt\r\n }", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n //I-array of strings and function\n //O-array of strings, modified\n //C-\n //E-\n //I'll make a variable to hold the new array\n var newStrings = []\n var tempString\n //Ok, ok, so next a loop, I'll use a for loop\n for(let i=0;i<strings.length;i++) {\n //Now I'll modify the string and put it in the new array\n tempString = strings[i]\n tempString = modify(tempString)\n newStrings.push(tempString)\n }\n \n return newStrings\n \n \n // YOUR CODE ABOVE HERE //\n}", "function damages_map(){\n\n}", "function addFunctions() {\n var divList = document.getElementsByClassName('cf_inplace')\n for (let i = 0; i < divList.length; i++) {\n //console.log(divList[i].children.length)\n for (let j = 0; j < divList[i].children.length; j++) {\n if(divList[i].children[j].tagName == \"IMG\") {\n divList[i].children[j].setAttribute('ondblclick', 'changeImage(this)')\n } else {\n divList[i].children[j].setAttribute('ondblclick', 'triggerChangeElement(this)')\n }\n }\n }\n\n for (let i = 0; i < divList.length; i++) {\n //console.log(\"add\")\n divList[i].appendChild(createEditButton(divList[i]))\n }\n}", "function Rewriter(){ }", "function repairFunctions(realmRec) {\n // Here, the order of operation is important: Function needs to be\n // repaired first since the other constructors need it.\n repairFunction(realmRec, 'Function', 'function');\n repairFunction(realmRec, 'GeneratorFunction', 'function*');\n repairFunction(realmRec, 'AsyncFunction', 'async function');\n repairFunction(realmRec, 'AsyncGeneratorFunction', 'async function*');\n}", "function replacer(m) {\n return escaper[m];\n }", "function add_applied_functions() {\n var ul = jQuery('#calcfuncsul');\n jQuery.each(functions_applied, function(i,e) {\n jQuery( \"<li data-id=\\\"\" + e + \"\\\" data-coltype=\\\"function\\\"></li>\" )\n .html( remove_me + ' ' +e )\n .appendTo( ul );\n });\n }", "function add_applied_functions() {\n var ul = jQuery('#calcfuncsul');\n jQuery.each(functions_applied, function(i,e) {\n jQuery( \"<li data-id=\\\"\" + e + \"\\\" data-coltype=\\\"function\\\"></li>\" )\n .html( remove_me + ' ' +e )\n .appendTo( ul );\n });\n }", "function changeText (paragraph) {\n newParagraph1 = paragraph.replace(/strawberry|Strawberry/g, \"banana\");\n newParagraph2 = newParagraph1.replace(/strawberries|Strawberries/g, \"bananas\");\n\n//4. Given the following paragraph, create a JavaScript function that changes all mentions of strawberry to banana and strawberries to bananas:\nStrawberries are a popular part of spring and summer diets throughout America. Mouths water from coast to coast each spring, when small white blossoms start to appear on strawberry bushes. They announce the impending arrival of the ruby red berries that so many people crave. Ripe strawberries taste sweet and have only a slight hint of tartness. They are also one of the healthiest fruits around. There are countless recipes for the luscious red berry, but many people prefer to eat them fresh and unaccompanied.\n return newParagraph2;\n}", "function dummy() {}", "function dummy() {}" ]
[ "0.6744191", "0.67120796", "0.63454187", "0.62559104", "0.598685", "0.5982629", "0.5922289", "0.5878065", "0.58572155", "0.5725822", "0.57194215", "0.5699527", "0.5684683", "0.56741697", "0.5669155", "0.56646496", "0.56393826", "0.56158507", "0.56145203", "0.5602656", "0.5597224", "0.5582325", "0.5572439", "0.55701244", "0.5566232", "0.5560494", "0.5545121", "0.5542467", "0.5535101", "0.5526945", "0.5519211", "0.55167425", "0.55167425", "0.55167425", "0.5513975", "0.5512532", "0.55052793", "0.5493113", "0.5492816", "0.54923546", "0.5488596", "0.5488596", "0.5474675", "0.54645866", "0.54595613", "0.54592913", "0.54536396", "0.54536396", "0.54512125", "0.5446476", "0.5433866", "0.5430053", "0.54214585", "0.54198414", "0.5419735", "0.5415606", "0.5405239", "0.54037774", "0.539837", "0.5397402", "0.53734505", "0.5366893", "0.53661484", "0.53578836", "0.5348561", "0.53283614", "0.5320923", "0.5315737", "0.5315475", "0.5312284", "0.53120804", "0.530762", "0.53037995", "0.5281862", "0.52800447", "0.5270022", "0.5269592", "0.52615744", "0.52615744", "0.52615744", "0.52603793", "0.52507466", "0.5247173", "0.52459955", "0.52397686", "0.52378917", "0.5225489", "0.521754", "0.5214672", "0.52123016", "0.52118725", "0.5208334", "0.52010196", "0.5194196", "0.5193501", "0.51897144", "0.5187923", "0.5187923", "0.51794434", "0.51718014", "0.51718014" ]
0.0
-1
props are passed in from app, set up a blank state to receive article to be passed down to components, edit and delete are bound at object scope and passed down to component
constructor(props){ super(props); this.state = {articles: [], categories: []} this.handleLink = this.handleLink.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.state = {\n visible: false,\n is_follow: false,\n id: props.id,\n action: 'new',\n article: store.get_current_article(),\n content: '',\n };\n this.share = this.share.bind(this);\n this.handle_submit = this.handle_submit.bind(this);\n this.handle_cancel = this.handle_cancel.bind(this);\n this.is_follow = this.is_follow.bind(this);\n this.process_options = this.process_options.bind(this);\n }", "target_article(state, payload){\n Object.assign(state.AdminPanel.articleEdit, payload)\n }", "constructor(props) {\n super(props);\n this.handleChange = this.handleChange.bind(this);\n this.handleSave = this.handleSave.bind(this);\n \n this.state = {\n //product: Object.assign({}, RESET_VALUES),\n\n myArticles: {\n articleTitle: '',\n details: ''\n }\n}\n }", "_initialize (props) {\n const { articleSession, config, archive, editorState, viewName } = props\n\n // TODO: I want to refactor how EditorSessions are created\n // particularly I want to work on the multi-view/user sessions\n const editorSession = new EditorSession(viewName, articleSession, config, this, editorState)\n const api = new ArticleAPI(editorSession, archive, config, articleSession, { getContext: () => this.context })\n\n // ATTENTION: augmenting the default context with editor stuff and api etc.\n // TODO: try to find a more idiomatic approach, without needing to hack the context\n // This should be solvable by sharing things like 'api' on the ArticlePanel level\n // and adding other things to getChildContext()\n const context = Object.assign(this.context, createEditorContext(config, editorSession, this), {\n api,\n archive,\n editor: this,\n urlResolver: archive,\n editable: true\n })\n\n this.api = api\n this.appState = context.appState\n this.context = context\n this.editorSession = editorSession\n\n this.editorSession.initialize()\n this.appState.addObserver(['workflowId'], this.rerender, this, { stage: 'render' })\n this.appState.addObserver(['settings'], this._onSettingsUpdate, this, { stage: 'render' })\n\n // HACK: ATM there is no better way than to listen to an archive\n // event and forcing the CommandManager to update commandStates\n // and propagating the changes\n archive.on('archive:saved', () => {\n // HACK: alternatively we could trigger the commandManager directly\n // but setting the selection dirty, also makes sure the DOM selection gets rerendered\n // this.editorSession.commandManager.reduce()\n this.appState._setDirty('selection')\n this.appState.propagateUpdates()\n })\n\n // HACK: resetting the app state here, because things might get 'dirty' during initialization\n // TODO: find out if there is a better way to do this\n this.appState._reset()\n }", "constructor(props) {\n super(props);\n this.state = {\n edit: false,\n note: this.props.note.note\n }\n }", "constructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tarticleItems: [],\n\t\t\tloading: true\n\t\t};\n\n\t}", "async getArticle(id){\n /**\n * GEt article if this is an edit article form\n */\n\n if( id ){\n // Get the article from the store\n let { article } = this.props\n \n // Get from the articles in th store if it is not the current article in the store\n if (id != article.id) {\n article= this.props.articles.filter(item=> item.id == id) [0]\n }\n\n if(article && article.id){\n await this.setState ({\n article_id: id,\n title: article.title,\n description: article.description\n })\n }\n } else {\n await this.setState ({\n article_id: 0,\n title: '',\n description: ''\n })\n\n }\n }", "_initialize (props) {\n const { articleSession, config, archive } = props\n\n // TODO: I want to refactor how EditorSessions are created\n // particularly I want to work on the multi-view/user sessions\n const editorSession = new ArticleEditorSession(\n articleSession, config, this,\n // initial editor state\n {\n workflowId: null,\n viewName: this.props.viewName,\n settings: this._createSettings(articleSession.getDocument())\n }\n )\n const api = new ArticleAPI(editorSession, archive, config, articleSession, { getContext: () => this.context })\n\n const context = Object.assign(createEditorContext(config, editorSession), {\n api,\n archive,\n editor: this,\n urlResolver: archive,\n editable: true\n })\n\n this.api = api\n this.appState = context.appState\n this.context = context\n this.editorSession = editorSession\n\n this.editorSession.initialize()\n this.appState.addObserver(['workflowId'], this.rerender, this, { stage: 'render' })\n this.appState.addObserver(['viewName'], this._updateViewName, this, { stage: 'render' })\n this.appState.addObserver(['settings'], this._onSettingsUpdate, this, { stage: 'render' })\n\n // HACK: ATM there is no better way than to listen to an archive\n // event and forcing the CommandManager to update commandStates\n // and propagating the changes\n archive.on('archive:saved', () => {\n // HACK: alternatively we could trigger the commandManager directly\n // but setting the selection dirty, also makes sure the DOM selection gets rerendered\n // this.editorSession.commandManager.reduce()\n this.appState._setDirty('selection')\n this.appState.propagateUpdates()\n })\n\n // HACK: resetting the app state here, because things might get 'dirty' during initialization\n // TODO: find out if there is a better way to do this\n this.appState._reset()\n }", "function stateChange(e) {\n setArticleParams();\n getArticle();\n }", "constructor() {\n super();\n this.state = {\n editingId: null,\n activeItem: null\n };\n }", "render(){\n if(!this.state.journalist){\n return null;\n }\n if(!this.state.articles){\n return(\n <div className=\"single-journalist-container\">\n <JournalistDetails id={this.props.id} journalist = {this.state.journalist} articles={null} handleDelete = {this.handleDelete} handleEdit={this.handleEdit}/>\n </div>\n )\n }\n return (\n <div className=\"single-journalist-container\">\n <JournalistDetails id={this.props.id} journalist = {this.state.journalist} articles={this.state.journalist._embedded.articles} handleDelete = {this.handleDelete} handleEdit={this.handleEdit}/>\n </div>\n )\n\n }", "constructor(props) {\n super(props);\n\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.submitted = props.onSubmit;\n\n // Url used for fetch\n let url;\n if(props.mode === 'edit') {\n url = 'http://206.189.15.232:8080/blogposts/' + props.id +'/';\n } else {\n url = 'http://206.189.15.232:8080/blogposts/';\n }\n\n this.state = {\n mode: props.mode,\n id: props.id,\n url: url,\n title: \"\",\n author: \"\",\n text: \"\",\n points: \"\",\n comments: []\n };\n\n console.log('mode = ' + this.state.mode + '(' + props.mode + ')');\n console.log('url = ' + this.state.url);\n console.log('id = ' + this.state.id);\n }", "constructor(){\n super()\n this.state= {\n date:new Date(),\n post:'',\n title:'',\n subTitle:'',\n author:'',\n description:'',\n posted:false,\n }\n this.handleGetContent = this.handleGetContent.bind(this)\n this.addPost = this.addPost.bind(this)\n this.handleInputChange = this.handleInputChange.bind(this)\n }", "render(){\n return (\n <ArticleList articles = {this.state.articles} />\n )\n }", "constructor(props) {\n super(props);\n this.state = {\n edited: null,\n text: this.props.content\n };\n }", "constructor(props) {\n super()\n this.state = {\n body: props.body,\n tempBody: ''\n }\n // this.handleBodyEdit = this.handleBodyEdit.bind(this)\n }", "constructor(props){\n super(props);\n this.state = {\n username: '',\n upc: '',\n articleType: 'shoes',\n color: '',\n description: '',\n imageURL: '',\n }\n\n }", "constructor(props) {\n super(props)\n // we use the constructor to set the INITIAL state\n this.state = {\n ideas: [],\n // editingIdeaId keeps track of which idea is being edited\n // by default, we are not editing any idea, so default is null\n editingIdeaId: null,\n notification: ''\n }\n }", "componentWillMount(){\n\n // If there is postData coming in, it means we need to Edit this post, so populate the data into state.\n if ( this.props.location && this.props.location.postData ) {\n this.setState({\n postData: {\n id: this.props.location.postData.id,\n titleInput: this.props.location.postData.title,\n bodyInput: this.props.location.postData.body,\n authorInput: this.props.location.postData.author,\n category: this.props.location.postData.category,\n },\n editingPost: true\n })\n }\n\n\n }", "constructor(props){\n super(props);\n this.state = { //initialising object properties\n title: \"\",\n isbn: \"\",\n author: \"\",\n description: \"\",\n publishedDate: \"\",\n publisher: \"\"\n };\n }", "constructor(props) {\n super(props);\n this.state = {\n title: \"\",\n description: \"\",\n author: \"\",\n authoiId: \"\"\n };\n }", "constructor(props) {\n super(props);\n this.state = {\n Title: '',\n Year: '',\n Poster: ''\n };\n\n\n //these are the functions to set the title,year and poster for each item\n this.handleChangeShowTitle = this.handleChangeShowTitle.bind(this);\n this.handleChangeShowYear = this.handleChangeShowYear.bind(this);\n this.handleChangeShowPoster = this.handleChangeShowPoster.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "constructor(props){\n super(props);\n\n \n this.state = {\n isLoading:true,\n data:null,\n setModalVisible:false,\n //modalArticleData is used to fetch data and is of type json.\n modalArticleData:{}\n }\n\n }", "constructor(props) {\n super(props);\n this.state = {\n view: this.props.view,\n display: this.props.params.displayString\n }\n if (this.state.view === 'course') {\n this.state.object = mySyllabus.find(course => (course.id === props.params.id)) || 0;\n } else if (this.state.view === 'term') {\n this.state.object = mySemesters.find(sem => (sem.id === 1));\n }\n }", "constructor(props) {\n super(props);\n this.state = {description: '', readonly: false};\n\n this.handleNameChange = this.handleNameChange.bind(this);\n this.handleDescriptionChange = this.handleDescriptionChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleEdit = this.handleEdit.bind(this);\n this.handleDelete = this.handleDelete.bind(this);\n }", "render(){\n let showNews = \"\"\n if(this.props.showNews === true){\n showNews= <NewsModule\n articleName={this.props.articleName} about={this.props.about} articleImage={this.props.articleImage} url={this.props.url} closeModal={this.props.closeModal} editNewsClick={this.props.editNewsClick} deleteArticle={this.props.deleteArticle} deleteNewsClick={this.props.deleteNewsClick} currentUserId={this.props.currentUserId} userId={this.props.userId}/>\n } else if(this.props.editNews === true){\n showNews= <AddEditNews\n handleFieldChange={this.props.handleFieldChange}\n editNews={this.props.editNews}closeModal={this.props.closeModal}\n addNews={this.props.addNews} editArticleChanges={this.props.editArticleChanges} addNewArticle={this.props.addNewArticle}\n articleName={this.props.articleName} about={this.props.about} articleImage={this.props.articleImage} url={this.props.url} articleId={this.props.articleId} warningMessage={this.props.warningMessage} warningMessageAbout={this.props.warningMessageAbout} warningMessageImg={this.props.warningMessageImg} warningMessageURL={this.props.warningMessageURL}/>\n } else if(this.props.deleteNews === true){\n showNews=<DeleteNews deleteArticle={this.props.deleteArticle} closeModal={this.props.closeModal}/>\n }\n\n return(\n <React.Fragment>\n {\n this.props.news.map((article, index)=>{\n return(\n <div className={this.createClass(index)}\n key={article.id} onClick={()=> this.props.showNewsClick(article.url, article.articleName, article.about, article.articleImage, article.id, article.userId)}>\n <div className=\"box\">\n <article className=\"media\">\n <figure className=\"media-left\">\n <p className=\"image is-64x64\">\n <img src={article.user.profilePic} alt=\"\" />\n </p>\n </figure>\n <div className=\"media-content\">\n <div className=\"content\">\n <p id=\"userInfo\" className=\"\">\n <strong>{article.user.firstName} {article.user.lastName}</strong> <small className={this.activeUserClass(article.userId)}>@{article.user.username}</small> <small className={this.activeUserClass(article.userId)}>{moment(`${article.dateSaved}`).fromNow()}</small>\n </p>\n <p className=\"\">{article.about}</p>\n </div>\n\n <article className=\"media\">\n <figure className=\"media-left\">\n <p className=\"image is-128x128\">\n <img src={article.articleImage} alt=\"\"/>\n </p>\n </figure>\n <div className=\"media-content\">\n <div className=\n {this.friendClassName(article.userId)}\n >\n <p>\n <strong>{article.articleName}</strong>\n </p>\n </div>\n </div>\n </article>\n </div>\n </article>\n </div>\n </div>\n\n )\n })\n }\n {showNews}\n </React.Fragment>\n )\n }", "constructor(props) {\n super(props);\n\n //The recipe info passed to the component\n let recipe = this.props.recipe;\n\n \n //Adds all of the card's starting info into state\n //State is updated when the elements are edited\n this.state = {\n title: recipe.header.recipeTitle,\n author: recipe.header.author,\n ingredients: recipe.ingredients,\n steps: recipe.steps,\n isDisabled: true\n };\n\n //Function binding\n this.handleFieldChange = this.handleFieldChange.bind(this);\n this.saveChanges = this.saveChanges.bind(this);\n this.beginEdit = this.beginEdit.bind(this);\n }", "constructor(props) {\n super(props);\n //we set the initial state of the note nav to false, ie. there will be no notes to show thus no notes to \"redirect\" to when clicked\n this.state = {\n redirect: false\n };\n //we bind the components to our event handlers to be executed\n this.saveNote = this.saveNote.bind(this);\n this.deleteNote = this.deleteNote.bind(this);\n }", "constructor(props) {\n super(props)\n this.state = {\n originalDetails: {title: '', body: '', voteScore: 0, deleted: false},\n modifiedDetails: {title: '', body: ''},\n }\n }", "constructor(props) {\r\n super();\r\n //console.log(props);\r\n this.state = {id: props.note.id, text: props.note.text};\r\n }", "initArticles(data) {\n this.setState({ articles: data });\n this.updateSoures();\n }", "constructor(props) {\n super(props);\n this.state = {\n topic: \"\",\n startYear: \"\",\n endYear: \"\",\n results: [],\n savedArticles: [],\n }\n }", "constructor(props){\n super(props);\n this.state = {\n loading: false, //sets all necessary attributes, mostly empty to be filled later\n edit: false,\n title: '',\n src: '',\n message: '',\n last: '',\n next: ''\n }\n }", "function mapStateToProps(state) {\n return {\n title: state.article.title\n };\n}", "constructor(title, author, text) {\n ///Prop for Title\n this.props = {};\n ///Prop for Author\n this.props.author = author;\n ///Prop for Text\n this.props.content = text;\n }", "constructor(props) {\n //props are used to export elements from other components\n super(props);\n this.state = {\n newItem: \"\", //any new todo appears here first then fetched into list item that holds al todos\n list: [] //loop over to display all todos\n };\n }", "constructor(props) {\n super(props);\n\n this.state = {\n \n //Note Text//\n noteValue: '',\n \n //Note Array//\n noteSize: 0,\n \n \n items: [],\n refresh: false, \n };\n this.add = this.add.bind(this);\n this.updateList = this.updateList.bind(this);\n this.loadList();\n this.delete = this.delete.bind(this);\n }", "constructor(props) {\n super(props);\n\n this.state = {\n };\n this.handleChangeTitle = this.handleChangeTitle.bind(this);\n this.handleChangeDescription = this.handleChangeDescription.bind(this);\n }", "constructor(props){\n super(props);\n this.state= {\n announcements: ANNOUNCEMENTS,\n selectedAnnouncement: null, //When the user selects an announcement, this value of null will change.\n }\n }", "constructor(props){\n super(props);\n this.state = {\n notes: [],\n bio: {},\n repos: []\n }\n }", "constructor(props) {\n super(props);\n this.state = {\n componentDicts: [],\n };\n\n this.handleRemove = this.handleRemove.bind(this);\n this.handleCreate = this.handleCreate.bind(this);\n }", "constructor(props){\n\t\t//can't call 'this' in constructor unless you call super(props)\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tnotes: [],\n\t\t\tbio: {},\n\t\t\trepos: []\n\t\t}\n\t}", "handleEditorReturn(newArticle){\n if (newArticle){ // not a cancel\n if (this.state.currentArticle){ // this is a replacement, remove the old article\n //get the id of the article we're interested in\n let editedArticleID = this.state.currentArticle._id;\n let editedArticle = Object.assign({}, this.state.currentArticle, {title:newArticle.title, extract:newArticle.extract, edited: newArticle.edited} );\n const articleStr = JSON.stringify(editedArticle);\n const request = new Request(\n SERVER + \"/articles/\" + editedArticleID,\n {\n method:'PUT', //replace the old one\n body: articleStr,\n headers: new Headers({'Content-type': 'application/json'})\n }\n );\n\n fetch(request)\n .then((response)=>{\n if (response.ok){\n return response.json();\n }\n })\n .then((newArticle)=>{\n const newCollection = this.state.collection.map((article)=>{\n if (article._id === editedArticle._id){\n return newArticle;\n }\n return article;\n });\n //update the collection and current article\n this.setState({currentArticle: editedArticle, collection: newCollection});\n });\n }\n\n //add a new article\n let addArticle = Object.assign({}, newArticle, {title:newArticle.title, extract:newArticle.extract, edited: newArticle.edited} );\n const articleStr = JSON.stringify(addArticle);\n const request = new Request(\n SERVER + \"/articles/\" ,\n {\n method:'POST', //add new article\n body: articleStr,\n headers: new Headers({'Content-type': 'application/json'})\n }\n );\n\n fetch(request)\n .then((response)=>{\n if (response.ok){\n\n return response.json();\n }\n })\n .then((newArticle)=>{\n const newCollection = this.state.collection.map((article)=>{\n if (article._id === addArticle._id){\n return newArticle;\n }\n return article;\n });\n //update the collection and current article\n this.setState({currentArticle: addArticle, collection: newCollection});\n });\n }\n // switch to the browsing view\n this.setState({mode:'view'});\n }", "componentWillMount() {\n this.props.initializeDatabaseObject();\n this.setState({ editItem: false });\n }", "function mapStateToProps(state) {\n console.log(state)\n return {\n articles: state.articles\n }\n}", "constructor(props){\r\n super(props)\r\n this.state = {\r\n notes:['note1','note2','note3'],\r\n bio: {name: 'Brian Paintsil'},\r\n repos:[1,2,3]\r\n }\r\n }", "constructor(props) {\n super(props);\n this.state = {\n editorVisible: false,\n editorValues: {},\n service: null,\n }\n }", "constructor(props) {\n super(props);\n this.state = {\n emotion: \"+1\",\n exercise: \"\",\n body: [\"\"],\n tags: \"\",\n isPublic: true,\n };\n\n //this.displayMessage = this.displayMessage.bind(this);\n\n //this.handleChange = this.handleChange.bind(this);\n //this.postBottle = this.postBottle.bind(this);\n this.routeChange = this.routeChange.bind(this);\n }", "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 \n this.state = {\n email : \"\",\n headline : \"Headline\",\n descript : \"Description\",\n propertytype :\"Property Type\",\n bedrooms : \"Bedrooms\",\n accomodates : \"Accomodates\",\n bathrooms : \"Bathrooms\",\n detailsfields : [],\n headlineFlag: false,\n descriptFlag : false,\n propertytypeFlag : false,\n bedroomsFlag : false,\n accomodatesFlag : false,\n bathroomsFlag : false,\n detailsCreated : false,\n detailsUpdated : false\n }\n\n this.handleLogout = this.handleLogout.bind(this);\n this.headlineChangeHandler = this.headlineChangeHandler.bind(this);\n this.descriptChangeHandler = this.descriptChangeHandler.bind(this);\n this.ptypeChangeHandler = this.ptypeChangeHandler.bind(this);\n this.bedsChangeHandler = this.bedsChangeHandler.bind(this);\n this.accChangeHandler = this.accChangeHandler.bind(this);\n this.bathChangeHandler = this.bathChangeHandler.bind(this);\n this.handlePropertyCreate = this.handlePropertyCreate.bind(this);\n }", "constructor(props){\n\n super(props);\n\n this.bodyClickEvent=null;//click event on page body\n this.changeDeffer=null;\n\n\n this.state={\n\n edit:false, //edit mode\n value:this.props.defValue\n };\n\n this.lastValue=this.props.defValue;\n\n }", "componentDidMount() {\n\n ArticleActions.receiveArticles()\n\n }", "constructor(props) {\n super(props)\n this.state = {\n edit: {\n id: this.props.event.id,\n title: this.props.event.title,\n description: this.props.event.description,\n start_date: this.props.event.start_date,\n end_date: this.props.event.end_date\n }\n }\n this.handleChange = this.handleChange.bind(this)\n this.handleSubmit = this.handleSubmit.bind(this)\n }", "constructor(props) {\n super(props);\n // local component state\n this.state = {\n description: props.existingExpense ? props.existingExpense.description : '',\n note: props.existingExpense ? props.existingExpense.note : '',\n amount: props.existingExpense ? (props.existingExpense.amount / 100).toString() : '',\n createdAt: props.existingExpense ? moment(props.existingExpense.createdAt) : moment(), // current time\n calendarFocused: false,\n error: ''\n };\n }", "constructor(props) {\n super(props)\n this.state = {\n account: '' ,\n socialNetwork: null ,\n postCount: 0,\n posts: [],\n loading: true //will show app is loading if we are waiting for information from the blockchain\n }\n //helps to bind, so we ca access it in main.js 's form\n this.createPost = this.createPost.bind(this)\n this.tipPost = this.tipPost.bind(this)\n }", "constructor(props) {\n super(props);\n \n this.state = {\n src:'',\n author:'',\n GoToCreate_visible: false, \n Remind_visible: false\n \n };\n }", "constructor(props) {\n super(props);\n this.state = {\n note_name:'',\n content: '',\n folder_id: '',\n date_modified: '',\n }\n }", "constructor(props) {\n super(props)\n this.state = {\n category: 'react',\n title: '',\n body: '',\n author: ''\n }\n }", "constructor(props) {\n super(props);\n this.state = {\n error: false,\n products: [], //all products in the DB\n errorMsg: '',\n deleteModal: null\n }\n }", "constructor(props){\n super(props);\n this.state = { book: this.props.book };\n }", "constructor(props) {\n super(props);\n this.state = {\n // initial state with empty attributes.\n Date: '',\n Strategy: '',\n Content: '',\n Time: '',\n Sprint: '',\n noteId: this.generateId()\n }\n }", "constructor(props) {\n //Call the constrictor of Super class i.e The Component\n super(props);\n //maintain the state required for this component\n this.state = {\n id: localStorage.getItem(\"id\"),\n eventDetailsStatus: false,\n toggle: false,\n eligible: this.props.item.eligibility,\n cname: this.props.item.companyId.name,\n companyId: this.props.item.companyId,\n eventId: this.props.item._id,\n response: \"\",\n resume: \"\",\n }\n\n this.changeEventDetailsStatus = this.changeEventDetailsStatus.bind(this)\n this.changeDisplay = this.changeDisplay.bind(this)\n this.changeHandler = this.changeHandler.bind(this)\n this.registerEvent = this.registerEvent.bind(this)\n }", "constructor(props) {\n super(props);\n this.classes = [];\n\n // let edit = props.children.find(element=>element.type==='edit');\n let workshop = props.children.find(element=>element.type==='workshop');\n\n let elements = cloneDeep(\n (props.children || [])\n .filter(element=> !['edit','workshop'].includes(element.type) )\n );\n\n this.state = {\n title: props.title,\n data: {elements},\n discussion: props.discussion || [],\n workshop: workshop || {},\n };\n\n // Inheriting display functions from a subclass takes priority over props\n ;[\n 'on_drag_end',\n 'display', 'edit_display', 'exercise_display', 'workshop_display',\n ]\n .forEach(fn=>{\n this[fn] = this[fn] || this.props[fn] || this['default_'+fn];\n this[fn] = this[fn] && this[fn].bind(this);\n });\n\n this.options = new Set(['Edit','Discuss']);\n\n if (workshop) {\n this.options.add('Workshop');\n }\n }", "constructor(props) {\n super(props);\n\n this.savedFields = this.initFields();\n this.savedFields['title'] = '%';\n this.state.mode = 'search';\n this.state.fields = this.getSavedFields();\n this.state.editable = true;\n }", "constructor() {\n super();\n this.state = {\n personTodo: semTodo, \n // task: '',\n // id: '',\n // completed: '', \n newTask: '' \n };\n }", "constructor() {\n super();\n this.state = {\n todo: '',\n items: [],\n key: 0,\n };\n\n this.onChange = this.onChange.bind(this);\n this.onSubmit = this.onSubmit.bind(this);\n this.saveEdit = this.saveEdit.bind(this);\n this.deleteItem = this.deleteItem.bind(this);\n }", "constructor(props) {\n super(props)\n this.state = {\n //this will render an array of dynamic data the will list the number of notes in our app\n //let's set the notes as an empty array to make it dynamic\n notes: []\n }\n //we have to always bind this\n this.add = this.add.bind(this)\n this.eachNote = this.eachNote.bind(this)\n this.update = this.update.bind(this)\n this.remove = this.remove.bind(this)\n this.nextId = this.nextId.bind(this)\n }", "constructor(props) {\n super(props);\n const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });\n const initialEditMode = false;\n\n this.state = {\n editMode: initialEditMode,\n dataSource: ds.cloneWithRows(this.getActivitiesForDataSource(this.props.activities, initialEditMode)),\n };\n }", "componentDidMount(){\n if(this.state.mode === 'edit'){\n fetch(this.state.url).then(response => response.json()).then(post => {\n this.setState({title: post.title});\n this.setState({author: post.author});\n this.setState({text: post.text});\n this.setState({points: post.points});\n this.setState({comments: post.comments});\n });\n }\n }", "constructor(props) {\n super(props); \n this.state = {\n /* id:1,\n title:\"ARE\",\n txt:\"Bla Bla bla\",\n content_id:1\n */} \n }", "componentWillMount() {\n this.setState({ product: this.props.product, editButtonClicked: this.props.editButtonClicked });\n }", "handleUpdate(evt) {\n evt.preventDefault();\n this.setState({ isEditing: false });\n // props here - like delete!\n this.props.editTodo(this.state.editTodoText, this.props.id);\n }", "constructor(props) {\n super(props);\n this.state = {\n title: \"\",\n body: \"\",\n image: null\n };\n this.handleTitleChange = this.handleTitleChange.bind(this);\n this.handleBodyChange = this.handleBodyChange.bind(this);\n this.handleImageChange = this.handleImageChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "constructor(props){\n super(props);\n this.state ={\n sTitle : '',\n sImg : '' ,\n sDesc : '',\n showModel : false\n };\n }", "render() {\n console.log(`Homepage.render`);\n const { articles, apiError } = this.state;//distruct this.state.articles\n return (\n <Container text>\n <div className=\"ui pointing menu\">\n <div className=\"right menu\">\n <div className=\"item\">\n <div className=\"ui transparent icon input\">\n <SearchBar searchWord={this.searchWord}></SearchBar>\n <i className=\"search link icon\"></i>\n </div>\n </div>\n </div>\n </div>\n\n {articles && <NewsList articles={articles} />}\n {apiError && <p>{this.state.apiError}</p>}\n </Container>\n\n );\n }", "constructor(props) {\n super(props);\n this.state = {\n title: '',\n body: ''\n };\n }", "constructor(props) {\n super(props);\n this.state = {\n description: \"\",\n debtorId: undefined,\n amount: 0\n };\n this.used = false;\n }", "render() {\n return ( \n <article className=\"posts-card\">\n <PostHeader title={this.props.details.title}/>\n <PostBody text={this.props.details.text}/>\n </article>\n )\n }", "constructor( props ) {\n super( props );\n this.state = { sections: null, tag: null };\n this.changeTag = this.changeTag.bind( this );\n }", "constructor(props) {\n super(props);\n this.state = {navObj: null};\n this.state = {dynamicContent: null};\n }", "renderArticles() {\r\n return this.state.articles.map(article => (\r\n <Panel\r\n article={article}\r\n key={article._id}\r\n getArticles={this.getArticles}\r\n />\r\n ));\r\n }", "render(){\n let addNews=\"\"\n if(this.state.addNews === true){\n addNews = <AddEditNews\n handleFieldChange={this.handleFieldChange}\n editNews={this.state.editNews}closeModal={this.closeModal}\n addNews={this.state.addNews} editArticleChanges={this.editArticleChanges} addNewArticle={this.addNewArticle}\n articleName={this.state.articleName} about={this.state.about} articleImage={this.state.articleImage} url={this.state.url} articleId={this.state.articleId} warningMessage={this.state.warningMessage} warningMessageAbout={this.state.warningMessageAbout} warningMessageImg={this.state.warningMessageImg} warningMessageURL={this.state.warningMessageURL}/>\n }\n return(\n <React.Fragment>\n <section className=\"container\">\n <div className=\"field is-grouped is-grouped-centered\">\n <h2 className=\"is-size-4\"><strong>News &nbsp;</strong></h2>\n <button className=\"button is-link\" onClick={()=>{\n this.addNewsClick()\n }}>+</button>\n </div>\n <div className=\"columns is-multiline\">\n <News showNews={this.state.showNews} showNewsClick={this.showNewsClick}\n addNews={this.state.addNews} handleFieldChange={this.handleFieldChange}\n news={this.state.news} editNews={this.state.editNews} articleName={this.state.articleName} about={this.state.about} articleImage={this.state.articleImage} url={this.state.url} closeModal={this.closeModal} editNewsClick={this.editNewsClick} editArticleChanges={this.editArticleChanges} addNewArticle ={this.addNewArticle} articleId={this.state.articleId} deleteArticle={this.deleteArticle} deleteNewsClick={this.deleteNewsClick} deleteNews={this.state.deleteNews} warningMessage={this.state.warningMessage} warningMessageAbout={this.state.warningMessageAbout} warningMessageImg={this.state.warningMessageImg} warningMessageURL={this.state.warningMessageURL} currentUserId={this.state.currentUserId} userId={this.state.userId} friends={this.props.friends} filteredFriends={this.state.filteredFriends}/>\n </div>\n </section>\n {addNews}\n </React.Fragment>\n )\n }", "constructor(props) {\n super(props);\n // 2)\n this.state = {\n title: 'Pulp fiction in cinema.',\n body: 'some text'\n }\n }", "constructor(props) {\n //Super permet d'appeler et/ou acceder a des fonctions definie dans l'objet parent\n super(props);\n //Etat = données initial de l'application\n this.state = {\n items:[],\n text: ''\n }\n\n }", "onSubmit(e) {\n //prevents the page from sending as soon as it's loaded\n e.preventDefault();\n //sends an alert when the edit article button is clicked with the title of the article that was updated\n alert(\"Article Updated:\" + this.state.Title + \" \");\n //our const editArticle which allows us to call the title,author,text,image and id from our server.js\n const editArticle = {\n title: this.state.Title,\n author: this.state.Author,\n text: this.state.Text,\n image: this.state.Image,\n _id: this.state._id\n }\n //axios.put that calls api/article and the unique id and the editArticle const\n axios.put('http://localhost:4000/api/articles/' + this.state._id, editArticle,)\n .then(res => {\n console.log(res.data)\n })\n .catch((err => {\n console.log(err);\n }))\n }", "constructor(props){\n super(props);\n this.state = {edit:false, text:this.props.text,tmp:this.props.text};\n if(this.props.active=='y')\n this.state.edit=true;\n }", "constructor() {\n super();\n this.state = {\n results: null,\n error: null\n };\n this.fetchLatestArticles = this.fetchLatestArticles.bind(this);\n }", "constructor() {\n //Call the constrictor of Super class i.e The Component\n super();\n this.state= {\n profile_details: [],\n student_or_faculty:'',\n student_id:'',\n faculty_id:'',\n redirectToEdit:false\n }\n }", "constructor(props){\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\tcomments: this.props.comments\n\t\t}\n\t}", "handleEdit(e) {\n e.preventDefault();\n {this.props.editBlog(e, this.state, this.state.id)}\n }", "constructor() {\n super();\n this.state = {\n todoList: stuffTodo,\n newItem: \"\"\n }\n }", "getNewsArticles() {\n this.setState({\n newsArticles: ArticlesStore.getArticles(),\n });\n }", "constructor(props){\n //We are going to create state data for our component. To do that we need to create a construtor method. This method will get called when an object is created using this class. Said another way, this methos will be called when the component is initialized.\n \n //To ensure that we have all the necessary features from React to create a stateful component, wwe need to call the super() method.\n //This super() calls the constructor for the component class in React\n super(props);\n this.state = {\n userName: \"Mikeo\",\n todoItems: [\n {action: \"Do Homework\", done: false},\n {action: \"Go to Dance Practice\", done: false},\n {action: \"Pay Bills\", done: true},\n {action: \"Play Super Smash Bros\", done: false},\n {action: \"Fix Headlights\", done: false},\n {action: \"Apply For Jobs\", done: false}\n ]\n }\n\n //below is end of constructor\n }", "constructor(props) {\n super(props);\n\n // Initialize state (set initial/default value to each obj inside state)\n this.state = {\n isLoading: true,\n expenses: [],\n categories: [],\n total: 0,\n item: this.emptyItem\n };\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleChangeCategory = this.handleChangeCategory.bind(this);\n }", "constructor(props) {\n super(props);\n \n this.state= {\n cardLogo : '',\n pairName : '',\n pairPrice : '',\n small_txt : ''\n }\n if(props.title) this.state={\n title : props.title,\n cardLogo : props.cardLogo,\n pairName : props.pairName,\n pairPrice : props.pairPrice\n }\n }", "constructor(){\n super();\n this.state={\n posts: [{\n id: \"0\",\n description: \"beautiful landscape\",\n imageLink: \"https://image.jimcdn.com/app/cms/image/transf/none/path/sa6549607c78f5c11/image/i4eeacaa2dbf12d6d/version/1490299332/most-beautiful-landscapes-in-europe-lofoten-european-best-destinations-copyright-iakov-kalinin.jpg\" +\n \"3919321_1443393332_n.jpg\"\n }, {\n id: \"1\",\n description: \"Aliens\",\n imageLink: \"https://img.purch.com/rc/640x415/aHR0cDovL3d3dy5zcGFjZS5jb20vaW1hZ2VzL2kvMDAwLzA3Mi84NTEvb3JpZ2luYWwvc3BhY2V4LWlyaWRpdW00LWxhdW5jaC10YXJpcS1tYWxpay5qcGc=\" +\n \"08323785_735653395_n.jpg\"\n }, {\n id: \"2\",\n description: \"On a vacation!\",\n imageLink: \"https://fm.cnbc.com/applications/cnbc.com/resources/img/editorial/2017/08/24/104670887-VacationExplainsTHUMBWEB.1910x1000.jpg\"\n }],\n };\n\n /* this bind function is useful because the value of this is `undefined` when\n * its used in another function which gets called from some other component\n * e.g. when removePhoto function below is called from another component then\n * this will point to undefined and in our case we cannot make use of this.setState\n * unless we stay in the current context of component\n */\n\n this.removePhoto = this.removePhoto.bind(this);\n }", "constructor(props){\n // the super method below allows us to call the constructor of the parent class of this class\n super(props);\n \n // the state here is where we hold properties that we want to record in this component \n this.state = {\n term: ''\n }\n }", "publish () {\n const { editorState, articleTitle } = this.state\n const json = editorStateToJSON(editorState)\n const html = stateToHTML(editorState.getCurrentContent(), this.editorOpts)\n const parsedJson = JSON.parse(json)\n\n\n // save the article\n saveArticle2(articleTitle, parsedJson, html)\n\n // clear the editor state\n // TODO: saveArticle2 should return a promise\n // and we should clear the state only if\n // the save was successful\n this.setState({\n editorState: editorStateFromRaw(null),\n articleTitle: '',\n })\n }", "function ArticlesList(props) {\n return (\n <div className={styles.wrapper}>\n <h2>Hello</h2>\n <ul>\n {props.articles.map((article) => {\n \n return (\n <li key={article.article_id}>\n <p>\n {\" \"}\n <Link to={`/articles/${article.article_id}`}>\n {article.title}{\" \"}\n </Link>\n </p>\n <p>Author: {article.author}</p>\n <p>Number of comments: {article.comment_count}</p>\n <div>\n <VoteButton\n votes={article.votes}\n cardType=\"articles\"\n id={article.article_id}\n />\n </div>\n <p>\n Created on:{\" \"}\n {new Date(article.created_at).toString().slice(0, 16)}{\" \"}\n </p>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}", "constructor() {\n super();\n this.state = {\n title: null\n };\n\n this.writeNewPost = this.writeNewPost.bind(this);\n }", "constructor(props){\n super()\n //state attribute should be called body, value should be props\n this.state = {body: props.body}\n }" ]
[ "0.69546324", "0.6915817", "0.68562263", "0.6641745", "0.6608698", "0.6594315", "0.65392333", "0.6391952", "0.63841134", "0.635811", "0.63385904", "0.6327693", "0.63176423", "0.6313578", "0.62447524", "0.6243676", "0.61990654", "0.6197271", "0.6187437", "0.6154973", "0.614267", "0.6132955", "0.6131307", "0.60994834", "0.60951096", "0.6085885", "0.6084514", "0.608439", "0.6076119", "0.6066293", "0.6061887", "0.6049255", "0.6043184", "0.60395414", "0.60246634", "0.6016151", "0.60109663", "0.6010658", "0.60033506", "0.59828424", "0.59726477", "0.59626937", "0.59277797", "0.59270287", "0.5917114", "0.59155613", "0.5908879", "0.587523", "0.58658624", "0.58313024", "0.5824057", "0.5817693", "0.5817633", "0.58157045", "0.58023053", "0.57945347", "0.57860994", "0.5784654", "0.5771045", "0.5764167", "0.5757805", "0.57506263", "0.57454246", "0.5737896", "0.57353014", "0.5728637", "0.5727581", "0.5727409", "0.5726773", "0.572478", "0.57243955", "0.57207847", "0.5712635", "0.57080555", "0.5703787", "0.5699653", "0.5697565", "0.569415", "0.5693492", "0.5692242", "0.56844753", "0.5684335", "0.56812894", "0.56743205", "0.56727564", "0.56659544", "0.5658351", "0.56564826", "0.5656421", "0.56554246", "0.5653373", "0.56484777", "0.564541", "0.5642733", "0.5636157", "0.5630115", "0.5629305", "0.5623079", "0.5618418", "0.5615123" ]
0.6073866
29
todo: Create JSON schema and validate object against schema
function validatePointsObject(pointsObject) { var valid = true; valid &= pointsObject['point1'] != null && pointsObject['point2'] != null; // first check parent nodes if (!valid) return false; valid &= !isNaN(pointsObject['point1']['lat']) && !isNaN(pointsObject['point1']['lng']); valid &= !isNaN(pointsObject['point2']['lat']) && !isNaN(pointsObject['point2']['lng']); return valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get jsonSchema() {\n return {\n type: \"object\",\n required: [\n \"user_id\",\n \"verified_by\",\n \"hospital\",\n \"address\",\n \"specialization\",\n \"license_number\",\n \"gender\",\n \"alt_email\",\n \"alt_phone\",\n ],\n\n properties: {\n id: { type: \"integer\" },\n user_id: { type: \"integer\" },\n verified_by: { type: \"integer\" },\n hospital: { type: \"string\", minLength: 1, maxLength: 255 },\n address: { type: \"string\", minLength: 1, maxLength: 255 },\n specialization: { type: \"string\", minLength: 1, maxLength: 255 },\n license_number: { type: \"string\", minLength: 1, maxLength: 255 },\n gender: { type: \"string\", minLength: 1, maxLength: 255 },\n alt_email: { type: \"string\", minLength: 3, maxLength: 255 },\n alt_phone: { type: \"string\", minLength: 11, maxLength: 11 },\n },\n };\n }", "static get jsonSchema () {\n return {\n type: 'object',\n required: ['name']\n };\n }", "static get jsonSchema(){\n return {\n type: \"object\",\n required: [\"state_name\", \"country_id\"],\n properties: {\n id: { type: \"integer\" },\n state_name: { type:\"string\", minLength: 1, maxLength: 255},\n country_id: { type: \"integer\" }\n }\n }\n }", "checkStructure(jsonSchema) {\n const { res } = this;\n\n if (jsonSchema.isJoi) {\n const error = Joi.validate(res.data, jsonSchema).error;\n\n assert.isTrue(error === null, error && error.message);\n } else {\n const ajv = new Ajv({ schemaId: 'auto' });\n ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));\n\n const validate = ajv.validate(jsonSchema, res.data);\n\n assert.isTrue(validate, ajv.errorsText());\n }\n\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: ['name'],\n properties: {\n id: { type: 'string' },\n\n name: { type: 'string'},\n total_posts: { type: 'integer'},\n is_verified: {type: 'boolean'},\n is_blocked: {type: 'boolean'},\n\n },\n }\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: ['amenity_id'],\n\n properties: {\n amenity_id: { type: 'string' },\n has_weights: { type: 'string', minLength: 3, maxLength: 31 },\n location: { type: 'string', minLength: 5, maxLength: 31 },\n },\n };\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: ['firstName', 'lastName'],\n\n properties: {\n id: { type: 'integer' },\n\n // default length of string type in knex is 255\n firstName: { type: 'string', minLength: 1, maxLength: 255 },\n lastName: { type: 'string', minLength: 1, maxLength: 255 }\n }\n };\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: [],\n\n properties: {\n room_id: { type: 'string' },\n price: { type: 'number' },\n max_guests: { type: 'number'},\n bed_type: {type: 'string', enum: [\"Twin\", \"Queen\", \"King\", \"Single\"]},\n availability: {type: 'boolean'},\n pets_allowed: {type: 'boolean'},\n },\n };\n }", "static async isValidObject (object) {\n return Station.validator.validate('station.schema.json', object);\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: ['chatId'],\n\n properties: {\n id: {type: 'integer'},\n chatId: {type: 'integer'},\n isAvailable: {type: 'boolean'},\n isActive: {type: 'boolean'}\n }\n };\n }", "static get jsonSchema() {\n return {\n type: 'object',\n required: ['username', 'pwHash'],\n properties: {\n username: {type: 'string'},\n firstName: {type: 'string'},\n lastName: {type: 'string'},\n email: {type: 'string'},\n isLocalResident: {type: 'string'},\n isVerified: {type: 'boolean'},\n isEmailVerified: {type: 'boolean'},\n pwHash:{ type: 'string'},\n pwSalt: {type: 'string'},\n pwAlgorithm: {type: 'string'},\n isAdmin: {type: 'boolean'},\n dateRegistered: {type: 'number', minimum: 0, maximum: UNIX_EPOCH_MAX},\n lastLogin: {type: 'number', minimum: 0, maximum: UNIX_EPOCH_MAX},\n }\n };\n }", "function checkValidJSONFields(payload) {\n const { rule, data } = payload;\n\n // checks if rule value is not an object.\n if (!(_checkType(rule, 'Object'))) {\n\n // returns error - object. \n return {\n error: {\n msg: 'rule should be an object.',\n data: null\n }\n }\n }\n \n // checks if data value is not a|an Object | Array | String.\n if (!(_checkType(data, 'Object')) && !(_checkType(data, 'Array')) && !(_checkType(data, 'String'))) {\n\n // returns error - object.\n return {\n error: {\n msg: 'data should be a|an (object|array|string).',\n data: null\n }\n }\n }\n// returns value - payload - object.\n return {\n value: payload\n }\n}", "parseJSONSchema(json) {\r\n let type = json[\"@type\"];\r\n let i = type.indexOf(\"#\");\r\n if (i > 0)\r\n type = type.substring(0, i);\r\n let obj = this.createType(type);\r\n obj.parse(json);\r\n return obj;\r\n }", "static get jsonSchema() {\n return {\n type: \"object\",\n required: [\"user_id\", \"post_id\"],\n\n properties: {\n like_id: { type: \"integer\" },\n\n user_id: { type: \"integer\" },\n post_id: { type: \"integer\" },\n },\n };\n }", "function validate(obj, schema) {\n if (schema instanceof RegExp) {\n\tif ((obj + \"\").match(schema)) {\n\t return false;\n\t} else {\n\t return \"RegExp failed: \" + schema;\n\t}\n }\n\n if (typeof schema === 'function') {\n\ttry {\n\t return schema(obj);\n\t} catch (e) {\n\t return \"Predicate failed: \" + e;\n\t}\n }\n\n if (obj === schema) {\n\treturn false;\n }\n\n if (typeof obj !== typeof schema) {\n\treturn \"Type mismatch: expected typeof to be \" + (typeof schema);\n }\n\n if (typeof schema !== 'object') {\n\treturn \"Value mismatch: expected \" + schema;\n }\n\n // Recursive structural equivalence.\n var key;\n\n if (!(schema.hasOwnProperty(\"_extensible\") && schema._extensible)) {\n\t// Ensure there's nothing in the object that the schema doesn't have.\n\tvar oKeys = {};\n\tfor (key in obj) {\n\t if (obj.hasOwnProperty(key)) {\n\t\toKeys[key] = 1;\n\t }\n\t}\n\tfor (key in schema) {\n\t if (!special_property(key) && schema.hasOwnProperty(key)) {\n\t\tdelete oKeys[key];\n\t }\n\t}\n\n\tvar aKeys = [];\n\tfor (key in oKeys) {\n\t aKeys.push(key);\n\t}\n\tif (aKeys.length) {\n\t return \"Unexpected properties: \" + aKeys.join(\", \");\n\t}\n }\n\n var haveResult = false;\n var result = {};\n var intermediate;\n\n for (key in schema) {\n\tif (!special_property(key) && schema.hasOwnProperty(key)) {\n\t intermediate = validate(obj[key], schema[key]);\n\t if (intermediate) {\n\t\tresult[key] = intermediate;\n\t\thaveResult = true;\n\t }\n\t}\n }\n\n return haveResult ? result : false;\n}", "function json_validate(scheme, data) {\n for(var x in scheme)\n if(data[x] == undefined) {\n console.log('Validation fail! Missing', x);\n return false;\n }\n\n return true;\n}", "function looksLikeJsonObject(input){return typeof input==='object'&&input!==null&&!(input instanceof Array)&&!(input instanceof Date)&&!(input instanceof Timestamp)&&!(input instanceof GeoPoint)&&!(input instanceof Blob)&&!(input instanceof DocumentKeyReference)&&!(input instanceof FieldValueImpl);}", "validateObj() {\n if (!this.isValid) {\n return;\n }\n\n for (const key in this._data) {\n const item = this._data[key];\n\n this._validateItem(item, key);\n }\n }", "function JSONSchema() {\n _.extend(this,\n {\n title: String,\n type: String,\n format: String,\n default: this,\n description: String,\n enum: [String],\n minimum: String,\n maximum: String,\n exclusiveMinimum: String,\n exclusiveMaximum: String,\n multipleOf: String,\n maxLength: String,\n minLength: String,\n pattern: String,\n not: String,\n definitions: {\n '.': this\n },\n\n // array specific keys\n items: [this],\n minItems: String,\n maxItems: String,\n uniqueItems: String,\n additionalItems: [this],\n\n // object\n maxProperties: String,\n minProperties: String,\n required: String,\n additionalProperties: String,\n allOf: [this],\n properties: {\n\n // property name\n '.': this\n }\n }\n );\n }", "function validateJSON(rawdata) {\n try {\n let validJSONObj = JSON.parse(rawdata);\n if(validJSONObj && typeof validJSONObj === 'object') {\n return validJSONObj;\n }\n } catch(err) {\n console.log(err);\n return false;\n }\n}", "dynamic() {\n\t\tconst dynamicSchema = Object.keys(this.schema)\n\t\t\t.filter(key => this.field.includes(key))\n\t\t\t.reduce((obj, key) => {\n\t\t\t\tobj[key] = this.schema[key];\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\t\t\t\n\t\tconst validate = Joi.object(dynamicSchema).validateAsync(this.fields);\n\t\treturn validate.then(() => {\n\t\t\treturn response({valid: true});\n\t\t}).catch(error => {\n\t\t\treturn response({invalid: true, message: joiError(error.toString())});\n\t\t})\n\t}", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n\n es_rule.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "isJSON(obj) {\r\n if (typeof (obj) == \"object\") {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }", "function validateObjects(movie){\n const schema = Joi.object({\n title: Joi.string().min(5).max(100).required(),\n genre: Joi.object({\n _id: Joi.objectId(),\n name: Joi.string()\n }),\n numberInStock: Joi.number().min(0).required(),\n dailyRentalRate: Joi.number().min(0).required()\n });\n return schema.validate(movie);\n}", "function checkJSONPayload(payload) {\n\n /**\n * checks if payload is a valid JSON Object.\n * checks if payload contains more than the required fields.\n */\n \n if (!(_checkType(payload, 'Object')) || !(Object.keys(payload).length <= 2)) {\n \n // returns error - object.\n return {\n error: {\n msg: \"Invalid JSON payload passed.\",\n data: null\n }\n }\n }\n\n // returns value - payload - object.// returns value - payload - object.\n return {\n value: payload\n };\n}", "function isJsonSchemaDraft4 (obj) {\n expect(obj).to.be.an(\"object\");\n expect(obj).to.include.keys(\"id\", \"$schema\", \"properties\", \"definitions\");\n expect(obj).not.to.have.any.keys(exports);\n return true;\n }", "function validateJSON(body) {\n try {\n var data = JSON.parse(body);\n // if came to here, then valid\n return data;\n } catch(e) {\n // failed to parse\n return null;\n }\n}", "function validate(schema,obj){\n if (obj === undefined || !schema) return;\n var corr = schema.bind(obj)\n if (!corr.validate) return;\n var ret\n corr.once('error', function(err){ \n ret = err; \n });\n corr.validate();\n return ret;\n}", "function validate({ path, obj, sch, parent = null }) {\n //console.log(\"validate\", obj, sch);\n let m;\n let type = null;\n let optional = false;\n if (sch.match(/^[\\!\\?]/)) {\n sch = sch.substr(1);\n optional = true;\n }\n\n if (optional && (obj === undefined || obj === null)) return true;\n\n // if lookup, validate further\n if ((m = sch.match(/^[0-9]+$/))) return validate({ path: `${path}`, obj, sch: lookups[sch * 1], parent: parent });\n\n // if validator verify it now\n if (sch.match(/^[a-zA-Z0-9_]*$/)) {\n if (obj === undefined || obj === null) {\n errors.push(`${path}: is required`);\n return false;\n }\n\n if (sch === \"\") return true; // no validation needed\n\n // given a validator. we verify above so should never throw this\n if (!validators[sch]) throw `${sch} : Validator specified in JSON schema not found`;\n else if (validators[sch](obj, { path, json, parent })) return true;\n else {\n errors.push(`${path}: validation failed`);\n return false;\n }\n }\n\n if ((m = sch.match(/^\\[(.*)\\]$/))) {\n if (!_.isArray(obj)) {\n errors.push(`${path}: should be array`);\n return false;\n }\n type = \"array\";\n sch = m[1];\n } else if ((m = sch.match(/^\\{(.*)\\}$/))) {\n if (!_.isObject(obj) || _.isArray(obj)) {\n errors.push(`${path}: should be object`);\n return false;\n }\n type = \"object\";\n sch = m[1];\n }\n\n // This should never happen as well\n if (!type) throw `${path}: Invalid type in Lookup`;\n\n // if array, validate for all\n if (type === \"array\") {\n let sch_parts = sch.split(\",\");\n for (let i in obj)\n validate({ path: `${path}.${i}`, obj: obj[i], sch: sch_parts[i % sch_parts.length], parent: obj });\n }\n\n if (type === \"object\" && sch !== \"\") {\n let keys = sch.split(\",\").reduce((acc, value) => {\n let [k, v] = value.split(\":\");\n if (!v) v = \"\";\n acc[k] = v;\n return acc;\n }, {});\n\n // if object, validate for all k-v\n for (let k in keys) validate({ path: `${path}.${k}`, obj: obj[k], sch: keys[k], parent: obj });\n }\n }", "function object_object(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (Object(util[\"e\" /* isEmptyValue */])(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value !== undefined) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "function validateFieldsDeep(rxJsonSchema) {\n var primaryPath = (0, _rxSchemaHelper.getPrimaryFieldOfPrimaryKey)(rxJsonSchema.primaryKey);\n function checkField(fieldName, schemaObj, path) {\n if (typeof fieldName === 'string' && typeof schemaObj === 'object' && !Array.isArray(schemaObj)) checkFieldNameRegex(fieldName);\n\n // 'item' only allowed it type=='array'\n if (schemaObj.hasOwnProperty('item') && schemaObj.type !== 'array') {\n throw (0, _rxError.newRxError)('SC2', {\n fieldName\n });\n }\n\n /**\n * required fields cannot be set via 'required: true',\n * but must be set via required: []\n */\n if (schemaObj.hasOwnProperty('required') && typeof schemaObj.required === 'boolean') {\n throw (0, _rxError.newRxError)('SC24', {\n fieldName\n });\n }\n\n // if ref given, must be type=='string', type=='array' with string-items or type==['string','null']\n if (schemaObj.hasOwnProperty('ref')) {\n if (Array.isArray(schemaObj.type)) {\n if (schemaObj.type.length > 2 || !schemaObj.type.includes('string') || !schemaObj.type.includes('null')) {\n throw (0, _rxError.newRxError)('SC4', {\n fieldName\n });\n }\n } else {\n switch (schemaObj.type) {\n case 'string':\n break;\n case 'array':\n if (!schemaObj.items || !schemaObj.items.type || schemaObj.items.type !== 'string') {\n throw (0, _rxError.newRxError)('SC3', {\n fieldName\n });\n }\n break;\n default:\n throw (0, _rxError.newRxError)('SC4', {\n fieldName\n });\n }\n }\n }\n var isNested = path.split('.').length >= 2;\n\n // nested only\n if (isNested) {\n if (schemaObj.primary) {\n throw (0, _rxError.newRxError)('SC6', {\n path,\n primary: schemaObj.primary\n });\n }\n if (schemaObj.default) {\n throw (0, _rxError.newRxError)('SC7', {\n path\n });\n }\n }\n\n // first level\n if (!isNested) {\n // if _id is used, it must be primaryKey\n if (fieldName === '_id' && primaryPath !== '_id') {\n throw (0, _rxError.newRxError)('COL2', {\n fieldName\n });\n }\n\n // check underscore fields\n if (fieldName.charAt(0) === '_') {\n if (\n // exceptional allow underscore on these fields.\n fieldName === '_id' || fieldName === '_deleted') {\n return;\n }\n throw (0, _rxError.newRxError)('SC8', {\n fieldName\n });\n }\n }\n }\n function traverse(currentObj, currentPath) {\n if (!currentObj || typeof currentObj !== 'object') {\n return;\n }\n Object.keys(currentObj).forEach(attributeName => {\n var schemaObj = currentObj[attributeName];\n if (!currentObj.properties && schemaObj && typeof schemaObj === 'object' && !Array.isArray(currentObj)) {\n checkField(attributeName, schemaObj, currentPath);\n }\n var nextPath = currentPath;\n if (attributeName !== 'properties') nextPath = nextPath + '.' + attributeName;\n traverse(schemaObj, nextPath);\n });\n }\n traverse(rxJsonSchema, '');\n return true;\n}", "function rule_json(value, fields, name)\n {\n if(empty_string(value)) {\n return true;\n }\n try {\n JSON.parse(value);\n } catch (e) {\n return false;\n }\n return true;\n }", "convertSchemaToAjvFormat (schema) {\n if (schema === null) return\n\n if (schema.type === 'string') {\n schema.fjs_type = 'string'\n schema.type = ['string', 'object']\n } else if (\n Array.isArray(schema.type) &&\n schema.type.includes('string') &&\n !schema.type.includes('object')\n ) {\n schema.fjs_type = 'string'\n schema.type.push('object')\n }\n for (const property in schema) {\n if (typeof schema[property] === 'object') {\n this.convertSchemaToAjvFormat(schema[property])\n }\n }\n }", "validate(obj) {\n return {\n pass: true,\n errors: {}\n };\n }", "function valid(schema, object) {\n\t\ttry {\n\t\t\tcheck(schema, object);\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t}", "parseJSONSchema(json) {\n let type = json[\"@type\"];\n let i = type.indexOf(\"://\");\n if (i > 0)\n type = type.substring(i + 3);\n i = type.indexOf(\"#\");\n if (i > 0)\n type = type.substring(0, i);\n switch (type) {\n case \"action-descriptor\":\n case \"https://\":\n return new ActionDescriptor(json);\n case \"realm-descriptor\":\n case \"https://realm...\":\n return new RealmDescriptor(json);\n case \"controller-descriptor\":\n case \"https://realm...\":\n return new RealmDescriptor(json);\n }\n throw new Error(\"unknown schema type: \" + type);\n }", "validate (data) {\n Joi.assert(data, Joi.object().keys({\n screenName: Joi.string().required()\n }).required())\n }", "function validate(jsonData, eventsOnly) {\n\n json = jsonData;\n var v = new validator();\n\n var segmentRequired;\n var segMinItems;\n if (eventsOnly) {\n segmentRequired = false;\n segMinItems = 0;\n } else {\n segmentRequired = true;\n segMinItems = 1;\n }\n // instance\n var schema = {\n 'id': '/schema',\n 'type': 'object',\n 'properties': {\n 'base_path': {'type': 'string', 'required': true},\n 'image_path': {'type': 'string', 'required': true},\n 'event_path': {'type': 'string', 'required': true},\n 'output_path': {'type': 'string', 'required': true},\n 'segment': {\n 'type': 'array',\n 'items': {'$ref': '/segment'},\n 'required': segmentRequired,\n 'minItems': segMinItems\n },\n 'event': {'type': 'array', 'items': {'$ref': '/event'}}\n }\n };\n\n // segment\n var segmentSchema = {\n 'id': '/segment',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'net': {'type': 'string', 'required': true},\n 'ovswitch': {'type': 'string', 'required': true},\n 'pnode': {'type': 'array', 'items': {'type': 'string'}, 'required': true, 'minItems': 1},\n 'host': {'type': 'array', 'items': {'$ref': '/host'}, 'required': false, 'minItems': 0},\n 'gateway': {'type': 'array', 'items': {'$ref': '/gateway'}},\n 'phydev': {'type': 'array', 'items': {'$ref': '/phydev'}, 'required': false}\n }\n };\n\n // phydev\n var phydevSchema = {\n 'id': '/phydev',\n 'type': 'object',\n 'properties': {\n 'pnode': {'type': 'string', 'required': true},\n 'dev': {'type': 'string', 'required': true}\n }\n };\n\n // host\n var hostSchema = {\n 'id': '/host',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'ip': {'type': 'array', 'items': {'type': 'string'}, 'required': true, 'minItems': 1},\n 'gw': {'type': 'string'},\n 'ns': {'type': 'array', 'items': {'type': 'string'}, 'required': false, 'maxItems': 2},\n 'os': {'type': 'string', 'required': true},\n 'architecture': {'type': 'string', 'required': true},\n 'major patch': {'type': 'string', 'required': true},\n 'memory': {'type': 'string', 'required': true},\n 'keymap': {'type': 'string'},\n 'pnode': {'type': 'string'},\n 'service': {'type': 'array', 'items': {'$ref': '/service'}},\n 'event': {'type': {'$ref': '/event'}}\n }\n };\n\n // gateway\n var gatewaySchema = {\n 'id': '/gateway',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'ipin': {'type': 'string', 'required': true},\n 'ipout': {'type': 'string', 'required': true},\n 'ns': {'type': 'array', 'items': {'type': 'string'}, 'maxItems': 2},\n 'os': {'type': 'string', 'required': true},\n 'architecture': {'type': 'string', 'required': true},\n 'major patch': {'type': 'string', 'required': true},\n 'memory': {'type': 'string', 'required': true},\n 'keymap': {'type': 'string'},\n 'pnode': {'type': 'string'},\n 'service': {'type': 'array', 'items': {'$ref': '/service'}},\n 'iptables': {'type': 'array', 'items': {'$ref': '/iptable'}}\n }\n };\n\n\n // service\n var serviceSchema = {\n 'id': '/service',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'serviceconf': {\n 'type': 'array',\n 'items': {'type': 'object'}\n }\n }\n };\n\n\n var iptableSchema = {\n 'id': '/iptable,',\n 'type': 'object',\n 'properties': {\n 'inport': {'type': 'integer', 'required': true},\n 'outport': {'type': 'integer', 'required': true},\n 'dst': {'type': 'string', 'required': true}\n }\n };\n\n var eventSchema = {\n 'id': '/event,',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'executor': {'type': 'string'},\n 'destination': {'type': 'string'},\n 'description': {'type': 'string'},\n 'time': {'type': 'array', 'items': {'type': 'string'}},\n 'absoluteTime': {'type': 'array', 'items': {'type': 'string'}},\n 'src': {'type': 'string', 'required': true},\n 'action': {'type': 'array', 'items': {'$ref': '/service'}, 'minItems': 1}\n }\n };\n\n var actionSchema = {\n 'id': '/action,',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'version': {'type': 'string'},\n 'score': {'type': 'array', 'items': {'$ref': '/score'}},\n 'command': {'type': 'string'}\n }\n };\n\n var scoreSchema = {\n 'id': '/score,',\n 'type': 'object',\n 'properties': {\n 'label': {'type': 'string', 'required': true},\n 'command': {'type': 'string', 'required': true},\n 'condition': {'type': 'string', 'required': true},\n 'team': {'type': 'array', 'items': {'type': 'string'}, 'minItems': 1},\n 'weight': {'type': 'integer', 'required': true}\n }\n };\n\n\n v.addSchema(segmentSchema, '/segment');\n v.addSchema(hostSchema, '/host');\n v.addSchema(gatewaySchema, '/gateway');\n v.addSchema(serviceSchema, '/service');\n v.addSchema(iptableSchema, '/iptable');\n v.addSchema(eventSchema, '/event');\n v.addSchema(actionSchema, '/action');\n v.addSchema(scoreSchema, '/score');\n v.addSchema(phydevSchema, '/phydev');\n\n // perform jsonschema validation\n var result = v.validate(json, schema);\n\n if (!result.valid) {\n var str = 'configuration file is not valid:\\n';\n result.errors.forEach(function (error) {\n str = str + error + '\\n';\n });\n console.error(str);\n return false;\n }\n\n // run additional validation\n\n if (utilities.isNullOrEmpty(json.base_path)) {\n console.error('base_path must not be null or empty');\n return false;\n }\n\n if (utilities.isNullOrEmpty(json.image_path)) {\n console.error('image_path must not be null or empty');\n return false;\n }\n\n if (utilities.isNullOrEmpty(json.event_path)) {\n console.error('event_path must not be null or empty');\n return false;\n }\n\n if (utilities.isNullOrEmpty(json.output_path)) {\n console.error('output_path must not be null or empty');\n return false;\n }\n\n\n var status = true;\n if (json.hasOwnProperty('segment')) {\n json.segment.every(function (segment) {\n\n if (!validateSegment(segment)) {\n status = false;\n }\n return status;\n });\n }\n\n if (!status) {\n return status;\n }\n\n //host.label, gateway.label must be unique\n if (!labelsUnique()) {\n return false;\n }\n\n // validate ip addresses\n if (!validateIpAddresses()) {\n return false;\n }\n\n if (json.hasOwnProperty('event')) {\n json.event.every(function (event) {\n if (!validateEvent(event)) {\n status = false;\n return false;\n }\n })\n }\n return status;\n}", "function looksLikeJsonObject(input) {\n return typeof input === 'object' && input !== null && !(input instanceof Array) && !(input instanceof Date) && !(input instanceof Timestamp) && !(input instanceof GeoPoint) && !(input instanceof Blob) && !(input instanceof DocumentKeyReference) && !(input instanceof FieldValueImpl);\n }", "function checkRequiredJSONFields(payload) {\n\n const requiredFields = ['rule', 'data'];\n\n for (field of requiredFields) {\n\n // checks if any of the required fields does not exist.\n if (payload[field] === undefined) {\n\n // returns error - object.\n return {\n error: {\n msg: `${field} is required.`,\n data: null\n }\n }\n }\n }\n\n // returns value - payload - object.\n return {\n value: payload\n }\n}", "function isValidJSON( value ){\n\t if( value === null ){\n\t return true;\n\t }\n\t\n\t switch( typeof value ){\n\t case 'number' :\n\t case 'string' :\n\t case 'boolean' :\n\t return true;\n\t\n\t case 'object':\n\t var proto = Object.getPrototypeOf( value );\n\t\n\t if( proto === Object.prototype || proto === Array.prototype ){\n\t return _.every( value, isValidJSON );\n\t }\n\t }\n\t\n\t return false;\n\t}", "get convertedSchema() {\n let schema = {\n $schema: \"http://json-schema.org/schema#\",\n title: this.label,\n type: \"object\",\n required: [],\n properties: this.fieldsToSchema(this.fields),\n };\n return schema;\n }", "function validate_document(data, logger) {\n var instance_json = JSON.parse(data);\n var type = instance_json._type;\n if (type) {\n var url = type_url_map[type];\n if (url) {\n var schema = url_schema_map[url];\n if (schema) {\n var errors = schema.validate(instance_json).errors;\n if (errors.length) {\n logger.error(JSON.stringify(errors));\n }\n }\n else {\n logger.error(\"No schema for \" + url);\n }\n }\n else {\n logger.error(\"No URL for \" + type);\n }\n }\n else {\n logger.error(\"No _type for \" + data);\n }\n }", "function test(schema, ob) {\n\ttry {\n\t\tconst errors = schema.validate(ob);\n\t\tif (errors) {\n\t\t\terrors.forEach(err => {\n\t\t\t\tconsole.log(err);\n\t\t\t});\n\t\t}\n\t} catch (err) {\n\t\tconsole.log(err);\n\t}\n}", "function validate_and_copy_passedJSON(JSON_Obj)\n{\n var err_list = []; //this will keep all the error messages\n //Empty template of a JSON object\n var Impersonating_JSON_Obj = {\n \"trueName\":null,\n \"impersonatingName\":null,\n };\n\n //check passed in JSON fields have correct data types\n if(typeof JSON_Obj.trueName != 'string')\n err_list.push(\"True Name is not String type\");\n else\n Impersonating_JSON_Obj.trueName = JSON_Obj.trueName;\n\n if(typeof JSON_Obj.impersonatingName != 'string')\n err_list.push(\"Name is not String type\");\n else\n Impersonating_JSON_Obj.impersonatingName = JSON_Obj.impersonatingName;\n \n if(err_list.length == 0)\n return Impersonating_JSON_Obj;\n else\n return null;\n}", "function validate(obj) {\r\n function search(arr, comp) {\r\n var pass = false;\r\n if (typeof comp != \"string\")\r\n return pass;\r\n __sco.each(arr, function (ix, val) {\r\n if (!pass)\r\n pass = typeof val == \"string\" && val.toUpperCase() == comp.toUpperCase();\r\n });\r\n return pass;\r\n }\r\n function objectvalidate(thisobj) {\r\n try {\r\n var parsed = __sco.tryparse(thisobj.data);\r\n if (__sco.type(thisobj.data) == \"string\" && __sco.type(parsed) == \"object\" && __sco.type(parsed.args) == \"array\" && __sco.type(parsed.func) == \"string\" && __sco.type(parsed.guid) == \"array\") {\r\n return true;\r\n }\r\n return false;\r\n }\r\n catch (ex) {\r\n return false;\r\n }\r\n }\r\n // If the server is down, returns null referrers; do not allow storage\r\n if (scobj.referrers == null) {\r\n store.cookies = false;\r\n store.local = false;\r\n return true;\r\n }\r\n else if (scobj.referrers.indexOf(obj.origin) > -1 && search(__sco.tryparse(obj.data).guid, scobj.guid))\r\n return true;\r\n else {\r\n if (typeof scobj.debug == \"boolean\" && scobj.debug && objectvalidate(obj))\r\n __sco.error(\"FAILED VALIDATION : ORIGIN : \" + obj.origin + \" ARGS : \" + (__sco.type(obj) !== \"string\" ? JSON.stringify(obj.data) : obj.data));\r\n return false;\r\n }\r\n }", "function looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Blob) &&\r\n !(input instanceof DocumentKeyReference) &&\r\n !(input instanceof FieldValueImpl));\r\n}", "function looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Blob) &&\r\n !(input instanceof DocumentKeyReference) &&\r\n !(input instanceof FieldValueImpl));\r\n}", "function looksLikeJsonObject(input) {\r\n return (typeof input === 'object' &&\r\n input !== null &&\r\n !(input instanceof Array) &&\r\n !(input instanceof Date) &&\r\n !(input instanceof Timestamp) &&\r\n !(input instanceof GeoPoint) &&\r\n !(input instanceof Blob) &&\r\n !(input instanceof DocumentKeyReference) &&\r\n !(input instanceof FieldValueImpl));\r\n}", "function valid_schema(schema) {\n\t\tif (typeof schema !== \"object\") {\n\t\t\tvar help = \"\";\n\t\t\tif (typeof schema == \"function\") help = \" It is a function, did you forget to use new?\"\n\t\t\tthrow new Error(\"schema '\" + schema + \"' is not an object.\" + help);\n\t\t}\n\n\t\tif (schema.__proto__['_schema_valid']) return schema;\n\n\t\tschema.__proto__['_schema_checking'] = true;\n\n\t\tfor (var field in schema) {\n\t\t\tif (field.indexOf('_schema_') === 0) continue;\n\n\t\t\t// Make sure a qualifier is set.\n\t\t\tif (schema[field].qualifier != \"required\" &&\n\t\t\t\t\tschema[field].qualifier != \"optional\" &&\n\t\t\t\t\tschema[field].qualifier != \"repeated\")\n\t\t\t\tthrow new Error(\"Invalid qualifier '\" + schema[field].qualifier + \"' on field '\" + field + \"'\");\n\n\t\t\t// Check the type of the field.\n\n\t\t\tif (isPrimitive(schema[field].type)) {\n\t\t\t\t// Primitive fields cannot go wrong.\n\t\t\t\t; // Nothing to do.\n\t\t\t} else {\n\t\t\t\t// Fields that are schemas have to be recursively. We watch out for loops!\n\t\t\t\tif (schema[field].type['_schema_checking']) {\n\t\t\t\t\tif (schema[field].qualifier == \"required\") {\n\t\t\t\t\t\tthrow new Error(\"required fields can not be used recursively (think about it, it makes sense)\");\n\t\t\t\t\t}\n\t\t\t\t\tschema_log(\"loop detected, already checked\");\n\t\t\t\t} else {\n\t\t\t\t\tvalid_schema(schema[field].type);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tschema.__proto__['_schema_checked'] = true;\n\t\tdelete schema.__proto__['_schema_valid'];\n\n\t\treturn schema;\n\t}", "function looksLikeJsonObject(input) {\n return typeof input === 'object' && input !== null && !(input instanceof Array) && !(input instanceof Date) && !(input instanceof Timestamp) && !(input instanceof GeoPoint) && !(input instanceof Blob) && !(input instanceof DocumentKeyReference) && !(input instanceof FieldValueImpl);\n}", "validateDatapoint(schema, datapoint) {\n return this.sameJSONStructure(schema, datapoint);\n }", "function isValidData(obj) {\n return Object.keys(obj).includes('id') && obj.id &&\n Object.keys(obj).includes('title') && obj.title;\n}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\r\n\t\t\t\t\tvar value = instance[i];\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}", "function isValidGeoJson(jsonObj){\n if(jsonObj.type){\n if(jsonObj.type==\"FeatureCollection\"){\n if(jsonObj.hasOwnProperty(\"features\")){\n for(var i=0;i<jsonObj.features.length;i++){\n if(!isValidGeoJson(jsonObj.features[i])){\n return false;\n }\n }\n return true;\n }\n }\n else if(jsonObj.type == \"Feature\"){\n if(jsonObj.hasOwnProperty(\"geometry\")&&jsonObj.hasOwnProperty(\"properties\")){\n if(!isValidGeoJsonGeometry(jsonObj.geometry)){\n return false;\n }\n return true;\n }\n }\n else{\n return isValidGeoJsonGeometry(jsonObj)\n }\n }\n return false;\n}", "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof GeoPoint) &&\n !(input instanceof Blob) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof FieldValueImpl));\n}", "function validate(json_control_data) {\n if( typeof json_control_data !== 'object' )\n return new Error('Not a JSON object, was: ' + typeof json_control_data);\n\n return json_control_data;\n}", "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof Timestamp) &&\n !(input instanceof GeoPoint) &&\n !(input instanceof Blob) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof FieldValueImpl));\n}", "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof Timestamp) &&\n !(input instanceof GeoPoint) &&\n !(input instanceof Blob) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof FieldValueImpl));\n}", "function checkObj(instance,objTypeDef,path,additionalProp){\n\n\t\tif(typeof objTypeDef =='object'){\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i in objTypeDef){ \n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\n\t\t\t\t\tvar value = instance[i];\n\t\t\t\t\t// skip _not_ specified properties\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\n\t\t\t\t\tvar propDef = objTypeDef[i];\n\t\t\t\t\t// set default\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\n\t\t\t\t\t}\n\t\t\t\t\tif(options.coerce && i in instance){\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\n\t\t\t\t\t}\n\t\t\t\t\tcheckProp(value,propDef,path,i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i in instance){\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\n\t\t\t\tif (options.filter) {\n\t\t\t\t\tdelete instance[i];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\n\t\t\tif(requires && !(requires in instance)){\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\n\t\t\t}\n\t\t\tvalue = instance[i];\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\n\t\t\t\tif(options.coerce){\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\n\t\t\t\t}\n\t\t\t\tcheckProp(value,additionalProp,path,i);\n\t\t\t}\n\t\t\tif(!_changing && value && value.$schema){\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\n\t\t\t}\n\t\t}\n\t\treturn errors;\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\n\n\t\tif(typeof objTypeDef =='object'){\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i in objTypeDef){ \n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\n\t\t\t\t\tvar value = instance[i];\n\t\t\t\t\t// skip _not_ specified properties\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\n\t\t\t\t\tvar propDef = objTypeDef[i];\n\t\t\t\t\t// set default\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\n\t\t\t\t\t}\n\t\t\t\t\tif(options.coerce && i in instance){\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\n\t\t\t\t\t}\n\t\t\t\t\tcheckProp(value,propDef,path,i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i in instance){\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\n\t\t\t\tif (options.filter) {\n\t\t\t\t\tdelete instance[i];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\n\t\t\tif(requires && !(requires in instance)){\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\n\t\t\t}\n\t\t\tvalue = instance[i];\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\n\t\t\t\tif(options.coerce){\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\n\t\t\t\t}\n\t\t\t\tcheckProp(value,additionalProp,path,i);\n\t\t\t}\n\t\t\tif(!_changing && value && value.$schema){\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\n\t\t\t}\n\t\t}\n\t\treturn errors;\n\t}", "function checkObj(instance,objTypeDef,path,additionalProp){\n\n\t\tif(typeof objTypeDef =='object'){\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i in objTypeDef){ \n\t\t\t\tif(objTypeDef.hasOwnProperty(i)){\n\t\t\t\t\tvar value = instance[i];\n\t\t\t\t\t// skip _not_ specified properties\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\n\t\t\t\t\tvar propDef = objTypeDef[i];\n\t\t\t\t\t// set default\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\n\t\t\t\t\t}\n\t\t\t\t\tif(options.coerce && i in instance){\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\n\t\t\t\t\t}\n\t\t\t\t\tcheckProp(value,propDef,path,i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i in instance){\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\n\t\t\t\tif (options.filter) {\n\t\t\t\t\tdelete instance[i];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\n\t\t\tif(requires && !(requires in instance)){\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\n\t\t\t}\n\t\t\tvalue = instance[i];\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\n\t\t\t\tif(options.coerce){\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\n\t\t\t\t}\n\t\t\t\tcheckProp(value,additionalProp,path,i);\n\t\t\t}\n\t\t\tif(!_changing && value && value.$schema){\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\n\t\t\t}\n\t\t}\n\t\treturn errors;\n\t}", "function cleanJSON(obj) {\n for (var p in obj) {\n if (p === '__proto__')\n\tdelete obj[p];\n else if (typeof obj[p] === 'object') {\n\tcleanJSON(obj[p]);\n }\n }\n }", "function parseSchemaObject(obj) {\n\t\tvar keys = Object.keys(obj);\n\t\tvar tests = [];\n\n\t\t// parse specials out from the keys\n\t\tkeys.forEach(function(k){\n\t\t\tvar specials = parseSpecial(k);\n\n\t\t\t// no specials were found in the key, so we interpret as matching the value of the key\n\t\t\tif (specials.length === 0) {\n\t\t\t\ttests.push(makeTest('BOUND', makePredicatePair(is(k), parser(obj[k])), 1, 1));\n\t\t\t}\n\n\t\t\t// is the key optional? I.e. `'(name)'`\n\t\t\tvar optional = specials.reduce(function(acc,v){ return acc || v.name === 'OPTIONAL'}, false);\n\t\t\t// is the key a `*`?\n\t\t\tvar star = specials.reduce(function(acc,v){ return acc || v.name === 'STAR'}, false);\n\t\t\t// is the key a `**`?\n\t\t\tvar star_star = specials.reduce(function(acc,v){ return acc || v.name === 'STAR_STAR'}, false);\n\n\t\t\tif (star) {\n\t\t\t\t// * matches exactly one key/value pair\n\t\t\t\tvar cost = 1;\n\t\t\t\t// (*) matches 0 or 1, so the `cost` of the test is 0, but the df of the test is still 1\n\t\t\t\tif(optional) { cost = 0; }\n\t\t\t\ttests.push(makeTest('FREE', makePredicatePair(isAnything, parser(obj[k])), 1, cost));\n\t\t\t}\n\n\t\t\tif (star_star) {\n\t\t\t\t// ** matches at least 1 key/value pair\n\t\t\t\tvar cost = 1;\n\t\t\t\t// an optional test doesn't cost anything\n\t\t\t\tif(optional) {cost = 0; }\n\t\t\t\t// since ** consumes all matches, its degrees of freedom is `Infinity`\n\t\t\t\ttests.push(makeTest('FREE', makePredicatePair(isAnything, parser(obj[k])), Infinity, cost));\n\t\t\t}\n\n\t\t\t// lastly, the case for optional values `'(name)'` with no specials\n\t\t\tif(optional && !(star||star_star)) {\n\t\t\t\t// the value inside of the parens => `name` in our example\n\t\t\t\tvar testVal = specials[0].result;\n\t\t\t\t// the cost is 0, the df is 1, and we use is(testVal) to match on the value inside the parens\n\t\t\t\ttests.push(makeTest('BOUND', makePredicatePair(is(testVal), parser(obj[k])), 1, 0));\n\t\t\t}\n\n\t\t});\n\n\t\t// return the parser built out from the schema\n\t\treturn function op(o) {\n\t\t\treturn evalObject(o, tests);\n\t\t};\n\t}", "function checkObject(errors, style, obj) {\n for (const key of Object.keys(obj)) {\n const expected = recase(key, style);\n\n if (key !== expected) {\n errors.push({\n property: key,\n expected\n });\n }\n\n if (obj[key] instanceof Array) {\n checkArray(errors, style, obj[key]);\n } else if (obj[key] instanceof Object) {\n checkObject(errors, style, obj[key]);\n }\n }\n}", "validate(object, ignore, cb){\n //Object if valid\n let result = {\n result: true,\n object: {\n valid: true,\n messages: []\n },\n message: \"Object is valid\"\n }\n \n //this variable will be filled in the check loop\n let uniqueFields = [];\n\n //Check if fields are filled, need to be filled and are the right type\n for(let key in this.model){\n let property = this.model[key];\n let required = property.required != null ? property.required : false;\n let unique = property.unique != null ? property.unique : false;\n let type = (property.type != null ? property.type : \"string\").toLowerCase();\n let minLength = property[\"min-length\"] != null ? property[\"min-length\"] : 0;\n let maxLength = property[\"max-length\"] != null ? property[\"max-length\"] : Number.MAX_SAFE_INTEGER;\n \n //push into unique fields array for the unique check\n if(unique) uniqueFields.push(key);\n\n //other checks\n if(required && object[key] == null) result.object.messages.push(key + \" is required\");\n if(object[key] != null){\n if(typeof(object[key]) !== type) result.object.messages.push(key + \" must be a \" + type);\n let objectLength = null\n \n if(type == \"number\")\n objectLength = object[key];\n else if(type == \"string\")\n objectLength = object[key].length;\n\n if(objectLength != null){ \n if(minLength > objectLength) result.object.messages.push(\"minimum length for \" + key + \" is \" + minLength); \n if(maxLength < objectLength) result.object.messages.push(\"maximum length for \" + key + \" is \" + minLength); \n if(property.length != null && property.length != objectLength) result.object.messages.push(\"the length of \" + key + \"must be \" + property.length);\n }\n }\n }\n //the unique check\n this.read(function(readResult){\n for(let recordIndex = 0; recordIndex < readResult.object.length; recordIndex++){\n let record = readResult.object[recordIndex];\n if(ignore.indexOf(record.id) < 0){\n for(let i = 0; i < uniqueFields.length; i++){\n if(record[uniqueFields[i]] == object[uniqueFields[i]]){\n result.object.messages.push(uniqueFields[i] + \": \"+ object[uniqueFields[i]] +\" is already in use\");\n }\n }\n }\n }\n if(result.object.messages.length > 0){\n result.object.valid = false;\n result.message = \"Object is not valid\";\n }\n cb(result);\n });\n }", "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_14__geo_point__[\"a\" /* GeoPoint */]) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_11__blob__[\"b\" /* Blob */]) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_13__field_value__[\"c\" /* FieldValueImpl */]));\n}", "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_14__geo_point__[\"a\" /* GeoPoint */]) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_11__blob__[\"b\" /* Blob */]) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_13__field_value__[\"c\" /* FieldValueImpl */]));\n}", "function validateSchema(fileName, object, schema) {\n const v = new Validator();\n const validationErrors = v.validate(object, schema).errors;\n if (validationErrors.length) {\n console.error(colors.red('\\nError - Schema validation:'));\n console.error(' ' + colors.yellow(fileName + ': '));\n validationErrors.forEach(e => {\n if (e.property) {\n console.error(' ' + colors.yellow(e.property + ' ' + e.message));\n } else {\n console.error(' ' + colors.yellow(e));\n }\n });\n console.error();\n process.exit(1);\n }\n}", "function looksLikeJsonObject(input) {\n return (typeof input === 'object' &&\n input !== null &&\n !(input instanceof Array) &&\n !(input instanceof Date) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_14__geo_point__[\"a\" /* GeoPoint */]) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_11__blob__[\"a\" /* Blob */]) &&\n !(input instanceof DocumentKeyReference) &&\n !(input instanceof __WEBPACK_IMPORTED_MODULE_13__field_value__[\"b\" /* FieldValueImpl */]));\n}", "function checkObj(instance,objTypeDef,path,additionalProp){\n\t\n\t\tif(typeof objTypeDef =='object'){\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i in objTypeDef){ \n\t\t\t\tif(objTypeDef.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_')){\n\t\t\t\t\tvar value = instance[i];\n\t\t\t\t\tvar propDef = objTypeDef[i];\n\t\t\t\t\tcheckProp(value,propDef,path,i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(i in instance){\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\n\t\t\t\terrors.push({property:path,message:(typeof value) + \"The property \" + i +\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\n\t\t\t}\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\n\t\t\tif(requires && !(requires in instance)){\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\n\t\t\t}\n\t\t\tvalue = instance[i];\n\t\t\tif(objTypeDef && typeof objTypeDef == 'object' && !(i in objTypeDef)){\n\t\t\t\tcheckProp(value,additionalProp,path,i); \n\t\t\t}\n\t\t\tif(!_changing && value && value.$schema){\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\n\t\t\t}\n\t\t}\n\t\treturn errors;\n\t}", "function createBodySchemas(item) {\n let results = {\n type: \"object\",\n properties: {}\n }\n let body = JSON.parse(item.body.text)\n for (let x in body) {\n if (typeof body[x] !== \"object\") {\n results.properties[x] = {\n type: typeof body[x]\n }\n }\n }\n return results\n}", "validate(schema, options) {\n schema.forEach(field => {\n // Infinite recursion prevention\n const key = `${options.type}:${options.subtype}.${field.name}`;\n if (!self.validatedSchemas[key]) {\n self.validatedSchemas[key] = true;\n self.validateField(field, options);\n }\n });\n }", "_validate (schema){\n return SwaggerParser.validate(schema);\n }", "function validateNode(obj) {\n const result = {};\n if (!('id' in obj)) {\n throw new Error('id field missing in node element');\n }\n if (typeof obj.id !== 'string') {\n throw new Error(`node.id field: expected string, got ${typeof obj.id}`);\n }\n result.id = obj.id;\n if (!('cluster' in obj)) {\n throw new Error('cluster field missing in node element');\n }\n if (typeof obj.cluster !== 'string') {\n throw new Error(`node.cluster field: expected string, got ${typeof obj.cluster}`);\n }\n result.cluster = obj.cluster;\n if (!('locality' in obj)) {\n throw new Error('locality field missing in node element');\n }\n result.locality = {};\n if ('region' in obj.locality) {\n if (typeof obj.locality.region !== 'string') {\n throw new Error(`node.locality.region field: expected string, got ${typeof obj.locality\n .region}`);\n }\n result.locality.region = obj.locality.region;\n }\n if ('zone' in obj.locality) {\n if (typeof obj.locality.region !== 'string') {\n throw new Error(`node.locality.zone field: expected string, got ${typeof obj.locality\n .zone}`);\n }\n result.locality.zone = obj.locality.zone;\n }\n if ('sub_zone' in obj.locality) {\n if (typeof obj.locality.sub_zone !== 'string') {\n throw new Error(`node.locality.sub_zone field: expected string, got ${typeof obj\n .locality.sub_zone}`);\n }\n result.locality.sub_zone = obj.locality.sub_zone;\n }\n if ('metadata' in obj) {\n result.metadata = getStructFromJson(obj.metadata);\n }\n return result;\n}", "function check(schema, object) {\n\n\t\tfor (var field in schema) {\n\n\t\t\t// Skip fields we use internally.\n\t\t\tif (field.indexOf('_schema_') === 0) continue;\n\n\t\t\t// Handle the different qualifiers.\n\t\t\tswitch (schema[field].qualifier) {\n\n\t\t\t\tcase \"required\":\n\t\t\t\t\tif (object[field] === undefined || object[field] === null)\n\t\t\t\t\t\tthrow new Error(\"required field '\" + field + \"' is \" + object[field]);\n\t\t\t\t\tif (isPrimitive(schema[field].type)) {\n\t\t\t\t\t\t// Check primitive field's type.\n\t\t\t\t\t\tif (typeof object[field] !== schema[field].type)\n\t\t\t\t\t\t\tthrow primitiveTypeMismatchError(\"required\", field, object[field], schema[field].type);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Schema field: check structure recursively.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcheck(schema[field].type, object[field]);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthrow new Error(\"required field '\" + field + \"' substructure mismatch: { \" + e + \" }\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"optional\":\n\t\t\t\t\tif (object[field] === undefined || object[field] === null) {\n\t\t\t\t\t\t// Field is is optional and not present, all right, continue.\n\t\t\t\t\t\t; // Nothing to do.\n\t\t\t\t\t// Field is optional and present.\n\t\t\t\t\t} else if (isPrimitive(schema[field].type)) {\n\t\t\t\t\t\t// Check primitive field's type.\n\t\t\t\t\t\tif (typeof object[field] !== schema[field].type)\n\t\t\t\t\t\t\tthrow primitiveTypeMismatchError(\"optional\", field, object[field], schema[field].type);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Schema field: check structure recursively.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcheck(schema[field].type, object[field]);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\tthrow new Error(\"optional field '\" + field + \"' substructure mismatch: { \" + e + \" }\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"repeated\":\n\t\t\t\t\t// Object check: only allow arrays.\n\t\t\t\t\tif (object[field] === undefined || object[field] === null)\n\t\t\t\t\t\tthrow new Error(\"repeated field '\" + field + \"' is '\" + object[field] + \"'\");\n\t\t\t\t\tif (object[field].__proto__ !== [].__proto__)\n\t\t\t\t\t\tthrow new Error(\"repeated field '\" + field + \"' is not an array: '\" + object[field] + \"'\");\n\n\t\t\t\t\t// Is it an array of primitives or objects?\n\t\t\t\t\tif (isPrimitive(schema[field].type)) {\n\t\t\t\t\t\tfor (var index in object[field]) {\n\t\t\t\t\t\t\t// Check if the array entry has that primitive type\n\t\t\t\t\t\t\tif (typeof object[field][index] !== schema[field].type)\n\t\t\t\t\t\t\t\tthrow primitiveTypeMismatchError(\"repeated\", field, object[field], schema[field].type);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (var index in object[field]) {\n\t\t\t\t\t\t\t// Repeated schema field: check recursively if the array entry matches the subschema\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tcheck(schema[field].type, object[field][index]);\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\tthrow new Error(\"repeated field '\" + field + \"' substructure mismatch: { \" + e + \" }\");\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\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// If switch did not match, we got a bad input (but this impossible due to the `valid_schema()` check).\n\t\t\t\t\tthrow new Error(\"jsschema: Illegal state: No qualifier matched\");\n\t\t\t}\n\t\t}\n\n\t\treturn object;\n\t}", "validate (){\n const that = this;\n return this\n ._validate(this.swaggerInput)\n .then((dereferencedSchema) => {\n that.swaggerObject = dereferencedSchema;\n return that;\n });\n }", "function matches_schema(schema, obj, ignore) {\n if (ignore === void 0) { ignore = '*'; }\n for (var el in schema) {\n if (schema[el] instanceof Object) {\n if (!(obj instanceof Object))\n return false;\n if (!matches_schema(schema[el], obj[el], ignore))\n return false;\n }\n if (!(schema instanceof Array)) {\n if (!obj.hasOwnProperty(el)) {\n return false;\n }\n }\n if (schema[el] === ignore)\n return true;\n if (!(schema[el] instanceof Object) && schema[el] !== obj[el])\n return false;\n }\n return true;\n}", "function checkTypes(object) {\n if (!object || typeof object !== 'object')\n throw new Error(\"Invalid package. It must be an object\");\n function checkDefinition(key, value, def, obj, parent) {\n if (def === undefined)\n throw new Error(\"Non existing field '\" + key + \"' specified\");\n switch (def.type) {\n case \"int\":\n if (def.enum) {\n if (value.constructor.isEnumItem)\n obj[key] = value = value.value;\n if (!isNaN(value))\n obj[key] = value = parseInt(value, 10);\n if (typeof value !== 'number' || isNaN(value)) {\n var tempValue = def.enum.get(value);\n if (tempValue === undefined)\n throw new Error(\"Invalid value '\" + value + \"' in field '\" + key + \"'\");\n obj[key] = value = tempValue.value;\n }\n if (!def.enum.get(value) || def.enum.get(value).value !== value)\n throw new Error(\"Invalid value '\" + value + \"' in field '\" + key + \"'\");\n }\n else {\n if (!isNaN(value))\n obj[key] = value = parseInt(value, 10);\n if (typeof value !== 'number' || isNaN(value))\n throw new Error(\"Expected int (got '\" + value + \"') in field '\" + key + \"'\");\n }\n break;\n case \"double\":\n if (!isNaN(value))\n obj[key] = value = Number(value);\n if (typeof value !== 'number' || isNaN(value))\n throw new Error(\"Expected double (got '\" + value + \"') in field '\" + key + \"'\");\n break;\n case \"list\":\n if (!Array.isArray(value))\n throw new Error(\"Expected array (got '\" + value + \"') in field '\" + key + \"'\");\n for (var i = 0; i < value.length; i++)\n checkDefinition(i, value[i], def.items, value, key);\n break;\n case \"string\":\n obj[key] = value = String(value);\n break;\n case \"any\":\n if (!isNaN(value))\n obj[key] = value = Number(value);\n else\n obj[key] = value = String(value);\n break;\n case \"object\":\n //Check field by field\n for (var innerKey in def.value) {\n if (value[innerKey] === undefined)\n throw new Error(\"Missing key '\" + innerKey + \"' in '\" + parent + \"'\");\n checkDefinition(innerKey, value[innerKey], def.value[innerKey], value, key);\n }\n break;\n\n default:\n throw new Error(\"Invalid type ('\" + def.type + \") of field \" + key);\n }\n }\n for (var key in object)\n checkDefinition(key, object[key], FIELDS_DEFINITION[key], object, 'package');\n}", "function _initSchema() {\n if (!ajvSchema) {\n ajvSchema = ajv_min({ allErrors: true });\n ajvSchema.addSchema(schemaJson, \"_\");\n ajvValidators = {};\n }\n }", "function validate(res){\n try {\n JSON.parse(JSON.stringify(require('./extracted/article.json')));\n JSON.parse(JSON.stringify(require('./extracted/metadata.json')));\n }\n catch (err){\n apiReply(res, {\n message: 'failure! Corrupt json recieved: ' + err,\n });\n return false;\n }\n return true;\n}", "function validateItem(body, res, callback) {\n var $RefParser = require('json-schema-ref-parser');\n fs.readFile('schemas/' + body.refCatalogueSchemaRelease + '/' + body.refCatalogueSchema, 'utf8', function(error, data) {\n if (error == null) {\n var fileData = JSON.parse(data);\n var traverse = require('json-schema-traverse');\n traverse(fileData, {allKeys: true}, function(schema, JSONPointer) {\n if (schema.$ref) {\n if (schema.$ref[0] !== '#') {\n var temp = 'schemas/' + body.refCatalogueSchemaRelease + '/' + schema.$ref;\n schema.$ref = temp;\n }\n }\n });\n $RefParser.dereference(fileData, function(errDeref, postSchema) {\n if (errDeref) {\n res.send(500);\n console.log(errDeref);\n } else {\n var valid = ajv.validate(postSchema, body);\n if (!valid) {\n res.send(400, ajv.errors); // bad request\n } else {\n callback();\n }\n }\n });\n } else {\n res.send(500, error);\n console.log(error);\n }\n });\n}", "isJson(value) {\n try {\n return typeof JSON.parse(value) === \"object\";\n } catch (e) {\n return false;\n }\n }", "static fromJSON(schema, json) {\n if (!json)\n throw new RangeError(\"Invalid input for Mark.fromJSON\");\n let type = schema.marks[json.type];\n if (!type)\n throw new RangeError(`There is no mark type ${json.type} in this schema`);\n return type.create(json.attrs);\n }", "_itemConformsToSchema(item, schema) {\n for(let prop in schema) {\n if (!item.hasOwnProperty(prop)) {\n return false;\n }\n if(typeof schema[prop] === 'object') {\n return this._itemConformsToSchema(item[prop], schema[prop]);\n } else {\n if (typeof item[prop] !== schema[prop]) {\n return false;\n }\n }\n }\n return true;\n }", "loadFromObject(obj, filename = null) {\n var _a;\n const validate = this.getSchemaValidator();\n if (!validate(obj)) {\n throw new SchemaValidationError(filename, `Element metadata is not valid`, obj, this.schema, \n /* istanbul ignore next: AJV sets .errors when validate returns false */\n (_a = validate.errors) !== null && _a !== void 0 ? _a : []);\n }\n for (const [key, value] of Object.entries(obj)) {\n if (key === \"$schema\")\n continue;\n this.addEntry(key, migrateElement(value));\n }\n }" ]
[ "0.73966765", "0.72902364", "0.72122175", "0.70063823", "0.6875793", "0.68678474", "0.67872113", "0.66434723", "0.66413265", "0.66275895", "0.6581166", "0.65784395", "0.65448296", "0.6533849", "0.6437929", "0.6401585", "0.6399698", "0.6354862", "0.63491166", "0.62535924", "0.62441576", "0.623878", "0.6232617", "0.6232617", "0.6232617", "0.6232617", "0.6232617", "0.62049896", "0.61853284", "0.617958", "0.6178089", "0.6166621", "0.615242", "0.6150121", "0.6136869", "0.608967", "0.60565263", "0.604674", "0.60297984", "0.6025395", "0.60152316", "0.5999298", "0.59841275", "0.5964807", "0.5954123", "0.59541214", "0.5951904", "0.59474975", "0.5942783", "0.59221745", "0.5918548", "0.59014356", "0.59014356", "0.59014356", "0.5901304", "0.5889774", "0.58889484", "0.58512354", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58497", "0.58444214", "0.58399564", "0.5828751", "0.5825802", "0.5825802", "0.5823652", "0.5823652", "0.5823652", "0.5822266", "0.57970023", "0.5795437", "0.57671696", "0.5759048", "0.5759048", "0.5758167", "0.5757819", "0.5755006", "0.5753252", "0.57480067", "0.5745661", "0.5737233", "0.5730841", "0.57224554", "0.57036364", "0.5683574", "0.56818664", "0.5675821", "0.566993", "0.5656883", "0.5647354", "0.5646961", "0.563116" ]
0.0
-1
write all the rows in the given array
function writeToDrive(oauth2Client){ var data=queue; //SPREADSHEET: 1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI var sheets = google.sheets('v4'); var request = { spreadsheetId: '1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI', //TODO it should be dynamic and created as needed when data grows range: 'Sheet1', includeValuesInResponse: 'true', valueInputOption: 'USER_ENTERED', insertDataOption: 'INSERT_ROWS', resource:{ "values": data }, auth: oauth2Client }; // sheets.spreadsheets.values.get({spreadsheetId: '1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI', // range: 'Sheet1',auth: oauth2Client}, function(err, response){ // if (err) { // console.error(err); // return; // } // } // ); console.log("%s Writing %s rows to Google drives",new Date().toISOString(),data.length); sheets.spreadsheets.values.append(request, function(err, response) { if (err) { console.error(err); return; } queue=queue.slice(data.length,queue.length); console.log("%s remaining rows in the queue:%s",new Date().toISOString(),queue.length); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printGrid(arr) {\n for (var j = 0; j < arr[0].length; j++) {\n var rowStr = \"\";\n for (var i = 0; i < arr.length; i++) {\n rowStr += arr[i][j];\n }\n fs.appendFile(\"./grid.txt\", rowStr + \"\\n\", (err) => {\n if (err) {\n console.log(err);\n }\n });\n }\n}", "serializeTableRows(writer, rows) {\n if (rows.length > 0) {\n for (let i = 0; i < rows.length; i++) {\n let row = rows[i];\n if (row.cells.length > 0) {\n this.serializeRow(writer, row);\n }\n }\n }\n }", "async write(sharedId, rowArray) {\n\n // log out data before trying insert // e.g. [monitoring.dev_pms] id: TEST-09, 1 rows\n log.data(this.dataset, this.table, sharedId, rowArray);\n \n // [start trace] -------------------------------\n const sp = log.SPAN.createChildSpan({ name: `${log.enums.methods.bqInsertRows}` });\n\n\n // write to bq\n await rowArray.forEach(row => { // rowArray = [{\"pms_id\":\"PMS-01-002\",\"pack_id\":\"0248\",\"pack\":{\"volts\":51.262,\"amps\":-0.625,\"watts\":-32.039,\"vcl\":3.654,\"vch\":3.676,\"dock\":4,\"temp_top\":35,\"temp_mid\":33,\"temp_bottom\":34},\"cell\":[{\"volts\":3.661,\"dvcl\":7,\"open\":false},{\"volts\":3.666,\"dvcl\":12,\"open\":false},{\"volts\":3.654,\"dvcl\":0,\"open\":false},{\"volts\":3.676,\"dvcl\":22,\"open\":false},{\"volts\":3.658,\"dvcl\":4,\"open\":false},{\"volts\":3.662,\"dvcl\":8,\"open\":false},{\"volts\":3.66,\"dvcl\":6,\"open\":false},{\"volts\":3.659,\"dvcl\":5,\"open\":false},{\"volts\":3.658,\"dvcl\":4,\"open\":false},{\"volts\":3.657,\"dvcl\":3,\"open\":false},{\"volts\":3.656,\"dvcl\":2,\"open\":false},{\"volts\":3.665,\"dvcl\":11,\"open\":true},{\"volts\":3.669,\"dvcl\":15,\"open\":false},{\"volts\":3.661,\"dvcl\":7,\"open\":false}],\"fet_in\":{\"open\":true,\"temp\":34.1},\"fet_out\":{\"open\":false,\"temp\":32.2},\"status\":{\"bus_connect\":true},\"sys\":{\"source\":\"S000\"},\"time_event\":\"2019-02-09 08:00:17.0200\",\"time_zone\":\"+07:00\",\"time_processing\":\"2019-09-08 05:00:48.9830\"}]\n this.storageObj\n .dataset(this.dataset)\n .table(this.table)\n .insert(row)\n .catch(e => log.error(`${log.enums.methods.bqInsertRows} Error [${this.dataset}.${this.table}]`, e))\n });\n\n \n // [end trace] ---------------------------------\n sp.endSpan();\n\n }", "function writeMultipleRows() {\n var data = getOrdersData();\n var lastRow = SpreadsheetApp.getActiveSheet().getLastRow();\n SpreadsheetApp.getActiveSheet().getRange(lastRow + 1,1,data.length, data[0].length).setValues(data);\n}", "function write(array, stream) {\n array = array.slice()\n function next() {\n while(array.length)\n if(stream.write(array.shift()) === false)\n return stream.once('drain', next)\n \n stream.end()\n }\n\n next()\n}", "function _putArrayToIndexedDB(array, callback) {\n var x = 0;\n if(array.length == 0) {\n callback();\n return;\n }\n function loopArray(array) {\n _putToIndexedDB(array[x],function(){\n x++;\n if(x < array.length) { loopArray(array); }\n else { callback(); }\n });\n };\n loopArray(array);\n }", "function writeRow(row) {\n process.stdout.write('|');\n for (let column of columns) {\n process.stdout.write(' ');\n process.stdout.write(String(row[column]));\n let padding = colLengths[column] - String(row[column]).length;\n for (var i = 0; i < padding; i++) {\n process.stdout.write(' ');\n }\n process.stdout.write(' |');\n }\n console.log();\n }", "function addtoArray() {\n //console.info(\"getRowCount\" + _self.backendApi.getRowCount());\n _self.backendApi.eachDataRow(function (rownum, row) {\n //console.info(\"rownum \" + rownum);\n lastrow = rownum;\n //do something with the row..\n\n });\n\n }", "function write_table(saved_table) {\n for (let i=0; i < height_2048; i++) {\n for (let j=0; j < width_2048; j++) {\n helper.set_cell(j,i,saved_table[i][j]);\n }\n }\n}", "function arrayOutput(a) {\n\t\tfor (var i=0; i<a.length; i++) {\n\t\t\tdocument.writeln(a[i]+'<br>');\n\t\t}\n\t}", "writeCells(args) {\n\t\targs.done();\n\t}", "function func10(arr) {\r\n arr.forEach((row, i) => {\r\n let line = \"\";\r\n console.log(\"row \" + i);\r\n row.forEach(char => (line += char + \" \"));\r\n console.log(line + \"\\n------\");\r\n });\r\n}", "function writeData() {\n Office.context.document.setSelectedDataAsync(MyArray, {coercionType: 'matrix'});\n}", "function processAllRows(array) {\n let ruleSet = getRuleFromUser();\n if (isNaN(ruleSet[7])) {\n ruleSet = createRandomRuleset();\n }\n\n let previousRowPixelStates = [\n [1, 1, 1],\n [1, 1, 0],\n [1, 0, 1],\n [1, 0, 0],\n [0, 1, 1],\n [0, 1, 0],\n [0, 0, 1],\n [0, 0, 0],\n ];\n\n let row;\n let column;\n let target;\n let prevSelf;\n let leftSibling;\n let rightSibling;\n let state;\n let arrayLength = array.length - 1;\n\n for (row = 1; row < arrayLength; row++) {\n for (column = 1; column < array[row].length - 1; column++) {\n target = [row, column];\n prevSelf = array[row - 1][column];\n leftSibling = array[row - 1][column - 1];\n rightSibling = array[row - 1][column + 1];\n\n for (state = 0; state < 8; state++) {\n if (leftSibling === previousRowPixelStates[state][0] &&\n prevSelf === previousRowPixelStates[state][1] &&\n rightSibling === previousRowPixelStates[state][2]\n ) {\n array[row][column] = ruleSet[state];\n break;\n }\n }\n }\n }\n\n renderAllCells(array, GRID_SIZE);\n }", "function writeTable(tblArr) {\n try {\n const jsonString = JSON.stringify(tblArr)\n fs.writeFileSync(dbpath, jsonString)\n console.log(\"writeFileSync successful, db.json updated\")\n } catch (e) {\n console.error(\"writeFileSync or JSON.stringify failed \", e)\n }\n}", "function writeData(arr, num, name) {\n\n var line = '';\n var doc = '';\n //console.log(\"before for loop\");\n //console.log(arr.length);\n //console.log(\"num: \" + num);\n\n for (var i = 0; i < arr.length; i+=num){\n\n //console.log(\"i: \"+ i + '\\n');\n line = '';\n for(var j = 0; j < num; j++){\n\n //console.log(\"j: \" + j + '\\n');\n\n if (j == num-1){\n line += arr[i+j];\n //console.log(\"inside if of j\");\n } // end if\n\n else {\n line += arr[i+j] + '@';\n //console.log(\"inside else of j\");\n } // end else\n } // end for j\n doc += line + ' ';\n } // end for i\n\n //console.log(doc);\n localStorage.setItem(name, doc);\n}", "writeTable(streamWriter, table) {\n for (let i = 0; i < table.rows.length; i++) {\n let row = table.rows[i];\n for (let j = 0; j < row.cells.length; j++) {\n let cell = row.cells[j];\n this.writeBody(streamWriter, cell.blocks);\n }\n }\n }", "function writemyfile(thearray){\n\n fs.writeFile('chicagocrimes.json',JSON.stringify(thearray),(err) => {\n\n if (err) throw err;\n\n });\n}", "function zeroRow(array) {\n \n let copy = array.slice()\n \n for (let i = 0; i < copy.length; i++) {\n copy[i] = 0; \n }\n \n return copy;\n}", "function printDOM(ArraySaved){\n \trow = myTable.insertRow(myTable.rows.length);//create new row.\n \tfor (var i=0 ; i<ArraySaved.length; i++){ \n\t\trow.innerHTML=\"\";//to clear the table data and update it from the private array every time.\n\t\trow.insertCell(0).innerHTML= myTable.rows.length-1;\n \trow.insertCell(1).innerHTML= ArraySaved[i].name;\n \trow.insertCell(2).innerHTML= ArraySaved[i].amount;\n \trow.insertCell(3).innerHTML= ArraySaved[i].SingleAmount;\n\t}\n\tconsole.log(\"ArraySaved\",ArraySaved)\n }", "function arrLog(arr) {\r\n for (var i = 0; i < arr.length; i++) {\r\n var line = \"\";\r\n if (arr[0].length) {\r\n\t for (var j = 0; j < arr[i].length; j++) {\r\n\t line += arr[i][j] + \" \";\r\n\t }\r\n\t } else {\r\n\t \tline += arr[i];\r\n\t }\r\n console.log(line);\r\n }\r\n}", "serializeCells(writer, cells) {\n for (let i = 0; i < cells.length; i++) {\n this.serializeCell(writer, cells[i]);\n }\n }", "function printTheArray(arr, n) {\n let content = '';\n for (let i = 0; i < n; i++) {\n content = content + arr[i];\n }\n if (content[0] === '0') return;\n const numOnes = (content.match(/1/g) || []).length;\n if (numOnes === 0 || numOnes === 1 || numOnes === 2 || numOnes === n) return;\n fs.writeFileSync(`./src/scripts/binary-${numOnes}.txt`, content + '\\n', { flag: 'a+' }, err => { })\n}", "function writeCsv(arr) {\n\n console.log(\"writing csv\");\n json2csv({ data: arr, fields: csvHeaders }, function(err, csv) {\n if (err) console.log(err);\n fs.writeFile(site+\"_\"+date+'.csv', csv, function(err) {\n if (err) throw err;\n console.log('file saved');\n });\n });\n}", "saveGrid(file) {\n\t\tlet data = this.rows + ' ' + this.cols;\n\n\t\t// TO DO: append the values in this.grid to data\n for(let i = 0; i < this.rows; i++){\n for(let j = 0; j < this.cols; j++){\n data += \" \" + this.grid[i][j];\n }\n }\n\t\tdata += '\\n';\n\t\tfs.writeFileSync(file,data);\n\t}", "function print2DArray(array)\n{\n\tvar n = array.length;\n\tvar out;\n\tvar i = 0;\n\tvar j = 0;\n\tfor( i = 0; i < n ; i++)\n\t{\n\t\tfor( j=0; j < n; j++)\n\t\t{\n\t\t\tout = out + array[i][j];\n\t\t\tif ( j < n - 1)\n\t\t\t\tout = out + \" \\t\";\n\t\t}\n\t\tout = out + \"\\n\";\n\t}\n\t//print(out);\n\tdelete out\n}", "function arrayOutput(ar){\n\tvar s = \"\";\n\tar.map((el)=>{\n\t\ts += JSON.stringify(el) + \"\\n\";\n\t});\n\treturn s;\n}", "function printArray(a){\nif (a.length == 0){\n return 'empty array' ;\n}\n var result = '';\nfor (var i = 0; i<a.length; i++) {\n result = result + 'row ' + i + ' \\n';\n console.log(result)\n for (var j=0; j<a[i].length; j++){\n result = result + a[i][j] + '\\n';\n }\n}\nreturn result;\n}", "function printArr(arr) {\n const end = arr.length-1\n arr.forEach((e, i) => {\n i === end ? process.stdout.write(`${e}\\n`) : process.stdout.write(`${e}, `);\n });\n}", "function outputArray( heading, theArray, output )\n\t{\n\t\tvar content = \"<h2>\" + heading + \"</h2><table>\" +\n\t\t\t\"<thead><th>Index</th><th>Value</th></thead><tbody>\";\n\n\t\t// output the index and value of each array element\n\t\tvar length = theArray.length; // get array's length once before loop\n\n\t\tfor ( var i =0; i < length; ++i )\n\t\t{\n\t\t\tcontent += \"<tr><td>\" + i + \"</td><td>\" + theArray[ i ] +\n\t\t\t\t\"</td></tr>\";\n\t\t} \t// end for\n\n\t\tcontent += \"</tboby></table>\";\n\t\toutput.innerHTML = content; // place the table in the output elements\n\t}\t// end function outputArray", "function arrayToString(array) {\n var string = \"\";\n for (let j = 0; j < array.length; j++){\n var string = string + array[j] + '\\n';\n };\n return string = string.slice(0, -1);\n }", "writeMany(indices, tensors) {\n if (indices.length !== tensors.length) {\n throw new Error(`TensorArray ${this.name}: could not write multiple tensors,` +\n `because the index size: ${indices.length} is not the same as tensors size: ${tensors.length}.`);\n }\n indices.forEach((i, index) => this.write(i, tensors[index]));\n }", "function writeMultiple( writeOffset, length, size, fn ) {\n for ( let i = 0; i < length; i++ ) {\n fn( i, writeOffset + ( i * size ));\n }\n}", "function create_rows(stones){\n /*Input: The array of the stones\n Output: An array that consists out of the rows of the field.\n */\n var rows = [[stones[0],stones[1],stones[2]], [stones[0],stones[7],stones[6]],[stones[2],stones[3],stones[4]],[stones[6],stones[5],stones[4]],[stones[8],stones[15],stones[14]], [stones[8],stones[9],stones[10]],[stones[10],stones[11],stones[12]],[stones[14],stones[13],stones[12]],[stones[16],stones[23],stones[22]], [stones[16],stones[17],stones[18]],[stones[18],stones[19],stones[20]],[stones[22],stones[21],stones[20]],[stones[7],stones[15],stones[23]], [stones[1],stones[9],stones[17]],[stones[19],stones[11],stones[3]],[stones[21],stones[13],stones[5]]];\n return rows;\n}", "function output(arr) {\n\tarr = outpfx.concat(arr);\n if (SAVEDATA) psiTurk.recordTrialData(arr);\n if (LOGGING) console.log(arr.join(\" \"));\n}", "function returnLinesFromArray(arr) {\n var txt = \"\";\n arr.forEach(function(row) {\n txt += row;\n txt += \"\\n\";\n });\n return txt;\n}", "function writeFile(fileName, array = []) {\n let path = `./output/${fileName}.out`;\n log(`Writing to ${path}`);\n\n let f = fs.createWriteStream(path, {\n encoding: \"UTF8\",\n flags: \"a\"\n });\n\n if (f.writable) {\n f.write(`${array.length} \\n`); // Header\n f.end(array.join(\" \"));\n } else {\n print(\"File not writable\");\n }\n}", "writeBatch(callback: WriteCallback): void {\n const batch = this.batch;\n // reset the instance batch\n this.batch = [];\n const tx = this.db.transaction(this.objectStore, \"readwrite\");\n const store = tx.objectStore(this.objectStore);\n for (const item of batch) {\n const toInsert = this.options.extra ? { ...item, ...this.options.extra } : item;\n store.put(toInsert);\n }\n // use setTimeout to yield the thread a bit - even with their quasi-asyncness\n // node streams can sometimes cause a bit too much throughput pressure on writes\n tx.complete.then(() => setTimeout(callback, 1)).catch(callback);\n }", "function makeTableWork() {\n appendArrays();\n \n //REMOVE ALL ROWS IN TABLE\n $(\"#main-table tbody tr\").remove();\n //////////////////////////\n \n for (let itemNum in allSongsArray) {\n addRows(itemNum);\n } \n}", "function pushData(arr)\r\n{\r\n\tfor (var i = 0; i < rows.length; i++)\r\n\t{\r\n var cells = rows[i].split(\",\");\r\n console.log(\"cells \",cells);\r\n if (cells.length > 1) {\r\n arr.push(trimOut(cells[0]));\r\n arr.push(trimOut(cells[2]));\r\n }\r\n }\r\n\tconsole.log(\"pushdata call \");\r\n main(document.getElementById('graphContainer'));\r\n}", "function printCells(array){\n for(var i = 0; i < array.length; i++){\n console.log(array[i]);\n }\n}", "function printLines (arrPrint) {\n for (i=0; i <arrPrint.length; i++) {\n document.write(arrPrint[i]);\n }\n return arrPrint;\n }", "function draw2DArray(array){\n var html=\"\";\n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n html = html + array[i][j] + \", \";\n }\n html=html+\"\\n\";\n }\n console.log(html);\n}", "function logAll(array) {\n for(var ii = 0; ii < array.length; ii++) {\n console.log(array[ii]);\n }\n}", "function create2DArr(rows){\n //start an array\n var array = [];\n \n //loop through the array\n for(var i=0;i<rows;i++){\n //put an array in that index\n array[i] = [];\n }\n \n return array;\n}", "output(ioArrays) {\n const delay = 5;\n return new Promise(async resolve => {\n for (const arrayName in ioArrays) {\n const ioArray = ioArrays[arrayName];\n let data = ioArray.data;\n\n if (ioArray.wasEmpty && data.every(item => item == 1)) {\n await timer(delay);\n continue;\n }\n\n data = data.reverse();\n const hex = this.convertToHex(data.join(\"\"));\n let cmd = `[${arrayName}es${hex}]`;\n await this.writeAndDrain(cmd);\n await timer(delay);\n\n if (data.every(item => item == 1)) {\n ioArray.wasEmpty = true;\n } else {\n ioArray.wasEmpty = false;\n }\n }\n\n resolve();\n });\n }", "function writeIterable({ type, buffer, value, length }) {\n buffer.addAll(flexInt.makeValueBuffer(length));\n for (const instance of value)\n type.writeValue(buffer, instance);\n}", "function outputArray(heading, theArray, output) {\n\toutput.innerHTML = heading + theArray.join(\" \");\n} //end function outputArray", "function insertRows(table, rows) {\n \n var chunkedRows = arrayUtils.chunkArray(rows, 25);\n \n chunkedRows.forEach(function(rows) {\n var insertQuery = \"\";\n \n rows.forEach(function(row) {\n var exists = rowExists(table, row);\n if (!exists) {\n insertQuery += getInsertString(table, row) \n + table.constants.semiColon + table.constants.space;\n };\n });\n \n if (insertQuery.length > 0) {\n FusionTables.Query.sql(insertQuery);\n };\n }); \n }", "function CSV(array) {\n // Use first element to choose the keys and the order\n var keys = Object.keys(array[0]);\n\n // Build header\n var result = keys.join(\",\") + \"\\n\";\n\n // Add the rows\n array.forEach(function (obj) {\n keys.forEach(function (k, ix) {\n if (ix) result += \"\\t\";\n result += obj[k];\n });\n result += \"\\n\";\n });\n\n return result;\n}", "function hdr(arr) {\n\tfor (var i=0; arr && i < arr.length; drw(arr[i++]));\n}", "function writeResults() {\n logger.trace(\"Starting to write results to file\");\n\n // A boolean to indicate if the writing is backed up\n var writeOK = true;\n\n // Loop over the rows watching for write backups\n do {\n // Now write it to the file\n writeOK = sourceStream.write(result.rows[i]['epochseconds'] + ',' +\n result.rows[i]['timestamp_utc'] + ',' + result.rows[i]['string_agg'] + '\\n');\n\n // Bump the counter\n i++;\n } while (i < numRows && writeOK);\n\n // Check to see if all the writes are done\n if (i < numRows) {\n logger.trace(\"Writing stopped at line \" + i + \" will wait for drain\");\n\n // Since not done, set up a handler to watch for the buffer to\n // drain and then start writing again\n sourceStream.once('drain', writeResults);\n } else {\n logger.info(\"All done writing to file, will end the write stream\");\n sourceStream.end();\n }\n }", "function writeRow(row){\t\n\treturn \"| \" + fillCell(row.item_id, 3) + \"| \" + fillCell(row.product_name, 30) + \" | \" + fillCell(row.department_name, 15) + \" | $\" + fillCell(row.price, 6) + \" | \" + fillCell(row.stock_quantity, 5) + \" |\";\n}", "function outputArray( heading, theArray, output )\n{\n output.innerHTML = heading + theArray.join( \" \" ); \n} // end function outputArray", "function draw(new_array, array_size) {\n // Getting the div in the body to draw the array\n var table_container = document.getElementById(\"table_container\");\n // Clearing the div for the new generation\n table_container.innerHTML = \"\";\n\n // For each row loop the below (array_size / ARRAY_COLUMN_WIDTH = how many rows)\n for (var i = 0; i < array_size / ARRAY_COLUMN_WIDTH; i++) {\n // Create one div for a row\n var row = document.createElement(\"div\");\n // Set attribute for this div\n row.setAttribute(\"class\", \"row\");\n // For each column loop the below\n for (var k = 0; k < ARRAY_COLUMN_WIDTH; k++) {\n // Create one div for a column\n var col = document.createElement(\"div\");\n // Set attribute for this div\n col.setAttribute(\"class\", \"col-sm with-number\");\n // Create another div to put the array value in it\n var value_p = document.createElement(\"div\");\n // Setting attributes\n value_p.setAttribute(\"class\", \"value\");\n // Putting the value as a text\n var text = document.createTextNode(new_array[k + i * ARRAY_COLUMN_WIDTH]); //\"value: \"+\n // Appending the value text in the value div\n value_p.appendChild(text);\n // I am doing this for better visualization\n if (k + i * ARRAY_COLUMN_WIDTH < array_size) {\n // Setting attributes for my easiness in each cell\n col.setAttribute(\"cell_id\", (k + i * ARRAY_COLUMN_WIDTH).toString());\n col.setAttribute(\"cell_value\", (new_array[k + i * ARRAY_COLUMN_WIDTH]).toString());\n // Creating a divider\n var hr = document.createElement(\"hr\");\n // Creating another div for the array index\n var index_p = document.createElement(\"div\");\n // Setting attributes\n index_p.setAttribute(\"class\", \"index\");\n // Putting the index as a text\n var index = document.createTextNode((k + i * ARRAY_COLUMN_WIDTH).toString()); //\"index: \"+\n // Appending the index text in the index div\n index_p.appendChild(index);\n // Appending the index div at parent div which is the column (cell)\n col.appendChild(index_p);\n // After the array index append the divider\n col.appendChild(hr);\n // Then append the array value\n col.appendChild(value_p);\n // Append the cell in the row div\n row.appendChild(col);\n // Finally append the row div at the table div\n table_container.appendChild(row);\n } else {\n //if a cell doesn't have values run this code for good visualization in the page \n col.setAttribute(\"class\", \"col-sm\");\n col.appendChild(document.createTextNode(\"\"));\n row.appendChild(col);\n table_container.appendChild(row);\n }\n }\n }\n}", "function writeAscii(arr) {\n document.querySelector('#fixed').innerHTML = arr.join('\\n');\n }", "function tableToCSV(){\n\tvar finalCSV = [];\n\tvar totalRows = document.querySelectorAll(\"table tr\");\n\n\t//start at one to avoid grabbing hidden header formatting row\n\tfor(var i = 1; i < totalRows.length; i++){\n\t\tvar tableRow = [];\n\t\tvar tableColms = totalRows[i].querySelectorAll(\"td\");\n\n\t\tfor(var x = 0; x < tableColms.length; x++){\n\t\t\ttableRow.push(tableColms[x].innerHTML);\n\t\t}\n\t\tfinalCSV.push(tableRow);\n\n\t}\n\tsendArrayToPHP(finalCSV);\n\twindow.location.href=window.location.href;//reloads the page\n}", "function logAll(array) {\n for (var i = 0; i < array.length; i++) {\n console.log(array[i]); \n }\n}", "function serialize_array_2d(arr) {\n// {{{\n\tvar str='';\n\tvar i = 0;\n\tstr += '' + arr[i][0];\n\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\tstr += ',' + arr[i][j];\n\t}\n\n\tfor (var i = 1; i < arr.length; ++i) {\n\t\tstr += '|';\n\t\tstr += '' + arr[i][0];\n\t\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\t\tstr += ',' + arr[i][j];\n\t\t}\n\t}\n\treturn str;\n// }}}\n}", "function makeAllRows() {\n for (var i = 0; i < allLocations.length; i++) {\n allLocations[i].customerNum();\n allLocations[i].cookiesPerHour();\n allLocations[i].totalCookies();\n allLocations[i].makeTableRow();\n }\n}", "function writeResult(resultArr){\n \tconsole.log(\"writing\");\n \tvar result = resultArr[0];\n \tvar flatPath = resultPathFlattened + subFolderIndex + '/'\n \tvar deepPath = resultPathDeep + subFolderIndex + '/';\n writeFileP(deepPath + propertyNumber + '.json', JSON.stringify(result))\n .then(writeFileP(flatPath + propertyNumber + '.json', JSON.stringify(flatten(result,{}))))\n }", "function showArray(array) {\n document.write('[');\n //document.write(array.toString());\n /*\n * array.toString() does this without the spaces between elements\n */\n for (var index = 0; index < array.length; ++index) {\n document.write(array[index]);\n if (index < array.length - 1)\n document.write(\", \");\n }\n document.write(']');\n putline();\n}", "function convertToCsvFormat(array) {\n var flatArray = [];\n for (var title = 0; title < locations.length; title++) {\n flatArray.push(locations[title]);\n }\n for (var x = 0; x < array.length; x++) {\n flatArray.push(array[x].name);\n flatArray.push(array[x].quantity);\n flatArray.push(array[x].location);\n }\n var csvFormatted = flatArray.join(\"|\");\n return csvFormatted;\n}", "function tri(){\n var arr1 = [\n [1,2,3,4,5],\n [6,7,8,9,10],\n [11,12,13,14,15],\n [16,17,18,19,20],\n [21,22,23,24,25],\n ]\n //arr1[i][j]\n for(var i = 0;i < 5;i++){\n for(var j = 0;j <= i;j++){\n document.write(arr1[i][j] + '&nbsp');\n if(i == j){\n document.write('</br>');\n }\n }\n }\n}", "function renderAllCells(array, GRID_SIZE) {\n let x;\n let y;\n\n for (x = 0; x < width; x++) {\n for (y = 0; y < height; y++) {\n drawCellState(x, y, array[y][x]);\n }\n }\n }", "function putBigArray(bigArray) {\n if (bigArray == null) {\n bigArray = loadBigArray()\n }\n for (let i = 0; i < bigArray.length; i++) {\n if (bigArray[i] != null) {\n const toPut = new Array(19)\n toPut[0] = i\n for (let j = 0; j < 6; j++) {\n if (bigArray[i][j] != null) {\n for (let k = 0; k < 3; k++) {\n toPut[1 + 3 * j + k] = bigArray[i][j][k]\n }\n }\n }\n Logger.log('at not string ' + (i + 3) + ', put: ' + toPut)\n // Logger.log('string?: ' + (i + 3))\n imageUrlsSheet.getSheets()[0].getRange(i + 3, 1, 1, 19).setValues([toPut])\n }\n }\n}", "write(board) {\n this.foreach( (x, y) => { board.setCell(x, y, this.id); } );\n }", "function writeTableData() {\r\n // Creates a tbody element.\r\n var finalTbody = document.createElement(\"tbody\");\r\n // Loop through the table data\r\n for (var i = 0; i < tableData.length; i++) {\r\n // Get the current row.\r\n var current = tableData[i];\r\n // Make a new row\r\n var tableRow = document.createElement(\"tr\");\r\n // loop through the rows\r\n for (var j = 0; j < current.length; j++) {\r\n // Create a table data element\r\n var dataCell = document.createElement(\"td\");\r\n // Set the text content to the current row text content.\r\n dataCell.textContent = current[j];\r\n // Append the dataCell to the tableRow.\r\n tableRow.appendChild(dataCell);\r\n }\r\n // Append the tableRow to the final table body.\r\n finalTbody.appendChild(tableRow);\r\n }\r\n // Get the table.\r\n var table = document.querySelectorAll(\"table.sortable\")[0];\r\n // Replace the old tbody with the new one.\r\n table.replaceChild(finalTbody, table.getElementsByTagName(\"tbody\")[0]);\r\n}", "function reocurring(){\n\tarray.forEach(array)\n}", "function twoDArrayToSheet(startVal,outSheet)\n{\n var capt = makeSetPatterns(startVal,startVal);\n //var outSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);\n for(var cA=0;cA<capt.length;cA++)\n {\n for (var cB=0;cB<capt[cA].length;cB++)\n {\n outSheet.getRange(cA+1,cB+1,1,1).setValue(capt[cA][cB])\n }\n }\n}", "function moveToEndOfArray(arr, condition) {\n const moved = [],\n len = arr.length;\n let write = 0;\n for (let read = 0; read < len; ++read) {\n if (condition(arr[read])) {\n moved.push(arr[read]);\n } else {\n arr[write] = arr[read];\n ++write;\n }\n }\n for (let read = 0; write < len; ++read, ++write) {\n arr[write] = moved[read];\n }\n }", "function table(arr) {\n let lean = arr.map((doc) => doc.toObject());\n return console.table(lean);\n}", "appendSingleIntervall(intervall) {\n \n //insert single row\n var newRow = intervall;\n newRow.index = this.data.intervalls.length;\n this.data.intervalls.push(newRow);\n\n return this.data.intervalls;\n }", "all(callback){\n\t\tfor (let i = 0 ; i < this.GRID_DOM.length; i++) {\n\t\t\tfor (let j = 0 ; j < this.GRID_DOM[i].length; j++) {\n\t\t\t\tcallback(this.GRID_DOM[i][j])\n\t\t\t}\n\t\t}\n\t}", "function doToArray(array, callback) {\n array.forEach(callback);\n}", "function saveRow(newCursor) {\n cursor = newCursor;\n pushRow(row);\n row = [];\n nextNewline = input.indexOf(newline, cursor);\n }", "function addingRows(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createDescripRow(data[i]));\n }\n // console.log(rowsToAdd);\n }", "function writeBlock(bufferArray) {\r\n const cb = FFI.Callback('int', [FPDF_FILEWRITE_ptr, voidPtr, 'int'], \r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (fpdfFilewritePtr, dataPtr, size) => {\r\n const buff = Ref.reinterpret(dataPtr, size, 0);\r\n bufferArray.push(Buffer.from(buff));\r\n return size;\r\n });\r\n return cb;\r\n}", "function removeRow(array, index) {\n array.splice(index, 1);\n }", "writeData(data, count) {\n var indices = this._lockTypedArray();\n\n // if data contains more indices than needed, copy from its subarray\n if (data.length > count) {\n\n // if data is typed array\n if (ArrayBuffer.isView(data)) {\n data = data.subarray(0, count);\n indices.set(data);\n } else {\n // data is array, copy right amount manually\n var i;\n for (i = 0; i < count; i++)\n indices[i] = data[i];\n }\n } else {\n // copy whole data\n indices.set(data);\n }\n\n this.unlock();\n }", "_exportToBinaryLittleEndian() {\n // 4 bytes for array length, and 4 bytes for every array element\n let buffer = Buffer.alloc((this.records.length + 1) * 4);\n let offset = 0; // offset will be maintained by the buffer return value\n\n offset = buffer.writeUInt32LE(this.records.length, offset);\n\n for (let i = 0; i < this.records.length; i++) {\n offset = buffer.writeUInt32LE(this.records[i], offset);\n }\n\n fs.writeFileSync(this.pathTemplate, buffer, 'binary');\n }", "function PrintArray(array, data) {\n // Check that the argument count is correct.\n AssertEquals(array.length, data.length * 2 + 1);\n\n for (var i = 0, idx = 1; i < data.length; i++, idx += 2) {\n array[idx] = data[i];\n }\n return array.join(\"\");\n}", "drawRows (rows_arr, start_index, count) {\n let table_body = this._table_body = $('<tbody>'),\n end_index,\n table_row_elem;\n\n if(!start_index) {\n start_index = 0;\n } \n end_index = start_index + count;\n\n if(end_index > rows_arr.length) {\n end_index = rows_arr.length;\n }\n\n if(rows_arr && rows_arr.length > 0) {\n for (let i = start_index; i < end_index; i++) {\n let row = rows_arr[i];\n table_row_elem = $('<tr>');\n //Store for easy retrieval\n this._table_row_arr.push(table_row_elem);\n //Now create the row content\n row.forEach(function(text, i){\n let row_td = $('<td>').text(text);\n this.setCellStyle(row_td, i);\n table_row_elem.append(row_td);\n }, this);\n table_body.append(table_row_elem);\n }\n this._tableElem.append(table_body);\n }\n\n \n }", "function outPut (element, index, array) {\n\tconsole.log('array[' + index + '] = ' + element);\n}", "function arrayToCSV (array) {\n var lineArray = [];\n array.forEach(function (infoArray, index) {\n var line = infoArray.join(\",\");\n //lineArray.push(index == 0 ? \"data:text/csv;charset=utf-8,\" + line : line);\n lineArray.push(index == 0 ? \"\" + line : line);\n });\n var csvFile = lineArray.join(\"\\n\");\n return csvFile;\n}", "function dumpArray(array) {\n console.log('[');\n array.forEach(function(value){\n console.log(' ' + value);\n });\n console.log(']');\n}", "function outputArray(arr){\n for(i=0; i<arr.length; i++)\n console.log(arr[i]);\n}", "_final(callback: WriteCallback) {\n this.writeBatch(callback);\n }", "function filledRow(len, value) \n{\n return Array.apply(null, Array(len)).map(function(val, idx) { return value});\n}", "function writeManyRecords() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n conn.setAutoCommit(false);\n\n var start = new Date();\n var stmt = conn.prepareStatement('INSERT INTO entries ' +\n '(guestName, content) values (?, ?)');\n for (var i = 0; i < 500; i++) {\n stmt.setString(1, 'Name ' + i);\n stmt.setString(2, 'Hello, world ' + i);\n stmt.addBatch();\n }\n\n var batch = stmt.executeBatch();\n conn.commit();\n conn.close();\n\n var end = new Date();\n Logger.log('Time elapsed: %sms for %s rows.', end - start, batch.length);\n}", "function csv(array){\n\n // this is not a world class csv generator\n return array.map(function(item){\n return typeof(item) === 'string' ? \n item.replace(/[\\\",]/g,'') :\n item;\n }).join(',')\n}", "function saveResult(){\n // TODO implementar salvar os dados em arquivo:\n // Salvar: http://phantomjs.org/api/fs/method/write.html\n // Converter JSON array para CSV\n console.log(JSON.stringify(serie));\n phantom.exit();\n}", "function outputData(dataArray) {\n //Her console.logger vi en tekst streng \"''Dette er funktionen der udskriver det hentede data: ''\"\n //samt vores array 'dataArray'\n console.log('Dette er funktionen der udskriver det hentede data: ' + dataArray);\n}", "function swapRows(array, from, to) {\n console.log(array, from, to);\n var tmp = array[from];\n array[from] = array[to];\n array[to] = tmp;\n }", "function printArray(arr) {}", "function setRow( M, n, a ){\n var w = M.width;\n var e = M.elements;\n var l = Math.min( a.length, w );\n \n for(var i=0, j=n*w; i<l; i++, j++)\n e[j] = a[i];\n}", "push(...row)\n\t{\n\t\tthis.rows.push({\n\t\t\ttype: 'data',\n\t\t\talign: this.alignment || 'l'.repeat(row.length),\n\t\t\tdata: row.map(String),\n\t\t\tdiv: false\n\t\t});\n\n\t\tthis.width = Math.max(this.width, row.length);\n\t}", "serializeRow(writer, row) {\n let owner = this.row;\n this.row = row;\n writer.writeStartElement(undefined, 'tr', this.wNamespace);\n this.serializeRowFormat(writer, row);\n this.serializeCells(writer, row.cells);\n writer.writeEndElement(); //end od table row 'tr'\n this.row = owner;\n }", "writeValue(buffer, value) {\n assert.isBuffer(buffer);\n assert.instanceOf(value, Array);\n write_util_1.writeIterable({ type: this.type, buffer, value, length: value.length });\n }", "function writeNumbers(array) {\n var i = 0;\n while (i < array.length) {\n // Assume the array's length is evenly divisible by 10 to avoid length\n // check overhead.\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n array[i++] = i;\n }\n return i;\n}", "set data(arr) {\n\t\tthis.wrapper.setData(arr);\n\t\tthis._tableData = arr;\n\t}" ]
[ "0.62822825", "0.5982951", "0.5975066", "0.59336877", "0.58772254", "0.58746153", "0.57763946", "0.57440925", "0.56147873", "0.55836165", "0.555648", "0.55488473", "0.5490231", "0.5454952", "0.544563", "0.54132086", "0.5405613", "0.53920597", "0.53753924", "0.5362929", "0.53284204", "0.53193814", "0.52928996", "0.52489233", "0.523177", "0.52169853", "0.52145493", "0.5209949", "0.5184967", "0.51729167", "0.51413214", "0.51409876", "0.51316404", "0.5113792", "0.50986296", "0.5091713", "0.50510514", "0.5048191", "0.5024725", "0.5021584", "0.5016891", "0.50151974", "0.5010106", "0.5008286", "0.4975321", "0.49715596", "0.49669585", "0.4955115", "0.4954613", "0.49513477", "0.49507996", "0.49473464", "0.49468392", "0.49224144", "0.49178228", "0.49138606", "0.49134126", "0.489975", "0.48969802", "0.48944417", "0.4893669", "0.48880613", "0.487097", "0.4857227", "0.48452154", "0.48441598", "0.48365918", "0.48343983", "0.48340446", "0.48323175", "0.48305833", "0.48266134", "0.48142418", "0.48123208", "0.48078614", "0.48075432", "0.48056126", "0.4797293", "0.4795696", "0.4794446", "0.47882608", "0.478138", "0.4778209", "0.47757977", "0.47721487", "0.4767658", "0.47663146", "0.47643474", "0.4755866", "0.47542617", "0.47419852", "0.47384483", "0.47345328", "0.4730678", "0.4727141", "0.4720554", "0.47197643", "0.47150385", "0.47096732", "0.47093347", "0.47080815" ]
0.0
-1
write to Google API in batch to respect rate limits
function batchWriteToDrive(oauth2Client){ //Google Sheet API Quota: 100req/100s per user. if (queue.length > 0){ writeToDrive(oauth2Client); } setTimeout(function(){ batchWriteToDrive(oauth2Client) },3000 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doBatchWrite(batch) {\r\n\r\n let requestBatch = batch.map(function (item) {\r\n return {\r\n PutRequest: {\r\n Item: item\r\n }\r\n };\r\n });\r\n\r\n let params = {\r\n RequestItems: {}\r\n };\r\n\r\n params.RequestItems[tableName] = requestBatch;\r\n\r\n return new Promise((resolve, reject) => {\r\n setTimeout(() => {\r\n const toResolve = docClient.batchWrite(params).promise()\r\n .then(data => {\r\n return data;\r\n });\r\n\r\n resolve(toResolve)\r\n }, writeDelay);\r\n })\r\n }", "async _writev(chunks, next) {\n const body = chunks\n .map(chunk => chunk.chunk)\n .reduce((arr, obj) => {\n if (this.config.usePartialUpdate) {\n arr.push({ update: { _id: this.idFn(obj) } })\n arr.push({ doc: obj, doc_as_upsert : true })\n } else {\n arr.push({ index: { _id: this.idFn(obj) } })\n arr.push(obj)\n }\n return arr\n }, [])\n debug.extend('_writev')(`writing ${chunks.length} records`)\n\n /**\n * Push the array of actions to ES and indicate that we are ready for the next\n * one. Be sure to propagate any errors:\n */\n\n try {\n await this.client.bulk({\n index: this.config.index,\n type: this.config.type,\n refresh: this.config.refresh,\n body\n })\n this.written += chunks.length\n this.logRate()\n next()\n } catch(err) {\n next(err)\n }\n }", "writeBatch(callback: WriteCallback): void {\n const batch = this.batch;\n // reset the instance batch\n this.batch = [];\n const tx = this.db.transaction(this.objectStore, \"readwrite\");\n const store = tx.objectStore(this.objectStore);\n for (const item of batch) {\n const toInsert = this.options.extra ? { ...item, ...this.options.extra } : item;\n store.put(toInsert);\n }\n // use setTimeout to yield the thread a bit - even with their quasi-asyncness\n // node streams can sometimes cause a bit too much throughput pressure on writes\n tx.complete.then(() => setTimeout(callback, 1)).catch(callback);\n }", "function sendBatch(batch)\n{\n var sendRequest = true;\n var attemptNo = 1;\n // While we want to keep making request, please keep making requests. We use the async\n // library here rather than a straight up while loop. This is necessary because the AWS\n // batchWriteItem is async and would cause an ordinary while loop to make repeated same-requests.\n async.whilst(\n // Test function;\n function()\n {\n return attemptNo < 3 && sendRequest;\n },\n // Function to call each time test function passes. This function will be called\n // until the batchWriteItem callback returns no unprocessed items.\n function(cb)\n {\n attemptNo++;\n\n // Request parameters.\n var params = {\n ReturnConsumedCapacity: \"TOTAL\",\n RequestItems: {}\n };\n params.RequestItems[batch.table] = batch.batch;\n\n dynDb.batchWriteItem(params, function(error, awsResults)\n {\n // There is an error. Stop processing immediately.\n if (error)\n {\n log(\"AWS batch write request errored: \" + error);\n log(\"Batch contained \" + batch.batch.length + \" items\");\n sendRequest = false; // Remove this line to make multiple attempts.\n cb();\n return;\n }\n\n // No error. Please continue.\n awsData = awsResults.unprocessedItems;\n // Test the data response. If there are no more unprocessed items,\n // signify that we do not wish to continue making AWS calls.\n if (!awsResults.unprocessedItems) sendRequest = false;\n // We have finished. call the callback.\n cb();\n });\n },\n // Function to call when repeated execution of main function has ceased.\n function(error)\n {\n if (error) log (error);\n }\n );\n}", "batchPut(table, ) {\n var params = {\n RequestItems: { // A map of TableName to Put or Delete requests for that table\n table_name_1: [ // a list of Put or Delete requests for that table\n { // An example PutRequest\n PutRequest: {\n Item: { // a map of attribute name to AttributeValue \n attribute_name: attribute_value,\n // attribute_value (string | number | boolean | null | Binary | DynamoDBSet | Array | Object)\n // ... more attributes ...\n }\n }\n },\n { // An example DeleteRequest\n DeleteRequest: {\n Key: { \n key_attribute_name: attribute_value, //(string | number | boolean | null | Binary)\n // more primary attributes (if the primary key is hash/range schema)\n }\n }\n },\n // ... more put or delete requests ...\n ],\n // ... more tables ...\n },\n ReturnConsumedCapacity: 'NONE', // optional (NONE | TOTAL | INDEXES)\n ReturnItemCollectionMetrics: 'NONE', // optional (NONE | SIZE)\n };\n docClient.batchWrite(params).promise();\n }", "function writeToDrive(oauth2Client){\n var data=queue;\n //SPREADSHEET: 1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI\n var sheets = google.sheets('v4');\n var request = {\n spreadsheetId: '1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI', //TODO it should be dynamic and created as needed when data grows\n range: 'Sheet1',\n includeValuesInResponse: 'true',\n valueInputOption: 'USER_ENTERED',\n insertDataOption: 'INSERT_ROWS',\n resource:{\n \"values\": data\n },\n auth: oauth2Client\n };\n\n // sheets.spreadsheets.values.get({spreadsheetId: '1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI',\n // range: 'Sheet1',auth: oauth2Client}, function(err, response){\n // if (err) {\n // console.error(err);\n // return;\n // }\n // }\n // );\n\n console.log(\"%s Writing %s rows to Google drives\",new Date().toISOString(),data.length);\n sheets.spreadsheets.values.append(request, function(err, response) {\n if (err) {\n console.error(err);\n return;\n }\n queue=queue.slice(data.length,queue.length);\n console.log(\"%s remaining rows in the queue:%s\",new Date().toISOString(),queue.length);\n }\n );\n}", "_bulkSave() {\n let { _saveQueue: saveQueue } = this;\n\n let promises = array();\n for (let i in saveQueue) {\n promises.push(this.add(i, saveQueue[i]));\n saveQueue[i] = array();\n }\n\n return Promise.all(promises, 'indexedDb/_bulkSave');\n }", "function writeManyRecords() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n conn.setAutoCommit(false);\n\n var start = new Date();\n var stmt = conn.prepareStatement('INSERT INTO entries ' +\n '(guestName, content) values (?, ?)');\n for (var i = 0; i < 500; i++) {\n stmt.setString(1, 'Name ' + i);\n stmt.setString(2, 'Hello, world ' + i);\n stmt.addBatch();\n }\n\n var batch = stmt.executeBatch();\n conn.commit();\n conn.close();\n\n var end = new Date();\n Logger.log('Time elapsed: %sms for %s rows.', end - start, batch.length);\n}", "async sendBatch(batch) {\n // We create the errors here to capture the stack traces at this point,\n // the async call that follows would probably loose of the stack trace\n const error = new errors_2.ProviderError(\"HttpProviderError\", -1);\n // we need this to sort the responses\n const idToIndexMap = {};\n const requests = batch.map((r, i) => {\n const jsonRpcRequest = this._getJsonRpcRequest(r.method, r.params);\n idToIndexMap[jsonRpcRequest.id] = i;\n return jsonRpcRequest;\n });\n const jsonRpcResponses = await this._fetchJsonRpcResponse(requests);\n for (const response of jsonRpcResponses) {\n if (isErrorResponse(response)) {\n error.message = response.error.message;\n error.code = response.error.code;\n error.data = response.error.data;\n // eslint-disable-next-line @nomiclabs/only-hardhat-error\n throw error;\n }\n }\n // We already know that it has this type, but TS can't infer it.\n const responses = jsonRpcResponses;\n // we use the id to sort the responses so that they match the order of the requests\n const sortedResponses = responses\n .map((response) => [idToIndexMap[response.id], response.result])\n .sort(([indexA], [indexB]) => indexA - indexB)\n .map(([, result]) => result);\n return sortedResponses;\n }", "function batchRequest(){\n // Use the lower value of items left in the link array or maxRequests\n var total = (linkArr.length-1 > maxRequests) ? maxRequests : linkArr.length-1;\n for(var i = 0; i<= total; i++) {\n qwest.get(endPoint+encodeURIComponent(linkArr[0]))\n .then(function(response) {\n apiActions.response({pageURL: response.url, report: response.data});\n })\n .catch(function(e, response) {\n console.log('>> Error: ', e, '\\nResponse: ', response);\n })\n // Remove the head from the array\n linkArr.shift();\n }\n\n // Batch request again if there's anything left in the array\n if(linkArr.length > 0) {\n setTimeout(function() {\n batchRequest();\n }, 30*1000);\n }\n}", "batchWriteParams(_items,options={},params={},meta) {\n // Convert items to array\n let items = (Array.isArray(_items) ? _items : [_items]).filter(x => x) \n\n // Error on no items\n if (items.length === 0)\n error(`No items supplied`)\n\n const {\n capacity,\n metrics,\n ..._args\n } = options\n\n // Remove other valid options from options\n const args = Object.keys(_args).filter(x => !['execute','parse'].includes(x))\n\n // Error on extraneous arguments\n if (args.length > 0)\n error(`Invalid batchWrite options: ${args.join(', ')}`)\n\n // Verify capacity\n if (capacity !== undefined\n && (typeof capacity !== 'string' || !['NONE','TOTAL','INDEXES'].includes(capacity.toUpperCase())))\n error(`'capacity' must be one of 'NONE','TOTAL', OR 'INDEXES'`)\n\n // Verify metrics\n if (metrics !== undefined\n && (typeof metrics !== 'string' || !['NONE','SIZE'].includes(metrics.toUpperCase())))\n error(`'metrics' must be one of 'NONE' OR 'SIZE'`)\n\n // Init RequestItems\n const RequestItems = {}\n \n // Loop through items\n for (const i in items) {\n const item = items[i]\n const table = Object.keys(item)[0]\n\n // Create a table property with an empty array if it doesn't exist\n if (!RequestItems[table]) RequestItems[table] = []\n\n // TODO: Add some validation here?\n\n // Push request onto the table array\n RequestItems[table].push(item[table]) \n }\n\n const payload = Object.assign(\n { RequestItems },\n capacity ? { ReturnConsumedCapacity: capacity.toUpperCase() } : null,\n metrics ? { ReturnItemCollectionMetrics: metrics.toUpperCase() } : null,\n typeof params === 'object' ? params : null\n )\n \n const Tables = {}\n return meta ? { payload, Tables } : payload\n\n }", "function runBatchGC() {\r\n\r\n if (TheRGC.length == 0) {\r\n console.log(\"nothing to batch geocode\"); // eslint-disable-line no-console\r\n return;\r\n }\r\n\r\n let url = [\"https://batch.geocoder.ls.hereapi.com/6.2/jobs?\",\r\n \"apiKey=\", API_KEY,\r\n \"&mode=retrieveAddresses\",\r\n \"&action=run\",\r\n \"&header=true\",\r\n \"&inDelim=|\",\r\n \"&outDelim=|&outCols=city,county,district,country\",\r\n \"&outputcombined=true\",\r\n \"&language=en\"\r\n ].join(\"\");\r\n\r\n let i = 0;\r\n let body = \"recId|prox\\n\" + TheRGC.map(elt => {\r\n return `${i++}|${elt.latlng}`;\r\n }).join(\"\\n\");\r\n\r\n\r\n\r\n request.post(url)\r\n .send(body)\r\n .set(\"Content-Type\", \"text/plain\")\r\n // .set('Accept', 'application/xml')\r\n .then(res => {\r\n let result = res.body.toString();\r\n\r\n //console.log(result);\r\n // extrait ReqestId\r\n const gid = findXmlTag(result, \"RequestId\");\r\n if (!gid) {\r\n console.error(\"No RequestId found\");\r\n return;\r\n }\r\n console.log(); // eslint-disable-line no-console\r\n console.log(`${TheRGC.length} reverse geocodes sent`); // eslint-disable-line no-console\r\n console.log(`to check status: node plex-place.js -c ${gid} `); // eslint-disable-line no-console\r\n\r\n // write temp file with the request to batch geocoder\r\n const matching = TheRGC.map(elt => elt.ids).join(\"\\n\");\r\n const fileOut = gid2Filename(gid);\r\n fs.writeFile(fileOut, matching, (err) => {\r\n if (err) throw err;\r\n });\r\n })\r\n .catch(err => {\r\n console.error(\"Error requesting batch geocode\", err.message);\r\n });\r\n\r\n}", "function insertAndGetBatch() {\n var docs = [];\n ['foo', 'bar', 'la', 'bamba'].forEach(function (val) {\n docs.push({value: val});\n });\n\n return dataDb.saveAsync(docs)\n .then(function () {\n return dataDb.viewAsync('data/byValue', {keys: ['foo', 'bar'], limit: 10});\n });\n}", "_write(chunk: any, encoding: string, callback: WriteCallback) {\n this.batch.push(chunk);\n this.total++;\n if (this.batch.length < (this.options.batchSize || DEFAULT_BATCH_SIZE)) {\n // can handle more data immediately\n callback();\n return;\n }\n // cannot handle more data until transaction completes\n this.writeBatch(callback);\n }", "static async createBatch() {\n return admin.firestore().batch();\n }", "async _write(body, enc, next) {\n debug.extend('_write')('writing 1 record')\n\n /**\n * Push the object to ES and indicate that we are ready for the next one.\n * Be sure to propagate any errors:\n */\n\n try {\n await this.client.index({\n index: this.config.index,\n type: this.config.type,\n id: this.idFn(body),\n refresh: this.config.refresh,\n body\n })\n this.written++\n this.logRate()\n next()\n } catch(err) {\n next(err)\n }\n }", "async fetchDetailsAndWriteIntoLocalFile(params) {\n const oThis = this;\n\n let startOffset = params.startOffset;\n\t\t\t\tlet endOffset = params.endOffset;\n\t\t\t\tlet batchNumber = params.batchNumber;\n\t\t\t\tlet lastProcessTime = params.lastProcessTime;\n\t\t\t\tlet fileName = oThis.localDirFullFilePath + \"/\" + batchNumber + \"_\" + Date.now() + '.csv';\n\t\t\t\tlet offset = startOffset;\n\n\t\t\t\tconsole.info(oThis.model.tableName, \"- started fetchDetailsAndWriteIntoLocalFile for batch\", batchNumber);\n\n let records;\n let totalRecordProcessed = 0;\n\n let localWriteObj = new localWrite({separator: \"|\"});\n let arrayOfList = [];\n const recordsToWriteOnce = 1000;\n\n while (offset < endOffset) {\n\n\t\t\t\t\tlet limit = oThis.mysqlLimit > (endOffset - offset) ? (endOffset - offset) : oThis.mysqlLimit;\n\n records = await oThis.model.fetchData({\n\t\t\t\t\t\t\t\tlastProcessTime: lastProcessTime,\n\t\t\t\t\t\t\t\tlimit: limit,\n offset: offset\n });\n\n\t\t\t\t\t\ttotalRecordProcessed += records.length;\n\n if (totalRecordProcessed >= recordsToWriteOnce) {\n totalRecordProcessed = 0;\n fileName = oThis.localDirFullFilePath + \"/\" + batchNumber + \"_\" + Date.now() + '.csv';\n }\n\n let r = oThis.formatData(records);\n\n if (!r.success) {\n return r;\n }\n\n arrayOfList = r.data.arrayOfList;\n if (arrayOfList.length > 0) {\n\t\t\t\t\t\t\tawait localWriteObj.writeArray(arrayOfList, fileName);\n }\n\n if (arrayOfList.length < limit) {\n return Promise.resolve(responseHelper.successWithData({hasRows: true}));\n }\n\t\t\t\t\toffset += limit;\n }\n\n }", "function writeMultipleRows() {\n var data = getOrdersData();\n var lastRow = SpreadsheetApp.getActiveSheet().getLastRow();\n SpreadsheetApp.getActiveSheet().getRange(lastRow + 1,1,data.length, data[0].length).setValues(data);\n}", "batchInsert(tableName, insertItems) {\n // creating the params object\n let params = {\n RequestItems: {}\n };\n let icount = 0;\n let recursive = false;\n const BreakException = {};\n \n // const mapExceptions = { types: { public: 'B', private: 'B' } };\n \n params.RequestItems[tableName] = [];\n \n // processing the items to insert\n // const putRequests = [];\n \n if(insertItems.length > 25) {\n recursive = true;\n }\n \n try {\n insertItems.forEach(item => {\n let request = {\n PutRequest: {\n Item: {}\n }\n };\n \n request.PutRequest.Item['id'] = { 'S': item.key };\n // delete item.key;\n \n let forBinary = {};\n \n let cleanItem = this.cleanObject(item);\n // this.logger.debug(JSON.stringify(item));\n \n request.PutRequest.Item = { ...request.PutRequest.Item, ...attr.wrap(cleanItem) };\n // this.logger.debug(JSON.stringify(request.PutRequest.Item)); process.exit();\n // adding each insert request object\n params.RequestItems[tableName].push(request);\n icount++;\n \n // removing current item from insertItems\n let index = insertItems.findIndex(element => {\n return _.isEqual(element, item);\n });\n \n if(index > -1) {\n insertItems = insertItems.slice(index+1);\n }\n \n if(icount >= 25) {\n // insertItems = insertItems.slice(24);\n icount = 0;\n throw BreakException;\n }\n });\n } catch(e) {\n if (e !== BreakException) throw e;\n }\n \n // this.logger.debug(JSON.stringify(params)); process.exit();\n // console.log(insertItems.length, params.RequestItems[tableName].length); process.exit();\n // this.logger.debug(JSON.stringify(params)); process.exit();\n // this.logger.debug(JSON.stringify(params));\n \n // after generates all the params, then batch to save\n this.dynamodb.batchWriteItem(params, (err, data) => {\n if(err) {\n this.logger.debug(\"Error inserting data. JSON Error: \" + JSON.stringify(err));\n process.exit(1);\n } else {\n if(recursive) {\n this.logger.info('Batch inserted!');\n // this.logger.info('New insert:::::::::::::::');\n // this.logger.debug(JSON.stringify(insertItems));\n this.batchInsert(tableName, insertItems);\n } else {\n this.logger.info('Success: ', data);\n this.logger.info('END the work!');\n process.exit();\n }\n }\n });\n }", "function SPHttpClientBatch(serviceScope, batchCreationOptions) {\r\n var _this = this;\r\n this._batchedRequests = [];\r\n serviceScope.whenFinished(function () {\r\n _this._fetchProvider = serviceScope.consume(fetchProviderServiceKey);\r\n _this._randomNumberGenerator = serviceScope.consume(RandomNumberGenerator.serviceKey);\r\n _this._digestCache = serviceScope.consume(DigestCache.serviceKey);\r\n });\r\n }", "_final(callback: WriteCallback) {\n this.writeBatch(callback);\n }", "function doBatchDelete(batch) {\r\n\r\n const requestBatch = buffer.nextKeys.map((keyVal) => {\r\n return {\r\n DeleteRequest: {\r\n Key: { [keyString]: keyVal }\r\n }\r\n };\r\n });\r\n\r\n let params = {\r\n RequestItems: {}\r\n };\r\n\r\n params.RequestItems[tableName] = requestBatch;\r\n\r\n return new Promise((resolve, reject) => {\r\n setTimeout(() => {\r\n const toResolve = docClient.batchWrite(params).promise()\r\n .then(data => {\r\n return data;\r\n });\r\n\r\n resolve(toResolve)\r\n }, writeDelay);\r\n })\r\n }", "async flush() {\n if (this._timer) {\n clearTimeout(this._timer);\n delete this._timer;\n }\n const batch = this._requests;\n const batchSize = batch.length;\n const deferred = this._onFlush;\n this._requests = [];\n this.numPendingRequests -= batchSize;\n delete this._onFlush;\n try {\n await this._sendBatch(batch);\n }\n catch (e) {\n this._subscriber.emit('error', e);\n }\n if (deferred) {\n deferred.resolve();\n }\n }", "async batchMinedPayments( )\n {\n var self = this ;\n\n var unbatched_pmnts = await self.mongoInterface.findAll('balance_payment',{batchId: null})\n\n\n var batchedPayments = 0;\n\n\n const MIN_PAYMENTS_IN_BATCH = 5; //5\n\n if( unbatched_pmnts.length >= MIN_PAYMENTS_IN_BATCH)\n {\n\n\n var batchData = {\n id: web3utils.randomHex(32),\n confirmed: false\n }\n\n await self.mongoInterface.upsertOne('payment_batch',{id: batchData.id}, batchData )\n\n\n\n var paymentsToBatch = unbatched_pmnts.slice(0,25) //max to batch is 25\n\n for( var element of paymentsToBatch ) {\n\n element.batchId = batchData.id;\n\n await self.mongoInterface.upsertOne('balance_payment',{id: element.id}, element )\n\n batchedPayments++;\n\n }\n\n\n }\n\n return {success:true,batchedPayments:batchedPayments} ;\n }", "function doBulkWrite(db) {\n const data = request.body.data;\n const bulkPromises = [];\n\n for (var collectionName in data) {\n var promise = getBulkWritePromise(db, collectionName, data);\n bulkPromises.push(promise);\n }\n\n return Promise.all(bulkPromises);\n }", "function gdriveUpload(reader, file, chunk, chunkIdx, data, callNb) {\n // Create a new file with the name provided inside the 'data' buffer\n var uri = 'https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart';\n var requestMessage = Windows.Web.Http.HttpRequestMessage(Windows.Web.Http.HttpMethod.post, new Windows.Foundation.Uri(uri));\n var httpClient = new Windows.Web.Http.HttpClient();\n if (callNb == undefined) {\n callNb = 0;\n }\n requestMessage.content = new Windows.Web.Http.HttpBufferContent(data);\n requestMessage.content.headers.append('Content-Type', 'multipart/related; boundary=trustydrive_separator');\n requestMessage.headers.append('Authorization', 'Bearer ' + chunk.provider.token);\n httpClient.sendRequestAsync(requestMessage).then(function (success) {\n if (success.isSuccessStatusCode) {\n success.content.readAsStringAsync().then(function (jsonInfo) {\n chunk.info[chunkIdx]['id'] = $.parseJSON(jsonInfo)['id'];\n uploadComplete(reader, file);\n });\n } else {\n if (callNb < 5) {\n setTimeout(function () {\n gdriveUpload(reader, file, chunk, chunkIdx, data, callNb + 1);\n }, 1000);\n }\n }\n });\n}", "function postBulkDataToThingSpeak(bulkData) {\r\n // Build the post string from the given data object\r\n var postData = {\r\n \"write_api_key\" : ThingSpeakSensorWritekey,\r\n \"time_format\" : \"relative\",\r\n \"updates\" : bulkData\r\n };\r\n var postDataStr = JSON.stringify(postData);\r\n \r\n // An object of options to indicate where to post to\r\n var post_options = {\r\n host: 'api.thingspeak.com',\r\n port: '80',\r\n path: '/channels/8203/bulk_update.json',\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Content-Length': Buffer.byteLength(postDataStr)\r\n }\r\n };\r\n\r\n // Set up the request\r\n var post_req = http.request(post_options, function(res) {\r\n res.setEncoding('utf8');\r\n res.on('data', function (chunk) {\r\n console.log('Response: ' + chunk);\r\n });\r\n });\r\n \r\n // post the data\r\n console.log(\"Posting: \" + postDataStr);\r\n post_req.write(postDataStr);\r\n post_req.end();\r\n}", "async scheduledFlush() {\n for (let k in this.buffers) {\n const buffer = this.buffers[k];\n if (buffer.rec_count !== 0 && buffer.time_limit >0 && new Date(buffer.created.getTime() + 1000 * buffer.time_limit) <= new Date()) {\n await this.close(buffer.domain, buffer.namespace);\n if (!this.shuttingDown) await this.open(buffer.domain, buffer.namespace, buffer.size_limit, buffer.time_limit);\n }\n }\n await this.upload();\n }", "async function batchYouTubeRequest({ endpoint, ids, playlistIds, ...options }) {\n let idField = 'id';\n let batchSize = MAX_YOUTUBE_BATCH_SIZE;\n const [model, action] = endpoint.split('.');\n const apiOptions = { ...options };\n let response;\n\n // Only the playlists endpoint can't accept batches of IDs and uses a different field name\n if (playlistIds) {\n batchSize = 1;\n idField = 'playlistId';\n ids = playlistIds;\n }\n\n const quotaCost =\n options.part.split(',').reduce((acc, part) => acc + partQuotas[part], 1) *\n Math.ceil(ids.length / batchSize);\n\n const message = `YouTube API quota used for ${endpoint}: ${quotaCost}`;\n logMessage({\n message,\n scope: 'batchYouTubeRequest',\n expiresIn: { days: 60 },\n metaData: { endpoint, quotaCost }\n });\n\n // Loop through each batch of updates (wrap async map in Promise.all())\n return (\n await Promise.all(\n chunks(ids, batchSize).map(async (chunk) => {\n apiOptions[idField] = chunk.join(',');\n\n debug(`batchYouTubeRequest to ${endpoint}`, apiOptions);\n try {\n response = await youtube[model][action](apiOptions);\n } catch (err) {\n throw new APIError(500, `YouTube API error calling ${endpoint} (${err.message})`);\n }\n\n return response.data.items;\n })\n )\n ).flat();\n}", "function gdriveUpdate(reader, file, chunk, chunkIdx, data, callNb) {\n // Update the content of an existing file from its ID\n var uri = 'https://www.googleapis.com/upload/drive/v3/files/' + chunk.info[chunkIdx].id + '?uploadType=media';\n var requestMessage = Windows.Web.Http.HttpRequestMessage(Windows.Web.Http.HttpMethod.patch, new Windows.Foundation.Uri(uri));\n var httpClient = new Windows.Web.Http.HttpClient();\n if (callNb == undefined) {\n callNb = 0;\n }\n requestMessage.content = new Windows.Web.Http.HttpBufferContent(data);\n requestMessage.content.headers.append('Content-Type', 'application/octet-stream');\n requestMessage.headers.append('Authorization', 'Bearer ' + chunk.provider.token);\n httpClient.sendRequestAsync(requestMessage).then(function (success) {\n if (success.isSuccessStatusCode) {\n uploadComplete(reader, file);\n } else {\n if (callNb < 5) {\n setTimeout(function () {\n gdriveUpdate(reader, file, chunk, chunkIdx, data, callNb + 1);\n }, 1000);\n }\n }\n });\n}", "function BatchWriter(options, callback) {\n options = merge({\n maxMemory: 10*1024,\n latency: 30*1000,\n timeout: 5*1000,\n threads: 10,\n }, options || {});\n this.connection = options.connection;\n writerOptions = new accumuloTypes.WriterOptions();\n writerOptions.maxMemory = options.maxMemory;\n writerOptions.latencyMs = options.latency;\n writerOptions.timeoutMs = options.timeout;\n writerOptions.threads = options.threads;\n var writer = undefined;\n // this callback was necessary because i was getting through an entire write without the writer\n // being initialized. this will keep us from getting anywhere without having that\n this.connection.getProxy().createWriter(this.connection.getLogin(), options.table, writerOptions, function(err, w) {\n writer = w;\n callback(w);\n });\n this.is_closed = false;\n\n // add mutations to the writer\n this.addMutations = function(mutations, callback) {\n if (this.is_closed) {\n throw \"Can't write to a closed writer\"\n }\n cells = {}\n for (i = 0; i < mutations.length; i++) {\n cells[mutations[i].row] = typeof cells[mutations[i].row] !== 'undefined' ? cells[mutations[i].row] : [];\n for (j = 0; j < mutations[i].updates.length; j++) {\n cells[mutations[i].row].push(mutations[i].updates[j]);\n }\n }\n this.connection.getProxy().update(writer, cells, callback);\n callback();\n } \n\n // add a single mutation to the writer\n this.addMutation = function(mutation, callback) {\n if (this.is_closed) {\n throw \"Can't write to a closed writer\"\n }\n cells ={};\n cells[mutation.row] = mutation.updates;\n this.connection.getProxy().update(writer, cells);\n callback();\n }\n \n // flush the updates\n this.flush = function(callback) {\n if (this.is_closed) {\n throw \"Can't flush a closed writer\"\n }\n this.connection.getProxy().flush(writer);\n callback();\n }\n\n // close the writer\n this.close = function(callback) {\n this.connection.getProxy().closeWriter(writer);\n this.is_closed = true;\n callback();\n }\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function next() {\n\n if (pointer >= amount)\n return callback(false, bulk);\n\n var amountParams = bulk[pointer].params.length;\n\n bulk[pointer].batches = new Array();\n\n var i, j;\n for (i = 0, j = bulk[pointer].params.length; i < j; i += limitOfBatch) {\n bulk[pointer].batches.push(bulk[pointer].params.slice(i, i + limitOfBatch));\n }\n\n var amountBatches = bulk[pointer].batches.length;\n var pointerBatches = 0;\n\n console.log(\"Bulk number: \" + (pointer + 1) + \" of \" + amount);\n console.log(\"Amount queries: \" + amountParams + \" limitOfBatch: \" + limitOfBatch);\n console.log(\"Amount batches: \" + amountBatches);\n\n function nextBatch() {\n if (pointerBatches >= amountBatches) {\n pointer++;\n next();\n } else {\n\n db.query(bulk[pointer].sql, [bulk[pointer].batches[pointerBatches]], function (err) {\n if (err) return callback(err);\n pointerBatches++;\n console.log(\"Sql batch complete: \" + pointerBatches + \" of \" + amountBatches);\n nextBatch();\n });\n }\n }\n nextBatch();\n }", "function batchSendLocalData_andClearStorageAfterwards() {\r\n\r\n\tconsole.log(\"[Matin] Sending data started...\");\r\n\tkRows = 150;\r\n\tmaxNoOfAttempts = 5;\r\n\twhile(globalData.length > 0) {\r\n\r\n\t\t// pop top 150 values\r\n\t\tvar sendingArray = [];\r\n\r\n\t\twhile(sendingArray.length < kRows && globalData.length > 0){\r\n\t\t\tsendingArray.push(globalData[0]);\r\n\t\t\tglobalData.shift();\r\n\t\t}\r\n\t\tconsole.log(\"[Matin] A package of \" + kRows + \" rows is being sent...\");\r\n\t\tsendFlag = false;\r\n\t\tattemptsNo = 0;\r\n\t\twhile(!sendFlag && attemptsNo < maxNoOfAttempts) {\r\n\t\t\tsendFlag = batchSendLocalData_kRowsAtATime(sendingArray);\r\n\t\t\tattemptsNo++;\r\n\t\t}\r\n\t\tif(!sendFlag) {\r\n\t\t\tconsole.log(\"[Matin] Some data could not be sent to the server in \" + maxNoOfAttempts + \" tries. Data should not be cleared.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"Data export complete\");\r\n\tclearDB();\r\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n }", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new __WEBPACK_IMPORTED_MODULE_3_pouchdb_collections__[\"a\" /* Map */]();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = {};\n requests.forEach(function (request) {\n if (request.id in requestsById) {\n requestsById[request.id].push(request);\n } else {\n requestsById[request.id] = [request];\n }\n });\n\n var numDocs = Object.keys(requestsById).length;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = Object.keys(requestsById);\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById[docId];\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function writeToAllGames(game, gb_api) {\n var active_sheet = allGamesSheet(),\n all_games_array = getDataFromAllGames();\n\n //Logger.log(game);\n var sheet = SpreadsheetApp.getActiveSheet(),\n row = sheet.getLastRow() + 1;\n if (gb_api){\n\n var values_to_save = [game.steam_id, game.gb_id, game.name, game.release_date,\n arrayToDashDelimited(game.concepts).join('|'),\n arrayToDashDelimited(game.developers).join('|'),\n arrayToDashDelimited(game.genres).join('|'),\n arrayToDashDelimited(game.similar_games).join('|'),\n arrayToDashDelimited(game.themes).join('|'), gb_api],\n range = sheet.getRange(row,1,1,values_to_save.length);\n\n\n } else {\n if (game.steam_id == '') { return true; }\n var values_to_save = [game.steam_id, game.gb_id, game.name, '',\n '',\n '',\n '',\n '',\n '', gb_api],\n range = sheet.getRange(row,1,1,values_to_save.length);\n }\n Logger.log('writing ' + game.name + ' to AllGames');\n\n range.setValues([values_to_save]);\n return true; // returns true if it put an entry into AllGames\n\n}", "flush() {\n // Pending Promises for _putMetricData calls\n const promises = []\n\n // Get a CloudWatch client (this will be falsy if we're not\n // really sending)\n const cw = this._setup()\n while (this._queue.length) {\n // Grab a batch of metrics from the queue - the maximum batch\n // size is 20.\n const queue = this._queue.slice(0, 20)\n this._queue = this._queue.slice(20)\n\n // Send the metrics\n promises.push(this._putMetricData(cw, queue))\n }\n\n return Promise.all(promises).catch(\n /* istanbul ignore next */\n (err) => console.warn(`Metrics: error during flush: ${err}`)\n )\n }", "function batchRequests(coords){\n var batchSize = parameters.batchSize-1;\n\n for (var c = 0; c < coords.length; c+=batchSize){\n var batch = coords.slice(c,c+batchSize);\n batch.unshift(startingPosition);\n makeRequest(batch)\n }\n }", "function bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new pouchdbCollections.Map();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n var formatResult = identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n }", "function bulkGet(db, opts, callback) {\n\t var requests = opts.docs;\n\n\t // consolidate into one request per doc if possible\n\t var requestsById = new ExportedMap();\n\t requests.forEach(function (request) {\n\t if (requestsById.has(request.id)) {\n\t requestsById.get(request.id).push(request);\n\t } else {\n\t requestsById.set(request.id, [request]);\n\t }\n\t });\n\n\t var numDocs = requestsById.size;\n\t var numDone = 0;\n\t var perDocResults = new Array(numDocs);\n\n\t function collapseResultsAndFinish() {\n\t var results = [];\n\t perDocResults.forEach(function (res) {\n\t res.docs.forEach(function (info) {\n\t results.push({\n\t id: res.id,\n\t docs: [info]\n\t });\n\t });\n\t });\n\t callback(null, {results: results});\n\t }\n\n\t function checkDone() {\n\t if (++numDone === numDocs) {\n\t collapseResultsAndFinish();\n\t }\n\t }\n\n\t function gotResult(docIndex, id, docs) {\n\t perDocResults[docIndex] = {id: id, docs: docs};\n\t checkDone();\n\t }\n\n\t var allRequests = [];\n\t requestsById.forEach(function (value, key) {\n\t allRequests.push(key);\n\t });\n\n\t var i = 0;\n\n\t function nextBatch() {\n\n\t if (i >= allRequests.length) {\n\t return;\n\t }\n\n\t var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n\t var batch = allRequests.slice(i, upTo);\n\t processBatch(batch, i);\n\t i += batch.length;\n\t }\n\n\t function processBatch(batch, offset) {\n\t batch.forEach(function (docId, j) {\n\t var docIdx = offset + j;\n\t var docRequests = requestsById.get(docId);\n\n\t // just use the first request as the \"template\"\n\t // TODO: The _bulk_get API allows for more subtle use cases than this,\n\t // but for now it is unlikely that there will be a mix of different\n\t // \"atts_since\" or \"attachments\" in the same request, since it's just\n\t // replicate.js that is using this for the moment.\n\t // Also, atts_since is aspirational, since we don't support it yet.\n\t var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n\t docOpts.open_revs = docRequests.map(function (request) {\n\t // rev is optional, open_revs disallowed\n\t return request.rev;\n\t });\n\n\t // remove falsey / undefined revisions\n\t docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\n\t var formatResult = identityFunction;\n\n\t if (docOpts.open_revs.length === 0) {\n\t delete docOpts.open_revs;\n\n\t // when fetching only the \"winning\" leaf,\n\t // transform the result so it looks like an open_revs\n\t // request\n\t formatResult = formatResultForOpenRevsGet;\n\t }\n\n\t // globally-supplied options\n\t ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n\t if (param in opts) {\n\t docOpts[param] = opts[param];\n\t }\n\t });\n\t db.get(docId, docOpts, function (err, res) {\n\t var result;\n\t /* istanbul ignore if */\n\t if (err) {\n\t result = [{error: err}];\n\t } else {\n\t result = formatResult(res);\n\t }\n\t gotResult(docIdx, docId, result);\n\t nextBatch();\n\t });\n\t });\n\t }\n\n\t nextBatch();\n\n\t}", "save(counters) {\n if (this._client == null)\n return;\n let dimensions = [];\n dimensions.push({\n Name: \"InstanceID\",\n Value: this._instance\n });\n let now = new Date();\n let data = [];\n counters.forEach(counter => {\n data.push(this.getCounterData(counter, now, dimensions));\n if (data.length >= 20) {\n async.series([\n (callback) => {\n this._client.putMetricData(params, function (err, data) {\n if (err) {\n if (this._logger)\n this._logger.error(\"cloudwatch_counters\", err, \"putMetricData error\");\n }\n callback(err);\n });\n },\n (callback) => {\n data = [];\n callback();\n }\n ]);\n }\n });\n var params = {\n MetricData: data,\n Namespace: this._source\n };\n if (data.length > 0) {\n this._client.putMetricData(params, function (err, data) {\n if (err) {\n if (this._logger)\n this._logger.error(\"cloudwatch_counters\", err, \"putMetricData error\");\n }\n });\n }\n }", "function batch_rec(batches, userid_table, count, connection, callback) {\n if (batches && batches.length) {\n batch(batches[0], userid_table, count, connection, (err) => {\n if (err) {\n callback(err)\n } else {\n batches.shift()\n count ++\n return batch_rec(batches, userid_table, count, connection, callback)\n }\n })\n } else {\n callback(null)\n }\n}", "function queue (key, batch) {\n var keys = Array.isArray(key) ? key : [key] \n batch = batch || []\n var toStart = []\n\n keys.forEach(function (key) { \n toStart.push({key: key, i: ++I})\n batch.push({type: 'put', key: toKey(key, I), value: key})\n })\n\n if(batch.length)\n db.batch(batch, function (err) {\n if(err) throw err //? is this the right thing to do here?\n toStart.forEach(function (a) {\n start(a.key, a.i)\n })\n })\n }", "function bulkGet(db, opts, callback) {\n\t var requests = opts.docs;\n\t\n\t // consolidate into one request per doc if possible\n\t var requestsById = {};\n\t requests.forEach(function (request) {\n\t if (request.id in requestsById) {\n\t requestsById[request.id].push(request);\n\t } else {\n\t requestsById[request.id] = [request];\n\t }\n\t });\n\t\n\t var numDocs = Object.keys(requestsById).length;\n\t var numDone = 0;\n\t var perDocResults = new Array(numDocs);\n\t\n\t function collapseResultsAndFinish() {\n\t var results = [];\n\t perDocResults.forEach(function (res) {\n\t res.docs.forEach(function (info) {\n\t results.push({\n\t id: res.id,\n\t docs: [info]\n\t });\n\t });\n\t });\n\t callback(null, {results: results});\n\t }\n\t\n\t function checkDone() {\n\t if (++numDone === numDocs) {\n\t collapseResultsAndFinish();\n\t }\n\t }\n\t\n\t function gotResult(docIndex, id, docs) {\n\t perDocResults[docIndex] = {id: id, docs: docs};\n\t checkDone();\n\t }\n\t\n\t var allRequests = Object.keys(requestsById);\n\t\n\t var i = 0;\n\t\n\t function nextBatch() {\n\t\n\t if (i >= allRequests.length) {\n\t return;\n\t }\n\t\n\t var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n\t var batch = allRequests.slice(i, upTo);\n\t processBatch(batch, i);\n\t i += batch.length;\n\t }\n\t\n\t function processBatch(batch, offset) {\n\t batch.forEach(function (docId, j) {\n\t var docIdx = offset + j;\n\t var docRequests = requestsById[docId];\n\t\n\t // just use the first request as the \"template\"\n\t // TODO: The _bulk_get API allows for more subtle use cases than this,\n\t // but for now it is unlikely that there will be a mix of different\n\t // \"atts_since\" or \"attachments\" in the same request, since it's just\n\t // replicate.js that is using this for the moment.\n\t // Also, atts_since is aspirational, since we don't support it yet.\n\t var docOpts = pick(docRequests[0], ['atts_since', 'attachments']);\n\t docOpts.open_revs = docRequests.map(function (request) {\n\t // rev is optional, open_revs disallowed\n\t return request.rev;\n\t });\n\t\n\t // remove falsey / undefined revisions\n\t docOpts.open_revs = docOpts.open_revs.filter(identityFunction);\n\t\n\t var formatResult = identityFunction;\n\t\n\t if (docOpts.open_revs.length === 0) {\n\t delete docOpts.open_revs;\n\t\n\t // when fetching only the \"winning\" leaf,\n\t // transform the result so it looks like an open_revs\n\t // request\n\t formatResult = formatResultForOpenRevsGet;\n\t }\n\t\n\t // globally-supplied options\n\t ['revs', 'attachments', 'binary', 'ajax'].forEach(function (param) {\n\t if (param in opts) {\n\t docOpts[param] = opts[param];\n\t }\n\t });\n\t db.get(docId, docOpts, function (err, res) {\n\t var result;\n\t /* istanbul ignore if */\n\t if (err) {\n\t result = [{error: err}];\n\t } else {\n\t result = formatResult(res);\n\t }\n\t gotResult(docIdx, docId, result);\n\t nextBatch();\n\t });\n\t });\n\t }\n\t\n\t nextBatch();\n\t\n\t}", "function index_browser_es_bulkGet(db, opts, callback) {\n var requests = opts.docs;\n\n // consolidate into one request per doc if possible\n var requestsById = new index_es_ExportedMap();\n requests.forEach(function (request) {\n if (requestsById.has(request.id)) {\n requestsById.get(request.id).push(request);\n } else {\n requestsById.set(request.id, [request]);\n }\n });\n\n var numDocs = requestsById.size;\n var numDone = 0;\n var perDocResults = new Array(numDocs);\n\n function collapseResultsAndFinish() {\n var results = [];\n perDocResults.forEach(function (res) {\n res.docs.forEach(function (info) {\n results.push({\n id: res.id,\n docs: [info]\n });\n });\n });\n callback(null, {results: results});\n }\n\n function checkDone() {\n if (++numDone === numDocs) {\n collapseResultsAndFinish();\n }\n }\n\n function gotResult(docIndex, id, docs) {\n perDocResults[docIndex] = {id: id, docs: docs};\n checkDone();\n }\n\n var allRequests = [];\n requestsById.forEach(function (value, key) {\n allRequests.push(key);\n });\n\n var i = 0;\n\n function nextBatch() {\n\n if (i >= allRequests.length) {\n return;\n }\n\n var upTo = Math.min(i + index_browser_es_MAX_NUM_CONCURRENT_REQUESTS, allRequests.length);\n var batch = allRequests.slice(i, upTo);\n processBatch(batch, i);\n i += batch.length;\n }\n\n function processBatch(batch, offset) {\n batch.forEach(function (docId, j) {\n var docIdx = offset + j;\n var docRequests = requestsById.get(docId);\n\n // just use the first request as the \"template\"\n // TODO: The _bulk_get API allows for more subtle use cases than this,\n // but for now it is unlikely that there will be a mix of different\n // \"atts_since\" or \"attachments\" in the same request, since it's just\n // replicate.js that is using this for the moment.\n // Also, atts_since is aspirational, since we don't support it yet.\n var docOpts = index_browser_es_pick(docRequests[0], ['atts_since', 'attachments']);\n docOpts.open_revs = docRequests.map(function (request) {\n // rev is optional, open_revs disallowed\n return request.rev;\n });\n\n // remove falsey / undefined revisions\n docOpts.open_revs = docOpts.open_revs.filter(index_browser_es_identityFunction);\n\n var formatResult = index_browser_es_identityFunction;\n\n if (docOpts.open_revs.length === 0) {\n delete docOpts.open_revs;\n\n // when fetching only the \"winning\" leaf,\n // transform the result so it looks like an open_revs\n // request\n formatResult = index_browser_es_formatResultForOpenRevsGet;\n }\n\n // globally-supplied options\n ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) {\n if (param in opts) {\n docOpts[param] = opts[param];\n }\n });\n db.get(docId, docOpts, function (err, res) {\n var result;\n /* istanbul ignore if */\n if (err) {\n result = [{error: err}];\n } else {\n result = formatResult(res);\n }\n gotResult(docIdx, docId, result);\n nextBatch();\n });\n });\n }\n\n nextBatch();\n\n}", "function updateBatch(db, roomID, dataToBatch) { \n const batch = db.batch();\n\n const sfRef = db.collection('Room').doc(roomID);\n sfRef.update(dataToBatch);\n\n batch.commit();\n }", "createBatch() {\r\n return this.web.createBatch();\r\n }", "async stopRecordingRequests() {\n if (!this.isRecordingRequests) {\n throw new Error('You need to start recording before stopping');\n }\n const batch = {\n intent: this.intent,\n requests: this.currentRequestsRecorded,\n validationErrors: lodash_1.compact(this.currentValidationErrorsRecorded),\n runtimeErrors: this.currentRuntimeErrorsRecorded\n };\n this.requestBatches.push(batch);\n this.isRecordingRequests = false;\n this.currentRequestsRecorded = [];\n this.currentValidationErrorsRecorded = [];\n this.intent = null;\n }", "async batch (items) {\n try {\n for (const item of items) item.id = this.getNextRequestId++\n\n const data = await makeHTTPRequest(this.opts, JSON.stringify(items))\n const batch = JSON.parse(data)\n if (!Array.isArray(batch)) throw new Error(JSON.stringify(batch))\n\n const itemsById = lodash.keyBy(items, 'id')\n for (const { result, error, id } of batch) {\n const { resolve, reject } = itemsById[id]\n if (error) reject(Object.assign(new Error(error.message || error.code), { code: error.code }))\n else if (result === undefined) reject(new TypeError('Missing RPC result'))\n else resolve(result)\n }\n } catch (e) {\n if (e.message === 'Internal server error') {\n return this.batch(items)\n }\n throw e\n }\n }", "_write(chunk, encoding, callback) {\n const write = () => {\n this._writeRequest(chunk, encoding, callback);\n };\n if (this.requestInitialized) {\n write();\n }\n else {\n this[kJobs].push(write);\n }\n }", "function addUpdates(batch, data) {\n if (typeof data.update === 'undefined') return;\n\n for (var i = 0; i < data.update.length; i++) {\n var doc = data.update[i];\n var id = castId(doc._id);\n\n delete doc._id;\n\n batch.find({_id: id}).updateOne({$set: doc});\n }\n }", "static async commitBatch(batch) {\n return batch.commit();\n }", "function bulkInsert(data, cb){\n db.Workout.bulkWrite(data)\n .then(dbTransaction => {\n cb(dbTransaction);\n })\n .catch(err => {\n cb((err));\n });\n}", "async _apply (batch) {\n const b = this.bee.batch({ update: false })\n for (const node of batch) {\n const op = JSON.parse(node.value.toString())\n // TODO: Handle deletions\n if (op.type === 'put') await b.put(op.key, op.value)\n }\n await b.flush()\n }", "async function giantBombAPICall (offset, dataAccum) {\n let URL = genApiURL(offset);\n await axios.get(URL)\n .then( (response) => {\n const maxOffset = response.data.number_of_total_results;\n const currentOffset = response.data.offset\n const offsetStore = response.data.number_of_page_results;\n const limit = response.data.limit;\n // for testing code below changed from < maxOffset - limit to 300 to test popDB with 100 results\n if (currentOffset + offsetStore < maxOffset - limit) {\n bombDB(currentOffset + offsetStore, response, dataAccum);\n } else {\n console.log(\"Giant Bomb download complete!\");\n fs.writeFile(\"dataAccum.json\", JSON.stringify(dataAccum, null, \" \"),function (err) {\n if (err) throw err;\n console.log('Saved!');\n });\n } \n }) \n}", "function storeFinalData(results, callback) {\n var updatedFinalData = results.merge_all_final_data;\n var bulk = Data.collection.initializeOrderedBulkOp();\n var bulkExecute;\n var now = new Date();\n\n //set the update parameters for query\n bulkExecute = false;\n for (var i = 0; i < updatedFinalData.length; i++) {\n\n //next(null,{'error':{'metricId':dataFromDb[j].data.metricId,'objectId':dataFromDb[j].data.objectId}})\n if (results.merge_all_final_data[i].error) {\n console.log('results.merge_all_final_data[i].error', results.merge_all_final_data[i].error)\n //bulkExecute = false;\n var mailOptions = {\n from: 'Datapoolt Team <[email protected]>',\n to: '[email protected]',\n subject: 'Error alert for the metric' + results.merge_all_final_data[i].error.metricId + 'and object id' + results.merge_all_final_data[i].error.objectId,\n\n // HTML Version\n // html: '<span>The data has crossed the limit of <b>' + thresholdValue + '</b></span>' + '<span> for the metric <b>' + metric.name + '</b></span>' + '<span> in <b>' + object.name + '</b></span>'\n\n };\n utility.sendEmail(mailOptions, '', function (err, response) {\n //callback(null, 'success');\n console.log('errormail', response)\n });\n errorDataList.push(results.merge_all_final_data[i].error)\n }\n else if (results.merge_all_final_data[i] != 'DataFromDb' && !results.merge_all_final_data[i].error) {\n bulkExecute = true;\n\n //set query condition\n var query = {\n 'objectId': results.data[i].objectId,\n 'metricId': results.data[i].metricId\n };\n\n //set the values\n var update = {\n $setOnInsert: {created: now},\n $set: {\n data: results.merge_all_final_data[i],\n updated: now\n }\n };\n\n //form the query\n bulk.find(query).upsert().update(update);\n }\n }\n if (bulkExecute === true) {\n\n //Doing the bulk update\n bulk.execute(function (err, response) {\n callback(err, 'success');\n });\n }\n }", "function sendTimeSeries(err) {\n if (err) {\n callback(err);\n } else {\n // put <name> <seconds_timestamp> <value>\n if (!opentsdb.write('put ' + metric.toString() + '\\n', 'ascii', callback)) {\n // Record failure in statsd\n statsClient.increment('opentsdb.write.delayed');\n\n // This should not be a problem unless data is queued for too long\n log.info('OpenTSDB data queued for writing');\n } else {\n // Record the time to process the request in statsd\n statsClient.timing('opentsdb.write.time', Date.now() - startTime);\n }\n }\n }", "function simulateWaterMarkRequest() {\n //Mimic 12 clients requesting documents to be watermarked at once.\n if (docs.length > 0) {\n var doc = docs.shift();\n //Rest API for retieving a ticket for a Document being watermarked in the future.\n watermark(doc).then(function(ticket) {\n tickets.push(ticket);\n console.log('ticket created:', ticket);\n console.log('tickets are: ' + tickets);\n });\n //Simulate request traffic\n setTimeout(simulateWaterMarkRequest, 100 * Math.random());\n }\n}", "function doBulkWriteCollection(collection, data) {\n return new Promise(function (resolve, reject) {\n const batch = collection.initializeOrderedBulkOp();\n\n addInserts(batch, data);\n addUpdates(batch, data);\n addDeletes(batch, data);\n\n batch.execute(function(error, result) {\n error ? reject(error) : resolve();\n });\n });\n }", "function sendToOnlineDB(entriesToAdd){\n // other files use fetch() so let's do that\n fetch(\"/api/transaction/bulk\", {\n method: \"POST\",\n body: allContent\n }).then(function (response){\n console.log(response);\n });\n}", "function dataGeneration(client, howMany) {\n console.log('Starting to insert', howMany);\n\n function batch(count, ID, callback) {\n const options = { count: 10, min: 0, max: 10000000 };\n const queries = [];\n\n if (count >= howMany / 50) {\n callback();\n return;\n } else {\n\n const query = `\n INSERT INTO tweets (id, content, isad, time, interactors) \n VALUES (?, ?, ?, ?, ?)\n `;\n \n let id;\n let content;\n let isAd;\n let date;\n let interactors;\n\n // Creates queries for batch insert into cassandra and elastic\n for (let i = 0; i < 50; i++) {\n id = uniqid();\n content = `tweet ${i}`;\n isAd = (i % 3 === 0);\n date = new Date();\n interactors = randomIntArray(options);\n const params = [id, content, isAd, date, interactors];\n queries.push({ query, params });\n }\n\n // Batch insert into cassandra\n client.batch(queries, { prepare: true }, (err) => {\n console.log(' Inserted ', ++count * 50);\n batch(count, ID, callback);\n });\n\n }\n }\n\n batch(0, 0, () => {\n console.log('Done...FUCK YEA NICK!!');\n });\n}", "function saveBulkPublicChat(){\n console.log('save bulk');\n db.collection('publicChat').insertMany(publicMessages)\n .then(function(result) {\n // process result\n //console.log(result);\n publicMessages = [];\n });\n}", "async function writeScrapedDataBatch(locations, timestamp) {\n // Generate Location RefIds\n const locationsWithRefIds = await addGeneratedIdsToLocations(locations);\n // Add Location documents for those that don't exist\n const itemsExistBools = await checkItemsExistByRefIds(\n \"locations\",\n locationsWithRefIds.map((loc) => loc.refId)\n );\n const nonExistentLocations = locationsWithRefIds.filter((_refId, idx) => {\n return !itemsExistBools[idx];\n });\n if (locationsWithRefIds.length) {\n await writeLocationsByRefIds(nonExistentLocations);\n }\n // Generate scraperRuns RefIds\n const locationsWithScraperRunIds = await addScraperRunIdsToLocations(\n locationsWithRefIds\n );\n // Write scraperRuns\n await writeScraperRunsByRefIds(locationsWithScraperRunIds, timestamp);\n\n // Generate appointment RefIds and filter on availability\n const locationsWithAllData = await addAppointmentsToLocations(\n locationsWithScraperRunIds\n );\n debug_log(\"locationsWithAllData\", locationsWithAllData);\n writeAppointmentsByRefIds(locationsWithAllData);\n}", "async function fake_main() {\n\n let recOutAll = []\n const recInAll = await csvIn.fromFile(inputFile)\n for (let i = 0; i < recInAll.length; i++) {\n let recIn = recInAll[i]\n /*\n if (i > 10) {\n break\n }\n */\n\n let recOut = {\n vrv: '2015',\n name: recIn.name,\n dispname: recIn.dispname,\n reihung: recIn.reihung\n }\n\n // console.log('' + i + ' ' + recOut.grpnum + '=' + recOut.name)\n recOutAll.push(recOut)\n }\n console.log('Begin: Write ' + recOutAll.length + ' records to db.')\n const tableName = 'vrv_bestandteile'\n await db(tableName).del().where({ vrv: '2015' })\n await db.batchInsert(tableName, recOutAll)\n console.log('End: Write to db.')\n}", "addLevelDBData(key,value){\n return new Promise((resolve, reject)=>{\n db.batch()\n .put(HEIGHT_KEY, key)\n .put(key, JSON.stringify(value))\n .write(function(err) {\n if (err) {\n console.log('Block ' + key + ' submission failed', err);\n reject(err);\n } else {\n resolve();\n }\n });\n\n });\n }", "async function gsrun(cl){\n\n //i think this is just to specify what api im using?\n const gsapi = google.sheets({version:'v4', auth:cl});\n\n //whenever we run one of the google sheets functions, you have to put in some options, and you can store that as a variable here just to make things easier\n const opt = {\n spreadsheetId: '1nTABNSFsGzwzLlEdNftxMXjJ9oSHyoKbenj8GJdClno',\n range: 'Sheet1!A2:B5'\n };\n\n //bulk has ALL data from that range, not just the values in cells. uncomment the log below to see what i mean\n let bulk = await gsapi.spreadsheets.values.get(opt);\n //console.log(bulk);\n\n //bulkArray here is getting the actual cell data, which is what we care about.\n let bulkArray = bulk.data.values;\n \n\n //these are a different set of options for actually writing things to the sheet\n //if you look at range and resource, you can see we're just taking the stuff that was read from the sheet and printing it slightly to the right\n const updateOpt = {\n spreadsheetId: '1nTABNSFsGzwzLlEdNftxMXjJ9oSHyoKbenj8GJdClno',\n range: 'Sheet1!E2',\n valueInputOption: 'USER_ENTERED',\n resource: {values: bulkArray}\n\n };\n\n //actually executing the options above\n let res = await gsapi.spreadsheets.values.update(updateOpt);\n\n\n}", "async function populateListings(location, limit) { \n const encodedLocation = location ? encodeURI(location) : consts.DEFAULT_LOCATION;\n const initialOpts = {\n clientId: consts.CLIENT_ID,\n location: encodedLocation,\n offset: 0,\n limit: consts.DEFAULT_LIMIT,\n priceMin: 0,\n priceMax: 5\n }\n log(`--- Populating listings for location ${location} on airbnb --- `);\n let listings = [];\n await getListings(initialOpts, listings, limit);\n log(`Now saving ${location} listings to database...`);\n try {\n const listingsBulk = RawListing.collection.initializeUnorderedBulkOp();\n listings.forEach(async page => {\n await Promise.all(page['search_results'].map(async record => {\n record['airbnb-demand-location'] = location; // tag listing record with our own location metadata\n await listingsBulk.find({'listing.id': record.listing.id}) // updates latest data and prevents duplicates \n .upsert()\n .updateOne(record); \n }));\n });\n await listingsBulk.execute(); \n log('Done saving listings to database.');\n await sleep(1000); \n } catch (err) {\n error('encountered error while saving listings to database: ', err);\n }\n}", "batchPermission(data){\nreturn this.post(Config.API_URL + Constant.USER_BATCHPERMISSION, data);\n}", "_writeToIndexDocumentQueue (batch) {\n const streamName = process.env.INDEX_DOCUMENT_STREAM_NAME\n const schemaName = process.env.INDEX_DOCUMENT_SCHEMA_NAME\n // Make sure stream-writing is configured\n if (streamName && schemaName) {\n this._getBibIdsForHoldingStatements(batch)\n .then((bibIds) => {\n const kinesisRecords = bibIds.map((bibId) => {\n return { type: 'record', uri: bibId }\n })\n return this._writeToStreamsClient(streamName, kinesisRecords, schemaName)\n .then(() => log.debug(`Wrote ${kinesisRecords.length} to ${streamName} (encoded against ${schemaName})`))\n })\n } else return Promise.resolve(batch)\n }", "function batchSendLocalData2() {\r\n\r\n\tif (globalData.length === 0){\r\n\t\tconsole.log(\"Data export complete\");\r\n\t\treturn;\r\n\t}\r\n\r\n\t// pop top 150 values\r\n\tvar sendingArray = [];\r\n\r\n\twhile(sendingArray.length < 150 && globalData.length > 0){\r\n\t\tsendingArray.push(globalData[0]);\r\n\t\tglobalData.shift();\r\n\t}\r\n\t\r\n\t$(\"#status\").css(\"background\",\"yellow\");\r\n\t\r\n\tconsole.log(sendingArray);\r\n\r\n\t$.post(\"https://cise.ufl.edu/~snair/consumedata.php\",\r\n\t\t\t{\r\n\t\tdata : JSON.stringify(sendingArray)\r\n\t\t\t}, \r\n\t\t\tfunction(data, status){\r\n\t\t\t\tconsole.log(\"Data: \" + data + \"\\nStatus: \" + status);\r\n\t\t\t\t$(\"#status\").css(\"background\",\"green\");\r\n\t\t\t\tbatchSendLocalData2();\r\n\t\t\t})\r\n\t\t\t.fail(function(data,status){\r\n\t\t\t\tconsole.log(\"Data: \" + data + \"\\nStatus: \" + status);\r\n\t\t\t\t$(\"#status\").css(\"background\",\"red\");\r\n\t\t\t\treturn;\r\n\t\t\t});\r\n}", "async function overwritePerformance(){\n\n\n /* Create a data object */\n data = [];\n\n /* Create the headers */\n data[0] = ['Date','Name','E-mail','Sales','Rating'];\n\n\n /* Create some rows of data */\n data[1] = ['2019-03-01','John Smith','[email protected]',10000,5];\n data[2] = ['2019-03-01','Sally Doe','[email protected]',5000,3];\n data[3] = ['2019-03-02','Sally Doe','[email protected]',7500,2];\n data[4] = ['2019-03-02','Mark Jack','[email protected]',9000,1];\n\n let response = await airshot.process('performance','upload','post',{\n broadcast_ID : 1,\n kpiIndicator : 'Sales',\n data : JSON.stringify(data),\n sheet_ID : sheet_ID, // Must be included to overwrite\n name : 'API Upload 1 (Overwrite)',\n });\n\n console.log(response);\n\n }", "function batch_sync(batches, userid_table, connection, callback) {\n async.waterfall([\n // Process the files and insert into userid_table\n function process(cb) {\n batch_rec(batches, userid_table, 0, connection, (err) => {\n if (err) {\n callback(err)\n } else {\n callback(null)\n }\n })\n },\n // Aggregate errors from userid_table\n function select(cb) {\n let cols = []\n for (rf of relevant_fields) {\n cols.push(rf)\n }\n cols.push('hash')\n cols.push('userid')\n const cols_string = comma(cols)\n const select_query = \"SELECT *, SUM(count) AS count FROM \" + userid_table + \" GROUP BY \" + cols_string\n \n connection.query(select_query, (err, result, fields) => {\n if (err) {\n cb(err)\n } else {\n cb(null, result)\n }\n })\n },\n // Flush userid_table\n function del(output, cb) {\n const delete_query = \"DELETE FROM \" + userid_table\n connection.query(delete_query, (err, result) => {\n if (err) {\n console.log('Error flushing: ' + userid_table)\n cb(err)\n } else {\n console.log('Flushed: ' + userid_table)\n cb(null, output)\n }\n })\n },\n // Insert aggregated errors into userid_table\n function insert(output, cb) {\n insert_table(output, userid_table, connection, (err) => {\n if (err) {\n console.log('Error aggregating errors in: ' + userid_table)\n cb(err)\n } else {\n console.log('Aggregated ' + output.length + ' errors into: ' + userid_table)\n cb(null, output)\n }\n })\n },\n ], \n function (err, result) {\n if (err) {\n callback(err)\n } else {\n callback(null, result)\n }\n })\n}", "function queueBatch(table, batch)\n{\n if (!batches[table]) batches[table] = [];\n batches[table].push({ table: table, batch: batch});\n}", "_flush(callback) {\n // ends json data.\n this._pushJSONPost();\n\n // end of flush\n callback();\n }", "patchBatch({\n dispatch\n }, list) {\n const url = `${endpointUrl}/batch-upsert`;\n return axios.post(url, list).then(result => {\n if (result.data.error) {\n throw new Error(result.data.error);\n }\n\n for (let i = 0, l = result.data.length; i < l; i++) {\n const resItem = result.data[i];\n dispatch('patch', {\n id: resItem.id,\n fields: resItem\n });\n }\n });\n }", "send({ projectId, batchId }) {\n\t\treturn client.patch(`/projects/${projectId}/qa/batches/${batchId}/send`);\n\t}", "function writeData() {\n //update values in the primary sheet and create a submission ID\n numUsers += submitUsers;\n numSubmit++; \n \n lastSubmitCell.setValue(Utilities.formatDate(timeStamp, ss.getSpreadsheetTimeZone(), \"M/d/yy h:mm a\"));\n numSubmitCell.setValue(numSubmit);\n numUsersCell.setValue(numUsers);\n batchId = createBatchId(newDate, numSubmit); \n \n //open the spreadsheet\n var getUrl = urlCell.getValue();\n var todaySS = SpreadsheetApp.openByUrl(getUrl);\n var formSheet = todaySS.getSheetByName('Users');\n \n for (i = 1; i < submitUsers+1; i++) {\n \n //write to daily sheet\n var dataArray = rawData[i];\n var org = dataArray[3];\n var orgId = getOrgId(org);\n dataArray.push(orgId);\n formSheet.appendRow(dataArray);\n \n //write to valid users sheet\n var validUserArray = dataArray;\n validUserArray.unshift(UID);\n validUserArray.unshift(batchId);\n validUserArray.unshift(newDate);\n validUserSheet.appendRow(validUserArray);\n \n UID = 'N-' + (parseInt(UID.slice(2)) + 1).toString().padStart(5, '0');\n \n }\n }", "function writeData(req, res){\n try {\n let input = req.body //Capture the query in the request\n\n DataPoint.remove({});\n\n if (!req.body.meetdata) req.body.meetdata = generateMockData();\n\n //Turned the next limit off for testing purposes TODO: turn it on again to reasonable limit\n //if (req.headers['content-length'] > 100 || req.url.length > 5000) {throw 'Request too large to process'};\n if (!input.meetsysteemId) {throw 'No device id provided'}\n if (!input.status) {throw 'No status provided in message'}\n if (isNaN(Number(input.status))) {throw 'Provided status is not a number'}\n if (!input.meetdata) {throw 'No data provided in message'}\n\n const dataPoints = input.meetdata.split(';').map(dp => {\n const dateString = dp.substr(0, 6);\n const date = moment(dateString, \"DDMMYY\").format();\n\n return {\n deviceId: input.meetsysteemId,\n date: new Date(date),\n status: input.status,\n metrics: dp\n }\n })\n\n DataPoint.insertMany(dataPoints, function(error, docs) {\n if (error) {\n console.error('Insert into db failed', err);\n }\n else {\n res.status(200)\n res.send(docs.length + \" docs succesfully inserted into db\")\n }\n });\n }\n catch(e){\n console.log(\"Client didn't provde the right arguments for the request\", e)\n res.status(406)\n res.send(e)\n }\n}", "function record_data(e) {\n var lock = LockService.getDocumentLock();\n lock.waitLock(30000); // hold off up to 30 sec to avoid concurrent writing\n\n try {\n Logger.log(JSON.stringify(e)); // log the POST data in case we need to debug it\n\n // select the 'responses' sheet by default\n var doc = SpreadsheetApp.getActiveSpreadsheet();\n var sheetName = e.parameters.formGoogleSheetName || \"responses\";\n var sheet = doc.getSheetByName(sheetName);\n\n var oldHeader = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];\n var newHeader = oldHeader.slice();\n var fieldsFromForm = getDataColumns(e.parameters);\n var row = [new Date()]; // first element in the row should always be a timestamp\n\n // loop through the header columns\n for (var i = 1; i < oldHeader.length; i++) { // start at 1 to avoid Timestamp column\n var field = oldHeader[i];\n var output = getFieldFromData(field, e.parameters);\n row.push(output);\n\n // mark as stored by removing from form fields\n var formIndex = fieldsFromForm.indexOf(field);\n if (formIndex > -1) {\n fieldsFromForm.splice(formIndex, 1);\n }\n }\n\n // set any new fields in our form\n for (var i = 0; i < fieldsFromForm.length; i++) {\n var field = fieldsFromForm[i];\n var output = getFieldFromData(field, e.parameters);\n row.push(output);\n newHeader.push(field);\n }\n\n // more efficient to set values as [][] array than individually\n var nextRow = sheet.getLastRow() + 1; // get next row\n sheet.getRange(nextRow, 1, 1, row.length).setValues([row]);\n\n // update header row with any new data\n if (newHeader.length > oldHeader.length) {\n sheet.getRange(1, 1, 1, newHeader.length).setValues([newHeader]);\n }\n }\n catch(error) {\n Logger.log(error);\n }\n finally {\n lock.releaseLock();\n return;\n }\n\n}", "function initiateCatPut(licenseNumStrings, url, key) {\ntry{\n var result = {\n totalCount : licenseNumStrings.length,\n activeCount : 0,\n inactiveCount: 0,\n errorRecordCount: 0,\n errorRecords: [],\n errors: [],\n resultCode: null,\n resultBody: null\n };\n var dataJsonArray = [];\n for (var i = 0, len = licenseNumStrings.length; i < len; i++) {\n try {\n\t\t\tvar jsonData = licenseNumberToCatJson(licenseNumStrings[i]);\n\t\t\tif (typeof(jsonData) == \"object\"){\n\t\t\t\tif (jsonData[\"LicenseStatus\"] == 'Active') {\n\t\t\t\t\tresult.activeCount++;\n\t\t\t\t} else {\n\t\t\t\t\tresult.inactiveCount++;\n\t\t\t\t}\n\t\t\t\tdataJsonArray.push(jsonData);\n\t\t\t}else{\n\t\t\t\tthrow jsonData;\n\t\t\t}\n } catch (err) {\n aa.print(err.stack);\n result.errorRecordCount++;\n var errorMessage = 'Error processing licenseNum ' + licenseNumStrings[i] + ' ' + err;\n result.errors.push(errorMessage);\n result.errorRecords.push(licenseNumStrings[i]);\n logDebug(errorMessage);\n }\n }\n ////////////FORMAT DATA TO JSON////////////////////////////////////////////////////\n var nData = {\n \"Key\": key,\n \"Data\": dataJsonArray\n };\n //logDebug(\"here: \" + JSON.stringify(nData, null, 4));\n var nDataJson = JSON.stringify(nData);\n\n var postResp = httpClientPut(url, nDataJson, 'application/json', 'utf-8');\n\t//content type and encoding are optional; if not sent default values\n\tvar contentType = \"application/json\";\n\tencoding = \"utf-8\";\n\n\t//build the http client, request content, and post method from the apache classes\n\tvar httpClientClass = org.apache.commons.httpclient;\n\tvar httpMethodParamsClass = org.apache.commons.params.HttpMethodParams;\n\tvar httpClient = new httpClientClass.HttpClient();\n\tvar putMethod = new httpClientClass.methods.PutMethod(url);\n\n\thttpClient.getParams().setParameter(httpMethodParamsClass.RETRY_HANDLER, new httpClientClass.DefaultHttpMethodRetryHandler());\n\tputMethod.addRequestHeader(\"Content-Type\", contentType);\n\tputMethod.addRequestHeader(\"Content-Length\", nDataJson.length);\n\n\tvar requestEntity = new httpClientClass.methods.StringRequestEntity(nDataJson, contentType, encoding);\n\tputMethod.setRequestEntity(requestEntity);\n\n\t//set variables to catch and logic on response success and error type. build a result object for the data returned\n\tvar resp_success = true;\n\tvar resp_errorType = null;\n\n\tvar resultObj = {\n\t\tresultCode: 999,\n\t\tresult: null\n\t};\n\tresultObj.resultCode = httpClient.executeMethod(putMethod);\n\tresultObj.result = putMethod.getResponseBodyAsString();\n\tputMethod.releaseConnection();\n\n\t//if any response other than transaction success, set success to false and catch the error type string\n\tvar statusCode = resultObj.resultCode;\n\tif (resultObj.resultCode.toString().substr(0, 1) !== '2') {\n\t\tresp_success = false;\n\t\tswitch (statusCode) {\n\t\t\tcase 100: resp_errorType = \"100 - Continue\"; break;\n\t\t\tcase 101: resp_errorType = \"101 - Switching Protocols\";break;\n\t\t\tcase 200: resp_errorType = \"200 - OK, Transmission Accepted\";break;\n\t\t\tcase 201: resp_errorType = \"201 - Created\";break;\n\t\t\tcase 202: resp_errorType = \"202 - Accepted\";break;\n\t\t\tcase 203: resp_errorType = \"203 - Non-Authoritative Information\";break;\n\t\t\tcase 204: resp_errorType = \"204 - No Content\";break;\n\t\t\tcase 205: resp_errorType = \"205 - Reset Content\";break;\n\t\t\tcase 206: resp_errorType = \"206 - Partial Content\";break;\n\t\t\tcase 300: resp_errorType = \"300 - Multiple Choices\";break;\n\t\t\tcase 301: resp_errorType = \"301 - Moved Permanently\";break;\n\t\t\tcase 302: resp_errorType = \"302 - Found\";break;\n\t\t\tcase 303: resp_errorType = \"303 - See Other\";break;\n\t\t\tcase 304: resp_errorType = \"304 - Not Modified\";break;\n\t\t\tcase 305: resp_errorType = \"305 - Use Proxy\";break;\n\t\t\tcase 306: resp_errorType = \"306 - (Unused)\";break;\n\t\t\tcase 307: resp_errorType = \"307 - Temporary Redirect\";break;\n\t\t\tcase 400: resp_errorType = \"400 - Bad Request\";break;\n\t\t\tcase 401: resp_errorType = \"401 - Unauthorized\";break;\n\t\t\tcase 402: resp_errorType = \"402 - Payment Required\";break;\n\t\t\tcase 403: resp_errorType = \"403 - Forbidden\";break;\n\t\t\tcase 404: resp_errorType = \"404 - Not Found\";break;\n\t\t\tcase 405: resp_errorType = \"405 - Method Not Allowed\";break;\n\t\t\tcase 406: resp_errorType = \"406 - Not Acceptable\";break;\n\t\t\tcase 407: resp_errorType = \"407 - Proxy Authentication Required\";break;\n\t\t\tcase 408: resp_errorType = \"408 - Request Timeout\";break;\n\t\t\tcase 409: resp_errorType = \"409 - Conflict\";break;\n\t\t\tcase 410: resp_errorType = \"410 - Gone\";break;\n\t\t\tcase 411: resp_errorType = \"411 - Length Required\";break;\n\t\t\tcase 412: resp_errorType = \"412 - Precondition Failed\";break;\n\t\t\tcase 413: resp_errorType = \"413 - Request Entity Too Large\";break;\n\t\t\tcase 414: resp_errorType = \"414 - Request-URI Too Long\";break;\n\t\t\tcase 415: resp_errorType = \"415 - Unsupported Media Type\";break;\n\t\t\tcase 416: resp_errorType = \"416 - Requested Range Not Satisfiable\";break;\n\t\t\tcase 417: resp_errorType = \"417 - Expectation Failed\";break;\n\t\t\tcase 500: resp_errorType = \"500 - Internal Server Error\";break;\n\t\t\tcase 501: resp_errorType = \"501 - Not Implemented\";break;\n\t\t\tcase 502: resp_errorType = \"502 - Bad Gateway\";break;\n\t\t\tcase 503: resp_errorType = \"503 - Service Unavailable\";break;\n\t\t\tcase 504: resp_errorType = \"504 - Gateway Timeout\";break;\n\t\t\tcase 505: resp_errorType = \"505 - HTTP Version Not Supported\";break;\n\t\t\tdefault: resp_errorType = statusCode + \" - Unknown Status Code\";\n\t\t}\n\t}\n\t//resp_errorType = httpStatusCodeMessage(resultObj.resultCode);\n\t//create script result object with status flag, error type, error message, and output and return\n\tvar postResp = new com.accela.aa.emse.dom.ScriptResult(resp_success, resp_errorType, resultObj.result, resultObj);\n //if success, write out the response code and message. Otherwise, get the error message\n var response = postResp.getOutput();\n logDebug(\"Response code: \" + response.resultCode);\n if (postResp.getSuccess()) {\n logDebug(\"Response message: \" + response.result);\n //exploreObject(response);\n result.resultCode = response.resultCode;\n result.resultBody = String(response.result);\n return new com.accela.aa.emse.dom.ScriptResult(true, null, null, result);\n } else {\n logDebug(\"Error retrieving postResp: \" + postResp.getErrorMessage());\n return postResp;\n }\n}catch (err){\n\tlogDebug(\"A JavaScript Error occurred: initiateCatPut: \" + err.message);\n\tlogDebug(err.stack);\n\taa.sendMail(sysFromEmail, emailAddress, \"\", \"A JavaScript Error occurred: initiateCatPut: \" + startDate, \"capId: \" + capId + br + err.message + br + err.stack);\n}}", "async upsertUserBatchToBraze(customers, iBatch, iBrazeThread, iRetryAttempt) {\r\n const externalIds = customers.map(doc => doc.external_id);\r\n const previouslyUnProcessedCustomers = customers.filter(element => element.sent_to_braze === false).map(element => element.external_id);\r\n // eslint-disable-next-line no-param-reassign\r\n delete customers.sent_to_braze;\r\n const recursiveStack = {\r\n response: []\r\n };\r\n let results = [];\r\n logger.debug(`(Repository/sync2braze.upsertUserBatchToBraze) # BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, inserting into braze # ${externalIds}, previouslyUnProcessedCustomers # ${previouslyUnProcessedCustomers} `);\r\n\r\n const payLoad = {\r\n api_key: env.brazeApiKey,\r\n user_aliases: customers,\r\n };\r\n const config = {\r\n responseType: 'json',\r\n };\r\n const url = `${env.brazeUrl}/users/alias/new`;\r\n\r\n this.responseFromBRAZE = await axios.post(url, payLoad, config)\r\n .catch(async (error) => {\r\n logger.error(`(Repository/sync2braze.upsertUserBatch) # BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, Error inserting into braze # ${error} ########### ${externalIds}`);\r\n if (iRetryAttempt < env.retryAttempts) {\r\n results = await this.upsertUserBatchToBraze(customers, iBatch, iBrazeThread, iRetryAttempt + 1);\r\n } else {\r\n //results = await cafService.markFailedUserBatchToBraze(externalIds, iBatch, iBrazeThread, iRetryAttempt);\r\n }\r\n recursiveStack.response.push({\r\n status: error.response.status,\r\n message: ` BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, ${error.response.data.message}`\r\n });\r\n results.response.forEach(element => recursiveStack.response.push({\r\n status: element.status,\r\n message: element.message\r\n }));\r\n\r\n return recursiveStack;\r\n });\r\n const {\r\n data\r\n } = this.responseFromBRAZE || {};\r\n if (data !== undefined) recursiveStack.response.push(data);\r\n if (data !== undefined && data.message === 'success') {\r\n //results = await cafService.markSuccessUserBatchToBraze(externalIds, iBatch, iBrazeThread);\r\n results.response.forEach(element => recursiveStack.response.push({\r\n status: element.status,\r\n message: element.message\r\n }));\r\n }\r\n this.responseFromBRAZE = recursiveStack;\r\n if (iRetryAttempt === 1) logger.info(`(Repository/sync2braze.upsertUserBatch) # BATCH ${iBatch} THREAD ${iBrazeThread}, Attempt ${iRetryAttempt}, inserted into braze, response: `, this.responseFromBRAZE.response);\r\n\r\n return this.responseFromBRAZE;\r\n }", "async function test(){\n var resultlist = []\n\n //Do 100 transactions\n for (var i = 0; i < 100; i++){\n\n //Set some random data\n var requestarguments = [\"asdf\" + String(i), \"1234asdfdsfa\", \"/mnt/hlfshared\", \"adsfasdfa.jpg\", \"Json:{lol}\", \"3187130962b4f4a3c1d66437caf274b66110e5573d21105066f799e6ee5fea6c\"]\n \n //Measure time at transaction sending\n var starttime = Date.now()\n\n //Send transaction\n hyperprovclient.ccPost('set', requestarguments).then((r) => {\n\n //Push time for this transaction to resultlist and print\n var donetime = (Date.now() - starttime)\n resultlist.push(donetime)\n console.log(donetime)\n })\n\n //Wait 5 seconds between each transaction\n await sleep(5000)\n }\n\n //Write all transaction times in comma separated format for external handling.\n fs.writeFile(\n \"writetimes\"+\".csv\",\n JSON.stringify(resultlist),\n function (err) {\n if (err) {\n console.error('Something went wrong');\n }\n }\n );\n}", "bulkCreateOrUpdateAnnotations(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n\n let apiInstance = new Bitbucket.ReportsApi(); // String | The account // String | The repository // String | The commit for which to retrieve reports // String | Uuid or external-if of the report for which to get annotations for // [ReportAnnotation] | The annotations to create or update\n /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ /*let commit = \"commit_example\";*/ /*let reportId = \"reportId_example\";*/ /*let body = [new Bitbucket.ReportAnnotation()];*/ apiInstance.bulkCreateOrUpdateAnnotations(\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.commit,\n incomingOptions.reportId,\n incomingOptions.body,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "function sendLogsToServer() {\n IdbRTC.getLog().then((data) => {\n if (data && data.length > 0) {\n let counter = 0, tempArray = [], dynamicLength = data.length;\n while (dynamicLength > 0) {\n /* Length of array which will be added to 'tempArray' */\n let len = dynamicLength >= messagesPerPostCall ? messagesPerPostCall : data.length;\n /* From index for slicing the 'data' */\n let from = counter * messagesPerPostCall;\n /* To index for slicing the 'data' */\n let to = from + len;\n tempArray.push(data.slice(from, to));\n dynamicLength = dynamicLength - len;\n counter++;\n }\n tempArray.map((arr) => {\n /* Double check so as we do not increase 4xx error counts on ES servers. */\n arr.length > 0 && postCall(arr);\n });\n }\n });\n}", "function write(){\nsetTimeout(function(){jsonfile.writeFile(file, obj, function (err) {\n console.error(err)\n});} \n \n, 15000);\n}", "function mainFunction() {\n var params = {\n 'method': 'GET',\n 'muteHttpExceptions': true,\n 'headers': headers\n };\n var response=UrlFetchApp.fetch(API_URL, params); \n var AllUsersData = JSON.parse(response.getContentText());\n writeInGSheet(AllUsersData);\n}", "async fetchAllRowsAndWriteIntoLocalFile() {\n\t\t\tconst oThis = this;\n\n\t\t\tlet lastProcessTime = await oThis.fetchLastProcessTime();\n\n\t\t\tconsole.info(oThis.model.tableName, \"- lastProcessTime-\", lastProcessTime);\n\n\t\t\tlet r = await oThis.fetchTotalRowCountAndMaxUpdated({lastProcessTime: lastProcessTime});\n\n\n\t\t\tlet totalRowCount = r[0].totalRowCount || 0;\n\t\t\tlet maxUpdatedAtStr = r[0].maxUpdatedAt || lastProcessTime;\n\n\t\t\tconsole.info(oThis.model.tableName, \"- totalRowCount-\", totalRowCount);\n\t\t\tconsole.info(oThis.model.tableName, \"- maxUpdatedAtStr-\", maxUpdatedAtStr);\n\n\t\t\tif (totalRowCount == 0){\n\t\t\t\treturn responseHelper.successWithData({hasRows: false});\n\t\t\t}\n\n\t\t\tshell.mkdir(\"-p\", oThis.localDirFullFilePath);\n\n\t\t\tlet perBatchSize = Math.ceil(totalRowCount/(oThis.mysqlLimit * oThis.parallelProcessCount));\n\n\t\t\tlet startOffset = 0;\n\t\t\tlet endOffset = 0;\n\n\t\t\tlet promiseArray = [];\n\t\t\tfor(let batchNumber=1; batchNumber <= oThis.parallelProcessCount; batchNumber++){\n\t\t\t\tendOffset = startOffset + (oThis.mysqlLimit * perBatchSize);\n\t\t\t\tlet params = {\n\t\t\t\t\tstartOffset: startOffset, endOffset: endOffset,\n\t\t\t\t\tlastProcessTime: lastProcessTime, batchNumber: batchNumber\n\t\t\t\t};\n\t\t\t\tlet r = oThis.fetchDetailsAndWriteIntoLocalFile(params);\n\t\t\t\tpromiseArray.push(r);\n\t\t\t\tif(endOffset >= totalRowCount){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tstartOffset = endOffset;\n }\n\n await Promise.all(promiseArray).catch((err)=>{\n \treturn Promise.reject(err);\n\t\t\t});\n\t\t\treturn responseHelper.successWithData({hasRows: true, maxUpdatedAtStr: maxUpdatedAtStr});\n\t }", "function clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var l = state.bufferedRequestCount;\n var buffer = new Array(l);\n var holder = state.corkedRequestsFree;\n holder.entry = entry;\n\n var count = 0;\n var allBuffers = true;\n while (entry) {\n buffer[count] = entry;\n if (!entry.isBuf) allBuffers = false;\n entry = entry.next;\n count += 1;\n }\n buffer.allBuffers = allBuffers;\n\n doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n // doWrite is almost always async, defer these to save a bit of time\n // as the hot path ends with doWrite\n state.pendingcb++;\n state.lastBufferedRequest = null;\n if (holder.next) {\n state.corkedRequestsFree = holder.next;\n holder.next = null;\n } else {\n state.corkedRequestsFree = new CorkedRequest(state);\n }\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null) state.lastBufferedRequest = null;\n }\n\n state.bufferedRequestCount = 0;\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n }", "submitBatch(contentLength, multipartContentType, body, options) {\n const operationArguments = {\n contentLength,\n multipartContentType,\n body,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);\n }" ]
[ "0.7247172", "0.6488182", "0.6431659", "0.6353969", "0.62039834", "0.6197206", "0.604436", "0.59201676", "0.58174837", "0.57005084", "0.56742567", "0.5663563", "0.5654786", "0.5646171", "0.55959135", "0.55823845", "0.55812925", "0.5573223", "0.55704427", "0.55629694", "0.5561079", "0.5525359", "0.5522533", "0.55015516", "0.54882663", "0.54791504", "0.5466293", "0.5431319", "0.5429324", "0.54009527", "0.53806674", "0.53697735", "0.53697735", "0.53697735", "0.53697735", "0.53697735", "0.53697735", "0.53697735", "0.5351601", "0.53449255", "0.5344557", "0.53256357", "0.5322041", "0.5322041", "0.5322041", "0.5322041", "0.53021723", "0.5295322", "0.5272291", "0.52719635", "0.52588123", "0.5258195", "0.5234311", "0.5230263", "0.52170753", "0.5207253", "0.5184904", "0.51727635", "0.51428473", "0.5139762", "0.5136526", "0.51301336", "0.5129574", "0.5118129", "0.5114795", "0.5100801", "0.5098267", "0.509588", "0.50883126", "0.5075555", "0.50679505", "0.5064978", "0.505769", "0.5041295", "0.50406516", "0.5036243", "0.50334233", "0.5028572", "0.4994958", "0.49938875", "0.49875727", "0.49849087", "0.49835077", "0.49773443", "0.49526387", "0.4946981", "0.4938412", "0.4937739", "0.49350274", "0.4934976", "0.49329445", "0.49286032", "0.49224073", "0.492203", "0.4913678", "0.48950446", "0.48931393", "0.48877844", "0.48871872", "0.4870938" ]
0.7140714
1
FUNCTIONS request for json data
function getData() { $.get('/api/get', function() { }).done(function(data) { var json = JSON.parse(data); json.forEach(function(todo, i) { renderTodo(todo); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testJson() {\n var baseUrl = 'https://rxnav.nlm.nih.gov/REST/';\n var testUrl = 'https://rxnav.nlm.nih.gov/REST/rxcui?name=xanax'\n var request = Meteor.npmRequire('request');\n request(testUrl, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var info = JSON.parse(body)\n console.log(body);\n }\n });\n }", "requestJson(type, Url, reqAuth, data) {\n reqAuth = reqAuth || false;\n data = data || null\n var Httpreq = new XMLHttpRequest();\n try {\n Httpreq.open(type, Url, false);\n if (reqAuth) {\n Httpreq.setRequestHeader('authentication-token', this.getCookie('authentication-token'));\n }\n Httpreq.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n Httpreq.send(JSON.stringify(data));\n } catch (e) {\n console.log(e);\n }\n try {\n if (!Url.endsWith(\"baskets\")) {\n a = JSON.parse(Httpreq.responseText);\n }\n else {\n a = [\n JSON.parse(Httpreq.responseText),\n {'authentication-token':Httpreq.getResponseHeader('authentication-token')}\n ];\n\n }\n } catch (e) {\n a = Httpreq.responseText;\n } finally {\n return a\n }\n\n }", "function getJSON(myUrl, view) { // function that allows us to request json from a url; executes when we query our api\n var request = new XMLHttpRequest();\n request.open('GET', myUrl, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n var data = JSON.parse(request.responseText);\n handleData(data, view); //once the data is parsed handle the data\n } else {\n console.log('The target server returned an error');\n }\n };\n\n request.onerror = function() {\n console.log('There was a connection error');\n };\n request.send()\n }", "function _request(method, url, data, callback) {\n const xhr = new XMLHttpRequest();\n \n \n // console.log(\"Data in request file: \" + url);\n\n // no need to pass the data here\n // - json endpoint is passed into request function in index.js\n // const dataString = JSON.parse(data);\n\n\n\n xhr.onreadystatechange = function() {\n // wait until response is ready\n if (xhr.readyState === 4) {\n // 200 http status code\n if (xhr.status === 200) {\n // console.log(\"xhr response text\" + xhr.responseText);\n callback(null, JSON.parse(xhr.responseText));\n } else {\n callback(true);\n }\n }\n };\n\n // open the xhr request, set header, and send\n xhr.open(method, url);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n }", "function json() {\n\n var body = '';\n request = http.get('https://mcapi.ca/query/198.24.171.162:25955/list', function(theJson){\n\n\t\ttheJson.on('data', function (chunk){\n\t\t\tbody += chunk;\n\t\t}).on('end', function(){\n\t\t\tconsole.log('Data stream end: ' + body);\n\t\t\tbody = JSON.stringify(body);\n\t\t\tconsole.log('stringify: ' + body);\n\t\ttheJson.on('error', function(err) {\n \t\t\tconsole.error(err);\n \t\t});\n\n \t\ttheJson.writeHead(200, {'Content-Type': 'application/json'} );\n\n\t\t\t// var responseBody = {\n // \t\t\theaders: headers,\n // \t\t\tmethod: method,\n // \t\t\turl: url,\n // \t\t\tbody: body\n // \t\t};\n\n \t\ttheJson.write(JSON.stringify(body));\n \t\ttheJson.end();\n\t\t});\n\t\t\n\t});\n\n}", "function jsonrequest(url,cFunction){\t\n\tlet request = new XMLHttpRequest();\n\trequest.responseType = \"json\";\n\trequest.onreadystatechange = function() {\n\t if (this.readyState == 4 && this.status == 200) {\n\t cFunction(this); //send xhr object to callback function\n\t }\n\t};\n\trequest.open(\"GET\", url, true); \n\trequest.send();\n}", "function getjson(str){\n\t\t// var url = \"http://localhost:8500/bzz:/bedda982589fbafc565e497d995c56a7a7a2cf7d3ca69bb5547f53c8e0b84215/\"\t\n\t\tvar url = \"http://localhost:8500/bzz:/\"+str;\n\t\trequest({\n\t\t\turl: url,\n\t\t\tjson: true\n\t\t}, function (error, response, body) {\n\t\t\t\t\t\n\t\t\tif (!error && response.statusCode === 200) {\n\t\t\t\tconsole.log(body) // Print the json response\n\t\t }\n\t\t})\n\t}", "jsonHttpRequest (data, callback) {\n try {\n callback = callback || function () {}\n const options = {\n uri: `http://${config.upstream}`,\n method: data ? 'POST' : 'GET',\n headers: {\n 'Content-Length': data.length,\n 'Content-Type': 'application/json',\n Accept: 'application/json'\n }\n }\n options.json = data\n\n request(options)\n .then(response => {\n response = response || {}\n if (response instanceof Array || response instanceof Object) {\n callback(null, response)\n } else {\n callback(null, JSON.parse(response))\n }\n })\n .catch(error => {\n callback(error, {})\n })\n } catch (error) {\n console.log('catch ', error)\n callback(error, {})\n }\n }", "function load_data_json(){\n $.ajax({\n url : product_api\n ,dataType : 'json'\n ,type : 'get'\n ,success: (data)=>{\n load_data(data);\n },\n error: (e) => {\n $('.msg.error.error.api').html('<h4>Erro ao acessar a api</h4>')\n }\n });\n}", "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "function getJson(data) {\n $.ajax({\n dataType: \"json\",\n url: dataUrl,\n success: function(data) {\n parseData(data);\n }\n });\n }", "function jsonGet(url, args, access_token, cb) {\n if (args != null) {\n url = url + '?' + stringify(args)\n }\n const req = request(\n url,\n {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Authorization': `Bearer ${access_token}`\n }\n },\n (res) => { fetchResult(res, url, cb) }\n )\n\n req.on('error', (e) => {\n logger.error(`Request error for ${url}: ${e}`)\n cb(e, null, null)\n })\n req.end()\n}", "function requestJSON(success){\n $.ajax({\n type: 'get',\n dataType: 'json',\n url: encodeURI('api/twitch/'+apiRequestQuery[\"api\"]+'/request.json'),\n async: true,\n success: success\n });\n}", "function getJSON(requestURL,process_function, args){\n\n var request = new XMLHttpRequest();\n request.open('GET', requestURL);\n request.responseType = 'json';\n request.send();\n\n request.onload = function() {\n if(request.status != 200) {\n linkError();\n return;\n }\n console.log(request.status);\n }\n \n}", "function getJSONdata(url) {\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open('GET', url);\n\t\trequest.onreadystatechange = function(){\n\t\t\tif((request.status==200) && (request.readyState==4)){\n\t\t\t\tconsole.log(request.responseText);\n\t\t\t}\n\t }\n \t\n\t request(send);\n }", "function d3_json(request) {\n return JSON.parse(request.responseText);\n }", "function RequestJson(url, callbackFunction, dataPost, mimeType) {\r\n\tvar request= new XMLHttpRequest();\r\n\t\r\n\trequest.onreadystatechange=function() {\r\n\t if (request.readyState==4 && request.status==200) \t{ callbackFunction( request.responseText); }\r\n\t};\r\n\t\r\n\tif (dataPost!=null) {\r\n\t\tif ( mimeType == null ) mimeType = \"application/json\"; //The MIME media type for JSON text is application/json\r\n\t\trequest.open(\"POST\", url,true);\r\n\t\trequest.setRequestHeader(\"Content-Type\", mimeType ); \r\n\t\trequest.send(dataPost);\r\n\t} else {\r\n\t\trequest.open(\"GET\", url,true);\r\n\t\trequest.send();\t\r\n\t}\r\n\t\t \r\n}", "function jsonGet(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', url, true);\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send();\r\n}", "function requestData(){\n\tloadJSON(\"https://dweet.io/get/dweets/for/money-tracker\", gotData);\n}", "function requestJSON(url,callback) {\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var res = JSON.parse(xmlhttp.responseText);\n try {\n callback(res);\n }\n catch (err) {\n console.log(err.message);\n }\n }\n }\n\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "function request(verb, route, jsonInput){\n const url = localURL.concat(route);\n const param={\n headers:{\n \"content-type\":\"application/json; charset=UTF-8\"\n },\n body:JSON.stringify(jsonInput),\n method:verb\n };\n return fetch(url,param)\n .then(data=>{return data.json()})\n //.then(res=>{console.log(res)})\n //.catch(error=>console.log(error))\n}", "function detailsJSON(idF){\n console.log(BASE_URL);\n $.ajax({ \n url:BASE_URL+\"/apis/detailJSON?\",type:\"get\",dataType:\"json\",\n data: {idQuery:idF},\n beforeSend:function(){\n \n },\n success:function(dataRec){ \n alert(\"Make something with this object\"+JSON.stringify(dataRec)); \n },\n error:function(xhr,status,err){ \n console.log(err);\n } \n }); \n}", "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}", "function requestJSON(callback){\n var xhr=new XMLHttpRequest();\n xhr.responseType='json';\n xhr.onreadystatechange=function(){\n\tif(xhr.readyState===4 && (xhr.status===200 || xhr.status===0)){\n\t callback(xhr.response);\n\t}\n };\n xhr.open('GET','./data/all.json',true);\n // xhr.setRequestHeader('Access-Control-Allow-Methods','GET');\n // xhr.setRequestHeader('Content-Type','application/json');\n xhr.send(null);\n}", "function onRequestJSON(request, response){\n response.writeHead(200, { \"Content-Type\": \"application/json\"})\n const data = {\n name: \"Tiko Putra\",\n age: 26 \n }\n response.end(JSON.stringify(data))\n}", "function callAPI(url,data,callback)\n{\n var formData = JSON.stringify(data);\n Request.get({\n headers: { \"Content-Type\":'application/json',\"Authorization\":\"BEARER 2HQ6xG29mp8kXslCDs8l1BhnSPxN2UdrftzFv8f9VrC1FrZ3RtHnHmDovMBZvPCDyXiEq910aH0VMIogWF61uWdTnZAIYf2ZXHXOiwoqZntbEUpxneq4Seu0BuLibNIwNrvsSt0PanuZphPWFdDyfNmTflUK3lZa8IOtvugkmWXOkb0wMwUgxzXzzbBKOZyqmthekO6e8R8yY6VSbe1csyqVSQCCXKcCfBmuFBHk7CWfkRyhqHvqaReD5rTelaE1\" },\n url: url,\n body: formData\n}, function(err, response) {\n var body = JSON.parse(response.body);\n callback(err, body);\n});\n}", "function getJson(uri, to, myarg) {\r\n doJsonReq(\"GET\", uri, null, to, myarg);\r\n}", "function makeRequestWithExtraParams(verb, url, data, inDataJson, parse, resFunc, type, id){\n\tconsole.log(url);\n\t\n\t//Create and send request\n\tvar req = new XMLHttpRequest();\n\treq.open(verb, url, true);\n\treq.addEventListener('load', function(){\n\t\t//Check for error message\n\t\tif (req.status >= 200 && req.status < 400)\n\t\t{\n\t\t\tif (parse){\n\t\t\t\tconsole.log(\"Parsing data\");\n\t\t\t\tvar response = JSON.parse(req.responseText);\n\t\t\t\tconsole.log(response);\n\t\t\t\tresFunc(response, type, id);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tvar response = req.responseText;\n\t\t\t\tconsole.log(response);\n\t\t\t\tresFunc(response, type, id);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tconsole.log(\"Error in network request: \" + req.StatusText);\n\t});\n\tif (data != null && !inDataJson){\n\t\treq.send(data);\n\t}\n\telse if (data != null && inDataJson){\n\t\treq.send(JSON.stringify(data));\n\t}\n\telse{\n\t\treq.send();\n\t}\n}", "function getjson(url, method, data) {\n return new Promise(function(resolve, reject) {\n let request = new XMLHttpRequest();\n request.responseType = 'json';\n request.onreadystatechange = function() {\n if (request.readyState === XMLHttpRequest.DONE) {\n if (request.status === 200) {\n resolve(request.response);\n } else {\n reject(Error(request.status));\n }\n }\n };\n request.onerror = function() {\n reject(Error(\"Network Error\"));\n };\n request.open(method, url, true);\n request.send(data);\n });\n}", "function json_request(URL, dictionary, s, f) {\n $.ajax({\n type: 'POST',\n url: URL,\n data: JSON.stringify(dictionary),\n contentType: \"application/json\",\n dataType: \"json\",\n success: s,\n error: f\n });\n}", "async json(data, method, additionalPath, additionalHeaders) {\r\n this._logger.info(`===> NetworkClient::${method} Send`);\r\n const headers = additionalHeaders || {};\r\n let localData;\r\n if (method === \"GET\" || method === \"DELETE\") {\r\n localData = this.objectToParameters(data);\r\n }\r\n else {\r\n headers[\"Content-Type\"] = \"application/json\";\r\n localData = JSON.stringify(data);\r\n }\r\n return this.doRequest(method, localData, additionalPath, headers)\r\n .then((responseData) => {\r\n try {\r\n const response = JSON.parse(responseData);\r\n this._logger.info(`===> NetworkClient::${method} Received`, response);\r\n return response;\r\n }\r\n catch (err) {\r\n this._logger.info(`===> NetworkClient::${method} Parse Failed`, responseData);\r\n throw (new networkError_1.NetworkError(`Failed ${method} request, unable to parse response`, {\r\n endPoint: this._networkEndPoint.getUri(),\r\n response: responseData\r\n }));\r\n }\r\n });\r\n }", "function makerequest(){\r\n console.log(\"Button clicked\")\r\n fetch('data.json').then((Response)=>{\r\n if(!Response.ok){\r\n throw Error(Response.statusText)\r\n }\r\n console.log(Response);\r\n const dt = Response.json()\r\n console.log(\"dt\",dt)\r\n return dt\r\n }).then((data)=>{\r\n console.log(\"data\",data)\r\n }).catch((error) => { console.log(error)})\r\n}", "function getSpecialData () {\n return $.ajax({\n url: \"https://json-data.herokuapp.com/restaurant/special/1\",\n });\n}", "function getJSONData() {\n var flickrURL = '';\n \t$.getJSON( flickrURL, successFn );\n }", "function jsonData() {\n getJSONP(jsonLink, function(data) {\n fillList(data);\n });\n}", "function req_get(url, data, callback) {\n let HOST_URL = 'https://klzz.hualinginfo.com/';\n // let HOST_URL = process.env.HOST_URL;\n let patt = /http/;\n if (!patt.test(url)) {\n url = HOST_URL + url;\n }\n if (data) {\n let urlParamArr = [];\n for (let key in data) {\n urlParamArr.push(key + '=' + data[key]);\n }\n let urlParam = '?' + urlParamArr.join('&');\n\n url += urlParam;\n }\n\n fetch(url).then(response => response.json()).then(json => {\n typeof callback == \"function\" && callback(json.data);\n });\n}", "function getProducts(callback) {\n // creation of request Object\n const request = new XMLHttpRequest();\n\n // adding an readyStatechange event listener to check all the state changes\n request.addEventListener('readystatechange', function () {\n\n // if we are getting data from that request or not\n if (request.readyState === 4 && request.status === 200) {\n var data = JSON.parse(request.responseText);\n callback(undefined, data);\n } else if (request.readyState === 4 && request.status !== 200) {\n callback('sorry data could not fetch', undefined)\n }\n })\n\n request.open('GET', '../data/data.json');\n request.send();\n}", "static getJSON(url) {\n return new Promise((resolve, reject) => {\n const getHTTP = new XMLHttpRequest();\n //URL to GET results with the amount entered by user plus the username found on the menu selected\n getHTTP.open('GET', url, true);\n getHTTP.setRequestHeader('Content-Type', 'application/json');\n getHTTP.onreadystatechange = function () {\n if (getHTTP.readyState === 4 && getHTTP.status === 200) {\n resolve(getHTTP.responseText);\n }\n };\n getHTTP.send();\n });\n }", "function loadJSON(arg, param, callback) {\n var fullQuery = param + \"/\"\n\n for (var key in arg) {\n fullQuery += arg[key] + \"/\"\n }\n\n console.log(fullQuery);\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', fullQuery, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function send_json(para) {\n return $.ajax({\n url: para.url,\n contentType: 'application/json',\n data: JSON.stringify(para.data),\n dataType: 'json',\n type: para.method\n })\n}", "function processRequest(dataToParse) {\n //let body = dataToParse['data']; \n let responseJSON = filterJSONResponse(responseJSON);\n return (JSON.stringify(responseJSON, null, ' '));\n}", "function goJson(data) {\n console.log('running goJson!', data);\n }", "function JSONReq(service, req, handler) {\r\n\t\tvar request = new XMLHttpRequest();\r\n\t\trequest.onreadystatechange = function() {\r\n\t\t\tif (request.readyState != 4)\r\n\t\t\t\treturn;\r\n\t\t\ttry {\r\n\t\t\t\tvar response = eval('(' + request.responseText + ')').d;\r\n\t\t\t} catch(e) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif ('object' != typeof response)\r\n\t\t\t\treturn;\r\n\t\t\thandler(response);\r\n\t\t};\r\n\t\trequest.open('POST',\r\n\t\t\t'http://radio3.cbc.ca/modules/r3-player/services/PlayerWebService.asmx/'\r\n\t\t\t+ service, true);\r\n\t\trequest.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\r\n\t\trequest.send(req);\r\n\t}", "function http_GET(url) {\n\tvar xmlHttp = new XMLHttpRequest();\n\txmlHttp.open(\"GET\", url, false); // false for synchronous request\n\txmlHttp.send(null);\n\tvar text = xmlHttp.responseText;\n\treturn JSON.parse(text);\n\n\t\n}", "function read_json_data(err, res, body) {\n\n\t// ToDo: Should be stateless: https://github.com/vlucas/frisby/issues/36\n\t// Grab returned session cookie\n session_cookie = res.headers['set-cookie'][0].split(';')[0];\n\n\tvar query = querystring.stringify({\n\t\tgui: 'ng',\n\t\toutput: \"json\",\n\t\tfilters: \"'id=1'\",\n\t\tcatalogName: \"dbo.Empleado\",\n\t\tcontrolType: 'formView',\n\t\tmode: 'readonly'\n\t})\n\n\tfrisby.create('Read JSON DATA')\n\t .addHeader('Cookie', session_cookie) // Pass session cookie with each request\n\t\t.get(url + '/api/read?' + query)\n\t\t.expectStatus(200)\n\t\t.expectHeaderContains('content-type', 'application/json')\n\t\t.expectJSON({\n\t\t\tsuccess: true,\n\t\t\taction: \"read\",\n\t\t\tgui: \"ng\",\n\t\t\toutput: \"json\",\n\t\t\tdata: {\n\t\t\t\ttotal: \"1\",\n\t\t\t\tcatalog: {\n\t\t\t\t\tdbId: panax_config.db.database,\n\t\t\t\t\tcatalogName: 'dbo.Empleado',\n\t\t\t\t\tcontrolType: 'formView',\n\t\t\t\t\tmode: 'readonly'\n\t\t\t\t\t//lang:\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t.expectJSONLength('data', function (val) {\n\t\t\texpect(val).toBe(1); // Custom matcher callback\n\t\t})\n\t\t.expectJSONTypes('data', {\n\t\t\t// AngularJS:\n\t\t\tschema: Object,\n\t\t\tform: Array,\n\t\t\tmodel: Array\n\t\t\t// ExtJS:\n\t\t\t// data: {\n\t\t\t// \tdata: Array\n\t\t\t// }\n\t\t})\n\t\t.after(read_html_filetemplate)\n\t.toss()\n}", "_request( url){\r\n\t\treturn fetch( url)\t//response = what we get from fetch = json with server response \r\n\t\t\t.then( ( response) => {\r\n\t\t\t\tif( response.status !== 200) {\r\n\t\t\t\t\tconsole.log('Request returned with code: ' + response.status);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\treturn response.json().then( ( data) => {\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t\t}).catch(( err) => {\r\n\t\t\t\tconsole.log('Fetch Error :-S', err);\r\n\t\t\t});\r\n\t}", "static sendData(httpMethod, url, data) {\n const requestObject = new XMLHttpRequest();\n\n requestObject.responseType = \"json\";\n\n requestObject.open(httpMethod, url, true);\n\n requestObject.setRequestHeader('Content-Type', 'application/json');\n\n requestObject.send(JSON.stringify(data));\n\n requestObject.readyState(\"load\", this.loadFunction);\n }", "function get_data(data = {}) {\n console.log(data)\n $.ajax({\n url: \"getdata.php\",\n data: data,\n type: \"post\",\n dataType: \"JSON\",\n success: function(res) {\n console.log(res)\n if (data.get == \"userlist\") {\n show_users(res);\n } else {\n // Show messages ...\n show_messages(res);\n }\n }, error: function(xhr, ajaxOptions, thrownError) {\n console.log(data)\n console.log(xhr.status);\n console.log(thrownError);\n }\n });\n }", "function requestGetApi(url, jsonData) {\r\n var settings = {\r\n \"async\": true,\r\n \"crossDomain\": true,\r\n \"url\": BASE_URL_API + url,\r\n \"method\": \"GET\",\r\n \"data\": jsonData\r\n };\r\n return $.ajax(settings);\r\n}//FIN FUNCION requestGetApiRoute", "jsonRequest(route: string, json: *, method: string = 'POST'): Promise<Response> {\n return this.statusHandler(fetch(`${config.apiBaseUrl}/${route}`, {\n method,\n headers: {\n 'Csrf-Token': Cookies.get()[config.csrfCookieName],\n 'Content-Type': 'application/json; charset=utf-8',\n Accept: 'application/json',\n },\n credentials: 'include', // Needed to allow cookies with CORS, see above link\n body: JSON.stringify(json),\n }));\n }", "loadJsonData() {\n }", "function getData(query, callBack) {\n \n // creating ajax request\n var xhtr = new XMLHttpRequest();\n xhtr.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n var result = JSON.parse(this.responseText);\n // call to callback function which is passed to getData function\n callBack(result);\n }\n }\n\n xhtr.open('GET', 'http://localhost:3333/api/' + query, true);\n xhtr.send(); \n }", "function GetJson(yourUrl) {\n \n var Httpreq = new XMLHttpRequest(); // a new request\n Httpreq.overrideMimeType(\"application/json\");\n Httpreq.open(\"GET\", yourUrl, false);\n Httpreq.send(null);\n \n return JSON.parse(Httpreq.responseText);\n}", "function json(response){\n return response.json();\n}", "function getData(url, successHandler, errorHandler){\n var data, status;\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true); //asynchronous get request\n xhr.onreadystatechange = function(){\n if(xhr.readyState == 4){\n status = xhr.status;\n if(status == 200){\n data = JSON.parse(xhr.responseText); //parsing the json document to js object\n successHandler && successHandler(data); //data handling callback when the request status is ok\n }else{\n errorHandler && errorHandler(status); //error handling callback otherwise\n }\n }\n };\n xhr.send();\n }", "getData(url = ``) {\n return fetch(url, {\n method: \"GET\", \n dataType: 'json'\n }) \n }", "function getJSON(url, body, callback, headers=FAKE_HEADERS) {\n \n var options = {\n url : url,\n headers : headers,\n method: 'POST',\n form: body\n };\n\n var buffer = \"\";\n var req = request(options).on('error', function(err) {\n console.log(err);\n buffer = {code:'5000', 'msg': err};\n }).on('response', function(res) {\n var buffer = \"\";\n res.on('data', function(data) {\n buffer += data;\n }).on('end', function() { \n callback(buffer);\n });\n }); \n}", "function apiGetJsonClbk( fullapilink, callbackfn ) {\n\n const xhr = new XMLHttpRequest();\n\n xhr.responseType = 'json';\n \n xhr.onreadystatechange = () => { if (xhr.readyState === XMLHttpRequest.DONE) { \n\n console.log( xhr.response );\n\n callbackfn( xhr.response ); \n \n } };\n\n xhr.open( 'GET', fullapilink );\n\n xhr.send();\n\n}", "function callDataAPI() {\n var xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n \"https://api.coronavirus.data.gov.uk/v1/data?filters=areaType%3Dnation%3BareaName%3Dengland&structure=%7B%22date%22%3A%22date%22%2C%22name%22%3A%22areaName%22%2C%22code%22%3A%22areaCode%22%2C%22cases%22%3A%7B%22daily%22%3A%22newCasesByPublishDate%22%2C%22cumulative%22%3A%22cumCasesByPublishDate%22%7D%2C%22deaths%22%3A%7B%22daily%22%3A%22newDeathsByDeathDate%22%2C%22cumulative%22%3A%22cumDeathsByDeathDate%22%7D%2C%22vaccines%22%3A%7B%22weekly2nddose%22%3A%22weeklyPeopleVaccinatedSecondDoseByVaccinationDate%22%2C%22weekly1stdose%22%3A%22weeklyPeopleVaccinatedFirstDoseByVaccinationDate%22%2C%22cum1stdose%22%3A%22cumPeopleVaccinatedFirstDoseByVaccinationDate%22%2C%22cum2nddose%22%3A%22cumPeopleVaccinatedSecondDoseByVaccinationDate%22%7D%7D\",\n false\n );\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(null);\n \n var jsonObject = JSON.parse(xhr.responseText);\n return jsonObject;\n }", "function getData(type, arg, cb) {\n var xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cb(JSON.parse(this.responseText));\n }\n };\n\n if (type == 'nickname') {\n xhr.open(\"GET\", \"https://api.worldoftanks.eu/wot/account/list/?application_id=5d6d1657c5bc736658f1e6aa3dcb5f6e&search=\" + arg);\n }\n else if (type == 'account_id') {\n xhr.open(\"GET\", \"https://api.worldoftanks.eu/wot/account/info/?application_id=5d6d1657c5bc736658f1e6aa3dcb5f6e&account_id=\" + arg + \"&fields=global_rating%2C+statistics\");\n }\n else if (type == 'Player-vehicle') {\n xhr.open(\"GET\", \"https://api.worldoftanks.eu/wot/account/tanks/?application_id=5d6d1657c5bc736658f1e6aa3dcb5f6e&account_id=\" + arg);\n }\n else if (type == 'vehicle') {\n xhr.open(\"GET\", \"https://api.worldoftanks.eu/wot/encyclopedia/tanks/?application_id=5d6d1657c5bc736658f1e6aa3dcb5f6e&fields=level%2C+nation%2C+tank_id%2C+type%2C+name\");\n }\n else {\n //not a valid search\n }\n xhr.send();\n}", "function loadJSONs( url, which ){\n var AJAX_req = new XMLHttpRequest();\n AJAX_req.overrideMimeType(\"application/json\");\n AJAX_req.open('GET',url,false);\n AJAX_req.onreadystatechange = function(){\n if(AJAX_req.readyState==4 && AJAX_req.status==\"200\"){\n if( which == 0){\n pre = JSON.parse( AJAX_req.responseText ); \n }\n else{\n post = JSON.parse( AJAX_req.responseText );\n }\n }\n };\n\n AJAX_req.send();\n}", "function getJSON(requestURL, callback) {\n request({\n url: requestURL,\n json: true\n }, function(error, response, data) {\n // Calls callback passed by one of the API functions\n callback(error, data);\n });\n}", "function getJSON(url, selectedCategory) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url, true);\n req.send();\n req.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200)\n {\n var jsonData = JSON.parse(this.responseText);\n //if data retreival is successful, call \"parseJSON\" function \n parseJSON(jsonData, selectedCategory);\n }\n };\n}", "function gotJSONNowWhat() {\n\t\tshowPhotos(oReq);\n\t }", "function getTheJson(apiUrl, cb){\r\n ajaxFunctions.ready(\r\n ajaxFunctions.ajaxRequest(reqMethod, apiUrl, true, function(data){\r\n cb(data);\r\n })\r\n ); \r\n }", "function getJsonData(url, callback){\n request.get({\n headers: {'User-Agent': h.browser()},\n url: url\n }, function (error, response, body) {\n\n if (error) throw new Error(url + ' did not respond');\n\n parseString(body, function (err, result, title) {\n callback(result);\n });\n });\n}", "static sendJson(method, endpoint, data) {\n const options = {\n method,\n headers: {\n 'Content-Type': 'application/json;charset=utf-8'\n },\n body: JSON.stringify(data)\n };\n return fetch(`${baseUrl}/${endpoint}`, options).then(response => {\n if (!response.ok) return;\n return response.json().then(data => data);\n });\n }", "function fetFunc(url,method,body) {\n fetch(url, {\n method: method,\n headers:\n {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify(body)\n })\n}", "function get_json_data() {\n let getBatchesURL = \"http://localhost:5000/batches/\";\n fetch(getBatchesURL)\n .then((res) => res.json())\n .then((json) => append_json(json));\n}", "function getData(){\t\r\nvar data;\r\nvar jsonurl = './tnow.json';\r\n$.ajax({\r\n\ttype: \"GET\",\r\n\turl: jsonurl,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Daten-Stream url\r\n\tdata: data,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Variable für json Container\r\n\tasync: true,\t\t\t\t\t\t\r\n\tdataType: \"json\",\r\n\tsuccess: function(data){\t\t\t\t\t\t\t\t\t\t// nur ausführen wenn getJson (hier ajax) erfolgreich war sonst zu error:\t\r\n\tlogger('get ./tnow.json');\r\n\tcelsius = data.temperature_record;\r\n\tgrenze();\r\n\t},\r\n\t//error: function(){alert('Der Server antwortet nicht!'); schalter = \"error\";}\r\n\t});\t\r\n}", "json(data) {\n\t\tthis.setHeader('content-type', 'application/json')\n\t\treturn this.send(JSON.stringify(data))\n\t}", "function getJSON () {\n\n var ourRequest = new XMLHttpRequest();\n ourRequest.open('GET', 'https://thesimpsonsquoteapi.glitch.me/quotes?count=30');\n ourRequest.onload = function() {\n\n //all json data inside ourData variable.\n var ourData = JSON.parse(ourRequest.responseText);\n\n //calls function to render HTML using ourData variable.\n renderHTML(ourData);\n };\n\n //sends data request\n ourRequest.send();\n}", "getData(){}", "function request(url, callback) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open('GET', url, true);\n xmlhttp.send();\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var data = JSON.parse(xmlhttp.responseText);\n callback(data);\n }\n };\n }", "function request_by_ajax(endpoint, post_params) {\n\n\t // var nongysid=cookie.load('nongysid')\n\t // var lon=cookie.load('lon')\n\t // var lat=cookie.load('lat')\n\n\n\t // const fullUrl= `${DOMAIN}expertinfo.php`\n\n\t // var nongysid=cookie.load('nongysid')\n\t // const fullUrl= `http://t.nongyisheng.com/h5/expertinfo?nongysid=${nongysid}&suid=${suid}`\n\n\t var header = {};\n\t if (post_params) {\n\t var data = new FormData();\n\t for (var key in post_params) {\n\n\t var value = post_params[key];\n\t if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) == \"object\") {\n\t value = JSON.stringify(value);\n\t }\n\t data.append(key, value);\n\t }\n\n\t // data.append( \"json\",JSON.stringify(post_params));\n\t header = {\n\t method: \"POST\",\n\t // headers: {\n\t // \"Content-Type\": \"application/x-www-form-urlencoded\"\n\t // },\n\t body: data\n\t };\n\t }\n\n\t debugger;\n\t var fullUrl = _globals.DOMAIN + '/' + endpoint;\n\n\t return fetch(fullUrl, header)\n\t // .then(function (response){\n\t // console.log(response.status)\n\t // console.log(response)\n\t // console.log(response.json())\n\t // return response.json()\n\t // })\n\t .then(function (response) {\n\t return response.json().then(function (json) {\n\t return { json: json, response: response };\n\t });\n\t }).then(function (_ref) {\n\t var json = _ref.json;\n\t var response = _ref.response;\n\n\t // alert(111)\n\t // console.log(json)\n\t // console.log(response)\n\t // console.log(json.data.expert)\n\t // console.log(schema)\n\t // console.log(normalize(json.data.expert,schema.expertSchema))\n\t // console.log(normalize(json.data.expert,\n\t // {\n\t // expert:schema.expertSchema\n\t // }))\n\n\t // console.log(\"=================start\")\n\t // console.log( normalize(json.data,schema.hospialSchema))\n\t // console.log(\"=================end\")\n\n\t // debugger;\n\t var _params = response.url.split(\"?\");\n\t if (_params.length > 0) {\n\t var requestParams = queryString.parse(_params[1]);\n\t json.requestParams = requestParams;\n\t }\n\t return Object.assign({}, json);\n\t });\n\t}", "getJson() {\n\n // create the new XMLHttpRequest\n var xhr = new XMLHttpRequest();\n\n // setting up the request\n xhr.open('GET', JSON_PATH, false);\n\n // when the JSON loads, parse it into an object and pass into this.parseEvents()\n xhr.onload = () => {\n this.events = this.parseEvents(JSON.parse(xhr.responseText));\n };\n\n // send the request\n xhr.send();\n\n }", "function request(mapjson) {\n // res.showMsg != undefined && res.showMsg\n var showMsg = mapjson.msg\n var url = mapjson.url\n var data = mapjson.data\n if (isEmpty(url)) {\n wx.showModal({\n title: '',\n content: 'url不能为空!',\n })\n return\n }\n if(url.indexOf('https')!=0){\n url = URL + url\n }\n if (!isEmpty(showMsg)) {\n wx.showLoading({\n title: showMsg,\n })\n }\n if(isEmpty(data)){\n data = {}\n }\n const app = getApp()\n data.name = app.globalData.name\n data.password = app.globalData.password\n console.log('data')\n console.log(data)\n wx.request({\n url: url,\n data: data,\n header: {\n \"content-type\": \"application/x-www-form-urlencoded;charset=utf-8\"\n },\n method: 'GET',\n dataType: 'json',\n responseType: 'text',\n success: function (res) {\n console.log('success:')\n // console.log(res.data)\n // console.log(res.header.data)\n //可根据后台返回的数据来取相应的字段\n var json = res.data //由于dataType设置的为json,已自动调用JSON.parse()\n // var json = JSON.parse(decodeURIComponent(res.header.data));\n if (json.success) {\n if(!isEmpty(mapjson.success)){\n mapjson.success(json)\n }\n } else {\n if (isEmpty(mapjson.error)) {\n wx.showModal({\n title: '',\n content: json.msg,\n showCancel: false\n })\n } else {\n mapjson.error(json)\n }\n }\n console.log(json);\n },\n fail: function (res) {\n console.log('fail:')\n console.log(res)\n if (isEmpty(mapjson.fail)) {\n wx.showModal({\n title: '',\n content: '网络请求失败',\n showCancel: false\n })\n }else{\n mapjson.fail(res)\n }\n },\n complete: function (res) {\n if (!isEmpty(showMsg)) {\n wx.hideLoading()\n }\n },\n })\n}", "request(url, form, data) {\n\n const options = {\n url: this.api + url,\n json: true\n };\n\n if (this.proxy) options.proxy = this.proxy;\n\n if (form) {\n options.form = form;\n } else {\n for (let item in data) {\n const type = typeof data[item];\n if (type == 'string' || type == 'object') continue;\n data[item] = JSON.stringify(data[item]);\n }\n options.formData = data;\n }\n\n return new Promise((resolve, reject) => {\n request.post(options, (error, response, body) => {\n if (error || !body || !body.ok || response.statusCode == 404) {\n return reject(error || body || 404);\n }\n return resolve(body);\n });\n });\n\n }", "function getJSON(url, callback){\n // create XMLHttp request\n const xhr = new XMLHttpRequest();\n // open a request\n xhr.open('GET', url);\n // create a callback function for the callback parameter\n xhr.onload = () => {\n // conditional that checks if xhr request was success\n if(xhr.status === 200){\n let data = JSON.parse(xhr.responseText);\n return callback(data);\n }\n };\n // send the request\n xhr.send();\n}", "function jsonRequest(url)\n{\n var script=document.createElement('script');\n script.src=url;\n document.getElementsByTagName('head')[0].appendChild(script);\n}", "function makeJsonRequest(url, parameters, handler){\n\tvar httpRequest = new XMLHttpRequest()\n\thttpRequest.onreadystatechange = function(){\n\t\t\n\t\tvar done = false;\n\t\tif(httpRequest.readyState == 4){\n\t\t\tif(httpRequest.status == 200){\n\t\t\t\tif(done == false){\n\t\t\t\t\tvar response = JSON.parse(httpRequest.responseText)\n\t\t\t\t\tif(response.status == 'failure' && response.message == 'no authorization'){\n\t\t\t\t\t\tlocation.reload()\n\t\t\t\t\t}\n\t\t\t\t\thandler.success(response)\n\t\t\t\t\tdone = true\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('redundant call')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(handler.failure){\n\t\t\t\t\thandler.failure()\n\t\t\t\t}\n\t\t\t\tconsole.log(httpRequest.status + ' : ' + httpRequest.statusText)\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\thttpRequest.open('POST', url, true)\n\thttpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); \n\thttpRequest.send(parameters)\n}", "function getDataFromServer(method, url, callback, formObject) {\n const xhttp = new XMLHttpRequest();\n xhttp.open(method, url, true);\n xhttp.responseType = \"json\";\n xhttp.onload = function () {\n if (xhttp.status === 404) {\n alert(\"Object not found\");\n } else {\n showHideElement(document.getElementById(\"waitingDiv\"), false);\n }\n\n callback(xhttp.response);\n };\n\n xhttp.send(formObject);\n}", "function rawData() {\n if(request.readyState == 4 && request.status == 200) {\n const data = JSON.parse(request.responseText);\n resolve(data);\n } else if(request.readyState == 4) {\n reject(\"Data error: Unable to fetch data\");\n }\n }", "function httpGetJson(theUrl) {\n var responseText = httpGet(theUrl);\n return JSON.parse(responseText);\n }", "function fetchJSON(){\n mRequest.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n mJson = JSON.parse(mRequest.responseText);\n iterateJSON(mJson)\n }\n }\n mRequest.open(\"GET\",mURL, true);\n mRequest.send();\n}", "function grab_data(data){\n try {\n if (http_req.readyState === XMLHttpRequest.DONE) {\n if (http_req.status === 200) {\n // parse responseText\n db_verguenza = JSON.parse(http_req.responseText)\n } else {\n console.log(\"status problem\");\n }\n }\n } catch (e) {\n console.log(\"Ups! Something's wrong D:\\n\" +e);\n }\n // display data after getting it\n display_data();\n}", "function ajaxWithJsonData(jsonData, url, type, callback){\n\t\t$.ajax({\n\t\t\ttype : type,\n\t\t\turl : url,\n\t\t\tdata : jsonData,\n\t\t\tencoded : true\n\t\t}).done(function(data){\n\t\t\tconsole.log(data);\n\t\t\tif (callback) callback(data);\n\t\t}).fail(function(err){\n\t\t\tconsole.log(\"ajax network error!\");\n\t\t});\n\t}", "function data(url, successFunction) {\n $.ajax({\n url: url,\n dataType: 'json',\n error: function(jqXHR, textStatus, errorThrown) { console.error(jqXHR, textStatus, errorThrown); },\n success: successFunction\n });\n}", "function getData() {\n return $.getJSON(apiUrl);\n}", "function request(url) {\n var req = new XMLHttpRequest();\n req.responseType = 'json';\n req.open('GET', url, false);\n req.send();\n return req.status == 200 ? req.response : null;\n}", "function nodeRequest(req, dat, callback = null){\n\t$.ajax({\t\t\t\n type: 'GET',\n\t\tdataType: 'json',\n data: dat,\n url: req,\n success: function(data){\n\t if(callback != null){\n\t\t callback(data);\n\t }\n }\n });\n}", "function getData(requestUrl) {\n \n\n}", "function loadData() {\n var jsonRovereto = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/rovereto\");\n dataRovereto = JSON.parse(jsonRovereto);\n var jsonPergine = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/pergine_valsugana\");\n dataPergine = JSON.parse(jsonPergine);\n var jsonTrento = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/trento\");\n dataTrento = JSON.parse(jsonTrento);\n //console.log(dataTrento);\n}", "async function Put_Get () {\n\n \n await postRequest('https://assets.breatheco.de/apis/fake/todos/user/fpineda1410', list)\n .then(data => console.log(data)) // Result from the `response.json()` call\n .catch(error => console.error(error))\n\n fetch('https://assets.breatheco.de/apis/fake/todos/user/fpineda1410') //Generic GET Method to the 4Geeks API\n .then(response => response.json())\n .then(data => {//console.log(data)\n \n }\n )\n\n \n //setJsonList(data)\n }", "function getIhhlAbstractData()\r\n{\r\n\t\r\n\tvar json = {\r\n\t\tfromDateStr:\"201704\",\r\n toDateStr:\"201707\",\r\n location:\"state\",\r\n locationIdStr:\"01\"\r\n\t }\r\n\t$.ajax({\r\n\t\turl: 'getIhhlAbstractData',\r\n\t\tdata: JSON.stringify(json),\r\n\t\ttype: \"POST\",\r\n\t\tdataType: 'json', \r\n\t\tbeforeSend: function(xhr) {\r\n\t\t xhr.setRequestHeader(\"Accept\", \"application/json\");\r\n\t\t xhr.setRequestHeader(\"Content-Type\", \"application/json\");\r\n\t\t},\r\n\t\tsuccess: function(ajaxresp) {\r\n\t\t\tconsole.log(ajaxresp);\r\n\t\t}\r\n\t});\r\n}", "function loadJSON(callback, endpoint, loadingFakeData=false) { \n\n console.log(\"Creating GET request for JSON\");\n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', endpoint, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText, loadingFakeData);\n }else{\n console.log(\"Could not fetch data! Status \" + xobj.status);\n }\n };\n xobj.send(null); \n }", "get(data) {\n try {\n return JSON.parse(data);\n } catch (e) {\n return data;\n }\n }", "function getData(url , data ) {\n // Default options are marked with *\n return fetch(url, {\n method: \"GET\", // *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(data), // body data type must match \"Content-Type\" header\n })\n // .then(response => response.json()); // parses response to JSON\n}", "function getJSON (url,callback) {\n 'use strict';\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function () {\n var status = xhr.status;\n if (status === 200){\n callback(null, xhr.response);\n }\n else {\n callback(status, xhr.response);\n }\n };\n xhr.send();\n}", "function request(method, url, success, fail) {\n if (method && method.length > 0 && url && url.length > 0) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n if (success) success(JSON.parse(xhr.responseText));\n } else {\n if (fail) fail(xhr.statusText);\n }\n };\n xhr.send();\n }\n }" ]
[ "0.71121454", "0.6793429", "0.6669767", "0.6665902", "0.6626412", "0.66127604", "0.66106755", "0.6507974", "0.64713794", "0.64438224", "0.64390486", "0.643685", "0.6432208", "0.6427079", "0.6426449", "0.64045554", "0.6402555", "0.63850814", "0.638002", "0.63504946", "0.63482475", "0.6328936", "0.62990314", "0.627189", "0.626201", "0.6237931", "0.62377745", "0.6226257", "0.62253296", "0.62247145", "0.62115777", "0.6189233", "0.6173761", "0.61636037", "0.61543375", "0.6153643", "0.61535233", "0.613418", "0.61330754", "0.6131783", "0.6128106", "0.612711", "0.61263216", "0.6121769", "0.6114973", "0.6089184", "0.6060408", "0.6055076", "0.60498714", "0.60493255", "0.6043424", "0.6040713", "0.60381025", "0.6031678", "0.6031228", "0.6025201", "0.60210013", "0.6017617", "0.60169464", "0.6010335", "0.60070646", "0.60043615", "0.5998967", "0.59978944", "0.5995885", "0.599286", "0.5991623", "0.5991013", "0.5976057", "0.5973566", "0.59699726", "0.5967722", "0.5965229", "0.5953727", "0.59472847", "0.59468234", "0.5945965", "0.5945859", "0.5939769", "0.59301424", "0.59292907", "0.5923319", "0.5918913", "0.5918837", "0.5912479", "0.59104425", "0.5905484", "0.5905433", "0.5900662", "0.58998287", "0.5899186", "0.5896746", "0.5894077", "0.5891344", "0.5886701", "0.58806086", "0.5877591", "0.5875738", "0.5872453", "0.5867611", "0.5862551" ]
0.0
-1
renders todos into list
function renderTodo(todo) { var html = '<a class="collection-item" id="'+todo.id+'" href="#modal-todo"'+ 'data-id="'+todo.id+'"'+ 'data-title="'+todo.title+'"'+ 'data-priority="'+todo.priority+'"'+ 'data-details="'+todo.details+'"'+ 'data-created="'+todo.createdAt+'"'+ 'data-elapsed="'+todo.elapsedTime+'"'+ 'data-finish="'+todo.finishAt+'"'+ 'data-complete="'+todo.isComplete+'"'+ '>'+ '<span class="badge '+todo.priority+'">'+ todo.priority+ '</span>'+ todo.title+ '</a>'; list.append(html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "function renderTodos () {\n for (i=0; i < todos.length; i++) {\n var todoItem = todos [i];\n var liElement = document.createElement (\"li\");\n liElement.textContent = todoItem;\n todoList.appendChild(liElement);\n }\n}", "function renderTodoList() {\n if (!data.todo.length && !data.completed.length) return;\n\n for (i = 0; i < data.todo.length; i++) {\n var value = data.todo[i];\n addItemToDOM(value);\n }\n for (j = 0; j < data.completed.length; j++) {\n var value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "function renderTodos() { //fução de renderização de 'to do'\n for (todo of todos) { //apliquei o 'for...of' para percorrer o array acima, criando a variável todo \n var todoElement = document.createElement('li'); //criei var todoElement que cria elementos dentro da ul\n var todoText = document.createTextNode(todo);//todos os elementos todo(criados na lista) serão armazenados em todoText\n \n todoElement.appendChild(todoText);\n listElement.appendChild(todoElement);\n }\n}", "renderTodos() {\n\t\tconst { todos } = this.props.store._;\n\n\t\tif (todos.length) {\n\t\t\treturn todos\n\t\t\t\t.sortBy('completed')\n\t\t\t\t.map( t => <TodoItem key={ t.$().pid() } todo={ t } todos={ todos } /> );\n\t\t} else {\n\t\t\treturn <p className=\"noItems\">What do you want to do today?</p>\n\t\t}\n\t}", "function render () {\n $toDoList.empty();// empty existing posts from view\n var toDoHtml = getAllToDoHtml(allToDos); // pass `allToDos` into the template function\n $toDoList.append(toDoHtml);// append html to the view\n}", "function renderTodos(todos) {\n //clear everything inside <ul> w/ clss=todo-todo-items \n todoItemsList.innerHTML = '';\n\n //run through ea item inside of todos\n todos.forEach(function(item){\n //check if each item is completed\n const checked = item.completed ? 'checked' : null;\n\n // make a li element and fill it \n const li = document.createElement('li');\n // <li class=\"item\"></li>\n li.setAttribute('class', 'item');\n // <li class=\"item\" data-key=\"20200708\"> </li> \n li.setAttribute('data-key', item.id);\n /* <li class=\"item\" data-key=\"20200708\"> \n <input type=\"checkbox\" class=\"checkbox\">\n Go to Gym\n <button class=\"delete-button\">X</button>\n </li> */\n\n // if item is completed, then add a class to <li> called 'checked', which will add \n //line-through style\n if(item.completed === true) {\n li.classList.add('checked');\n }\n li.innerHTML = `\n <input type=\"checkbox\" class=\"checkbox\" ${checked}>\n ${item.name}\n <button class=\"delete-button\">X</button>\n `;\n // finally add the <li> to the <ul>\n todoItemsList.append(li) \n });\n}", "function renderToDoList() {\n\tif (!data.openTasks.length && !data.doneTasks.length) return; \n\n\tfor (var i=0; i < data.openTasks.length; i++) {\n\t\tvar value = data.openTasks[i]; \n\t\tcreateListElement(value); \n\t}\n\n\tfor (var j=0; j < data.doneTasks.length; j++) {\n\t\tvar value = data.doneTasks[j]; \n\t\tcreateListElement(value, true); \n\t}\n}", "render() {\n\t\treturn (\n\t\t\t<section className=\"main\">\n\t\t\t\t<ul className=\"todo-list\">\n\t\t\t\t\t{this.props.todos.map( (todo, i) => <ToDoItem key={todo.id} id={todo.id} isCompleted={todo.completed} text={todo.title} destroyOne={this.props.destroyOne(i)} toggleTodo={this.props.toggleTodo(i)}/> )}\n\t\t\t\t</ul>\n\t\t\t</section>\n\n\t)}", "function render() {\n let ul = document.getElementById(\"ul\");\n ul.innerHTML = \"\";\n for (let i = 0; i < todos.length; i++) {\n // Create li element\n let li = document.createElement(\"li\");\n li.classList.add(\"list-group-item\");\n li.innerHTML = todos[i].name;\n ul.appendChild(li);\n\n //Create Checkbox\n let checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkBox\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n checkBox.checked = todos[i].isCompleted;\n if (checkBox.checked == true) {\n li.classList.add(\"itemIsChecked\");\n }\n checkBox.addEventListener(\"change\", () => {\n toggleCheckbox(todos[i].name);\n li.classList.toggle(\"itemIsChecked\");\n });\n li.appendChild(checkBox);\n\n //Create remove button\n let remove = document.createElement(\"button\");\n remove.classList.add(\"delete\");\n remove.setAttribute(\"type\", \"button\");\n remove.setAttribute(\"aria-label\", \"Delete button\");\n remove.innerHTML = '<i class=\"far fa-trash-alt\"></i>';\n remove.addEventListener(\"click\", () => {\n removeTodo(todos[i].name);\n li.remove();\n });\n li.appendChild(remove);\n }\n}", "function renderTodoList() {\n //if there is nothing...\n if(!data.todo.length && !data.completed.length){\n //exit function\n return;\n }\n\n //if there is something...add them to DOM\n for (let i = 0; i < data.todo.length; i++) {\n let value = data.todo[i];\n addItemToDOM(value);\n }\n\n for (let j = 0; j < data.completed.length; j++) {\n let value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "function _drawTodos() {\n let template = ''\n store.State.todos.forEach(item => {\n template += `<li class=\"action\">\n <div class =\"inline\"><input class=\"align-middle\" type=\"checkbox\" ${item.completed ? \"checked\" : \"\"}><div onclick=\"app.TodoController.toggleTodoStatus(${item._id})\">${item.description}</div></div><button class=\"btn btn-danger deleteBtn float-right\" onclick=\"app.TodoController.removeTodo(${item._id})\"></button></li>`\n });\n document.getElementById('list-items').innerHTML = template;\n // document.getElementById('task-count').innerText = \n}", "function render(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const container = document.querySelector('.js-todolist');\n container.innerHTML = '';\n const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItemsReverse) {\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right todoinput\">\n \t\t\t\t<img class=\"image fit\"src=\"images/${todoItem.data.image}\" alt=\"\" />\n \t\t\t\t<div class=\"inner\">\n \t\t\t\t\t<header>\n \t\t\t\t\t\t<h2><a href=\"#/post/${todoItem.id}\">${todoItem.data.title}</a></h2>\n \t\t\t\t\t</header>\n \t\t\t\t\t<p>${todoItem.data.todo}</p>\n \t\t\t\t</div>\n \t\t\t</article>\n\t\t\t `;\n container.appendChild(div);\n };\n }", "function renderTodo(todo) {\n localStorage.setItem('todoItemsRef', JSON.stringify(todoItems));\n const list = document.querySelector('.js-todo-list');\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = '';\n return\n }\n\n const isChecked = todo.checked ? 'done': '';\n \n const node = document.createElement(\"li\");\n node.setAttribute('class', `todo-item ${isChecked}`);\n node.setAttribute('data-key', todo.id);\n node.innerHTML = `\n <input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n <svg><use href=\"#delete-icon\"></use></svg>\n </button>\n `;\n\n if (item) {\n list.replaceChild(node, item);\n } else {\n list.append(node);\n }\n}", "function renderList() {\n viewSection.innerHTML = \"\";\n counter.innerText = todoList.length;\n for(const todo of todoList) {\n const todoElement = createTodoElement(todo);\n viewSection.appendChild(todoElement);\n }\n}", "function render() {\n // Clean the list\n list.innerHTML = '';\n var filteredTodo = getFilteredTodos();\n var todoEls = filteredTodo.map(createTodoNode);\n todoEls.forEach(function (t) { return list.appendChild(t); });\n count.innerHTML = todoEls.length + \" items \" + (filter === FILTER.COMPLETED ? 'completed' : 'left');\n}", "function renderTodo(todo) {\n //store todo items into browser storage.\n localStorage.setItem(\"todoItem\", JSON.stringify(todoItems));\n //get reference of required elements.\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n //Runs a check for deleted items and update the DOM.\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const isChecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry.\n const listItemElement = document.createElement(\"li\");\n\n // set class and data-key attributes to the todo entry.\n listItemElement.setAttribute(\"class\", `todo-item ${isChecked}`);\n listItemElement.setAttribute(\"data-key\", todo.id);\n //populate the todo entry with required values.\n listItemElement.innerHTML = `\n <input id =\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run condition to append the created item to the page.\n if (item) {\n list.replaceChild(listItemElement, item);\n }\n else {\n list.append(listItemElement);\n }\n}", "function _drawTodos() {\n let template = `<ul>`\n ProxyState.todos.forEach(t => template += `<li class=\"d-flex w-100 align-items-center justify-content-between\">${t.Template}</li>`)\n document.getElementById('todo-list').innerHTML = template + '</ul>'\n document.getElementById('todo-count').innerText = \"Remaining To-dos: \" + ProxyState.todos.length\n}", "function renderTodo(todo) {\n //Store todo items into broser storage\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\n //Get reference of required elements\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n //Runs a check for deleted items and update the DOM\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const ischecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry\n //set clss and data-key attribute to the todo entry\n const listItemElement = document.createElement(\"li\");\n listItemElement.setAttribute(\"class\", `todo-item ${ischecked}`);\n //populate the required the values\n listItemElement.setAttribute(\"data-key\", todo.id);\n listItemElement.innerHTML = `<input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run the condition to append the created item to the page\n if (item) {\n list.replaceChild(listItemElement, item);\n } else {\n list.append(listItemElement);\n }\n\n}", "function renderToDos() {\n// let toDos = loadFromLocalStorage();\n ul.innerHTML = \"\";\n for(todo of toDos){\n // Checkbox (when clicked will cross out the text)\n const newCheckBox = document.createElement(\"input\");\n newCheckBox.setAttribute(\"type\", \"checkbox\");\n // task\n const newLi = document.createElement(\"li\");\n // Remove Button (when clicked will remove entire todo)\n const newRemoveBtn = document.createElement(\"button\");\n\n // todo is the object within the array toDos, todo has a key(task) and status set to false\n newLi.innerText = todo.task;\n newRemoveBtn.innerText = \"x\";\n newRemoveBtn.setAttribute(\"id\",\"removeBtn\");\n\n newLi.prepend(newCheckBox);\n newLi.append(newRemoveBtn);\n ul.append(newLi);\n\n // monitor the status of each todo\n if (todo.done) {\n newCheckBox.checked = todo.done;\n newCheckBox.classList.add(\"crossOut\");\n }\n }\n}", "function render(){\n todoListContent.innerHTML = \"\";\n\n if(items.length <= 0){\n todoListContent.innerHTML = \"No items in this list\";\n return;\n }\n\n //todoListContent.append(`${items.length} items`)\n\n items.forEach((item, index) => {\n const wrapper = document.createElement('template');\n wrapper.innerHTML = itemHtml(index, item);\n todoListContent.appendChild(wrapper.content.cloneNode(true));\n });\n\n}", "function render (todoList) {\n renderTodoList(todoList);\n}", "function viewTodoListDom() {\n //clear list of items before render\n list.innerHTML = \"\";\n for (let i = 0; todoItemsOjb.todoItemsRender.length > i; i++) {\n addToDoItemDom(todoItemsOjb.todoItemsRender[i]);\n }\n}", "function addTodosToPage() {\n var ul = document.getElementById(\"todoList\");\n var listFragment = document.createDocumentFragment();\n for (var i = 0; i< todos.length; i++) {\n var todoItem = todos[i];\n var li = createNewTodo(todoItem);\n listFragment.appendChild(li);\n }\n ul.appendChild(listFragment);\n }", "render() {\n return (\n <div>\n <ul className=\"todoList\">{\n this.props.todos.map((todo) => {\n return <TodoItem key={todo.id} todo={todo} actions={this.props.actions}/>\n })\n }</ul>\n </div>\n );\n }", "function renderTodo(items=[]) {\n\t\t\t\tvar item = ``;\n\t\t\t\tfor(var i=0;i<items.length;i++) {\n\t\t\t\t\t\t\t\titem += `\n\t\t\t\t\t\t\t\t\t\t\t\t<li class=\"collection-item\">\n \t\t\t\t\t\t\t\t\t\t\t${items[i]}\n \t\t\t\t\t\t\t\t\t\t\t<a data-id=\"${i}\" href=\"#!\" class=\"secondary-content delete-todo\">\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t <i class=\"material-icons small red-text\">delete</i>\n \t\t\t\t\t\t\t\t\t\t\t</a>\n \t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdocument.querySelector(\".list-todoo\").innerHTML = item;\n\t\t\t\t\n\t\t\t\t// Delete todoo\n \t\tconst btnDeleteTodos = Array.from(document.querySelectorAll(\".delete-todo\"));\n \t\tif (btnDeleteTodos != null ) {\t\t\t\n \t\tbtnDeleteTodos.forEach((btn) => {\n \t\t\t\tbtn.addEventListener(\"click\", function() {\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tconst id = parseInt(this.dataset.id);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tSwal.fire({\n \t\t\t\t\t\t\t\t\t\t\t\ttitle: 'Are you sure?',\n \t\t\t\t\t\t\t\t\t\t\t\ttext: \"You won't be able to revert this!\",\n \t\t\t\t\t\t\t\t\t\t\t\ticon: 'warning',\n \t\t\t\t\t\t\t\t\t\t\t\tshowCancelButton: true,\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonColor: '#3085d6',\n \t\t\t\t\t\t\t\t\t\t\t\tcancelButtonColor: '#d33',\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonText: 'Yes, delete it!'\n\t\t\t\t\t\t\t\t\t\t}).then((result) => {\n \t\t\t\t\t\t\t\t\t\t\t\tif (result.isConfirmed) {\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titems.splice(id, 1);\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tToast.fire({\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon: 'success',\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle: \"Your todo has been deleted\"\n \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\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trenderTodo(items);\n \t\t\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});\n \t\t});\n \t\t\t\n \t\t} \n\t\t\t\n}", "renderTaskList(tasks) {\n this.ulTaskList.innerHTML = '';\n this.tasks.tasks.forEach((task, index) => this.createNewLiTodoElementHTML(task, index))\n }", "function render() {\n // get all the todos stored on the repository\n var todos = global.TodoRepository.find();\n\n // no todos? :happy_face: render a message on the\n // screen telling: Nothing to do, yay!\n if (todos.length === 0) {\n return renderMessage(\"Nothing to do, yay!\");\n }\n\n // is there any filter active (all, pending, done)? Ok\n // then filter the todos and keep just the ones that\n // match the filter criteria\n var filteredTodos = todos.filter(function(todo) {\n if (filter === \"all\") {\n return true;\n }\n\n if (filter === \"pending\") {\n return !todo.complete;\n }\n\n if (filter === \"done\") {\n return todo.complete;\n }\n });\n\n // no todos after the filter? Cool\n // Print to the screen the message: Nothing here\n if (filteredTodos.length === 0) {\n return renderMessage(\"Nothing here\");\n }\n\n // The document doesn't know what it is a todo\n // the document only works with domNodes, so just\n // convert all our filtered todos into domNodes.\n var todoNodes = filteredTodos.map(function(todo) {\n // let's create a list item\n var todoNode = global.document.createElement(\"li\");\n\n // let's add it an id (so we can identify 'em later)\n todoNode.setAttribute(\"id\", \"todo-\" + todo.id);\n\n // add the text\n todoNode.textContent = todo.text;\n\n // is completed? let's mark it with the \"done\" class\n if (todo.complete) {\n todoNode.classList.add(\"done\");\n }\n\n // if somebody clicks it let's toggle the class\n todoNode.addEventListener(\"click\", toggleTodo);\n return todoNode;\n });\n\n // we must clean the list first (we don't want duplicated elements)\n todoList.innerHTML = \"\";\n\n // we must add every todoNode into the todoList\n todoNodes.forEach(function(todo) {\n todoList.appendChild(todo);\n });\n }", "formTodoList(){\n\t\tlet filteredTodo = this.getFilterTodo();\n\n\t\treturn filteredTodo.map(item => {\n\t\t\t\t\t\t\treturn <ListGroupItem \n\t\t\t\t\t\t\t\tclassName=\"listGrpItem\"\n\t\t\t\t\t\t\t\tkey={item.id}> \n\t\t\t\t\t\t\t\t<TodoItem toggleTodo={this.toggleTodo.bind(this)} \n\t\t\t\t\t\t\t\tremoveTodo={this.removeTodo.bind(this)} \n\t\t\t\t\t\t\t\teditTodo={this.editTodo.bind(this)}\n\t\t\t\t\t\t\t\ttodo={item}/>\n\t\t\t\t\t\t\t</ListGroupItem>\n\t\t\t\t\t\t\t});\n\t}", "function renderList() {\n //use a for loop to render the list items\n var html = \"\"\n for (let i = 0; i < arr.length; i++) {\n\n if (arr[i].isCompleted) {\n html += `<li class=\"todo-list-item completed\" id=${i}>${arr[i].task}</li>`\n } else {\n html += `<li class=\"todo-list-item\" id=${i}>${arr[i].task}</li>`\n }\n }\n todoList.innerHTML = html\n}", "function getTodos() {\n checksaveTodos();\n todos.forEach(function(todo) {\n var newList = document.createElement('li');\n newList.classList.add(\"list-item\");\n newList.innerHTML = `${todo}`;\n unList.append(newList);\n var icon = document.createElement('i');\n icon.setAttribute(\"class\", \"fas fa-trash\");\n newList.appendChild(icon);\n })\n pendingItem(todos);\n}", "todoList() {\r\n return this.state.todos.map(function (currentTodo, i) {\r\n return <Todo todo={currentTodo} key={i} />;\r\n });\r\n }", "render() {\n return (\n <div className=\"todos-wrapper\">\n <ol>\n {this.props.todos.map(todo => {\n return !todo.deleted &&\n <li key={todo.id} >\n <Todo todo={todo} \n todoId={todo.id} \n toggleTodo={this.handleToggle}\n deleteTodo={this.handleDelete} />\n </li>\n })}\n </ol>\n </div>\n );\n }", "async renderAllTodos() {\n const todos = await Controller.getTodos();\n this.renderNav(todos);\n this.renderTodos(todos);\n this.renderHeadingTitle('All Todos', todos.length);\n }", "render(){\n\t\t/* Creates variables to hold properties */\n\t\tconst todoEntries = this.props.entries\n\t\tconst listItems = todoEntries.map(this.createItems)\n\n\t\treturn(\n\t\t\t/* Creates an unordered list that holds the information entered by user */\n\t\t\t<ul id = \"theList\">{listItems}</ul>\n\n\t\t)\n\t}", "function renderList( list ){\n const listPlace = document.querySelector('.container');\n \n let HTML = '';\n\n for (let i = 0; i < list.length; i++) {\n const todoItem = list[i];\n \n HTML += `\n <div class=\"item\">\n <div class=\"status ${todoItem.status}\"></div>\n <p class=\"desciption\">${todoItem.description}</p>\n <div class=\"deadline\">${todoItem.deadline}</div>\n <div class=\"actions\">\n <div class=\"action remove\">Remove</div>\n </div>\n </div>`;\n }\n return listPlace.innerHTML += HTML;;\n}", "function displayDoneTodos() {\n\tlet todos = '';\n\tfor (let index = 0; index < doneTodoList.length; index++) {\n\t\tlet counter = index + 1;\n\t\ttodos += `<p>\n ${counter}. ${doneTodoList[index]} \n `;\n\t}\n\tdocument.getElementById('displayDoneTodoList').innerHTML = todos;\n}", "function _drawTodos() {\n document.getElementById(\"total\").innerText = store.State.todos.length.toString()\n let todos = store.State.todos;\n console.log(todos)\n let todoElem = document.getElementById(\"todos\");\n let template = \"\"\n todos.forEach(todo => {\n template += todo.Template\n });\n todoElem.innerHTML = template\n}", "function renderActiveToDos(list) {\n const toDoTarget = document.getElementById(\"to-do-target\");\n const template = document.getElementsByTagName(\"template\")[1];\n clearTarget(toDoTarget);\n\n list.forEach((obj, index) => {\n const clone = template.content.cloneNode(true);\n const done = clone.querySelector(\".done\");\n const listItem = clone.querySelector(\".list-item\");\n const flag = clone.querySelector(\".flag\");\n const deleteItem = clone.querySelector(\".delete\");\n\n toDoTarget.appendChild(clone);\n\n done.addEventListener(\"click\", (event) => {\n obj.done ? (obj.done = false) : (obj.done = true);\n listItem.classList.contains(\"strikethrough\")\n ? listItem.classList.remove(\"strikethrough\")\n : listItem.classList.add(\"strikethrough\");\n });\n\n listItem.textContent = list[index].name;\n if (obj.done) {\n listItem.classList.add(\"strikethrough\");\n }\n if (obj.flag) {\n listItem.classList.add(\"flagged\");\n }\n\n flag.addEventListener(\"click\", (event) => {\n event.preventDefault();\n obj.flag ? (obj.flag = false) : (obj.flag = true);\n listItem.classList.contains(\"flagged\")\n ? listItem.classList.remove(\"flagged\")\n : listItem.classList.add(\"flagged\");\n });\n\n deleteItem.addEventListener(\"click\", (event) => {\n event.preventDefault();\n list.splice(index, 1);\n renderActiveToDos(list);\n });\n\n const newListItem = toDoTarget.childNodes;\n });\n}", "function renderTasks(){\n todoList.innerHTML = ''\n\n tasks.forEach( task => {\n todoList.appendChild(generateTask(task))\n })\n}", "renderTodos(todos, filters) {\r\n\r\n // filter by the todo task property values\r\n const filteredTodos = todos.filter(todo => {\r\n\r\n // setup text filter\r\n const textMatch = todo.task.toLowerCase().includes(filters.searchText.toLowerCase())\r\n // setup completed status filter\r\n const completedMatch = ! filters.hideCompleted || ! todo.completed\r\n\r\n return textMatch && completedMatch\r\n })\r\n\r\n const todoList = document.getElementById('todo-list')\r\n \r\n // clear the todo list on the page\r\n todoList.innerHTML = ''\r\n\r\n // create a summary of todos that need completing\r\n todoList.appendChild(this.generateSummaryDOM(filteredTodos))\r\n\r\n // add the todos to the todo list on the page\r\n filteredTodos.forEach(todo => {\r\n const createTodo = this.generateTodoDOM(todo)\r\n todoList.appendChild(createTodo)\r\n }) \r\n }", "function addList(todo) {\n var li;\n if (todo.completed) {\n li = $(`<li class=\"done\">${todo.name} -- <span id=\"dltSpan\" class=\"fas fa-trash-alt\"></span></li>`)\n } else {\n li = $(`<li>${todo.name}<span id=\"dltSpan\" class=\"fas fa-trash-alt\"></span></li>`)\n }\n li.data('id', todo._id)\n $('#ul').append(li)\n}", "function showTodos() {\n var i, l,\n html = '';\n \n\t\t// process todos\n for(i = 0, l = todos.length; i < l; i++) {\n if(showing == 'all' || \n (todos[i]['completed'] && showing == 'completed') || \n (!todos[i]['completed'] && showing == 'active')) \n\t\t\t{\n \n html += '<div class=\"todo-item ' + (todos[i]['completed'] ? 'completed' : '') + '\" id=\"todo-holder-' + i + '\">' + \n\n todos[i]['todo'] +\n\n '<a href=\"#\" class=\"remove\" data-id=\"todo-' + i + '\">&times;</a>' +\n\n '<a href=\"#\" class=\"complete\" data-id=\"todo-' + i + '\">&#x2713;</a>' +\n\n '<form id=\"todo-edit-form-' + i + '\">' +\n\n '<input id=\"todo-edit-' + i + '\" type=\"text\" value=\"' + todos[i]['todo'] + '\">' +\n\n '</form>' +\n\n '</div>';\n }\n }\n \n\t\t// render todos\n $('todos').innerHTML = html;\n \n\t\t// render toolbar\n $('toolbar').innerHTML = '<span id=\"total-items\">' + todos.length + ' item' + (todos.length == 1 ? '' : 's') + '</span>' +\n '<a href=\"#\"' + (showing == 'all' ? ' class=\"selected\"' : '') + ' id=\"show-all\">All</a>' +\n '<a href=\"#\"' + (showing == 'active' ? ' class=\"selected\"' : '') + ' id=\"show-active\">Active</a>' +\n '<a href=\"#\"' + (showing == 'completed' ? ' class=\"selected\"' : '') + ' id=\"show-completed\">Completed</a>';\n \n $('toolbar').style.display = todos.length ? 'block' : 'none';\n \n }", "function renderTodo(todo) {\r\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\r\n // seleting the first element with a class of \"js-todo-list\"\r\n const list = document.querySelector(\".js-todo-list\");\r\n // Select the current todo items in the DOM\r\n const item = document.querySelector(`[data-key='${todo.id}']`);\r\n\r\n if(todo.deleted) {\r\n // remove the item from the DOM\r\n item.remove();\r\n return\r\n }\r\n\r\n // use te ternary opertor to check if the \"todo.checked\" is true \r\n // if so, assign 'done' to 'isChecked'.Otherwise, assign an empty string\r\n const isChecked = todo.checked ? 'done' : \" \";\r\n\r\n //create a 'li' element and assign it to 'node'\r\n const node = document.createElement(\"li\");\r\n //set the class attribute\r\n node.setAttribute(\"class\", `todo-item ${isChecked}`);\r\n //set the data-key attribute to the id of the todo\r\n node.setAttribute(\"data-key\", todo.id);\r\n \r\n //Setting the contents of the 'li' element created above \r\n node.innerHTML = `\r\n <input id =\"${todo.id}\" type=\"checkbox\" />\r\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\r\n <span>${todo.text}</span>\r\n <button class=\"delete-todo js-delete-todo\"> <svg><use href=\"#delete-icon\"></use></svg> </button>\r\n \r\n `;\r\n // If the item already exists in the DOM \r\n if (item) {\r\n list.replaceChild(node, item);\r\n } else {\r\n // Otherwise append it to the end of the list\r\n list.append(node);\r\n }\r\n\r\n\r\n}", "function displayTodos() {\n console.log('My todos:' , todos);\n}", "function listTodos(){\n console.log(\"*********************\");\n todos.forEach(function(todo, index){ \n console.log(index + \": \" + todo);\n });\n console.log(\"*********************\");\n }", "renderItems(){\n\t\tconst props = _.omit(this.props,'todos');\n\t\treturn _.map(this.props.todos,\n\t\t\t\t\t(todo,index) => <TodosListItems key={index} {...todo} {...props}/> \n\t\t); \n\t}", "function displayTodos() {\r\n console.log(todos);\r\n}", "function printTodos(urlApi, template, list){\n //reset\n list.html('');\n\n $.ajax({\n url: urlApi,\n method: 'GET',\n success: function(data) {\n var todos = data;\n \n for (var i = 0; i < todos.length; i++) {\n var todo = todos[i];\n \n var context = {\n todo: todo.text,\n id: todo.id\n }\n \n var html = template(context);\n list.append(html);\n }\n $('.input').val('');\n \n },\n error: function() {\n console.log('Errore');\n }\n });\n}", "function render(){\n var contenL1 = document.getElementById('todo-list-map');\n var arrTodoHtml =todo.map(function(item,i){\n return '<li class =\"list-group-item\" id =\"li-map-'+i+'\">' + item + ' ' \n + '<button class =\"btn btn-outline-secondary _btn-delete\" onclick=\"deleteTodo('+i+')\">Delete</button></li>';\n });\n var content = arrTodoHtml.join('');\n contenL1.innerHTML=content;\n }", "function renderTodos1(todos) {\n for (var _i = 0, todos_1 = todos; _i < todos_1.length; _i++) {\n var todo = todos_1[_i];\n // let newRow: HTMLTableRowElement = (<HTMLTableElement>document.querySelector('tcontent'))!.insertRow(); // liefert null, #todo\n var newRow = document.getElementById('tcontent').insertRow();\n newRow.insertCell().innerText = String(todo.id);\n newRow.insertCell().innerText = String(todo.userId);\n newRow.insertCell().innerText = String(todo.title);\n newRow.insertCell().innerText = String(todo.completed);\n if (todo.completed) {\n newRow.style.textDecoration = 'line-through';\n }\n }\n}", "function showTodo(todo) {\n // Our single todo item template, each todo item is a single LI tag\n // Note that you can run functions and methods within the ${} template strings\n\n // console.log(todo)\n\n var todoTemplate = `<li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"checkbox\">\n <label>\n <input type=\"checkbox\" data-id=\"${todo.id}\" />\n ${todo.todo}\n </label>\n </div>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-danger\">${todo.category.toUpperCase()}</span>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-default\">${moment(todo.due_date).format('MM/DD/YYYY')}</span>\n </div>\n </div>\n </li>`\n\n // Concatenate our single todo item template onto the end of the existing todo items on the page\n todosContainer.innerHTML += todoTemplate\n}", "function printList(arrayList){\r\n // Pulisce la lista, prima di stamparla\r\n $('.todo-list').text('');\r\n // Preparo template di Handelbars\r\n var source = $('#todo-template').html();\r\n var template = Handlebars.compile(source);\r\n for (var i = 0; i < arrayList.length; i++) {\r\n context = {\r\n listItem: arrayList[i].text,\r\n itemId: arrayList[i].id\r\n };\r\n var html = template(context);\r\n $('.todo-list').append(html);\r\n };\r\n }", "async function render(){\n let todos = await listar_todos()\n const todos_template = todos.map(todo =>{\n if(todo.completado === 0){\n return '<div class=\"todo\" style=\"border-color:red;\" >'+'<h1 style=\"red;\">'+todo.titulo+'</h1>'+'<pre>'+todo.descripcion+'</pre>'+'<button class=\"eliminar\">Eliminar</button>'+'<button class=\"editar\">Editar</button>'+'<button class=\"completado\">Completado</button>'+'</div>'\n }\n else{\n return '<div class=\"todo\" style=\"border-color:rgb(21,255,0);\" >'+'<h1 style=\"color:rgb(21,255,0);\">'+todo.titulo+'</h1>'+'<pre>'+todo.descripcion+'</pre>'+'<button class=\"eliminar\">Eliminar</button>'+'<button class=\"editar\">Editar</button>'+'<button class=\"completado\">Completado</button>'+'</div>'\n }\n })\n contenedor.innerHTML = todos_template.join('')\n eliminar_todo(todos)\n completar_todo(todos)\n editar_todo_evento(todos)\n}", "function createTodos(todos) {\n let todosList = document.querySelector(\"#todos-list\")\n todosList.innerHTML = \"\"\n\n // create list tag for each todo\n todos.forEach((todo, index) => {\n let li = document.createElement(\"li\")\n li.className = \"list-group-item\"\n let content = document.createElement(\"span\")\n content.textContent = todo.content\n content.style.textDecoration = todo.status ? \"initial\" : \"line-through\"\n let deleteBtn = document.createElement(\"img\")\n deleteBtn.src = \"media/delete.png\"\n deleteBtn.alt = \"delete icon\"\n deleteBtn.className = \"right\"\n\n //append content and deleteBtn to li\n li.append(content)\n li.append(deleteBtn)\n\n //append li to todosList\n todosList.append(li)\n\n // add deleteBtn functionality\n deleteBtn.addEventListener(\"click\", e => {\n todos.splice(index, 1)\n localStorage.setItem(\"todos\", JSON.stringify(todos))\n createTodos(todos)\n })\n\n\n // add complete functionality\n content.addEventListener(\"click\", e => {\n todos[index].status = !todos[index].status\n localStorage.setItem(\"todos\", JSON.stringify(todos))\n createTodos(todos)\n })\n });\n}", "render() {\n return (\n <div>\n {this.props.list.map((d, i) => {\n return <Todo key = {i} status={d.status} priority={d.priority} description={d.description} />\n })\n }\n </div>\n )\n }", "function renderTodos() {\n //removendo todo o conteúdo da lis antes de exibir\n listElement.innerHTML = \"\";\n\n //gerando a list\n for (todo of todos) {\n let todoElement = document.createElement('li');\n let todoText = document.createTextNode(todo + \" - \");\n\n let linkElement = document.createElement('a');\n //obrigatoriamente o componente a precisa de um href\n linkElement.setAttribute('href', '#');\n\n //posicao do todo na list\n let posicao = todos.indexOf(todo);\n linkElement.setAttribute('onclick', 'deletetodo(' + posicao + ')');\n\n let linkText = document.createTextNode('X');\n linkElement.appendChild(linkText);\n\n //add na minha li o texto e o link\n todoElement.appendChild(todoText);\n todoElement.appendChild(linkElement);\n\n listElement.appendChild(todoElement);\n }\n}", "function EditableTodoList({todos, update, remove}) {\n\n const eTodoList = todos.map(t => <EditableTodo key={t.id} todo={t} update={update} remove={remove}/>);\n return (\n <div>\n {eTodoList}\n </div>\n );\n}", "function printAllTodos(apiUrl, template, todosList) {\n // clean\n todosList.html('');\n $.ajax({\n url: apiUrl,\n method: 'GET',\n success: function (data) {\n var todos = data;\n\n for (var i = 0; i < todos.length; i++) {\n var todo = todos[i];\n\n var context = {\n todo: todo.text,\n id: todo.id\n }\n var html = template(context);\n todosList.append(html);\n }\n\n },\n error: function () {\n console.log('errore richiesta todos');\n\n }\n\n });\n\n}", "static renderTasks(tasks) {\n const todoList = document.getElementById(\"taskList\");\n let view = \"\";\n\n tasks.forEach(t => {\n let checked = t.completed ? \"checked\" : \"\";\n let classDone = t.completed ? \"done\" : \"\";\n // console.log(t.id + ' checked: ' + checked + ' ' + t.completed);\n view += `<li id='${t.id}' class='show ${classDone}'>\n <input type='checkbox'\n id='cb_${t.id}' onclick='checkTask(this.id)'${checked}/>\n <p>${t.content}</p>\n <a id='a_${t.id}' href='#' onclick='deleteTask(this.id)'> X </a> \n </li>`;\n });\n todoList.innerHTML = view;\n }", "function displayTodos() {\n\tconsole.log('My todos: ', todos);\n}", "render() {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<h1> Todos </h1>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t}", "function todo_list(){ /*Defined the function todo_list()*/\n var todo_list_html = \"\"; /*taken a variable which is initialised with blank string. */\n\n if(todos.length){ /*now the array is empty, but as we will insert todo's in it , at each index there will be our li tag.so if there will be any elements in the array, this condition will execute.*/\n for(todo in todos){ /*doing loop through in the todos array, */\n todo_list_html += '<li class=\"list-group-item\"><span class=\"todo_text\">'+todos[todo]+'</span><button class=\"btn btn-danger btn-xs pull-right todo_delete_btn\">x</button></li>';\n }\n }else{\n todo_list_html = '<li class=\"list-group-item text-danger\">No Data Available</li>'; /*if there will be not anything in the todos array , then this part will execute.In this part, in local var , we simply just assign with no data available. */\n }\n $(\"#todo_list\").html(todo_list_html) /*so in that todo_list_html var ,we have the tags in string,so we are just pushing it in the UL list in html, by using the id of the ul tag.By doing that it will dynamically add there. */\n $(\"#todo_count\").html(todos.length) /*we have given a badge near the To Do heading,so at starting assigned with 0, then, what we are doing is, taking its id, and counting the todos array length.basically , what will show here, number of the elements present in the array.so simply we are changing.*/\n }", "function displayTodos() {\n console.log(\"My todos:\", todos);\n}", "function renderTheUI() {\n //below is how you make it usable\n const toDoList = document.getElementById(\"toDoList\");\n //textContent is an attribute that it has\n toDoList.textContent = \"\";\n\n //for everything in this list do the thing (this function) this function is not named\n toDos.forEach(function(toDo) {\n //these are creating html elements (document.createElement creates html element without being in the html file)\n const newLi = document.createElement(\"li\");\n const checkbox = document.createElement(\"input\");\n const deleteButton = document.createElement(\"button\");\n\n //create a function to use when you press delete\n function deleteToDo() {\n //I want my list toDos to be filled with filtered items that are not\n //filter is a built in function for lists, which runs a function against your lists\n //item is creating another anonomys function (instead of function ()) and\n //alternative to write [after .filter( ] this could be: function(item){ } item => {return item !== toDos;}\n toDos = toDos.filter(item => {\n return item.id !== toDo.id;\n });\n }\n\n //for above this is what the object item and toDo look like\n // {\n // title\n // complete\n // id\n // };\n deleteButton.addEventListener(\"click\", event => {\n deleteToDo();\n renderTheUI();\n });\n\n checkbox.type = \"checkbox\";\n\n newLi.textContent = toDo.title;\n deleteButton.textContent = \"Delete!\";\n\n toDoList.appendChild(newLi);\n newLi.appendChild(checkbox);\n newLi.appendChild(deleteButton);\n });\n }", "function ToDoList({ toDos, setToDos }) {\n //const { userId } = useContext(AuthContext);\n\n useEffect(() => {\n async function fetchData() {\n try {\n const response = await axios.get(\n \"http://localhost:8080/eventdisplaypost/list/\"\n );\n const data = response.data;\n\n setToDos(data);\n } catch (e) {\n console.error(e);\n }\n }\n\n fetchData();\n }, []);\n\n //console.log(toDos);\n // we will map through toDos in order to get each object of todos\n return (\n <div>\n <div className=\"todo-container\">\n <ul>\n {toDos.map((toDo) => (\n <ToDo\n key={toDo._id}\n setToDos={setToDos}\n _id={toDo._id}\n toDo={toDo}\n text={toDo.headerText}\n toDos={toDos}\n bodyText={toDo.bodyText}\n />\n ))}\n </ul>\n </div>\n </div>\n );\n}", "function createTodoListItem(todo) {\n // var checkbox = document.createElement('input');\n // checkbox.className = 'toggle';\n // checkbox.type = 'checkbox';\n // checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.innerHTML = todo.title;\n //label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n // var deleteLink = document.createElement('button');\n // deleteLink.className = 'destroy';\n // deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n // divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n // divDisplay.appendChild(deleteLink);\n\n // var inputEditTodo = document.createElement('input');\n // inputEditTodo.id = 'input_' + todo._id;\n // inputEditTodo.className = 'edit';\n // inputEditTodo.value = todo.title;\n // inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n // inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n // li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n}", "async function displayTodos() {\n let arr = await getAndDisplayTodos(db)\n\n if (completed) {\n arr = arr.filter(item => item.completed === true)\n }\n\n if (uncompleted) {\n arr = arr.filter(item => item.completed === false)\n }\n\n if (arr.length !== 0) {\n try {\n todoList.innerHTML = ''\n\n return arr.forEach((item) => {\n\n let li = createAndAppendElements('li', 'todo', '', '', todoList)\n\n let todoItemDiv = createAndAppendElements('div', 'todo-item', '', '', li)\n\n todoItemDiv.setAttribute('id', item.id)\n\n if (item.completed) {\n todoItemDiv.classList.add('completed')\n }\n\n let p = createAndAppendElements('p', 'todo-text', item.todo, '', todoItemDiv)\n\n let btnDiv = createAndAppendElements('div', 'btn', '', '', todoItemDiv)\n\n let markButton = createAndAppendElements('button', 'mark-complete-btn', '', item.id, btnDiv)\n \n markButton.innerHTML = `<i class=\"fa fa-check-circle\" aria-hidden=\"true\"></i>`\n\n markButton.onclick = markTodoAsComplete\n\n let editButton = createAndAppendElements('button', 'edit-todo-btn', 'E', item.id, btnDiv)\n\n editButton.innerHTML = `<i class=\"fa fa-pen-square\" aria-hidden=\"true\"></i>`\n\n editButton.onclick = editTodo\n\n let delButton = createAndAppendElements('button', 'delete-todo-btn', '', item.id, btnDiv)\n\n delButton.innerHTML = `<i class=\"fas fa-trash\" aria-hidden=\"true\"></i>`\n \n delButton.onclick = deleteTodo\n })\n\n } catch (err) {\n console.log(err);\n }\n\n } else {\n //display message if no todos\n todoList.innerHTML = ` <li> <h4> No Todos yet😱 </br>Create new Todo🙂<h4></li>`\n if (completed) {\n todoList.innerHTML = ` <li> <h4> You've not completed any Todo🥺<h4></li>`\n }\n if (uncompleted) {\n todoList.innerHTML = ` <li> <h4> You have no uncompleted todo😎<h4></li>`\n }\n\n }\n\n}", "render() {\n var todoEntries = this.props.entries;\n var listItems = todoEntries.map(this.createTasks);\n\n return(\n <ul className=\"theList\">\n <FlipMove duration={250} easing=\"ease-out\">\n {listItems}\n </FlipMove>\n </ul>\n );\n }", "function displayTodos() {\n\tconsole.log('My todos:', todos);\n}", "function displayTodos() {\n console.log(\"My Todos: \", todos);\n}", "renderLists() {\n\t\treturn _.map(this.props.lists, (list,listKey) => { \n\t\t\treturn (\n\t <div className={`todo-list ${list.type}`} key={listKey}>\n\t \t<div className=\"todo-list-header\">\n\t \t\t<button \n\t \t\t\tclassName=\"btn btn-graphic\" \n\t \t\t\ttitle=\"Delete List\" \n\t \t\t\tonClick={() => this.props.removeList(this.props.user.uid,listKey)}>\n\t \t\t\t<p>X</p>\n\t \t\t</button>\n\t\t \t<button \n\t\t\t \tclassName=\"btn btn-graphic\" \n\t\t\t \ttitle=\"Edit\" \n\t\t\t \tonClick={() => this.edit(listKey)}>\n\t\t\t \t{<p>&#x270E;</p>}\n\t\t \t</button>\n\t\t \t<h2>{list.title}</h2>\n\t \t</div>\n\n\t \t<ul className=\"list-group list-group-flush\">\n\t \t{(list.items).map((item,index) => (\n\t\t\t\t\t<ListItem\n\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\titem={item[0]}\n\t\t\t\t\t\tcomplete={item[1]}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\tlistName={listKey}\n\t\t\t\t/>))}\n\t \t</ul>\n\t </div>\n\t );\n \t});\n\t}", "function addHTMLTodos(todo) {\n\tincompleteTasksList.innerHTML = \"\";\n\tfor (let i = 0; i < todo.length; i++) {\n\t\tlet node = document.createElement(\"li\");\n\t\tnode.setAttribute(\"class\", `\"item\"`);\n\t\tnode.setAttribute(\"dataKey\", todo[i].id);\n\t\tnode.setAttribute(\"update-key\", `\"item${i}\"`);\n\t\tnode.innerHTML =\n\t\t\t`\n <input type=\"checkbox\" class=\"checkbox\" id=\"${i}\" onclick=completeTasks(` +\n\t\t\ttodo[i].id +\n\t\t\t`,` +\n\t\t\ti +\n\t\t\t`)>\n <small>Task Added: ${todo[i].date}</small>\n <span><input type=\"text\" id=\"item${i}\" class=\"myinput\" value=\"${todo[i].name}\" disabled \"/> </span>\n <button class=\"btn btn-warning updateBtn\" id=\"btn${i}\" onclick=editItem(` +\n\t\t\ti +\n\t\t\t`)>Edit</button>\n <button class=\"btn btn-danger deleteBtn\">Delete</button>\n <br/>\n <hr/>\n `;\n\t\t// Append the element to the DOM as the last child of the element\n\t\tincompleteTasksList.append(node);\n\t}\n}", "function view()\n{\n\t// This function takes care of rendering the to do list\n\t// All UI elements should be added to the \"container\" \n\t// section of the HTML. \n\n\t// get container element by id\n\tvar container = document.getElementById(\"container\");\n\n\tcontainer.innerHTML = \"\";\n\n\t// go through todo list items and add them\n\tfor(var i = 0; i < todos.length; i ++) {\n\t\tvar div = document.createElement('div');\n\n\t\tdiv.className = 'row';\n\n\t\tvar status = '';\n\n\t\tif(todos[i].status == true) {\n\t\t\tstatus = 'checked';\n\t\t}\n\n\t\tdiv.innerHTML = '<input class=\"todoItem\" type=\"checkbox\" onclick=\"updateStatus('+i+')\" '+status+'>\\\n \t\t\t\t\t\t <label for=\"todoItem\">'+todos[i].name+'</label>'+todos[i].completeDate+' \\\n \t\t\t\t\t\t <br>';\n\n\t\tcontainer.appendChild(div);\n\t}\n\t\n\n // clear the text in the input field for todo item\n\tdocument.getElementsByName(\"task\")[0].value = \"\";\n\n}", "function renderTask(listTask) {\n ulList.innerHTML = '';\n\n listTask.forEach(function(item) {\n //check if the task is completed or not\n const checked = item.completed ? 'checked': null;\n\n const li = document.createElement('li');\n //set a class to the li\n li.setAttribute('class', 'task');\n //gives the li a id\n li.setAttribute('data-key', item.id);\n\n \n //it creates the li markup\n li.innerHTML = \n `<input type=\"checkbox\" class=\"checkbox\" ${checked}>\n <span>- ${item.name}</span>\n <i class=\"far fa-trash-alt delete-button\"></i>`;\n\n //if the task is completed, it add a line through\n if(item.completed === true) {\n li.children[1].classList.add('strike');\n }\n\n //add task inside ul\n ulList.append(li)\n\n });\n}", "function refreshTodos() {\n fetchTodos(function(todos) {\n todoList.innerHTML = ''\n\n if (todos.length === 0) {\n todoList.innerHTML = '' +\n '<div style=\"text-align: center;\">' +\n '<i class=\"fas fa-box-open\"></i>' +\n '<p>No items</p>' +\n '</div>';\n return;\n }\n\n for (let index = todos.length - 1; index >= 0; index--) {\n // Read the todo items backwards (most recent first).\n const todo = todos[index]\n\n addTodo(todo)\n }\n })\n}", "function create (todo){\n const html = `\n <li class=\"list-group-item d-flex justify-content-between align-items-center todo\">\n <span>\n ${todo}\n </span>\n <i class=\"fas fa-trash-alt delete\"></i>\n</li>\n `\nlist.innerHTML += html;\n}", "function traerTodos(todos) {\n $(\"#Todos\").empty();\n for (const todo of todos) {\n pintarTODO(todo['_id'],todo['title'],todo['end_date'],todo['description'],[],todo['status']);\n }\n}", "function getTodos () {\r\n let todos;\r\n //CHECK\r\n if(localStorage.getItem('todos') === null) {\r\n todos = []\r\n }else{\r\n todos = JSON.parse(localStorage.getItem('todos'))\r\n }\r\n todos.forEach(function(todo){\r\n const todoDiv = document.createElement('div')\r\n todoDiv.classList.add('todo-div')\r\n // Creat <li>\r\n const newTodo = document.createElement('li')\r\n newTodo.innerText = todo;\r\n newTodo.classList.add('todo-item')\r\n todoDiv.appendChild(newTodo)\r\n // Checked\r\n const checkedButton = document.createElement('button')\r\n checkedButton.classList.add('checked')\r\n checkedButton.innerHTML = '<i class=\"fas fa-check\"></i>'\r\n todoDiv.appendChild(checkedButton)\r\n // Delete\r\n const deleteButton = document.createElement('button')\r\n deleteButton.classList.add('delete')\r\n deleteButton.innerHTML = '<i class=\"far fa-trash-alt\"></i>'\r\n todoDiv.appendChild(deleteButton)\r\n // Append to list\r\n todoList.appendChild(todoDiv)\r\n })\r\n}", "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.appendChild( document.createTextNode(todo.title));\n label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(deleteLink);\n\n var inputEditTodo = document.createElement('input');\n inputEditTodo.id = 'input_' + todo._id;\n inputEditTodo.className = 'edit';\n inputEditTodo.value = todo.title;\n inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "render(){\n\n\n console.log(this.props.todos);\n\n return (\n <table>\n\n <TodoListHeader />\n <tbody>\n {this.renderItems()}\n </tbody>\n </table>\n );\n }", "getTodos() {\n return this.props.todos.map( (todo, i) => {\n return <Todo key={todo.thingToDo + i} thingToDo={todo.thingToDo}\n isDone={todo.isDone} index={i} deleteTodo={this.deleteTodo}\n updateTodo={this.updateTodo}/>\n })\n }", "async function getTodos() {\r\n try {\r\n const ul = document.querySelector('.toDos')\r\n let newElement = '';\r\n const res = await fetch('/getToDos')\r\n const json = await res.json()\r\n console.log(json)\r\n if(json.hasOwnProperty('error')) {\r\n newElement = `<li class=\"toDoItem\">\r\n <span class=\"text\">\r\n No data, please add a todo\r\n </span>\r\n </li>`\r\n }else {\r\n json.forEach(todos => {\r\n console.log(todos.todo)\r\n newElement += `<li class=\"toDoItem\">\r\n <span class=\"text\">\r\n ${todos.todo}\r\n </span>\r\n <button class=\"done\">Done</button>\r\n </li>`\r\n });\r\n }\r\n ul.innerHTML = newElement;\r\n\r\n\r\n }\r\n catch(err) {\r\n console.log(err)\r\n }\r\n}", "function renderTodos(todos) {\n $('#todo-div').empty();\n $('#completed-div').empty();\n // Loop through the results of the get route.\n for (let x of todos) {\n // If it's got a completed date, it's gonna go in the completed section with a green background.\n if (x.date_completed) {\n let $div = $(`<div class=\"todo-item completed-todo\" data-id=${x.id}></div>`);\n $div.append(`<p class=\"todo-name\"><b>${x.name}</b></p>`);\n $div.append(`<p class=\"todo-task\">${x.todo}</p>`);\n $div.append(`<p class=\"todo-added\">Added: ${x.date_added}</p>`);\n $div.append(`<p class=\"todo-completed\">Completed: ${x.date_completed}</p>`);\n $div.append(`<button class=\"btn-undo-complete btn btn-sm\" data-completion=\"${x.date_completed}\">Not Done</button>`);\n $div.append(`<button class=\"btn-delete btn btn-danger btn-sm\">Delete</button>`);\n $('#completed-div').append($div);\n\n }\n // If it doesn't have a completed date, it's gonna go in the to-do section with a yellow background.\n else {\n let $div = $(`<div class=\"todo-item\" data-id=${x.id}></div>`);\n $div.append(`<p class=\"todo-name\"><b>${x.name}</b></p>`);\n $div.append(`<p class=\"todo-task\">${x.todo}</p>`);\n $div.append(`<p class=\"todo-added\">Added: ${x.date_added}</p>`);\n $div.append(`<p class=\"todo-completed\">Not Completed</p>`);\n $div.append(`<button data-completion=\"${x.date_completed}\" class=\"btn-complete btn btn-success btn-sm\">Done!</button>`);\n $div.append(`<button class=\"btn-delete btn btn-danger btn-sm\">Delete</button>`);\n $('#todo-div').append($div);\n }\n\n }\n}", "function render(){\n\tvar src = \"\"\n\tfor(i in TodoList.items) src += ItemTemplate(TodoList.items[i]);\n\tel.innerHTML = src;\n}", "function loadTodos(){\r\n var i;\r\n for (var i=0; i < todos.length; i++){\r\n\tdocument.getElementById('main-todo-list').innerHTML += '<div class=\"todo\"><input type=\"checkbox\" class=\"todo-checkbox\" /><span class=\"todo-text\">' + todos[i].text + '</span></div>';\r\n }\r\n}", "function renderTask() {\n // e.preventDefault();\n //creates task item\n const todos = document.createElement(\"li\");\n todos.classList.add(\"todos\");\n //creates checkbox\n const checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkbox-list\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n //creates list item\n const listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n listItem.innerHTML = inputValue.value;\n //creates X icon to delete item\n const xIcon = document.createElement(\"img\");\n xIcon.classList.add(\"xClose\");\n // xIcon.setAttribute(\"src\", \"../images/icon-cross.svg\");\n //EDIT BUTTON\n const EditBtnsWrapper = document.createElement(\"span\");\n EditBtnsWrapper.classList.add(\"EditBtnsWrapper\");\n //EDIT BUTTON\n const editButton = document.createElement(\"button\");\n editButton.innerHTML = '<i class=\"fas fa-paperclip\"></i> ';\n editButton.classList.add(\"edit-btn\");\n editButton.addEventListener(\"click\", () => {\n listItem.setAttribute(\"contentEditable\", true);\n listItem.focus();\n });\n //appends items to list\n EditBtnsWrapper.append(editButton, xIcon);\n todos.append(checkBox, listItem, EditBtnsWrapper);\n // todoList.appendChild(todos);\n todoList.insertBefore(todos, todoList.firstChild);\n\n inputValue.value = null;\n inputValue.focus();\n listItems++;\n itemsValue();\n}", "function showTodosInUI() {\n let todos = [];\n if (localStorage.getItem('todos') === null) {\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem('todos'));\n }\n todos.forEach(function (todo) {\n const todoDiv = document.createElement('div');\n todoDiv.classList.add('todo');\n //create li\n const newTodo = document.createElement('li');\n newTodo.innerText = todo;\n newTodo.classList.add('todo-item');\n // put newTodo inside the created div\n todoDiv.appendChild(newTodo);\n\n // COMPLETED BUTTON\n const completedBtn = document.createElement('button');\n completedBtn.innerHTML = '<i class=\"fas fa-check\"></i>';\n completedBtn.classList.add('completed-btn');\n //append completed button to the div\n todoDiv.appendChild(completedBtn);\n\n // DELETE BUTTON\n const deleteBtn = document.createElement('button');\n deleteBtn.innerHTML = '<i class=\"fas fa-trash\"></i>';\n deleteBtn.classList.add('delete-btn');\n //append delete button to the div\n todoDiv.appendChild(deleteBtn);\n // APPEND TODO TO LIST\n todoList.appendChild(todoDiv);\n });\n}", "function getTodos(todo) {\n if (localStorage.getItem('todos') === null) {\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem('todos'))\n }\n todos.forEach((todo) => {\n const todoDiv = document.createElement('Div');\n todoDiv.className = 'todo';\n //creating li\n const li = document.createElement('li');\n li.className = 'todo-item';\n // adding input text to todo list\n li.innerText = todo;\n // creating check button\n const checkButton = document.createElement('button');\n checkButton.innerHTML = `<i class=\"fas fa-check\"></i>`\n checkButton.className = `check-btn`;\n // creating delete button\n const deleteButton = document.createElement('button');\n deleteButton.innerHTML = `<i class=\"fas fa-trash\"></i>`\n deleteButton.className = `delete-btn`;\n todoDiv.appendChild(li);\n todoDiv.appendChild(checkButton);\n todoDiv.appendChild(deleteButton);\n // Append to List\n todoList.appendChild(todoDiv);\n });\n}", "display() {\n const display = this.state.todos.map(todo => {\n return (\n <Todo key={todo.id} \n id={todo.id} \n todo={todo} \n removeTodo={this.remove} \n \n />\n );\n });\n return display;\n }", "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.id = 'chk_'+todo.title;\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var colorDiv = document.createElement('div');\n colorDiv.className = 'colorDiv '+todo.color;\n\n var label = document.createElement('label');\n label.setAttribute('for', checkbox.id);\n label.appendChild(document.createTextNode(todo.title));\n\n var text = document.createElement('div');\n text.className = \"todo_text\";\n text.appendChild(document.createTextNode((todo.text !== '') ? todo.text : 'No comment'));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var editLink = document.createElement('button');\n editLink.className = 'edit';\n editLink.addEventListener( 'click', editButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(colorDiv);\n divDisplay.appendChild(text);\n\n divDisplay.appendChild(deleteLink);\n divDisplay.appendChild(editLink);\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "function renderList(tasks){\r\n list.innerHTML=\"\"\r\n for (var i =0 ;i< tasks.length; i++) {\r\n if(tasks[i].isCompleted==false)\r\n list.insertAdjacentHTML(\"beforeend\",`<h3>&bull;${tasks[i].name}&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}done\">DONE</button>&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}delete\">DELETE</button></h3>`) \r\n else{\r\n list.insertAdjacentHTML(\"beforeend\",`<h3>&bull;${tasks[i].name}&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}redo\"style=\"background-color: lightgreen;\">REDO</button>&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}delete\">DELETE</button></h3>`) \r\n }\r\n }\r\n}", "function displayTodos() {\n console.log('My Todos:',todos)\n}", "render() {\n\t\t//app level state is shared\n\t\t// return this.props.todos.map((todo) => <h2>{todo.title}</h2>);\n\t\t//MAP through each todo\n\n\t\treturn this.props.todos.map((todo) => (\n\t\t\t<h3>\n\t\t\t\t{/* keys should be the id prop usually */}\n\t\t\t\t{/* //go up one level becuase we can'tuse the state just console stuff */}\n\t\t\t\t<ToDoItem\n\t\t\t\t\tkey={todo.id}\n\t\t\t\t\ttodo={todo}\n\t\t\t\t\tmarkComplete={this.props.markComplete}\n\t\t\t\t\tdeleteTask={this.props.deleteTask}\n\t\t\t\t/>\n\t\t\t</h3>\n\t\t));\n\t}", "function get(){\n var str=localStorage.getItem(\"thingstodo\");\n todos=JSON.parse(str);\n if(!todos){\n todos=[];\n }else{\n for (var i = 0; i < todos.length; i++) {\n var list=document.getElementById('listof');\n var txt=document.createTextNode(todos[i]);\n var unli=document.createElement('LI');\n unli.appendChild(txt);\n list.appendChild(unli);\n unli.className='do';\n var de=document.createTextNode('Delete');\n var bu=document.createElement('button');\n bu.appendChild(de);\n unli.appendChild(bu);\n bu.style.float='right';\n unli.style.listStyle='none';\n var done=document.createTextNode('Done');\n var btn=document.createElement('button');\n btn.appendChild(done);\n unli.appendChild(btn);\n btn.style.float='right';\n }\n\n \n\n\n }\n\n }", "listTodos(){\n //this context works fine here.\n renderTodoList(getTodos(this.key), this.listContainer);\n }", "function displayTodos(){\r\n\tconsole.log(\" My todos: \", todos);\r\n}", "render() {\n return (\n <div style = {todosStyle}>\n <Todos_compose onSubmit={this.handleAddition}/>\n <Todos_list onDestroy={this.handleDestroy} onChange={this.handleChange} data={this.state.arr}/>\n </div>\n );\n }", "function addTodos(todos) {\n\t//add todos to the page\n\ttodos.forEach(function(todo){\n\t\taddTodo(todo);\n\t});\n}", "function displayNotes(notes) {\n $(\"#todo-list\").empty();\n for (var key in notes) {\n var classes = '';\n if(notes[key].status === 'completed') classes += ' strike';\n else if(notes[key].status === 'archived') continue;\n \n var note = $(`\n <li id='toDoListItem' data-uid=\"${key}\">\n <label class=${classes}>\n <input \n type='checkbox' \n name='todo-item-done' \n class='filled-in todo-item-done' \n value='${notes[key].text}'\n data-uid=\"${key}\" />\n ${notes[key].text}\n <button \n class='todo-item-delete waves-effect waves-light btn deleteItemBtn'\n data-uid=\"${key}\">\n Remove\n </button>\n </label>\n </li>\n `);\n $(\"#todo-list\").append(note);\n }\n }" ]
[ "0.82022727", "0.794333", "0.789683", "0.7819229", "0.7647979", "0.75708413", "0.7537786", "0.7511343", "0.75055003", "0.74943507", "0.74279547", "0.74085474", "0.7372558", "0.73592174", "0.73560476", "0.7331652", "0.7271383", "0.7230757", "0.72179824", "0.72143036", "0.7182169", "0.7180679", "0.7174325", "0.7131109", "0.7117615", "0.71098953", "0.7092634", "0.706305", "0.7051747", "0.7037098", "0.70347947", "0.70150024", "0.7013802", "0.6992368", "0.6991314", "0.6982348", "0.69814646", "0.69442147", "0.6924223", "0.69098634", "0.6904557", "0.6858763", "0.68577445", "0.68500227", "0.6849683", "0.6842953", "0.68242955", "0.6820808", "0.6817731", "0.6813963", "0.68095124", "0.6794489", "0.6782398", "0.6780675", "0.67683977", "0.675767", "0.67513967", "0.6733958", "0.67264867", "0.67174196", "0.67159045", "0.6714925", "0.6710121", "0.66806084", "0.6673394", "0.6666702", "0.66640586", "0.66628623", "0.6647999", "0.6644031", "0.66429037", "0.6632208", "0.6631567", "0.6620502", "0.66187406", "0.6614692", "0.65980065", "0.6594409", "0.65925807", "0.658885", "0.65843976", "0.65835434", "0.65832436", "0.65800476", "0.6565848", "0.6559719", "0.6550944", "0.65497893", "0.6549002", "0.65280855", "0.65243405", "0.65235513", "0.6511086", "0.6500408", "0.6495838", "0.64847624", "0.64845717", "0.6483344", "0.6476146", "0.64758235" ]
0.7016427
31
renders todo details in modal
function renderModalTodo(todo) { todo = $(todo); var id = todo.attr('data-id'), title = todo.attr('data-title'), priority = todo.attr('data-priority'), details = todo.attr('data-details'), created = todo.attr('data-created'), elapsed = parseInt(todo.attr('data-elapsed')), finish = todo.attr('data-finish'), complete = todo.attr('data-complete'), duration = getDuration(created, elapsed); modalTodo.find('.modal-header').text(title + " - "); modalTodo.find('.modal-header').append( '<span class="'+priority+'-text">'+ priority+ '</span>'+ '<button class="right waves-effect waves-light btn"><i class="material-icons">play_arrow</i></button>' ); var html = '<h5>'+ details+ '</h5>'+ '<table>'+ '<tbody>'+ '<tr>'+ '<td>Elapsed time</td>'+ '<td>'+duration+'</td>'+ '</tr>'+ '<tr>'+ '<td>Created</td>'+ '<td>'+moment(created).format("DD/MM/YY, HH:MM:SS")+'</td>'+ '</tr>'+ '<tr>'+ '<td>Finish by</td>'+ '<td>'+moment(finish).format("DD/MM/YY, HH:MM:SS")+'</td>'+ '</tr>'+ '</tbody>'+ '</table>' ; modalTodo.find('.modal-details').html(html); modalTodo.find('#trigger-edit').attr('data-id', id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderModalEdit(todo) {\n\t\tvar form = $('#form-todo-edit');\n\t\t\n\t\tvar id = todo.attr('data-id'),\n\t\t\t\ttitle = todo.attr('data-title'),\n\t\t\t\tpriority = todo.attr('data-priority'),\n\t\t\t\tdetails = todo.attr('data-details'),\n\t\t\t\tcreated = todo.attr('data-created'),\n\t\t\t\telapsed = parseInt(todo.attr('data-elapsed')),\n\t\t\t\tfinish = todo.attr('data-finish'),\n\t\t\t\tcomplete = todo.attr('data-complete'),\n\t\t\t\tduration = getElapsed(created, elapsed).split(':');\n\t\t\n\t\tform.find('#inputId').val(id);\n\t\tform.find('#inputTitle').val(title);\n\t\tform.find('#inputPriority').val(priority);\n\t\tform.find('#inputDetails').val(details);\n\t\tform.find('#inputDetails').trigger('autoresize');\n\t\tform.find('#inputCreatedDate').val(getDate(created));\n\t\tform.find('#inputCreatedTime').val(getTime(created));\n\t\tform.find('#inputFinishDate').val(getDate(finish));\n\t\tform.find('#inputFinishTime').val(getTime(finish));\n\t\tform.find('#inputElapsedHours').val(duration[0]);\n\t\tform.find('#inputElapsedMinutes').val(duration[1]);\n\t\tform.find('#inputElapsedSeconds').val(duration[2]);\n\t\t\n\t\tMaterialize.updateTextFields();\n\t\t$('select').material_select();\n\t}", "function renderTodo(todo) {\n\t\tvar html =\n\t\t\t\t'<a class=\"collection-item\" id=\"'+todo.id+'\" href=\"#modal-todo\"'+\n\t\t\t\t\t'data-id=\"'+todo.id+'\"'+\n\t\t\t\t\t'data-title=\"'+todo.title+'\"'+\n\t\t\t\t\t'data-priority=\"'+todo.priority+'\"'+\n\t\t\t\t\t'data-details=\"'+todo.details+'\"'+\n\t\t\t\t\t'data-created=\"'+todo.createdAt+'\"'+\n\t\t\t\t\t'data-elapsed=\"'+todo.elapsedTime+'\"'+\n\t\t\t\t\t'data-finish=\"'+todo.finishAt+'\"'+\n\t\t\t\t\t'data-complete=\"'+todo.isComplete+'\"'+\n\t\t\t\t'>'+\n\t\t\t\t\t'<span class=\"badge '+todo.priority+'\">'+\n\t\t\t\t\t\ttodo.priority+\n\t\t\t\t\t'</span>'+\n\t\t\t\t\ttodo.title+\n\t\t\t\t'</a>';\n\t\tlist.append(html);\n\t}", "function showTodo(todo) {\n // Our single todo item template, each todo item is a single LI tag\n // Note that you can run functions and methods within the ${} template strings\n\n // console.log(todo)\n\n var todoTemplate = `<li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"checkbox\">\n <label>\n <input type=\"checkbox\" data-id=\"${todo.id}\" />\n ${todo.todo}\n </label>\n </div>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-danger\">${todo.category.toUpperCase()}</span>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-default\">${moment(todo.due_date).format('MM/DD/YYYY')}</span>\n </div>\n </div>\n </li>`\n\n // Concatenate our single todo item template onto the end of the existing todo items on the page\n todosContainer.innerHTML += todoTemplate\n}", "function showTodo(todo) {\n console.log(todo.title + ': ' + todo.text);\n}", "function renderTodo(todo) {\n //store todo items into browser storage.\n localStorage.setItem(\"todoItem\", JSON.stringify(todoItems));\n //get reference of required elements.\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n //Runs a check for deleted items and update the DOM.\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const isChecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry.\n const listItemElement = document.createElement(\"li\");\n\n // set class and data-key attributes to the todo entry.\n listItemElement.setAttribute(\"class\", `todo-item ${isChecked}`);\n listItemElement.setAttribute(\"data-key\", todo.id);\n //populate the todo entry with required values.\n listItemElement.innerHTML = `\n <input id =\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run condition to append the created item to the page.\n if (item) {\n list.replaceChild(listItemElement, item);\n }\n else {\n list.append(listItemElement);\n }\n}", "function renderTodo(todo) {\n //Store todo items into broser storage\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\n //Get reference of required elements\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n //Runs a check for deleted items and update the DOM\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const ischecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry\n //set clss and data-key attribute to the todo entry\n const listItemElement = document.createElement(\"li\");\n listItemElement.setAttribute(\"class\", `todo-item ${ischecked}`);\n //populate the required the values\n listItemElement.setAttribute(\"data-key\", todo.id);\n listItemElement.innerHTML = `<input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run the condition to append the created item to the page\n if (item) {\n list.replaceChild(listItemElement, item);\n } else {\n list.append(listItemElement);\n }\n\n}", "function render () {\n $toDoList.empty();// empty existing posts from view\n var toDoHtml = getAllToDoHtml(allToDos); // pass `allToDos` into the template function\n $toDoList.append(toDoHtml);// append html to the view\n}", "function renderTodo(todo) {\n localStorage.setItem('todoItemsRef', JSON.stringify(todoItems));\n const list = document.querySelector('.js-todo-list');\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = '';\n return\n }\n\n const isChecked = todo.checked ? 'done': '';\n \n const node = document.createElement(\"li\");\n node.setAttribute('class', `todo-item ${isChecked}`);\n node.setAttribute('data-key', todo.id);\n node.innerHTML = `\n <input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n <svg><use href=\"#delete-icon\"></use></svg>\n </button>\n `;\n\n if (item) {\n list.replaceChild(node, item);\n } else {\n list.append(node);\n }\n}", "function populateModal(event)\n{\n\t// If the user clicks an li\n\tif(event.target && !event.target.classList.contains(\"checkmark\") && (event.target.nodeName == \"LI\" || event.target.nodeName == \"SPAN\")) \n\t{\n\t\t//Modal content\n\t\tlet modalText = document.querySelectorAll(\".modal-text\")[0];\n\t\t// Get the <span> element that closes the modal\n\t\tlet spanClose = document.querySelectorAll(\".close\")[0];\n\t\tlet list = event.target.closest(\"UL\");\n\t\tlet tasksArray = localStorage.getItem(\"tasks\") ? JSON.parse(localStorage.getItem(\"tasks\")) : [];\n\n\t\tlet taskID = event.target.id.includes(\"task\") ? event.target.id : event.target.parentNode.id;\n\t\tlet targetTask = tasksArray[getTaskIndex(taskID)];\n\t\tlet deleteButton = createHTMLElement(\"button\", \"Delete\", [\"delete-button\"]);\n\t\tlet targetTaskArray = new Array();\n\t\tlet elementText = \"\";\n\n\t\tfor(let key in targetTask)\n\t\t{\n\t\t\t//We check this to prevent printing out the to do's id as it is not necessary\n\t\t\tif(key !== \"to_do_id\")\n\t\t\t{\n\t\t\t\telementText = key !== \"to_do_due_date\" ? targetTask[key] : formatDate(new Date(targetTask[key]));\n\t\t\t\tlet newElement = createHTMLElement(\"p\", elementText, [\"modal-task-attributes\"]);\n\t\t\t\tmodalText.appendChild(newElement);\n\t\t\t\ttargetTaskArray.push(newElement);\n\t\t\t\tmodalText.insertBefore(labelCreator(key, [\"modal-task-label\"]), newElement);\n\t\t\t}\n\t\t}\n\t\t\n\t\tmodalToggle();\n\n\t\tif(!event.target.classList.contains(\"done-list-item\"))\n\t\t{\n\t\t\tlet editButton = createHTMLElement(\"button\", \"Edit\", [\"edit-button\"]);\n\t\t\tmodalText.appendChild(editButton);\n\n\t\t\teditButton.addEventListener(\"click\", function editTask()\n\t\t\t{\n\t\t\t\tmodalText.removeChild(editButton);\n\t\t\t\tmodalText.removeChild(deleteButton);\n\t\t\t\tpopulateEditModal(taskID, targetTaskArray);\n\t\t\t\teditButton.removeEventListener(\"click\", editTask);\n\t\t\t\t\n\t\t\t});\n\t\t}\n\n\t\tmodalText.appendChild(deleteButton);\n\n\t\t//Delete task button\n\t\t//Removes the task from the list, form memory, and removes the event listener that is created when the modal is opened\n\t\tdeleteButton.addEventListener(\"click\", function removeTask()\n\t\t{\n\t\t\tif(confirm(`The event \"${event.target.textContent}\" will be gone forever. Is this ok?`))\n\t\t\t{\n\t\t\t\tlet targetedListItem = document.querySelector(`#${taskID}`);\n\t\t\t\tlist.removeChild(targetedListItem);\n\t\t\t\tremoveTaskFromMemory(tasksArray, taskID);\n\t\t\t\tdeleteButton.removeEventListener(\"click\", removeTask);\n\t\t\t\tmodalToggle();\n\t\t\t}\n\t\t});\n\n\n\t\t// When the user clicks on <span> (x), close the modal\n\t\tspanClose.addEventListener(\"click\",closeModalEvent, event);\n\t\t// When the user clicks anywhere outside of the modal, close it\n\t\twindow.addEventListener(\"click\", closeModalEvent, event);\n\t\t\n\t}\n}", "function view()\n{\n\t// This function takes care of rendering the to do list\n\t// All UI elements should be added to the \"container\" \n\t// section of the HTML. \n\n\t// get container element by id\n\tvar container = document.getElementById(\"container\");\n\n\tcontainer.innerHTML = \"\";\n\n\t// go through todo list items and add them\n\tfor(var i = 0; i < todos.length; i ++) {\n\t\tvar div = document.createElement('div');\n\n\t\tdiv.className = 'row';\n\n\t\tvar status = '';\n\n\t\tif(todos[i].status == true) {\n\t\t\tstatus = 'checked';\n\t\t}\n\n\t\tdiv.innerHTML = '<input class=\"todoItem\" type=\"checkbox\" onclick=\"updateStatus('+i+')\" '+status+'>\\\n \t\t\t\t\t\t <label for=\"todoItem\">'+todos[i].name+'</label>'+todos[i].completeDate+' \\\n \t\t\t\t\t\t <br>';\n\n\t\tcontainer.appendChild(div);\n\t}\n\t\n\n // clear the text in the input field for todo item\n\tdocument.getElementsByName(\"task\")[0].value = \"\";\n\n}", "function TaskModal({ onHide, task }) {\n return (\n <>\n <Modal show={true} onHide={onHide}>\n <Modal.Header closeButton>\n <Modal.Title>{task.title}</Modal.Title>\n </Modal.Header>\n <Modal.Body>{task.textBody}</Modal.Body>\n <Modal.Footer>\n <Button variant=\"secondary\" onClick={onHide}>\n Close\n </Button>\n </Modal.Footer>\n </Modal>\n </>\n );\n}", "function todoView(item) {\n var todoConfig = U({ editing: false });\n var toggleEditing = C(_ => todoConfig.editing = !Boolean(todoConfig.editing));\n var doneEditing = C(_ => todoConfig.editing = false);\n var edit = C(_ => todoConfig.editing = true );\n \n return E('li') .\n is({ class: { completed: item.completed, editing: config.editing} }) .\n has([\n \n E('div#view') . has ([\n E('input') . is({type: 'checkbox'}) . does({click: 0}) . sets(item.completed),\n LABEL(item.title) . does({ doubleclick: edit })\n ]),\n \n E('input.edit') . sets(item.title) . does({ blur: doneEditing })\n ])\n ;\n }", "function showCreateTodo() {\n $('.form-create-todo').show()\n $('.my-todo').hide()\n $('.project-menu').hide()\n}", "function openTodoModal() {\n todoModal.style.display = \"block\";\n}", "function showDetails() {\n const item = this.options.foodTruck;\n\n document.body.insertAdjacentHTML(\n 'afterbegin',\n `<section id=\"modal\" class=\"modal\">\n <h2>${item.name}</h2>\n <p>Sells ${item.product} for ${item.avgPrice} ${ checkPlural(item.avgPrice, 'coin') }.</p>\n <section class=\"queue\">\n <span>${item.queue}</span>\n <p>${ checkPlural(item.queue, 'person') } waiting</p>\n </section>\n <span class=\"close\" onclick=\"hideDetails()\">✕</span>\n </section>`\n );\n}", "function handleTaskModal() {\n props.openModal('edit task', props.task);\n }", "function populateTodos(list) {\n \n list.forEach(function(td, idx) {\n $('#todo-lists').prepend(`\n <div class=\"card\">\n <div class=\"card-header\" id=\"heading${idx}\">\n <h2 class=\"mb-0\">\n <div class=\"todo-data row\">\n <div class=\"todo-title col-6\">\n <button class=\"btn btn-link\" type=\"button\" data-toggle=\"collapse\" data-target=\"#collapse${idx}\" aria-expanded=\"true\" aria-controls=\"collapse${idx}\">\n Todo: ${td.name}\n </button>\n </div>\n <div class=\"todo-updel-buttons col-6\">\n <button id=\"\"complete-todo-button class=\"btn btn-info update-todo\" value=\"${td._id}\" dataTarget=\"#updateModal\" data-id=\"${td._id}\" >Complete</button>\n <button class=\"btn btn-danger delete-todo\" value=\"${td._id}\">Delete</button>\n </div>\n </div>\n </h2>\n </div>\n\n <div id=\"collapse${idx}\" class=\"collapse show\" aria-labelledby=\"heading${idx}\" data-parent=\"#todo-lists\">\n <div class=\"card-body row\">\n <div class=\"col-4\">\n <p class=\"\"desc>Description: ${td.description}</p>\n <p class=\"due_date\">Due: ${td.due_date.toString().slice(0, 10)}</p>\n <p class=\"completed-todo\">Completed: ${td.completed}</p>\n </div>\n <div class=\"col-5\">\n <img src=\"${td.qr_link}\">\n </div>\n </div>\n </div>\n </div>\n `)\n })\n}", "function showTodosInUI() {\n let todos = [];\n if (localStorage.getItem('todos') === null) {\n todos = [];\n } else {\n todos = JSON.parse(localStorage.getItem('todos'));\n }\n todos.forEach(function (todo) {\n const todoDiv = document.createElement('div');\n todoDiv.classList.add('todo');\n //create li\n const newTodo = document.createElement('li');\n newTodo.innerText = todo;\n newTodo.classList.add('todo-item');\n // put newTodo inside the created div\n todoDiv.appendChild(newTodo);\n\n // COMPLETED BUTTON\n const completedBtn = document.createElement('button');\n completedBtn.innerHTML = '<i class=\"fas fa-check\"></i>';\n completedBtn.classList.add('completed-btn');\n //append completed button to the div\n todoDiv.appendChild(completedBtn);\n\n // DELETE BUTTON\n const deleteBtn = document.createElement('button');\n deleteBtn.innerHTML = '<i class=\"fas fa-trash\"></i>';\n deleteBtn.classList.add('delete-btn');\n //append delete button to the div\n todoDiv.appendChild(deleteBtn);\n // APPEND TODO TO LIST\n todoList.appendChild(todoDiv);\n });\n}", "async function renderNotes(showDone = showDeleted, sortMethode = sortOrder) {\n const notes = await notesService.getNotes(showDone, sortMethode);\n const todoHtml = await createTodosHtml(notes);\n todoElement.innerHTML = '';\n todoElement.innerHTML = todoHtml;\n}", "function showNotes(event) {\n event.preventDefault();\n\n // Hide the tooltip for this element so that they don't hang\n // around (Resolves display issues with tooltips after showing\n // the notes modal).\n $(this).tooltip('hide');\n\n // Get the article id so we can find any existing notes.\n const article = $(this).parents('.card').data();\n\n // Ask for any existing notes from the backend.\n $.get(`/api/notes/${article.id}`).done((response) => {\n // Construct the interior of the modal.\n const contentWrap = $('<div>').addClass('container-fluid');\n const existingNotes = $('<ul>').addClass(\n 'list-group list-group-flush note-container'\n );\n const contentBreak = $('<hr>').addClass('my-2');\n const newNoteBox = $('<textarea>').addClass('form-control').attr({\n placeholder: 'Write your notes here...',\n rows: 4,\n cols: 50,\n });\n\n contentWrap.append(existingNotes, contentBreak, newNoteBox);\n\n // Use bootbox.js to build and display the bootstrap modal.\n bootbox.dialog({\n closeButton: true,\n onEscape: true,\n show: true,\n title: `<strong>Notes:</strong><br>${article.title}...`,\n message: contentWrap,\n backdrop: true,\n buttons: {\n save: {\n /* eslint-disable max-len */\n label: '<span class=\"fa fa-pencil-alt\"></span>&nbsp;&nbsp;Save Note',\n /* eslint-enable max-len */\n className: 'btn-primary save-note',\n callback: saveNote,\n },\n close: {\n /* eslint-disable max-len */\n label: '<span class=\"fas fa-times\"></span>&nbsp;&nbsp;Close',\n /* eslint-enable max-len */\n className: 'btn-outline-warning',\n callback: function () {\n bootbox.hideAll();\n },\n },\n },\n });\n\n const notes = {\n id: article.id,\n notes: response || [],\n };\n\n // Attach the existing notes and article id to the save button.\n $('.save-note').data('article', notes);\n\n // Populate the list of existing notes or the message that\n // none have been created yet.\n createNoteList(notes);\n });\n }", "addOne(todo) {\n\t\tvar view = new TodoView({ model: todo });\n\t\tthis.$('#todo-list').append(view.render().el);\n\t}", "function showTodo(id){\n $('#todoModal').modal('toggle');\n\n $(\"#btnAddTodo\").hide();\n $(\"#btnUpdateTodo\").show();\n $(\"#btnDeleteTodo\").show();\n\n var xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function(){\n if (xhr.readyState == 4 && xhr.status == 200){\n var response = xhr.responseText;\n var title = JSON.parse(response).title;\n var category = JSON.parse(response).category;\n var description = JSON.parse(response).description;\n\n var parent1 = document.getElementById(\"titleTodo\");\n var parent2 = document.getElementById(\"categoryTodo\");\n var parent3 = document.getElementById(\"descriptionTodo\");\n\n parent1.value = title;\n parent2.value = category;\n parent3.value = description;\n }else{\n }\n }\n xhr.open('POST','./ajax/todo.show.php');\n\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n var data = 'id=' +id;\n\txhr.send(data);\n}", "function displayNotes(notes) {\n $(\"#todo-list\").empty();\n for (var key in notes) {\n var classes = '';\n if(notes[key].status === 'completed') classes += ' strike';\n else if(notes[key].status === 'archived') continue;\n \n var note = $(`\n <li id='toDoListItem' data-uid=\"${key}\">\n <label class=${classes}>\n <input \n type='checkbox' \n name='todo-item-done' \n class='filled-in todo-item-done' \n value='${notes[key].text}'\n data-uid=\"${key}\" />\n ${notes[key].text}\n <button \n class='todo-item-delete waves-effect waves-light btn deleteItemBtn'\n data-uid=\"${key}\">\n Remove\n </button>\n </label>\n </li>\n `);\n $(\"#todo-list\").append(note);\n }\n }", "function showEditTodoList() {\n hideTodosLayers();\n var listId = document.forms.todoForm.listId.value;\n if (listId != null && listId != \"null\" && listId != \"\") {\n $(\"editListDiv\").style.display=\"inline\";\n todo_lists.getTodoList(listId, replyEditTodoList);\n document.forms.editListForm.name.focus();\n tracker('/ajax/showEditTodoList');\n }\n}", "async function renderTodo(todo){\n\n const todoIsComplete = todo.complete\n const taskList = todoIsComplete ? completedTodoList : incompleteTodoList;\n const checked = todoIsComplete ? \"checked\" : \"\";\n\n let todoItemHTML = \n `<div class=\"form-check\">\n <label class=\"form-check-label\">\n <input id=\"${todo.id}\" class=\"js-tick\" type=\"checkbox\" ${checked}/>\n ${todo.name}\n </input>\n <p class=\"input-helper\" id=\"incomplete-list\"></p>\n </label>\n\n <div class=\"editicons\">\n <i class=\"remove mdi mdi-close-circle-outline fas fa-edit customeditbutton\"></i>\n <i class=\"remove mdi mdi-close-circle-outline customdeletebutton\"></i>\n </div>\n </div>\n `;\n \n //Add todo to DOM in either the complete or incomplete Task List Depending on variable value\n taskList.insertAdjacentHTML(\"afterbegin\", todoItemHTML)\n \n\n }", "function renderTodo(items=[]) {\n\t\t\t\tvar item = ``;\n\t\t\t\tfor(var i=0;i<items.length;i++) {\n\t\t\t\t\t\t\t\titem += `\n\t\t\t\t\t\t\t\t\t\t\t\t<li class=\"collection-item\">\n \t\t\t\t\t\t\t\t\t\t\t${items[i]}\n \t\t\t\t\t\t\t\t\t\t\t<a data-id=\"${i}\" href=\"#!\" class=\"secondary-content delete-todo\">\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t <i class=\"material-icons small red-text\">delete</i>\n \t\t\t\t\t\t\t\t\t\t\t</a>\n \t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdocument.querySelector(\".list-todoo\").innerHTML = item;\n\t\t\t\t\n\t\t\t\t// Delete todoo\n \t\tconst btnDeleteTodos = Array.from(document.querySelectorAll(\".delete-todo\"));\n \t\tif (btnDeleteTodos != null ) {\t\t\t\n \t\tbtnDeleteTodos.forEach((btn) => {\n \t\t\t\tbtn.addEventListener(\"click\", function() {\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tconst id = parseInt(this.dataset.id);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tSwal.fire({\n \t\t\t\t\t\t\t\t\t\t\t\ttitle: 'Are you sure?',\n \t\t\t\t\t\t\t\t\t\t\t\ttext: \"You won't be able to revert this!\",\n \t\t\t\t\t\t\t\t\t\t\t\ticon: 'warning',\n \t\t\t\t\t\t\t\t\t\t\t\tshowCancelButton: true,\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonColor: '#3085d6',\n \t\t\t\t\t\t\t\t\t\t\t\tcancelButtonColor: '#d33',\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonText: 'Yes, delete it!'\n\t\t\t\t\t\t\t\t\t\t}).then((result) => {\n \t\t\t\t\t\t\t\t\t\t\t\tif (result.isConfirmed) {\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titems.splice(id, 1);\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tToast.fire({\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon: 'success',\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle: \"Your todo has been deleted\"\n \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\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trenderTodo(items);\n \t\t\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});\n \t\t});\n \t\t\t\n \t\t} \n\t\t\t\n}", "function buildTodo(todo) {\n var todoHtml = '<div class=\"todo\" id=\"'+ todo.title +'\" ><p>' + todo.description\n + '</p>'\n + '<button class=\"delete-todo\">Delete</button></div>';\n\n return todoHtml;\n}", "function displayNote(noteid, title, note, completed) {\n\tvar idTag, htmlTag;\n\tif (completed == \"0\" || completed == 0){\n\t\tidTag = \"#notCompletedList\";\n\t\thtmlTag = \"<button class='btn btn-info btn-xs' onclick='toggle(\\\"\"+noteid+\"\\\")'>Mark as Complete</button>\";\n\t}else if(completed == \"1\" || completed == 1){\n\t\tidTag = \"#completedList\";\n\t\thtmlTag = \"<button class='btn btn-info btn-xs' onclick='toggle(\\\"\"+noteid+\"\\\")'>Mark as Not Complete</button>\";\n\t}else\n\t\treturn;\n\n\t$(idTag).append(\n\t\t\"<tr id='\"+noteid+\"'>\"+\n\t\t\t\"<td id='title\"+noteid+\"'>\"+title+\"</td>\"+\n\t\t\t\"<td id='note\"+noteid+\"'>\"+note+\"</td>\"+\n\t\t\t\"<td id='completed\"+noteid+\"' value='\"+completed+\"' style='text-align:center;'>\"+\n\t\t\thtmlTag +\n\t\t\t\" <button class='btn btn-default btn-xs' onclick='editNote(\\\"\"+noteid+\"\\\")'><span title='Edit' class='glyphicon glyphicon-pencil' aria-hidden='true'></span></button>\"+\n\t\t\t\" <button class='btn btn-danger btn-xs' onclick='deleteNote(\\\"\"+noteid+\"\\\")'><span title='Remove' class='glyphicon glyphicon-remove' aria-hidden='true'></span></button></td>\"+\n\t\t\"</tr>\");\n}", "function displayNotesDetails(note){\n return `<p>title: ${note.title}</p><p style=\"display:block\">note: ${note.body}</p>`\n }", "function renderTodo(idx, todo) {\n return div([\n span(todo.get('text')),\n input(\".todo-completed\",\n { type: 'checkbox', checked : todo.get('completed'), 'data-todo-id' : idx }),\n span(\".remove-todo\", {'data-todo-id' : idx}, \" x\")\n ])\n}", "function showDetails(item) {\n loadDetails(item).then(function () {\n // call function to display items in modal\n populateModal(item);\n });\n }", "function renderTodoList() {\n if (!data.todo.length && !data.completed.length) return;\n\n for (i = 0; i < data.todo.length; i++) {\n var value = data.todo[i];\n addItemToDOM(value);\n }\n for (j = 0; j < data.completed.length; j++) {\n var value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "render() {\n\t\treturn (\n\t\t\t<section className=\"main\">\n\t\t\t\t<ul className=\"todo-list\">\n\t\t\t\t\t{this.props.todos.map( (todo, i) => <ToDoItem key={todo.id} id={todo.id} isCompleted={todo.completed} text={todo.title} destroyOne={this.props.destroyOne(i)} toggleTodo={this.props.toggleTodo(i)}/> )}\n\t\t\t\t</ul>\n\t\t\t</section>\n\n\t)}", "function showTodos() {\n var i, l,\n html = '';\n \n\t\t// process todos\n for(i = 0, l = todos.length; i < l; i++) {\n if(showing == 'all' || \n (todos[i]['completed'] && showing == 'completed') || \n (!todos[i]['completed'] && showing == 'active')) \n\t\t\t{\n \n html += '<div class=\"todo-item ' + (todos[i]['completed'] ? 'completed' : '') + '\" id=\"todo-holder-' + i + '\">' + \n\n todos[i]['todo'] +\n\n '<a href=\"#\" class=\"remove\" data-id=\"todo-' + i + '\">&times;</a>' +\n\n '<a href=\"#\" class=\"complete\" data-id=\"todo-' + i + '\">&#x2713;</a>' +\n\n '<form id=\"todo-edit-form-' + i + '\">' +\n\n '<input id=\"todo-edit-' + i + '\" type=\"text\" value=\"' + todos[i]['todo'] + '\">' +\n\n '</form>' +\n\n '</div>';\n }\n }\n \n\t\t// render todos\n $('todos').innerHTML = html;\n \n\t\t// render toolbar\n $('toolbar').innerHTML = '<span id=\"total-items\">' + todos.length + ' item' + (todos.length == 1 ? '' : 's') + '</span>' +\n '<a href=\"#\"' + (showing == 'all' ? ' class=\"selected\"' : '') + ' id=\"show-all\">All</a>' +\n '<a href=\"#\"' + (showing == 'active' ? ' class=\"selected\"' : '') + ' id=\"show-active\">Active</a>' +\n '<a href=\"#\"' + (showing == 'completed' ? ' class=\"selected\"' : '') + ' id=\"show-completed\">Completed</a>';\n \n $('toolbar').style.display = todos.length ? 'block' : 'none';\n \n }", "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "function render(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const container = document.querySelector('.js-todolist');\n container.innerHTML = '';\n const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItemsReverse) {\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right todoinput\">\n \t\t\t\t<img class=\"image fit\"src=\"images/${todoItem.data.image}\" alt=\"\" />\n \t\t\t\t<div class=\"inner\">\n \t\t\t\t\t<header>\n \t\t\t\t\t\t<h2><a href=\"#/post/${todoItem.id}\">${todoItem.data.title}</a></h2>\n \t\t\t\t\t</header>\n \t\t\t\t\t<p>${todoItem.data.todo}</p>\n \t\t\t\t</div>\n \t\t\t</article>\n\t\t\t `;\n container.appendChild(div);\n };\n }", "showDetailModal(item,e) {\n e.stopPropagation();\n const originalTask = JSON.parse(JSON.stringify(item));\n this.setState({\n detailConfirm: true,\n item: item,\n originalTask: originalTask,\n id: this.props.todoList.indexOf(item)\n });\n }", "function showAddTask() {\n vm.taskFormMode = 'add';\n vm.task = {};\n jQuery('#editTaskModal').modal('show');\n }", "function getTodo(){\n // e.preventDefault()\n const token = localStorage.getItem('token');\n $.ajax({\n method: \"GET\",\n url: server + \"/todos\",\n headers: {\n acces_token: token\n }\n }).done(response => {\n // console.log(response)\n $(\"#list-todo\").empty()\n response.forEach(element => {\n const title = element.title\n const description = element.description\n const status = element.status\n const due_date = element.due_date\n $(`<div class=\"card mx-4 mt-4 shadow\" style= \"width: 25%;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${title}</h5>\n <h6 class=\"card-subtitle mb-2 text-muted\" id=\"status\">${status}</h6>\n <p class=\"card-text\">\n ${description} harus dikerjakan sebelum ${due_date}\n </p>\n <button class=\"btn btn-primary\" onclick=\"editTodo(${element.id})\">Edit Todo</button>\n <button class=\"btn btn-primary\" onclick=\"updateTodo(event, ${element.id})\">Update Todo</button>\n <button class=\"btn btn-danger\" onclick=\"deleteTodo(event, ${element.id})\">Delete Todo</button>\n </div>\n </div>`).appendTo(\"#list-todo\")\n });\n }).fail( err => {\n console.log(err)\n })\n}", "function addTodoBtn() {\n $('#')\n $('#add-todo-item').show('fast', function() {\n\n });\n console.log ('add item clicked')\n }", "function createTask(todo, parent) {\n let column = createElement({ class: 'col-md-4' });\n let taskField = createElement({ class: 'task d-flex' });\n taskField.style.background = todo.color;\n\n // <p>{inputValue}</p>\n let taskText = createElement('p');\n taskText.innerHTML = todo.todo;\n taskField.appendChild(taskText);\n\n // <i class=\"far fa-times-circle ms-auto\" ></i>\n let taskDelete = createElement('i', {\n class: 'far fa-times-circle ms-auto',\n });\n taskDelete.addEventListener('click', () => {\n fetch(`${BASE_URL}/${todo.id}`, { method: 'DELETE' });\n parent.removeChild(column);\n });\n taskField.appendChild(taskDelete);\n\n let controlPanel = createTaskController(taskField, todo.id);\n controlPanel.style.display = 'none';\n taskField.appendChild(controlPanel);\n\n // When mouseover in taskField, controlPanel Show\n taskField.addEventListener('mouseover', () => {\n controlPanel.style.display = 'flex';\n });\n\n // When mouseout from taskField, controlPanel Hide\n taskField.addEventListener('mouseout', () => {\n controlPanel.style.display = 'none';\n });\n\n column.appendChild(taskField);\n parent.appendChild(column);\n}", "function getTodo(todo)\n{\n\n let todos;\n if(localStorage.getItem('todos')=== null)\n {\n todos=[];\n } \n else\n {\n todos=JSON.parse(localStorage.getItem('todos')); \n }\n todos.forEach(function(todo){ \n const todiv=document.createElement('div');\n todiv.classList.add(\"todo\");\n\n const newtodo=document.createElement('li');\n newtodo.innerText=todo;\n todiv.classList.add(\"todo-item\");\n todiv.appendChild(newtodo);\n \n const completedButton=document.createElement('button');\n\n completedButton.innerHTML=\"<i class='bx bx-check'></i>\";\n completedButton.classList.add(\"comp-butt\");\n todiv.appendChild(completedButton);\n\n\n const trashButton=document.createElement('button');\n\n trashButton.innerHTML=\"<i class='bx bx-trash'></i>\";\n trashButton.classList.add(\"trash-butt\");\n todiv.appendChild(trashButton);\n\n todolist.appendChild(todiv);\n });\n}", "function displayDoneTodos() {\n\tlet todos = '';\n\tfor (let index = 0; index < doneTodoList.length; index++) {\n\t\tlet counter = index + 1;\n\t\ttodos += `<p>\n ${counter}. ${doneTodoList[index]} \n `;\n\t}\n\tdocument.getElementById('displayDoneTodoList').innerHTML = todos;\n}", "function showUpdateTaskModal() {\n let updateModal = document.getElementById('update-modal');\n let description = updateModal.querySelector('.modal-input[type=\"text\"]');\n let dueDate = updateModal.querySelector('.modal-input[type=\"date\"]');\n let isToday = updateModal.querySelector('.fa-sun');\n let isImportant = updateModal.querySelector('.fa-star');\n\n description.value = selectedTask.querySelector('.task-desc').innerHTML;\n dueDate.value = getDate(selectedTask.querySelector('.task-dueDate').innerHTML);\n selectedTask.dataset.isToday == 'true' ? isToday.classList.add('today') : isToday.classList.remove('today');\n selectedTask.querySelector('.important-star').classList.contains('important') == true ? isImportant.classList.add('important') : isImportant.classList.remove('important');\n\n updateModal.style.display = \"flex\";\n}", "function renderToDoList() {\n\tif (!data.openTasks.length && !data.doneTasks.length) return; \n\n\tfor (var i=0; i < data.openTasks.length; i++) {\n\t\tvar value = data.openTasks[i]; \n\t\tcreateListElement(value); \n\t}\n\n\tfor (var j=0; j < data.doneTasks.length; j++) {\n\t\tvar value = data.doneTasks[j]; \n\t\tcreateListElement(value, true); \n\t}\n}", "function renderTask() {\n // e.preventDefault();\n //creates task item\n const todos = document.createElement(\"li\");\n todos.classList.add(\"todos\");\n //creates checkbox\n const checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkbox-list\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n //creates list item\n const listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n listItem.innerHTML = inputValue.value;\n //creates X icon to delete item\n const xIcon = document.createElement(\"img\");\n xIcon.classList.add(\"xClose\");\n // xIcon.setAttribute(\"src\", \"../images/icon-cross.svg\");\n //EDIT BUTTON\n const EditBtnsWrapper = document.createElement(\"span\");\n EditBtnsWrapper.classList.add(\"EditBtnsWrapper\");\n //EDIT BUTTON\n const editButton = document.createElement(\"button\");\n editButton.innerHTML = '<i class=\"fas fa-paperclip\"></i> ';\n editButton.classList.add(\"edit-btn\");\n editButton.addEventListener(\"click\", () => {\n listItem.setAttribute(\"contentEditable\", true);\n listItem.focus();\n });\n //appends items to list\n EditBtnsWrapper.append(editButton, xIcon);\n todos.append(checkBox, listItem, EditBtnsWrapper);\n // todoList.appendChild(todos);\n todoList.insertBefore(todos, todoList.firstChild);\n\n inputValue.value = null;\n inputValue.focus();\n listItems++;\n itemsValue();\n}", "function showNotes() {\r\n let notes = localStorage.getItem('notes');\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n let title = localStorage.getItem('title')\r\n\r\n if (title == null) {\r\n tObj = [];\r\n } else {\r\n tObj = JSON.parse(title);\r\n }\r\n // var date = new Date()\r\n\r\n let time = localStorage.getItem('time')\r\n\r\n if (time == null) {\r\n timeObj = []\r\n } else {\r\n timeObj = JSON.parse(time)\r\n }\r\n let important = localStorage.getItem('important')\r\n\r\n if (important == null) {\r\n timeObj = []\r\n } else {\r\n importantObj = JSON.parse(important)\r\n }\r\n\r\n let html = '';\r\n notesObj.forEach(function(element, index) {\r\n\r\n\r\n html += `\r\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;margin:10px 20px\">\r\n <div class=\"card-body\" style='height:auto;'>\r\n <h5 class=\"card-title titleSearch\">${tObj[index]}</h5>\r\n <p class=\"card-text notes-search edit-element\">${element}</p>\r\n <button href=\"\" id=\"${index}\" onclick='deleteNote(this.id)' type='button' style='margin:10px 0px;display:block;'class=\"btn btn-outline-primary container\">Delete Note</button>\r\n <button href=\"\" id=\"${index}\" onclick='edit(this.id)' type='button' style='margin:10px auto;width:110px;'class=\"btn btn-outline-warning\" >Edit Note</button>\r\n <button href=\"\" id=\"${index}\" onclick='save(this.id)' type='button' style='margin:10px auto;width:110px;'class=\"btn btn-outline-success\">Save Note</button>\r\n <button href=\"\" id=\"${index}\" onclick='important(this.id)' type='button' style='display:block;margin:0px 0px;'class='btn ${importantObj[index]} container'>Mark as Important</button>\r\n </div>\r\n <div class=\"card-footer text-muted\">\r\n ${timeObj[index]}\r\n </div>\r\n </div>\r\n `\r\n });\r\n let notesElm = document.getElementById('notes');\r\n // \r\n let noteChecker = document.getElementById('noteContent')\r\n if (notesObj.length != 0) {\r\n notesElm.innerHTML = html;\r\n\r\n noteChecker.innerHTML = '<i>Here are your added notes</i>'\r\n } else {\r\n noteChecker.innerHTML = '<i>You have nothing here! Add Notes</i>'\r\n }\r\n}", "function showTodo(id){\n\tconsole.log(\"edit todo : \" + id);\n\tvar todoArr = readTodosArray();\n\tconsole.log(todoArr);\n\tvar content_input = document.getElementById(\"content-input\");\n\tcontent_input.value = todoArr[id-1][CONTENT];\n\tvar due_input = document.getElementById(\"due-input\");\n\tdue_input.value = todoArr[id-1][DUE];\n\tvar due_input = document.getElementById(\"id-input\");\n\tdue_input.value = todoArr[id-1][ID];\n}", "get listTemplate() {\n return /*html*/`\n <div class=\"col-3 border rounded shadow-lg\">\n <h2>${this.title} <button type=\"button\"class=\"text-danger close mt-3\" onclick=\"app.listController.delete('${this.id}')\"><span>&times;</span></button></h2>\n\n <form onsubmit=\"app.taskController.create(event, '${this.id}')\">\n <div class=\"form-group\">\n <input type=\"text\" name=\"taskTitle\" class=\"form-control\" placeholder = \"Enter List Item...\">\n <button type=\"submit\" name=\"\" id=\"\" class=\"btn btn-primary\">Add List</button>\n </div>\n <div class=\"row\">\n ${this.tasks}\n </div>\n </form>\n </div>`\n }", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Modal>\n\t\t\t\t\t{this.state.modalChild}\n\t\t\t\t</Modal>\n\t\t\t\t<ul>\n\t\t\t\t\t {this.state.entries.map((entry) => (\n\t\t\t\t\t\t<li data-index={entry.sort}>\n\t\t\t\t\t\t\t{entry.text}\n\t\t\t\t\t\t\t<span style=\"color: red;\" class=\"delete-item\" onClick={memobind(this, 'removeItem', entry.id)}>x</span>\n\t\t\t\t\t\t\t<span style=\"color: green;\" class=\"edit-item\" onClick={memobind(this, 'editItem', entry)}>e</span>\n\t\t\t\t\t\t</li>))}\n\t\t\t\t</ul>\n\t\t\t\t<form autocomplete=\"off\" class={style['nb-form']} onSubmit={this.handleSubmit}>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={style['nb-form__input']}\n\t\t\t\t\t\tonKeyUp={this.handleTextChange}\n\t\t\t\t\t\tplaceholder=\"New note\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t/>\n\t\t\t\t\t<button type=\"submit\" class=\"hidden-submit\" disabled={'' === this.state.text}>Submit</button>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n\t}", "function handleItem(event){\n setCurrent(event.target.innerHTML);\n \n for(let i=0;i<todoList.length;i++){ //Get details of clicked item\n if(todoList[i].name===event.target.innerHTML){\n setTitleEdit(todoList[i].name);\n setDescriptionEdit(todoList[i].description);\n setTeamEdit(todoList[i].team);\n break;\n }\n }\n setListOpen(true);\n }", "function pendingItem(todos){\n pending.innerHTML = `Your have ${todos.length} remaining task`;\n }", "function _drawTodos() {\n let template = ''\n store.State.todos.forEach(item => {\n template += `<li class=\"action\">\n <div class =\"inline\"><input class=\"align-middle\" type=\"checkbox\" ${item.completed ? \"checked\" : \"\"}><div onclick=\"app.TodoController.toggleTodoStatus(${item._id})\">${item.description}</div></div><button class=\"btn btn-danger deleteBtn float-right\" onclick=\"app.TodoController.removeTodo(${item._id})\"></button></li>`\n });\n document.getElementById('list-items').innerHTML = template;\n // document.getElementById('task-count').innerText = \n}", "displayInfo() {\n this.getTime();\n $('#modalTitle').html(`${this.name}`);\n $('#modalInfo').html(\n `<li>Current Time: &nbsp; ${this.time}</li><li>Latitude: &nbsp; ${this.latitude}</li><li>Longitude: &nbsp; ${this.longitude}</li><li>Distance from your location: &nbsp; ${this.distance}km</li>`\n );\n $('#wikiInfo').removeClass('show');\n $('#forecastInfo').removeClass('show');\n $('#weatherInfo').removeClass('show');\n $('#generalInfo').addClass('show');\n $('#infoModal').modal();\n }", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n }\n else {\n notesobj = JSON.parse(notes);\n }\n\n let html = \"\";\n notesobj.forEach(function (element, index) {\n html += ` <div class=\"notescard my-2 mx-2 card\" style=\"width: 18rem;\">\n \n <div class=\"card-body\">\n <div class=\"mark\" ><i id=\"${index}\" class=\"far fa-star fa-2x\"></i></div>\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete Note</button>\n <button class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#EditNote\" onclick=\"editnote(${index})\">Edit Note</button>\n </div>\n </div>`\n var imp = index;\n\n });\n let notesElm = document.getElementById('notes');\n if (notesobj.length != 0) {\n notesElm.innerHTML = html;\n \n }\n else {\n notesElm.innerHTML = `<h5 class=\"text-white\">Nothing to show Use \"Add a note section\" to above add notes</h5>`;\n }\n // markupdate();\n\n}", "function editTask(event){\n const header = event.target.parentElement;\n const task = header.parentElement;\n const id = Number(task.getAttribute(\"data-id\"));\n const val = database.getField(id);\n val.onsuccess = () => {\n const {key, title, description} = val.result;\n var editTitle = document.getElementById(\"editTitle\");\n editTitle.setAttribute(\"value\",title);\n\n var editDescription = document.getElementById(\"editDescription\");\n editDescription.innerHTML = description;\n }\n modal.style.display = \"block\";\n var saveChange = document.querySelector(\"#btnsave\");\n saveChange.setAttribute(\"data-id\",id);\n saveChange.onclick = changeTask;\n }", "function showDetail() {\n showModal('detail.html');\n}", "function viewTodoListDom() {\n //clear list of items before render\n list.innerHTML = \"\";\n for (let i = 0; todoItemsOjb.todoItemsRender.length > i; i++) {\n addToDoItemDom(todoItemsOjb.todoItemsRender[i]);\n }\n}", "function contentDetail(i){\n const itm = globalArr[i]\n console.log(itm)\n $('#info').modal('toggle');\n $(\"#content_no\").text(itm.no)\n $(\"#content_description\").text(itm.description)\n $(\"#content_status\").text(itm.status)\n $(\"#content_date\").text(itm.date)\n $(\"#content_detail\").text(itm.details)\n $(\"#content_title\").text(itm.title + \" - \" + itm.contentsId)\n}", "function displayTodos() {\n //var data is a Promise \n let data = new Promise((resolve, reject) => {\n let xml = new XMLHttpRequest();\n xml.open('get', '/get-data');\n xml.onreadystatechange = () => {\n if (xml.readyState == 4 && xml.status == 200) {\n //what we got back from the server\n //if OK it will go to .then \n resolve(JSON.parse(xml.responseText))\n }\n }\n xml.send();\n })\n //when a data arrive run this function \n //to make a card for each todo task\n data.then((data) => {\n let text = '';\n //go through all the data from DB \n for (let i = 0; i < data.length; i++) {\n //will make a card \n text += `\n <div class=\"col-6\">\n <div class=\"card\">\n <div class=\"card header\">\n <button class=\"btn btn-sm btn-secondary float-left\">Task${i + 1}</button>\n <button class=\"btn btn-sm btn-succes float-right\">${data[i].date}</button>\n </div>\n <div class=\"card body text-center\">\n <h3>${data[i].msg}</h3>\n </div>\n <div class=\"card footer text-center\">\n <button data-id=\"${data[i]._id}\" class=\"btn btn-sm btn-danger\">Delete</button>\n </div>\n </div>\n</div>`\n }\n //using a mainRow to display a card\n mainRow.innerHTML = text;\n\n let alldeleteBtns = document.querySelectorAll('[data-id]');\n\n for (let i = 0; i < alldeleteBtns.length; i++) {\n alldeleteBtns[i].addEventListener('click', deleteTodo);\n }\n })\n}", "function todoCreator(todoText, completed) {\n uniqueCounter = uniqueCounter + 1;\n var todoId = 'todo' + uniqueCounter;\n return '<li class=\"list-group-item d-flex\">' +\n ' <div class=\"form-check\" style=\"flex: 1 1 auto;\" onchange=\"toggleComplete(this);maybeHideDeleteAll();\">' +\n ' <input type=\"checkbox\" class=\"form-check-input\" id=\"' + todoId + '\">' +\n ' <label class=\"form-check-label\" for=\"' + todoId + '\">' +\n (completed ? '<del>' + todoText + '</del>' : todoText) +\n ' </label>' +\n ' </div>' +\n ' <button onclick=\"deleteTodo(this);maybeHideDeleteAll();\" class=\"btn btn-secondary btn-sm\">Delete</button>' +\n '</li>';\n}", "function createModalHTML(data){ \n data.forEach(function(note){\n $(\".existing-note\").append(`\n <div class=\"panel panel-default\" id=\"${note._id}\">\n <div class=\"panel-body\">\n <div class=\"noteContent\">\n <p>${note.body}</p>\n <button class=\"btn btn-primary edit-note\" data-noteId=\"${note._id}\"\">Edit</button>\n <button class=\"btn btn-primary delete-note\" data-noteId=\"${note._id}\">Delete</button>\n </div>\n <div class=\"update-form\"></div>\n </div>\n </div>\n `)\n }); \n}", "function renderTodo(todo) {\n //This function renders a todo to the page.\n //If the todo already exists then this function will update it\n\n //Check if todo already exists in dom\n var $existingElem = $('#'+ todo.id);\n if ($existingElem.length) {\n //Update text (possible it's not changed)\n $existingElem.find('.task').text(todo.item);\n\n //Check if element is in correct list and check if \n if (($existingElem.parent('ul').attr('id') === 'todo-list') && (todo.completed === true)) {\n //Move from todo to completed\n $existingElem.detach();\n $('#completed-list').prepend($existingElem); \n $existingElem.slideDown();\n\n } else if (($existingElem.parent('ul').attr('id') === 'completed-list') && (todo.completed === false)) {\n //Move from complted to todo\n $existingElem.detach();\n $('#todo-list').prepend($existingElem); \n $existingElem.slideDown();\n }\n } else {\n // Todo is new to client.. add\n var taskHTML = '<li><span class=\"done\">%</span>'; \n taskHTML += '<span class=\"edit\">+</span>'; \n taskHTML += '<span class=\"delete\">x</span>'; \n taskHTML += '<span class=\"task\"></span></li>';\n\n var $newTask = $(taskHTML); \n $newTask.find('.task').text(todo.item);\n $newTask.attr('id',todo.id);\n $newTask.hide(); \n if (todo.completed === true) {\n $('#completed-list').prepend($newTask); \n } else {\n $('#todo-list').prepend($newTask); \n }\n $newTask.show('clip',250).effect('highlight',1000);\n }\n}", "function addTodo(todo){\n\t//create new jQuery li (add the span for the X button)\n\tvar newTodo = $('<li class=\"task\">' + todo.name + '<span>X</span></li>');\n\t//stick the mongo _id in the jQuery data here so that the delete button works\n\tnewTodo.data('id', todo._id);\n\t//pstick the completed property in the jQuery data store\n\tnewTodo.data('completed', todo.completed);\n\t//cross out item if it's completed\n\tif(todo.completed) {\n\t\tnewTodo.addClass(\"done\");\n\t}\n\t//add the generated todo to the list on the page\n\t$(\".list\").append(newTodo);\n}", "function Todo(props) {\n const [modalIsOpen, setModalIsOpen ] = useState(false);\n function deleteHandler(){\n setModalIsOpen(true);\n }\n\n function closeModalHandler(){\n setModalIsOpen(false);\n\n }\n return (\n <div className=\"card\">\n <h2>{props.text}</h2>\n <div className=\"actions\">\n <button className=\"btn\" onClick={deleteHandler}>Delete</button>\n </div>\n {modalIsOpen && <Modal onCancel={closeModalHandler} onConfirm={closeModalHandler}/>}\n {modalIsOpen && <Backdrop onClick={closeModalHandler}/>}\n </div>\n )\n}", "formTodoList(){\n\t\tlet filteredTodo = this.getFilterTodo();\n\n\t\treturn filteredTodo.map(item => {\n\t\t\t\t\t\t\treturn <ListGroupItem \n\t\t\t\t\t\t\t\tclassName=\"listGrpItem\"\n\t\t\t\t\t\t\t\tkey={item.id}> \n\t\t\t\t\t\t\t\t<TodoItem toggleTodo={this.toggleTodo.bind(this)} \n\t\t\t\t\t\t\t\tremoveTodo={this.removeTodo.bind(this)} \n\t\t\t\t\t\t\t\teditTodo={this.editTodo.bind(this)}\n\t\t\t\t\t\t\t\ttodo={item}/>\n\t\t\t\t\t\t\t</ListGroupItem>\n\t\t\t\t\t\t\t});\n\t}", "render() {\n return (\n <div className='container'>\n <div className='header'>\n <h1><span className='very'>The</span> Simple To-do App</h1>\n <h3><span className='subheader'>Track all the things!</span></h3>\n </div>\n <div className='row'>\n <Form addItem={this.addItem} />\n <ToDoList toDoList={this.state.toDoList}\n handleUpdate={this.handleUpdate}\n handleDelete={this.handleDelete}\n handleArchive={this.handleArchive} />\n </div>\n <div className='row'>\n <div className='footer col-sm-4'>\n <h4>Tasks completed: {this.state.archive.length}</h4>\n </div>\n </div>\n </div>\n );\n }", "render() {\n return (\n <div className='App'>\n <h1>Todo List</h1>\n <h2 className=\"todo-items\"><TodoList \n todos={this.state.todos}\n toggleItem={this.toggleItem} \n /></h2>\n \n <TodoForm\n addTodo={this.addTodo}\n clearTodos={this.handleTodoDoneClick}\n />\n <Footer/>\n </div>\n );\n }", "viewList(list) {\n // WE'LL BE ADDING THE LIST ITEMS TO OUR WORKSPACE\n let itemsListDiv = document.getElementById(\"todo-list-items-div\");\n\n // GET RID OF ALL THE ITEMS\n this.clearItemsList();\n\n if(list!=null){\n for (let i = 0; i < list.items.length; i++) {\n // NOW BUILD ALL THE LIST ITEMS\n let listItem = list.items[i];\n\n let status = (listItem.status==\"incomplete\") ? \"<div class='status-col yellow'>\"+listItem.status+\"</div>\"\n : \"<div class='status-col blue'>\"+listItem.status+\"</div>\"\n let listItemElement = \"<div id='\" + listItem.id + \"' class='list-item-card'>\"\n + \"<div class='task-col'>\" + listItem.description + \"</div>\"\n + \"<div class='due-date-col'>\"+listItem.dueDate+\"</div>\"\n + status\n + \"<div class='list-controls-col'>\"\n + \" <div class='list-item-control material-icons'>keyboard_arrow_up</div>\"\n + \" <div class='list-item-control material-icons'>keyboard_arrow_down</div>\"\n + \" <div class='list-item-control material-icons'>close</div>\"\n + \" <div class='list-item-control'></div>\"\n + \" <div class='list-item-control'></div>\"\n + \"</div>\";\n itemsListDiv.innerHTML += listItemElement;\n \n }\n let listitems = document.getElementsByClassName(\"list-item-card\");\n let thisController = this.controller;\n for (var i = 1; i < listitems.length; i++) {\n var des = listitems[i].getElementsByClassName('task-col')[0];\n des.onclick = function(e){\n var div=document.createElement(\"Input\");\n div.className=\"task-col\";\n div.setAttribute(\"type\", \"text\");\n div.value=e.target.innerHTML;\n\n div.onblur=function(e){\n thisController.handleTaskChange(e.target.parentNode.id,e.target.value);\n }\n\n e.target.replaceWith(div);\n }\n\n var dat = listitems[i].getElementsByClassName('due-date-col')[0];\n dat.onclick = function(e){\n var div=document.createElement(\"Input\");\n div.className=\"due-date-col\";\n div.setAttribute(\"type\", \"date\");\n div.value=e.target.innerHTML;\n \n div.onblur=function (e) {\n thisController.handleDateChange(e.target.parentNode.id,e.target.value);\n }\n\n e.target.replaceWith(div);\n }\n\n var stat = listitems[i].getElementsByClassName('status-col')[0];\n stat.onclick = function(e){\n var div=document.createElement(\"select\");\n div.className=\"status-col\";\n let status = (e.target.innerHTML==\"incomplete\") ? \"<option value='incomplete' selected>incomplete</option>\"\n +\"<option value='complete'>complete</option>\" :\n \"<option value='incomplete'>incomplete</option>\"\n +\"<option value='complete' selected>complete</option>\";\n div.innerHTML+=status;\n \n div.onblur=function (e) {\n thisController.handleStatusChange(e.target.parentNode.id,e.target.value);\n }\n \n e.target.replaceWith(div);\n \n }\n\n if(i>1){\n var up = listitems[i].getElementsByClassName('list-item-control')[0];\n up.onclick = function(e){\n thisController.handleMoveUp(e.target.parentNode.parentNode.id);\n }\n }\n\n if(i<listitems.length-1){\n var down = listitems[i].getElementsByClassName('list-item-control')[1];\n down.onclick = function(e){\n thisController.handleMoveDown(e.target.parentNode.parentNode.id);\n }\n }\n\n var del = listitems[i].getElementsByClassName('list-item-control')[2];\n del.onclick = function(e){\n thisController.handleDeleteAnItem(e.target.parentNode.parentNode.id);\n }\n }\n this.greyOutAdded();\n document.getElementById(\"todo-lists-list\").firstChild.style.color=\"yellow\";\n }else{\n this.returnColorAdded();\n document.getElementById(\"todo-lists-list\").firstChild.style.color=\"rgb(233,237,240)\";;\n }\n this.undoRedo();\n }", "createViewModal() {\n const htmlstring = '<div class=\"modal-content\">' +\n '<div class=\"modal-header\">' +\n ' <span id=\"closeview\" class=\"closeview\">&times;</span>' +\n ' <h2>' + this.name + '</h2>' +\n '</div>' +\n '<div class=\"modal-body\">' +\n ' <h2>Description</h2>' +\n ' <p>' + this.description + '</p>' +\n ' <h2>Current Status : ' + this.status + '</h2>' +\n ' <h2>Assigned to ' + this.assignee + '</h2>' +\n ' <h2>Priority : ' + this.priority + '</h2>' +\n ' <h2>Created on : ' + this.date + '</h2>' +\n '</div>' +\n '</div>';\n\n return htmlstring;\n }", "function Todo({ todo, toggleComplete, removeTodo }) {\n return (\n <body>\n <div className=\"center-align\">\n <div className=\"todo-list\">\n <div className=\"todo\">\n <div \n style={{ textDecoration: todo.isCompleted ? \"line-through\" : \"\" }}\n >\n {todo.text}\n </div>\n <button class=\"waves-effect waves-light btn\" onClick={() => toggleComplete(todo)}>Complete</button>\n <button class=\"waves-effect red lighten-3 btn\" onClick={() => removeTodo(todo)}>x</button>\n </div>\n \n {/* <div className=\"right-align\">\n <button class=\"waves-effect waves-light btn\" onClick={() => toggleComplete(todo)}>Complete</button>\n <button class=\"waves-effect red lighten-3 btn\" onClick={() => removeTodo(todo)}>x</button>\n </div> */}\n </div>\n </div>\n \n </body>\n \n );\n}", "function displayTask(task) {\r\n\r\n let itemIndex = task.id;\r\n\r\n let itemDiv = document.createElement(\"div\");\r\n itemDiv.id = \"tn\" + itemIndex;\r\n itemDiv.className = \"taskNote fade-in\";\r\n let noteAdd = document.getElementById(\"tasks\").appendChild(itemDiv);\r\n\r\n let textDiv = document.createElement(\"div\");\r\n textDiv.className = \"taskText\";\r\n textDiv.innerHTML = task.details;\r\n let textAdd = document.getElementById(itemDiv.id).appendChild(textDiv);\r\n\r\n let timeDiv = document.createElement(\"div\");\r\n timeDiv.className = \"dateTime\";\r\n timeDiv.innerHTML = task.date + \"<br />\" + task.time;\r\n let timeAdd = document.getElementById(itemDiv.id).appendChild(timeDiv);\r\n\r\n let iconDiv = document.createElement(\"div\");\r\n iconDiv.id = \"di\" + itemIndex;\r\n iconDiv.className = \"del\";\r\n let iconDivAdd = document.getElementById(itemDiv.id).appendChild(iconDiv);\r\n\r\n let delButton = document.createElement(\"button\");\r\n delButton.className = \"delInv glyphicon glyphicon-trash\";\r\n let delButtonAdd = document.getElementById(iconDiv.id).appendChild(delButton);\r\n\r\n let spaceAdd = document.getElementById(iconDiv.id).innerHTML += \"&nbsp;&nbsp;\";\r\n\r\n let editButton = document.createElement(\"button\");\r\n editButton.className = \"edInv glyphicon glyphicon-pencil\";\r\n let editButtonAdd = document.getElementById(iconDiv.id).appendChild(editButton);\r\n\r\n deleteButtons();\r\n editButtons();\r\n\r\n}", "function modal(){\n\n\t\tdocument.getElementsByClassName(\"modal-pic-container\")[0].innerHTML = '';\n\t\tlet img = document.createElement('img');\n\t\timg.id = 'modal-pic';\n\t\timg.src = this.children[0].getAttribute('src');\n\t\timg.alt = this.children[0].getAttribute('alt');\n\t\tdocument.getElementsByClassName(\"modal-pic-container\")[0].appendChild(img);\n\n\t\tdocument.getElementById('modal-name').innerHTML = '';\n\t\tlet a = document.createElement('a');\n\t\ta.innerHTML = this.children[1].children[0].innerHTML;\n\t\ta.href = this.getAttribute('class');\n\t\ta.target = '_blank';\n\t\tdocument.getElementById('modal-name').appendChild(a);\n\n\t\tlet url = 'https://final-project-sekyunoh.herokuapp.com/description?id='\n\t\t+this.getAttribute('id');\n\t\t// fetch url\n\t\tfetch(url)\n\t\t.then(checkStatus)\n\t\t.then(function(responseText) {\n\t\t\tlet res = JSON.parse(responseText);\n\t\t\tdocument.getElementById('modal-desc').innerHTML = res['desc'];\n\t\t})\n\t\t.catch(function(error) {\n\t\t\t// error: do something with error\n\t\t\t//showError(error,);\n\t\t\tdisplayError(error + ' while fetching description');\n\t\t});\n\n\t\tlet modal = document.getElementById('myModal');\n\t\tmodal.style.display = \"block\";\n\n\t\tdocument.getElementsByClassName(\"close\")[0].onclick = function() {\n\t\t\tmodal.style.display = \"none\";\n\t\t};\n\t}", "function editButtonPressed(todo) {\n $('#todo_input').val(todo.title);\n $('#text_input').val(todo.text);\n $('#enterdetails').html('Enter Details: (Edit: '+todo.title+')'); // Add a hint that we are now editing\n $('#sendtodo').val('edit'); // Change the Save button from save-mode to edit-mode\n $('#canceltodo').show(); // Show the cancel button\n currentTodo = todo;\n\n if(colorChecked !== '') {\n colorChecked.removeClass( 'circleclicked' );\n }\n colorChecked = $('.circle.'+todo.color);\n $('.circle.'+todo.color).addClass( 'circleclicked' );\n\n console.log(todo);\n }", "function renderTodoList() {\n //if there is nothing...\n if(!data.todo.length && !data.completed.length){\n //exit function\n return;\n }\n\n //if there is something...add them to DOM\n for (let i = 0; i < data.todo.length; i++) {\n let value = data.todo[i];\n addItemToDOM(value);\n }\n\n for (let j = 0; j < data.completed.length; j++) {\n let value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "function buildNotes(notes) {\n\n //Loop through the notes\n notes.forEach(function(note) {\n\n\n const noteCard = `<div id=\"${note._id}\" class=\"note alert alert-primary alert-dismissible\" role=\"alert\">\n <div class=\"note-body\">\n ${note.body}\n </div>\n <button type=\"button\" class=\"close edit-note\">\n <span><i class=\"fas fa-edit\"></i></span>\n </button>\n <button type=\"button\" class=\"close delete-note\">\n <span>&times;</span>\n </button>\n </div>`\n\n $(\".notes-modal\").find(\"#article-notes\").append(noteCard)\n\n\n });\n }", "function render(){\n var contenL1 = document.getElementById('todo-list-map');\n var arrTodoHtml =todo.map(function(item,i){\n return '<li class =\"list-group-item\" id =\"li-map-'+i+'\">' + item + ' ' \n + '<button class =\"btn btn-outline-secondary _btn-delete\" onclick=\"deleteTodo('+i+')\">Delete</button></li>';\n });\n var content = arrTodoHtml.join('');\n contenL1.innerHTML=content;\n }", "async function displayTodos() {\n let arr = await getAndDisplayTodos(db)\n\n if (completed) {\n arr = arr.filter(item => item.completed === true)\n }\n\n if (uncompleted) {\n arr = arr.filter(item => item.completed === false)\n }\n\n if (arr.length !== 0) {\n try {\n todoList.innerHTML = ''\n\n return arr.forEach((item) => {\n\n let li = createAndAppendElements('li', 'todo', '', '', todoList)\n\n let todoItemDiv = createAndAppendElements('div', 'todo-item', '', '', li)\n\n todoItemDiv.setAttribute('id', item.id)\n\n if (item.completed) {\n todoItemDiv.classList.add('completed')\n }\n\n let p = createAndAppendElements('p', 'todo-text', item.todo, '', todoItemDiv)\n\n let btnDiv = createAndAppendElements('div', 'btn', '', '', todoItemDiv)\n\n let markButton = createAndAppendElements('button', 'mark-complete-btn', '', item.id, btnDiv)\n \n markButton.innerHTML = `<i class=\"fa fa-check-circle\" aria-hidden=\"true\"></i>`\n\n markButton.onclick = markTodoAsComplete\n\n let editButton = createAndAppendElements('button', 'edit-todo-btn', 'E', item.id, btnDiv)\n\n editButton.innerHTML = `<i class=\"fa fa-pen-square\" aria-hidden=\"true\"></i>`\n\n editButton.onclick = editTodo\n\n let delButton = createAndAppendElements('button', 'delete-todo-btn', '', item.id, btnDiv)\n\n delButton.innerHTML = `<i class=\"fas fa-trash\" aria-hidden=\"true\"></i>`\n \n delButton.onclick = deleteTodo\n })\n\n } catch (err) {\n console.log(err);\n }\n\n } else {\n //display message if no todos\n todoList.innerHTML = ` <li> <h4> No Todos yet😱 </br>Create new Todo🙂<h4></li>`\n if (completed) {\n todoList.innerHTML = ` <li> <h4> You've not completed any Todo🥺<h4></li>`\n }\n if (uncompleted) {\n todoList.innerHTML = ` <li> <h4> You have no uncompleted todo😎<h4></li>`\n }\n\n }\n\n}", "function showNotes() {\n //Fetch notes from local storage.\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n };\n\n //Fetch Notes title from local storage.\n let notesTitle = localStorage.getItem('notesTitle');\n if (notesTitle == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(notesTitle);\n };\n\n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n let today = new Date().toLocaleDateString() \n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${index+1}-${titleObj[index]}</h5>\n <h6 class=\"card-title\">Note Create Date:${today}</h6>\n <p class=\"card-text\">${element}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\"\n style=\"background-color:#9c4949\">Delete Note</button>\n </div>\n </div>`;\n });\n \n let notesElm = document.getElementById('notes');\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n notesElm.style.color = 'black';\n }\n else {\n notesElm.innerHTML = `<h4>Nothing to Show! Use \"Add a Note\" section above to add Notes</h4>`;\n notesElm.style.color = 'green';\n }\n}", "function ToDoItems(props) {\n return (\n <div>\n <TaggedContentCard href={\"/myPlants/detail/\" + props.id} thumbnail={props.image} title={props.commonName} description={props.scientificName} tags={[props.nextWaterDate]} />\n </div>\n );\n}", "function showCreateNoteModal() {\n utils.clearPageNotification();\n\n // Creating the modal content elements\n var modalBody = $('<div >');\n var noteNameInput = $('<input type=\"text\" class=\"form-control form-control-lg\" />');\n var noteNameInputContainer = $('<div class=\"pull-left\"><div class=\"form-group col-sm-12\">');\n var modalFooter = $('<div class=\"pull-right\">');\n var createButton = $('<button type=\"button\" class=\"btn btn-primary\">Create</button>');\n\n // Appending to create the modal content structure\n noteNameInputContainer.append(noteNameInput);\n modalBody.append(noteNameInputContainer);\n modalFooter.append(createButton);\n\n var modal = utils.showModalPopup('Enter a name for your new note', modalBody, modalFooter);\n\n // Registering event listeners for the modal window\n createButton.click(function() {\n createNote(noteNameInput.val());\n modal.modal('hide');\n });\n }", "function display() {\n\tlet ref = localStorage.getItem(\"Todo List\");\n\t// if reference exists\n\tif (ref) {\n\t\ttodoArr = JSON.parse(ref);\n\t\taddHTMLTodos(todoArr);\n\t}\n\tdisplay_comp();\n}", "render() {\n return (\n <div>\n <h2>To Do App: MVP</h2>\n <TodoList toggleCompleted={this.toggleCompleted} listTasks={this.state.tasks} />\n <TodoForm \n newValue={this.state.newTasks} \n addToNewTasks={this.addToNewTasks} \n addToList={this.addToList}\n clearButton={this.clearButton}\n />\n </div>\n );\n }", "function openNotesEditModal(e) {\r\n e.preventDefault();\r\n\r\n dmpNotesModal.style.display = \"block\";\r\n\r\n currentEditDay = e.target.dataset.jsEditNotes;\r\n currentEditDayNumber = parseInt(\r\n currentEditDay.charAt(currentEditDay.length - 1)\r\n );\r\n currentDayDisplay = days[currentEditDayNumber - 1];\r\n\r\n dmpNotesModalHeader.textContent = `${currentDayDisplay} Notes`;\r\n dmpNotesModalInput.value = dmpContent[currentEditDay][\"notes\"];\r\n}", "function showTasks() {\n // hold the html that will be displayed in the task sidebar\n let tasksHtml = '<div id=\"task-container\" class=\"col <!-- s12 m12 -->\">';\n // iterate over the tasks in the current list\n tasks.forEach((task) => {\n // Make it so each task that is created has its own id as it loops through below\n tasksHtml += `\n \n <div id=\"${task.id}\" class=\"collection-item detail\">\n <label>\n <input type=\"checkbox\" onclick=\"toggleTaskCompleted(this, '${task.id}')\"/>\n <span>${task.text}</span>\n <span><button class=\"btn\" onclick=\"removeTask('${task.id}')\">\n <i class=\"far fa-trash-alt\"></i>\n </button><span>\n </label>\n </div>\n <div class=\"divider\"></div>`;\n });\n tasksHtml += '</div>'\n\n // print out the tasks\n document.getElementById('what-task').innerHTML = tasksHtml;\n\n }", "async function render(){\n let todos = await listar_todos()\n const todos_template = todos.map(todo =>{\n if(todo.completado === 0){\n return '<div class=\"todo\" style=\"border-color:red;\" >'+'<h1 style=\"red;\">'+todo.titulo+'</h1>'+'<pre>'+todo.descripcion+'</pre>'+'<button class=\"eliminar\">Eliminar</button>'+'<button class=\"editar\">Editar</button>'+'<button class=\"completado\">Completado</button>'+'</div>'\n }\n else{\n return '<div class=\"todo\" style=\"border-color:rgb(21,255,0);\" >'+'<h1 style=\"color:rgb(21,255,0);\">'+todo.titulo+'</h1>'+'<pre>'+todo.descripcion+'</pre>'+'<button class=\"eliminar\">Eliminar</button>'+'<button class=\"editar\">Editar</button>'+'<button class=\"completado\">Completado</button>'+'</div>'\n }\n })\n contenedor.innerHTML = todos_template.join('')\n eliminar_todo(todos)\n completar_todo(todos)\n editar_todo_evento(todos)\n}", "function getNotes(name){\n $('#edit_note').modal();\n //set title\n document.getElementById('noteTitle').innerHTML = \"Notes for \" +name;\n\n document.getElementById('name_hidden2').value = name;\n \n}", "display() {\n const display = this.state.todos.map(todo => {\n return (\n <Todo key={todo.id} \n id={todo.id} \n todo={todo} \n removeTodo={this.remove} \n \n />\n );\n });\n return display;\n }", "render() {\n return (\n <div className=\"App\">\n <ul>\n { this.state.todos.map( (todo, index) =>\n <ToDo key={ index } description={ todo.description } isCompleted={ todo.isCompleted } toggleComplete={ () => this.toggleComplete(index) } deleteTodo ={ () => this.deleteTodo(index) } />\n )}\n </ul>\n <form onSubmit={ (e) => this.handleSubmit(e) }>\n <input type=\"text\" value={ this.state.newTodoDescription } onChange={ (e) => this.handleChange(e) }/>\n <input type=\"submit\" />\n </form>\n </div>\n )\n }", "function renderTodos1(todos) {\n for (var _i = 0, todos_1 = todos; _i < todos_1.length; _i++) {\n var todo = todos_1[_i];\n // let newRow: HTMLTableRowElement = (<HTMLTableElement>document.querySelector('tcontent'))!.insertRow(); // liefert null, #todo\n var newRow = document.getElementById('tcontent').insertRow();\n newRow.insertCell().innerText = String(todo.id);\n newRow.insertCell().innerText = String(todo.userId);\n newRow.insertCell().innerText = String(todo.title);\n newRow.insertCell().innerText = String(todo.completed);\n if (todo.completed) {\n newRow.style.textDecoration = 'line-through';\n }\n }\n}", "changeModalHeaderText(editable) {\n this._modalTaskTitle.innerText = editable ? 'Edit Task':'Add Task';\n }", "function getTodo() {\n let tasks;\n if (localStorage.getItem('todo') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('todo'));\n }\n\n // Loop through task\n tasks.forEach(task => {\n // Create list item\n let todoItem = document.createElement('li');\n // Add class to List item\n todoItem.classList.add('todo-item');\n todoItem.appendChild(document.createTextNode(task));\n // Create New link\n let link = document.createElement('a');\n // Add class to link\n link.className = 'delete secondary-content';\n // set attribute\n link.href = '#';\n // Add content to link\n link.innerHTML = '<i class=\"fas fa-times\"></i>';\n // Append link to item\n todoItem.appendChild(link);\n // Append List item to list\n todoList.appendChild(todoItem);\n }); \n}", "function addTodo(todo) {\n const newTodo = $(`<li class=\"task\">${todo.name}<span>X</span></li>`);\n newTodo.data('id', todo.id);\n newTodo.data('completed', todo.completed);\n if(todo.completed) {\n newTodo.addClass('done');\n }\n $('.list').append(newTodo);\n}", "function createNewRow(todo) {\n const $newInputRow = $(\n [\n \"<li class='list-group-item todo-item'>\",\n \"<span>\",\n todo.text,\n \"</span>\",\n \"<input type='text' class='edit' style='display: none;'>\",\n \"<button class='delete btn btn-danger'>x</button>\",\n \"<button class='complete btn btn-primary'>✓</button>\",\n \"</li>\"\n ].join(\"\")\n );\n console.log(todo.id);\n $newInputRow.find(\"button.delete\").data(\"id\", todo.id);\n $newInputRow.find(\"input.edit\").css(\"display\", \"none\");\n $newInputRow.data(\"todo\", todo);\n if (todo.complete) {\n $newInputRow.find(\"span\").css(\"text-decoration\", \"line-through\");\n }\n return $newInputRow;\n }", "processDeleteList() { // CHANGE\n // Prompt window, slides a dialog\n // must be animated on and off screen\n window.todo.view.showDialog();\n // disable buttons\n document.body.classList.add(\"modal_open\");\n // allow modal and modal buttons to be clicked \n // let dialog = document.getElementById(TodoGUIId.MODAL_YES_NO_DIALOG);\n // dialog.classList.add(\"modal_container_open\");\n }", "edit(todo) {\n this.editTodo = todo.content;\n todo.isEdited = true;\n }", "function todoList(todoItem) {\r\n\r\n var todoObj = todoItem.data();\r\n \r\n todoObj.id = todoItem.id;\r\n\r\n\r\n var p = document.createElement('p');\r\n\r\n var textNode = document.createTextNode(todoObj.todo);\r\n\r\n p.appendChild(textNode);\r\n p.setAttribute('id', todoObj.id);\r\n getDiv.appendChild(p);\r\n\r\n var EditBtn = document.createElement('button');\r\n var EditTextnode = document.createTextNode('Edit Item');\r\n EditBtn.appendChild(EditTextnode);\r\n p.appendChild(EditBtn);\r\n EditBtn.setAttribute('onclick' , 'EditNode(this)');\r\n\r\n var deleteBtn = document.createElement('button');\r\n var deleteTextNode = document.createTextNode(\"delete\");\r\n deleteBtn.appendChild(deleteTextNode);\r\n deleteBtn.setAttribute('onclick' , 'deleteItem(this)');\r\n p.appendChild(deleteBtn);\r\n\r\n var todoImage = document.createElement('img');\r\n todoImage.setAttribute('src' , todoObj.image);\r\n todoImage.setAttribute('width' , '50px');\r\n todoImage.setAttribute('height' , '50px');\r\n console.log(todo)\r\n p.appendChild(todoImage);\r\n\r\n\r\n}", "function TodoView() {\n return (\n <div id={'todoApp'}>\n <div className={styles['list']}>\n <TodoList />\n </div>\n <Link\n to=\"/todos/new\"\n className={`btn btn-outline-secondary ${styles['add-new-todo-button']}`}\n >\n Add new todo\n </Link>\n <Route\n exact\n path=\"/todos/new\"\n component={TodoCreateModalLazy}\n />\n <Route exact path=\"/todos/:id/edit\" component={TodoEditModal} />\n </div>\n );\n}", "function getDetail(id) {\n $('.jumbotron').hide()\n $('#buttonAllTodos').hide()\n $('#addNewTodo').hide()\n $('#edit-todo').show()\n $('#signInButton').hide()\n $('#gSignIn').hide()\n $('#login_data').hide()\n $('#signup_form').hide()\n $('#allTodos').show()\n $('#logout_button').show()\n $.get(`http://localhost:3000/todos/${id}`)\n .done(todo => {\n let date = new Date(`${todo.due_date}`)\n let month = date.getMonth() + 1\n let radio_status;\n if (todo.status == 'checked') {\n radio_status = \n `<input type=\"checkbox\" name=\"checked\" value=\"checked\" id=\"checked\" checked>Done<br>`\n } else {\n radio_status = \n `<input type=\"checkbox\" name=\"checked\" value=\"checked\" id=\"checked\">Done<br>`\n }\n let specDate = date.getDate()\n if ((date.getMonth() + 1) < 10) month = '0' + (date.getMonth() + 1)\n if (specDate < 10) specDate = '0' + (date.getDate())\n let full_date = `${date.getFullYear()}-${month}-${specDate}`\n $('#addNewTodo').hide()\n $('#edit-todo').empty()\n $('#edit-todo').append(`\n <form id=\"form-edit-todo\">\n Name:\n <input type=\"text\" value=\"${todo.name}\" id=\"name-updated\"> <br>\n Description:\n <input type=\"text\" value=\"${todo.description}\" id=\"desc-updated\"> <br>\n Status:\n ${radio_status}\n Due Date:\n <input type=\"date\" value=\"${full_date}\" id=\"pick-date\"> <br>\n <button type=\"submit\">Update Todo</button>\n </form>\n `)\n\n //edit todo\n $('#form-edit-todo').submit(function (event) {\n event.preventDefault()\n let checkbox = $('#checked:checked').val()\n if ($('#checked').not(':checked')) checkbox = 'unchecked'\n checkbox = 'checked'\n // tembak ke localhost abis itu update datanya\n $.ajax({\n url: `http://localhost:3000/todos/${id}`,\n type: 'put',\n data: {\n name: $('#name-updated').val(),\n description: $('#desc-updated').val(),\n status: checkbox,\n due_date: $('#pick-date').val()\n }\n })\n .done(updated => {\n swal(\"Your todo has been successfully updated\", \"\", \"success\");\n homepage()\n fetchTodos()\n })\n .fail(err => {\n console.log(err)\n })\n })\n })\n .fail(err => {\n console.log(err)\n })\n}", "function toggleTodo(event) {\n // this funciton gets called when somebody clicks a todo\n // and the click event gets triggered.\n event.preventDefault();\n\n // if it's already marked as done let's unmark it (remove class done)\n // if it's pending let's mark it as done (add class done)\n event.target.classList.toggle(\"done\");\n\n // let's get the id of that todo from the element\n // that was clicked\n var todoId = event.target.getAttribute(\"id\");\n\n // the id has this form \"todo-1\", we only care about\n // the number, so let's extract it\n var id = todoId.split(\"-\")[1];\n\n // get the todo from the repository, the id is a tring and find\n // accepts a number, so let's convert it to a number.\n // Find returns a list, if find... well... finds the todo\n // it will return a list with only one todo.\n // So let's extract the todo from the list\n var todo = global.TodoRepository.find(Number(id))[0];\n\n // if it's already marked as done let's unmark it\n // if it's pending let's mark it as done\n todo.complete = !todo.complete;\n\n // don't create a new one, just update the existing one\n global.TodoRepository.save(todo, false);\n\n // print (update) the todo list on the screen!\n render();\n }" ]
[ "0.7492966", "0.7484302", "0.6420262", "0.6416993", "0.6294539", "0.6256276", "0.62361515", "0.6209705", "0.6191751", "0.6191233", "0.6190431", "0.61891675", "0.6180034", "0.61781734", "0.6170497", "0.61701435", "0.61595416", "0.6092127", "0.60896057", "0.6089572", "0.6059959", "0.603424", "0.6030256", "0.6029869", "0.6022022", "0.6007545", "0.60069275", "0.6004284", "0.59847707", "0.59785545", "0.5977273", "0.5973216", "0.59700364", "0.5965255", "0.59620476", "0.59509563", "0.59496933", "0.59357405", "0.5873207", "0.58692914", "0.5862559", "0.5862391", "0.5858853", "0.58473927", "0.5846543", "0.58462334", "0.5838104", "0.58197135", "0.5816602", "0.5796199", "0.57939863", "0.5787179", "0.5786552", "0.5779647", "0.5778535", "0.5773756", "0.5772427", "0.5757175", "0.5756484", "0.57564586", "0.57529366", "0.5751327", "0.57512504", "0.57490164", "0.574865", "0.57441074", "0.5741877", "0.5741476", "0.5739703", "0.57322127", "0.5727788", "0.5727312", "0.57264817", "0.5725612", "0.5722798", "0.5722368", "0.5716678", "0.5710792", "0.57103795", "0.5701393", "0.5697716", "0.5697678", "0.5693224", "0.56911725", "0.5682984", "0.56801176", "0.567762", "0.5677206", "0.5673763", "0.5673564", "0.56699777", "0.5669863", "0.5666693", "0.56639165", "0.56632996", "0.5662296", "0.5662004", "0.5653059", "0.5652904", "0.5649396" ]
0.82247376
0
renders todo info on edit modal
function renderModalEdit(todo) { var form = $('#form-todo-edit'); var id = todo.attr('data-id'), title = todo.attr('data-title'), priority = todo.attr('data-priority'), details = todo.attr('data-details'), created = todo.attr('data-created'), elapsed = parseInt(todo.attr('data-elapsed')), finish = todo.attr('data-finish'), complete = todo.attr('data-complete'), duration = getElapsed(created, elapsed).split(':'); form.find('#inputId').val(id); form.find('#inputTitle').val(title); form.find('#inputPriority').val(priority); form.find('#inputDetails').val(details); form.find('#inputDetails').trigger('autoresize'); form.find('#inputCreatedDate').val(getDate(created)); form.find('#inputCreatedTime').val(getTime(created)); form.find('#inputFinishDate').val(getDate(finish)); form.find('#inputFinishTime').val(getTime(finish)); form.find('#inputElapsedHours').val(duration[0]); form.find('#inputElapsedMinutes').val(duration[1]); form.find('#inputElapsedSeconds').val(duration[2]); Materialize.updateTextFields(); $('select').material_select(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderModalTodo(todo) {\n\t\ttodo = $(todo);\n\t\t\n\t\tvar id = todo.attr('data-id'),\n\t\t\t\ttitle = todo.attr('data-title'),\n\t\t\t\tpriority = todo.attr('data-priority'),\n\t\t\t\tdetails = todo.attr('data-details'),\n\t\t\t\tcreated = todo.attr('data-created'),\n\t\t\t\telapsed = parseInt(todo.attr('data-elapsed')),\n\t\t\t\tfinish = todo.attr('data-finish'),\n\t\t\t\tcomplete = todo.attr('data-complete'),\n\t\t\t\tduration = getDuration(created, elapsed);\n\t\t\n\t\tmodalTodo.find('.modal-header').text(title + \" - \");\n\t\tmodalTodo.find('.modal-header').append(\n\t\t\t'<span class=\"'+priority+'-text\">'+\n\t\t\t\tpriority+\n\t\t\t'</span>'+\n\t\t\t'<button class=\"right waves-effect waves-light btn\"><i class=\"material-icons\">play_arrow</i></button>'\n\t\t);\n\t\t\n\t\tvar html =\n\t\t\t\t'<h5>'+\n\t\t\t\t\tdetails+\n\t\t\t\t'</h5>'+\n\t\t\t\t'<table>'+\n\t\t\t\t\t'<tbody>'+\n\t\t\t\t\t\t'<tr>'+\n\t\t\t\t\t\t\t'<td>Elapsed time</td>'+\n\t\t\t\t\t\t\t'<td>'+duration+'</td>'+\n\t\t\t\t\t\t'</tr>'+\n\t\t\t\t\t\t'<tr>'+\n\t\t\t\t\t\t\t'<td>Created</td>'+\n\t\t\t\t\t\t\t'<td>'+moment(created).format(\"DD/MM/YY, HH:MM:SS\")+'</td>'+\n\t\t\t\t\t\t'</tr>'+\n\t\t\t\t\t\t'<tr>'+\n\t\t\t\t\t\t\t'<td>Finish by</td>'+\n\t\t\t\t\t\t\t'<td>'+moment(finish).format(\"DD/MM/YY, HH:MM:SS\")+'</td>'+\n\t\t\t\t\t\t'</tr>'+\n\t\t\t\t\t'</tbody>'+\n\t\t\t\t'</table>'\n\t\t\t\t;\n\t\t\n\t\tmodalTodo.find('.modal-details').html(html);\n\t\tmodalTodo.find('#trigger-edit').attr('data-id', id);\n\t}", "edit(todo) {\n this.editTodo = todo.content;\n todo.isEdited = true;\n }", "function renderTodo(todo) {\n\t\tvar html =\n\t\t\t\t'<a class=\"collection-item\" id=\"'+todo.id+'\" href=\"#modal-todo\"'+\n\t\t\t\t\t'data-id=\"'+todo.id+'\"'+\n\t\t\t\t\t'data-title=\"'+todo.title+'\"'+\n\t\t\t\t\t'data-priority=\"'+todo.priority+'\"'+\n\t\t\t\t\t'data-details=\"'+todo.details+'\"'+\n\t\t\t\t\t'data-created=\"'+todo.createdAt+'\"'+\n\t\t\t\t\t'data-elapsed=\"'+todo.elapsedTime+'\"'+\n\t\t\t\t\t'data-finish=\"'+todo.finishAt+'\"'+\n\t\t\t\t\t'data-complete=\"'+todo.isComplete+'\"'+\n\t\t\t\t'>'+\n\t\t\t\t\t'<span class=\"badge '+todo.priority+'\">'+\n\t\t\t\t\t\ttodo.priority+\n\t\t\t\t\t'</span>'+\n\t\t\t\t\ttodo.title+\n\t\t\t\t'</a>';\n\t\tlist.append(html);\n\t}", "function editToDo() {\t\t\n\t\tasync function fetchRequest(path, newData) {\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(`${ AppHelper.API_URL }/users/edit/${ path }/${ id }`, {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\tAuthorization: `Bearer ${ token }`\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify(newData)\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconst success = await response.json();\n\t\t\t\t\n\t\t\t\tif (success) {\n\t\t\t\t\t// Clears the form fields when finished\n\t\t\t\t\tclearFields();\n\t\t\t\t\t\n\t\t\t\t\t// Success message\n\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\ticon: 'success',\n\t\t\t\t\t\ttitle: 'Yay!',\n\t\t\t\t\t\ttext: 'Your To Do has been edited.',\n\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t\ttimer: 2468\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// router\n\t\t\t\t\trouter.push('/dashboard');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(err);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// CONTROL STATEMENTS\n\t\t// If all three fields are filled up\n\t\tif (name !== '' && description !== '' && date !== '') {\n\t\t\tconst editedFields = {\n\t\t\t\tname: name,\n\t\t\t\tdescription: description,\n\t\t\t\ttoDoDate: date\n\t\t\t};\n\t\t\t\n\t\t\tfetchRequest('to-do', editedFields);\n\t\t\t\n\t\t\t// Name field is the only one with content\n\t\t} else if (name !== '') {\n\t\t\tconst editedField = { name: name };\n\t\t\t\n\t\t\tfetchRequest('to-do-name', editedField);\n\t\t\t\n\t\t\t// Description field is the only one with content\n\t\t} else if (description !== '') {\n\t\t\tconst editedField = { description: description };\n\t\t\t\n\t\t\tfetchRequest('to-do-desc', editedField);\n\t\t\t\n\t\t\t// Date field is the only one with content\n\t\t} else if (date !== '') {\n\t\t\tconst editedField = { toDoDate: date };\n\t\t\t\n\t\t\tfetchRequest('to-do-date', editedField);\n\t\t}\n\t}", "function editItem() {\n todoItem = _.first(todo.where({ todo_id: todo_id }));\n log.debug('[TodoListNewEdit] : Editing todo Item', todoItem);\n\n // Set the title to Edit\n Alloy.Globals.Menu.setTitle(\"Edit Task\");\n\n $.textFieldName.value = todoItem.get('name');\n $.textFieldContent.value = todoItem.get('content');\n\n}", "function editTask(event){\n const header = event.target.parentElement;\n const task = header.parentElement;\n const id = Number(task.getAttribute(\"data-id\"));\n const val = database.getField(id);\n val.onsuccess = () => {\n const {key, title, description} = val.result;\n var editTitle = document.getElementById(\"editTitle\");\n editTitle.setAttribute(\"value\",title);\n\n var editDescription = document.getElementById(\"editDescription\");\n editDescription.innerHTML = description;\n }\n modal.style.display = \"block\";\n var saveChange = document.querySelector(\"#btnsave\");\n saveChange.setAttribute(\"data-id\",id);\n saveChange.onclick = changeTask;\n }", "function editButtonPressed(todo) {\n $('#todo_input').val(todo.title);\n $('#text_input').val(todo.text);\n $('#enterdetails').html('Enter Details: (Edit: '+todo.title+')'); // Add a hint that we are now editing\n $('#sendtodo').val('edit'); // Change the Save button from save-mode to edit-mode\n $('#canceltodo').show(); // Show the cancel button\n currentTodo = todo;\n\n if(colorChecked !== '') {\n colorChecked.removeClass( 'circleclicked' );\n }\n colorChecked = $('.circle.'+todo.color);\n $('.circle.'+todo.color).addClass( 'circleclicked' );\n\n console.log(todo);\n }", "edit() {\n let selected = this.props.todo.selected;\n let input = document.getElementById('input-to-do');\n let val = input.value;\n\n if (this.props.todo.editing) {\n this.props.addEdits(selected, this.props.todo.todo, this.props.todo.totalToDos);\n this.props.turnEditingOn(false);\n input.value = '';\n } else if (selected) {\n let value = selected.value;\n input.value = value;\n this.props.turnEditingOn(true);\n } \n }", "function showEditTodoList() {\n hideTodosLayers();\n var listId = document.forms.todoForm.listId.value;\n if (listId != null && listId != \"null\" && listId != \"\") {\n $(\"editListDiv\").style.display=\"inline\";\n todo_lists.getTodoList(listId, replyEditTodoList);\n document.forms.editListForm.name.focus();\n tracker('/ajax/showEditTodoList');\n }\n}", "function editTodo(id){\n // localStorage.setItem(\"id\", id)\n const token = localStorage.getItem('token');\n // e.preventDefault()\n // bikin ajax getById\n $.ajax({\n method: \"GET\",\n headers: {\n acces_token: token\n },\n url: server + `/todos/${id}`\n }).done(todo => {\n console.log(todo)\n $(\"#home-page\").hide()\n $(\"#sign-in-page\").hide()\n $(\"#sign-up-page\").hide()\n $(\"#add-todo-form\").hide()\n $(\"#edit-todo-form\").show() // harusnya di render setelah GET by id\n $(\"#title-edit\").val(todo.title)\n $(\"#description-edit\").val(todo.description)\n $(\"#due-date-edit\").val(todo.due_date)\n $(\"#edit-id\").val(todo.id)\n }).fail(err => {\n console.log(err)\n })\n\n // $(\"#home-page\").hide()\n // $(\"#sign-in-page\").hide()\n // $(\"#sign-up-page\").hide()\n // $(\"#add-todo-form\").hide()\n // $(\"#edit-todo-form\").show() // harusnya di render setelah GET by id\n /* populate data contohnya \n $(\"#title-edit\").val(data.title)\n $(\"#description-edit\").val(data.description)\n $(\"#due-date-edit\").val(data.dueDate)\n */\n}", "function editTodo(e) {\n let todoItem = e.target.parentNode;\n let todotext = e.target.parentNode.firstChild.innerText\n //remove the content div and replace it with the edit input\n e.target.parentNode.firstChild.remove();\n let editInput = document.createElement('input');\n editInput.className = 'editing'\n editInput.value = todotext;\n todoItem.insertBefore(editInput, e.target.parentNode.firstChild)\n}", "function edit(todoId, options) {\n let state = dataHub.getState();\n let todo = state.todos.find((todo) => {\n return todo.id === todoId;\n });\n if (options.status) {\n todo.status = options.status;\n }\n dataHub.setTodos(state.todos);\n todosResource.saveTodos(state.todos);\n }", "function editar_todo(indice,todos){\n const mod_titulo = document.getElementById('mod-titulo')\n mod_titulo.value = todos[indice].titulo\n const mod_descripcion = document.getElementById('mod-descripcion')\n mod_descripcion.value = todos[indice].descripcion\n const btn_modificar = document.getElementById('modificar')\n btn_modificar.addEventListener('click',async ()=>{\n const model = document.getElementById('model')\n model.style.display = 'none'\n let url = window.origin+'/modificar_todo'\n let todo = todos[indice]\n todo.titulo = mod_titulo.value\n todo.descripcion = mod_descripcion.value\n let data = await fetch(url,{\n method: 'PUT',\n credentials: 'include',\n cache: 'no-cache',\n body: JSON.stringify(todo),\n headers: new Headers({\n 'content-type':'application/json'\n })\n })\n render()\n })\n}", "function EditableTodoList({todos, update, remove}) {\n\n const eTodoList = todos.map(t => <EditableTodo key={t.id} todo={t} update={update} remove={remove}/>);\n return (\n <div>\n {eTodoList}\n </div>\n );\n}", "function Todo({todos, completeTodo, removeTodo, updateTodo}) {\n const [edit, setEdit] = useState({\n id: null,\n value: ''\n })\n const submitUpdate = value => {\n updateTodo(edit.id, value)\n setEdit ({\n id: null,\n value: ''\n })\n }\n\n if (edit.id) {\n return <TodoForm edit={edit} onSubmit={submitUpdate}/>\n }\n\n\n\n return todos.map((todo, index) => (\n <div className={todo.isComplete ? 'todo-complete' : 'not-complete'} key = {index} style={{\n display: \"flex\",\n alignItems: \"center\",\n cursor:\"pointer\"\n\n }}> \n \n <div key ={todo.id} onClick = {() => completeTodo(todo.id)}\n style = {{padding: \"1rem\"}}\n >\n {todo.text}\n \n </div>\n <button className=\"editButton\" style={{margin: \"0 1rem\"}} onClick={() => setEdit({id: todo.id, value: todo.text})}><FaPen style={{ fontSize: \"1.4rem\", color: \"grey\"}}/></button>\n\n <button className=\"removeButton\" style={{margin: \"0 1rem\"}} onClick={() => removeTodo(todo.id)}><FiTrash2 style ={{fontSize: \"1.4rem\",color: \"grey\"}}/></button>\n \n </div>\n ))\n}", "function todoView(item) {\n var todoConfig = U({ editing: false });\n var toggleEditing = C(_ => todoConfig.editing = !Boolean(todoConfig.editing));\n var doneEditing = C(_ => todoConfig.editing = false);\n var edit = C(_ => todoConfig.editing = true );\n \n return E('li') .\n is({ class: { completed: item.completed, editing: config.editing} }) .\n has([\n \n E('div#view') . has ([\n E('input') . is({type: 'checkbox'}) . does({click: 0}) . sets(item.completed),\n LABEL(item.title) . does({ doubleclick: edit })\n ]),\n \n E('input.edit') . sets(item.title) . does({ blur: doneEditing })\n ])\n ;\n }", "update(todo) {\n if (!this.editTodoIsValid) {\n return;\n }\n\n todo.content = this.editTodo;\n todo.isEdited = false;\n\n // Reset the edit todo.\n this.editTodo = null;\n }", "function editTask(req, res){\n\n\tlet id=req.query.id\n\tTodoList.find({}, function(err,toDoList){\n\t\tif(err){\n\t\t\tconsole.log('Error in editing task');\n\t\t\treturn\n\t\t}\n\t\treturn res.render('home', {\n\t\t\ttitle: \"Home\",\n\t\t\tTask_List: toDoList,\n\t\t\ttaskId: id\n\t\t});\n\t})\n\n}", "function handleTaskModal() {\n props.openModal('edit task', props.task);\n }", "function editTodo(i){\n let toDoTask = localStorage.getItem(\"localtodo\");\n saveIndex.value = i;\n let todoObj = JSON.parse(toDoTask);\n todoInp.value = todoObj[i];\n saveBtn.style.display = \"block\";\n addTodo.style.display=\"none\";\n addTodo.setAttribute(\"disabled\", true)\n }", "function editItem(id) {\n\t\t[...todo].map((item) => {\n\t\t\tif (item.id === id) {\n\t\t\t\tfetch(`http://127.0.0.1:3010/tasks/${id}`, {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\t\tbody: JSON.stringify({ id: item.id, text: editText, completed: item.completed, tag: item.tag, lastMod: new Date().getTime(), displayDate: new Date().toLocaleString(), outOfTime: item.outOfTime, alarm: item.alarm })\n\t\t\t\t}).then((resp) => resp.json())\n\t\t\t\t\t.then((data) => { console.log(data) });\n\t\t\t\twindow.location.reload()\n\n\t\t\t}\n\t\t\treturn item\n\t\t})\n\t\tsetEdit(null)\n\t\tsetEditText('')\n\t}", "function showTodo(id){\n\tconsole.log(\"edit todo : \" + id);\n\tvar todoArr = readTodosArray();\n\tconsole.log(todoArr);\n\tvar content_input = document.getElementById(\"content-input\");\n\tcontent_input.value = todoArr[id-1][CONTENT];\n\tvar due_input = document.getElementById(\"due-input\");\n\tdue_input.value = todoArr[id-1][DUE];\n\tvar due_input = document.getElementById(\"id-input\");\n\tdue_input.value = todoArr[id-1][ID];\n}", "function renderTodo(todo) {\n //store todo items into browser storage.\n localStorage.setItem(\"todoItem\", JSON.stringify(todoItems));\n //get reference of required elements.\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n //Runs a check for deleted items and update the DOM.\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const isChecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry.\n const listItemElement = document.createElement(\"li\");\n\n // set class and data-key attributes to the todo entry.\n listItemElement.setAttribute(\"class\", `todo-item ${isChecked}`);\n listItemElement.setAttribute(\"data-key\", todo.id);\n //populate the todo entry with required values.\n listItemElement.innerHTML = `\n <input id =\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run condition to append the created item to the page.\n if (item) {\n list.replaceChild(listItemElement, item);\n }\n else {\n list.append(listItemElement);\n }\n}", "function TodoItem({ id, todo, status, updateTodo, removeTodo }) {\n const [editMode, setEditMode] = useState(false);\n\n const handleDelete = removeTodo.bind(null, id);\n\n function handleEdit() {\n setEditMode(true);\n }\n\n function handleToggleStatus() {\n let newStatus = status === \"pending\"\n ? \"complete\"\n : \"pending\";\n\n updateTodo({ id, todo, status: newStatus });\n }\n\n return (\n <li id={id} className=\"TodoItem\">\n <svg className=\"vertical-lines\" width=\"100\" height=\"100\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"82\" y1=\"0\" x2=\"82\" y2=\"100\" stroke=\"#ff9999\" strokeWidth=\"2\" />\n <line x1=\"89\" y1=\"0\" x2=\"89\" y2=\"100\" stroke=\"#ff9999\" strokeWidth=\"2\" />\n </svg>\n {editMode\n ? <EditTodoForm id={id} currentTodo={todo} updateTodo={updateTodo} />\n : <>\n <span className=\"icon-collection\">\n <svg className=\"icon-delete\" onClick={handleDelete} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M12 0a12 12 0 100 24 12 12 0 000-24zm4.2 18L12 13.7 8 18 6 16.2l4-4.2L6 8 7.8 6l4.2 4L16 6l2 1.8-4.2 4.2 4.2 4-1.8 2z\" />\n </svg>\n\n <svg className=\"icon-edit\" onClick={handleEdit} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M12 0a12 12 0 100 24 12 12 0 000-24zM7 17l1-4 3.1 3L7 17zm5.2-1.9L9 12 14.8 6 18 9.2l-5.8 6z\" />\n </svg>\n\n <svg className=\"icon-complete-status\" onClick={handleToggleStatus} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"M12 0a12 12 0 100 24 12 12 0 000-24zm-1.3 17.3l-4.4-4.4L8 11.1l2.6 2.5 5.7-5.8 1.9 1.8-7.6 7.7z\" />\n </svg>\n </span>\n <Todo todo={todo} status={status} /></>}\n </li>\n );\n}", "function renderTodo(todo) {\n //Store todo items into broser storage\n localStorage.setItem(\"todoItems\", JSON.stringify(todoItems));\n //Get reference of required elements\n const list = document.querySelector(\".js-todo-list\");\n const item = document.querySelector(`[data-key='${todo.id}']`);\n //Runs a check for deleted items and update the DOM\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = \"\";\n return;\n }\n //Evaluate the done state of a todo entry\n const ischecked = todo.checked ? \"done\" : \"\";\n //create a list item that holds todo entry\n //set clss and data-key attribute to the todo entry\n const listItemElement = document.createElement(\"li\");\n listItemElement.setAttribute(\"class\", `todo-item ${ischecked}`);\n //populate the required the values\n listItemElement.setAttribute(\"data-key\", todo.id);\n listItemElement.innerHTML = `<input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for =\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n &times;\n </button>\n `;\n //Run the condition to append the created item to the page\n if (item) {\n list.replaceChild(listItemElement, item);\n } else {\n list.append(listItemElement);\n }\n\n}", "function renderTodo(todo) {\n localStorage.setItem('todoItemsRef', JSON.stringify(todoItems));\n const list = document.querySelector('.js-todo-list');\n const item = document.querySelector(`[data-key='${todo.id}']`);\n\n if (todo.deleted) {\n item.remove();\n if (todoItems.length === 0) list.innerHTML = '';\n return\n }\n\n const isChecked = todo.checked ? 'done': '';\n \n const node = document.createElement(\"li\");\n node.setAttribute('class', `todo-item ${isChecked}`);\n node.setAttribute('data-key', todo.id);\n node.innerHTML = `\n <input id=\"${todo.id}\" type=\"checkbox\"/>\n <label for=\"${todo.id}\" class=\"tick js-tick\"></label>\n <span>${todo.text}</span>\n <button class=\"delete-todo js-delete-todo\">\n <svg><use href=\"#delete-icon\"></use></svg>\n </button>\n `;\n\n if (item) {\n list.replaceChild(node, item);\n } else {\n list.append(node);\n }\n}", "function edit_note(note_id, note_name) {\n fetch(`${note_name}/edit/${note_id}`)\n .then(response => response.json())\n .then(notes => {\n Array.prototype.forEach.call(notes.task, note => {\n document.querySelector(`#edit-note-${note.id}`).style.display == 'block'\n document.getElementById(`edit-note-${note.id}`).innerHTML = `<form id=\"edit_note\"> <textarea rows=\"5\" cols=\"45\" id=\"newnote\">${note.note}</textarea> <br> <button class=\"save_edit btn btn-dark\" type=\"submit\"> Save </button></form>`;\n\n document.querySelector('#edit_note').onsubmit = function() {\n fetch(`${note_name}/edit/${note_id}`, {\n method: 'PUT',\n body: JSON.stringify({\n note: document.querySelector('#newnote').value\n })\n })\n }\n })\n })\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "function edit_task(_task_id) {\n if(typeof(_task_id) != 'undefined'){\n taskid = _task_id;\n }\n\n $.get(admin_url + 'tasks/task/'+taskid,function(response){\n $('#_task').html(response)\n $('body').find('#_task_modal').modal('show');\n });\n}", "editingModal(){\n return(\n <div className=\"modal-background\">\n <div className=\"modal-window\">\n <button onClick={()=>this.hideMenu()}>Close</button>\n <p>Edit Note</p>\n <form onSubmit={this.handleUpdate}><table><tbody>\n <tr>\n <td><label htmlFor='editedTitle'>Title</label></td>\n <td><input type='text' value={this.state.editedTitle} onChange={this.handleChange} id='editedTitle'/></td>\n </tr>\n <tr>\n <td><label htmlFor='editedUrl'>Image URL</label></td>\n <td><input type='text' value={this.state.editedUrl} onChange={this.handleChange} id='editedUrl'/></td>\n </tr>\n <tr>\n <td><label htmlFor='editedCaption'>Caption</label></td>\n <td><input type='text' value={this.state.editedCaption} onChange={this.handleChange} id='editedCaption'/></td>\n </tr>\n </tbody></table>\n <input type=\"submit\" value={\"Save Changes\"}/></form>\n </div>\n </div>\n )\n }", "editButton(e, i) {\n this.prevent(e);\n this.setState({\n signal: i,\n show: true,\n description: this.props.reducerApp.todos[i].description,\n }, () => {\n this.showModal()\n })\n }", "function renderTodo(idx, todo) {\n return div([\n span(todo.get('text')),\n input(\".todo-completed\",\n { type: 'checkbox', checked : todo.get('completed'), 'data-todo-id' : idx }),\n span(\".remove-todo\", {'data-todo-id' : idx}, \" x\")\n ])\n}", "function editTask(e){\n ui.showEidtState();\n const id = e.target.parentElement.id.split('-')[1];\n http\n .get(`http://localhost:3000/Tasks/${id}`)\n .then(data => {\n ui.fillForm(data);\n });\n}", "function editTask() {\n vm.task = {};\n jQuery('#editTaskModal').modal('hide');\n }", "function renderTask() {\n // e.preventDefault();\n //creates task item\n const todos = document.createElement(\"li\");\n todos.classList.add(\"todos\");\n //creates checkbox\n const checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkbox-list\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n //creates list item\n const listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n listItem.innerHTML = inputValue.value;\n //creates X icon to delete item\n const xIcon = document.createElement(\"img\");\n xIcon.classList.add(\"xClose\");\n // xIcon.setAttribute(\"src\", \"../images/icon-cross.svg\");\n //EDIT BUTTON\n const EditBtnsWrapper = document.createElement(\"span\");\n EditBtnsWrapper.classList.add(\"EditBtnsWrapper\");\n //EDIT BUTTON\n const editButton = document.createElement(\"button\");\n editButton.innerHTML = '<i class=\"fas fa-paperclip\"></i> ';\n editButton.classList.add(\"edit-btn\");\n editButton.addEventListener(\"click\", () => {\n listItem.setAttribute(\"contentEditable\", true);\n listItem.focus();\n });\n //appends items to list\n EditBtnsWrapper.append(editButton, xIcon);\n todos.append(checkBox, listItem, EditBtnsWrapper);\n // todoList.appendChild(todos);\n todoList.insertBefore(todos, todoList.firstChild);\n\n inputValue.value = null;\n inputValue.focus();\n listItems++;\n itemsValue();\n}", "changeModalHeaderText(editable) {\n this._modalTaskTitle.innerText = editable ? 'Edit Task':'Add Task';\n }", "function editModal(id, category, date){\n modal.classList.add('modal_open-js');\n todoList.classList.add('task_close-js');\n editForm.setAttribute('data-id',`${id}`);\n editForm.setAttribute('data-category',`${category}`);\n editForm.setAttribute('data-date',`${date}`);\n}", "function changeTodo(event) {\n revisedTodo = prompt(\"Enter the updated Todo\");\n\n if (revisedTodo != null && revisedTodo != \"\") {\n var position = event.currentTarget.id.split(\"-\")[1];\n todos[position].todoText = revisedTodo;\n }\n displayTodos();\n}", "function createEditInput (todo) {\r\n const content = todo.querySelector('.list-item-content').innerHTML\r\n const input = document.createElement('input')\r\n input.classList.add('edit-field')\r\n input.value = content\r\n return input\r\n}", "async function renderTodo(todo){\n\n const todoIsComplete = todo.complete\n const taskList = todoIsComplete ? completedTodoList : incompleteTodoList;\n const checked = todoIsComplete ? \"checked\" : \"\";\n\n let todoItemHTML = \n `<div class=\"form-check\">\n <label class=\"form-check-label\">\n <input id=\"${todo.id}\" class=\"js-tick\" type=\"checkbox\" ${checked}/>\n ${todo.name}\n </input>\n <p class=\"input-helper\" id=\"incomplete-list\"></p>\n </label>\n\n <div class=\"editicons\">\n <i class=\"remove mdi mdi-close-circle-outline fas fa-edit customeditbutton\"></i>\n <i class=\"remove mdi mdi-close-circle-outline customdeletebutton\"></i>\n </div>\n </div>\n `;\n \n //Add todo to DOM in either the complete or incomplete Task List Depending on variable value\n taskList.insertAdjacentHTML(\"afterbegin\", todoItemHTML)\n \n\n }", "function createEditPrompt(event) {\n const editButton = event.currentTarget;\n if ( !hasClass(editButton, \"todo-edit\") ) return;\n const todoText = editButton.parentNode.querySelector(\".todo-text\");\n //create prompt element:\n const editPromptContainer = document.createElement(\"div\");\n const editPrompt = document.createElement(\"div\");\n const editTextInput = document.createElement(\"input\");\n const confirmEditButton = document.createElement(\"button\");\n editPromptContainer.id = \"edit-prompt-container\"; \n editPrompt.id = \"edit-prompt\";\n editTextInput.classList.add(\"edit-input\");\n confirmEditButton.classList.add(\"edit-confirm\");\n editTextInput.value = todoText.innerText;\n confirmEditButton.innerText = \"Edit\";\n editPrompt.append(editTextInput, confirmEditButton);\n editPromptContainer.appendChild(editPrompt);\n document.body.appendChild(editPromptContainer);\n \n confirmEditButton.onclick = () => {\n todoText.innerText = editTextInput.value;\n const index = todoElementIndex(todoText.parentNode);\n todoList[index].text = todoText.innerText;\n setPersistent(DB_NAME, todoList);\n editPromptContainer.remove();\n };\n}", "function updateTodo(){\n\tconsole.log(\"update todo\");\n\n\tvar todo_table = document.getElementById(\"todo-list-table\");\t\n\t\n\t// if todo list is empty\n\tvar empty_message = document.getElementById(\"empty-message\");\n\tif(readCount() == 0){\n\t\tif(todo_table.rows.length==3){\n\t\t\ttodo_table.deleteRow(1);\n\t\t}\n\t\tempty_message.removeAttribute(\"style\");\n\t\treturn;\n\t}\n\t// if todo list is not empty\n\tempty_message.style.display = \"none\";\n\tvar todoArr = readTodosArray();\n\t\n\t// clean all list\n\tvar table_length = todo_table.rows.length;\n\tfor(var i=1; i<table_length-1; i++){\n\t\ttodo_table.deleteRow(1);\n\t}\n\t\n\t// put new list\n\tfor(var i=0; i<readCount(); i++){\n\t\tvar row = todo_table.insertRow(i+1);\n\t\tvar cell_id = row.insertCell(0);\n\t\tvar cell_content = row.insertCell(1);\n\t\tvar cell_due = row.insertCell(2);\n\t\tvar cell_btn = row.insertCell(3);\n\t\t\n\t\tcell_id.innerHTML = todoArr[i][ID];\n\t\tcell_content.innerHTML = todoArr[i][CONTENT];\n\t\tcell_due.innerHTML = todoArr[i][DUE];\n\t\tcell_btn.innerHTML = '<a href=\"#\" class=\"btn btn-sm btn-outline-primary\" data-toggle=\"modal\" data-target=\"#editModal\" onclick=\"showTodo('+todoArr[i][ID]+')\">Edit</a>';\n\t\tcell_btn.innerHTML += '<a href=\"#\" class=\"btn btn-sm btn-outline-success\" onclick=\"finishTodo('+todoArr[i][ID]+')\">Finish</a>';\n\t}\n\n}", "function editTask() {\n const buttonEdit = document.querySelectorAll('.button-edit')\n buttonEdit.forEach(button => {\n button.onclick = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n const input = el.querySelector('.list-block__input')\n const p = el.querySelector('.list-block__p-text')\n const imgEdit = el.querySelector('.button-edit')\n const imgSave = el.querySelector('.button-save')\n imgSave.classList.remove('button--hidden')\n imgEdit.classList.add('button--hidden')\n input.value = p.textContent\n p.classList.add('list-block__text--hidden')\n input.classList.remove('list-block__text--hidden')\n input.focus()\n }\n })\n }\n })\n }", "function showTodo(todo) {\n console.log(todo.title + ': ' + todo.text);\n}", "async function editTodo(req, res) {\n await Todo.findByIdAndUpdate(req.params.id, req.body);\n show(req, res);\n}", "function edit(idx) {\n let fl = fullList[idx];\n document.querySelector(\".item2\").value = fl.item;\n document.querySelector(\".textarea2\").value = fl.info;\n document.querySelector(\".form2\").style.display = \"flex\";\n modal.classList.add(\"open\");\n position = idx;\n}", "showEditModal(postToEdit) {\n this.props.mappedshowEditModal(postToEdit);\n }", "function renderTodo(todo) {\n //This function renders a todo to the page.\n //If the todo already exists then this function will update it\n\n //Check if todo already exists in dom\n var $existingElem = $('#'+ todo.id);\n if ($existingElem.length) {\n //Update text (possible it's not changed)\n $existingElem.find('.task').text(todo.item);\n\n //Check if element is in correct list and check if \n if (($existingElem.parent('ul').attr('id') === 'todo-list') && (todo.completed === true)) {\n //Move from todo to completed\n $existingElem.detach();\n $('#completed-list').prepend($existingElem); \n $existingElem.slideDown();\n\n } else if (($existingElem.parent('ul').attr('id') === 'completed-list') && (todo.completed === false)) {\n //Move from complted to todo\n $existingElem.detach();\n $('#todo-list').prepend($existingElem); \n $existingElem.slideDown();\n }\n } else {\n // Todo is new to client.. add\n var taskHTML = '<li><span class=\"done\">%</span>'; \n taskHTML += '<span class=\"edit\">+</span>'; \n taskHTML += '<span class=\"delete\">x</span>'; \n taskHTML += '<span class=\"task\"></span></li>';\n\n var $newTask = $(taskHTML); \n $newTask.find('.task').text(todo.item);\n $newTask.attr('id',todo.id);\n $newTask.hide(); \n if (todo.completed === true) {\n $('#completed-list').prepend($newTask); \n } else {\n $('#todo-list').prepend($newTask); \n }\n $newTask.show('clip',250).effect('highlight',1000);\n }\n}", "render() {\n if (this.props.item !== null) {\n return (\n <Modal\n isOpen={this.props.showEditModal}\n toggle={this.props.toggleShowEditModal}\n >\n <Form>\n <ModalHeader toggle={this.props.toggleShowEditModal}>\n <h2>Edit Item</h2>\n <Button onClick={this.toggleEditMode}>Edit</Button>\n </ModalHeader>\n <ModalBody>\n {this.renderEditComponent()}\n </ModalBody>\n <ModalFooter>\n {this.state.editActive ? (\n <Button className={\"btn btn-primary\"} onClick={this.sumbitEdit}>\n Save\n </Button>\n ) : (\n <p />\n )}\n <p>\n {this.state.previouslyEdited && !this.state.editActive\n ? \"Click Close to see Changes\"\n : \"\"}\n </p>\n <Button\n className={\"btn btn-danger\"}\n onClick={this.props.toggleShowEditModal}\n >\n {this.state.editActive ? \"Cancel\" : \"Close\"}\n </Button>\n </ModalFooter>\n </Form>\n </Modal>\n );\n } else {\n return <div />;\n }\n }", "editExisting(inID) {\n\n // Get the task from local storage and set it on the form. If we can't\n // find it then that means the user clicked a category node. In that case,\n // we're just going to toggle it's open/close state.\n const tasks = JSON.parse(localStorage.getItem(\"TasksDB\"));\n const task = tasks[inID];\n if (!task) {\n if ($$(\"moduleTasks-items\").isBranchOpen(inID)) {\n $$(\"moduleTasks-items\").close(inID);\n } else {\n $$(\"moduleTasks-items\").open(inID);\n }\n return;\n }\n\n // Set flag to indicate editing an existing task and show the details.\n wxPIM.isEditingExisting = true;\n wxPIM.editingID = inID;\n\n // Clear the details form.\n $$(\"moduleTasks-detailsForm\").clear();\n\n // Show the form. Note that this has to be done before the call to\n // setValues() below otherwise we get an error due to setting the value of\n // the richtext (my guess is it lazy-builds the DOM and it's not actually\n // there until the show() executes.\n $$(\"moduleTasks-details\").show();\n\n // Special handling for dates.\n if (task.dueDate) {\n task.dueDate = new Date(task.dueDate);\n }\n\n // Populate the form.\n $$(\"moduleTasks-detailsForm\").setValues(task);\n\n // Finally, enable the delete button.\n $$(\"moduleTasks-deleteButton\").enable();\n\n }", "async edit({ params, request, response, view }) {}", "render() {\n return (\n <div className=\"App\">\n <ul>\n { this.state.todos.map( (todo, index) =>\n <ToDo key={ index } description={ todo.description } isCompleted={ todo.isCompleted } toggleComplete={ () => this.toggleComplete(index) } deleteTodo ={ () => this.deleteTodo(index) } />\n )}\n </ul>\n <form onSubmit={ (e) => this.handleSubmit(e) }>\n <input type=\"text\" value={ this.state.newTodoDescription } onChange={ (e) => this.handleChange(e) }/>\n <input type=\"submit\" />\n </form>\n </div>\n )\n }", "function editTodoList() {\n var listId = document.forms.todoForm.listId.value;\n var name = document.forms.editListForm.name.value;\n var rssAllowed = 0;\n if (document.forms.editListForm.rssAllowed.checked) {\n rssAllowed = 1;\n }\n $(\"editListDiv\").style.display='none';\n dwr.engine.beginBatch();\n todo_lists.editTodoList(listId, name, rssAllowed);\n todos.forceGetCurrentTodoLists(replyCurrentTodoLists);\n renderTable();\n dwr.engine.endBatch();\n tracker('/ajax/editTodoList');\n}", "function renderEdit(context) {\n context.loggedIn = sessionStorage.getItem('authtoken') !== null;\n context.username = sessionStorage.getItem('username');\n\n this.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n editForm: './templates/edit/editForm.hbs'\n }).then(function (res) {\n this.partial('./templates/edit/editPage.hbs');\n })\n }", "function showUpdateTaskModal() {\n let updateModal = document.getElementById('update-modal');\n let description = updateModal.querySelector('.modal-input[type=\"text\"]');\n let dueDate = updateModal.querySelector('.modal-input[type=\"date\"]');\n let isToday = updateModal.querySelector('.fa-sun');\n let isImportant = updateModal.querySelector('.fa-star');\n\n description.value = selectedTask.querySelector('.task-desc').innerHTML;\n dueDate.value = getDate(selectedTask.querySelector('.task-dueDate').innerHTML);\n selectedTask.dataset.isToday == 'true' ? isToday.classList.add('today') : isToday.classList.remove('today');\n selectedTask.querySelector('.important-star').classList.contains('important') == true ? isImportant.classList.add('important') : isImportant.classList.remove('important');\n\n updateModal.style.display = \"flex\";\n}", "function view()\n{\n\t// This function takes care of rendering the to do list\n\t// All UI elements should be added to the \"container\" \n\t// section of the HTML. \n\n\t// get container element by id\n\tvar container = document.getElementById(\"container\");\n\n\tcontainer.innerHTML = \"\";\n\n\t// go through todo list items and add them\n\tfor(var i = 0; i < todos.length; i ++) {\n\t\tvar div = document.createElement('div');\n\n\t\tdiv.className = 'row';\n\n\t\tvar status = '';\n\n\t\tif(todos[i].status == true) {\n\t\t\tstatus = 'checked';\n\t\t}\n\n\t\tdiv.innerHTML = '<input class=\"todoItem\" type=\"checkbox\" onclick=\"updateStatus('+i+')\" '+status+'>\\\n \t\t\t\t\t\t <label for=\"todoItem\">'+todos[i].name+'</label>'+todos[i].completeDate+' \\\n \t\t\t\t\t\t <br>';\n\n\t\tcontainer.appendChild(div);\n\t}\n\t\n\n // clear the text in the input field for todo item\n\tdocument.getElementsByName(\"task\")[0].value = \"\";\n\n}", "function handleEditToggle() {\n let $thisToilet = $(this).closest('.toilet');\n $thisToilet.find(\".before-edit\").toggle();\n $thisToilet.find(\".edit-form\").toggle();\n}", "function handleItem(event){\n setCurrent(event.target.innerHTML);\n \n for(let i=0;i<todoList.length;i++){ //Get details of clicked item\n if(todoList[i].name===event.target.innerHTML){\n setTitleEdit(todoList[i].name);\n setDescriptionEdit(todoList[i].description);\n setTeamEdit(todoList[i].team);\n break;\n }\n }\n setListOpen(true);\n }", "function showTodo(todo) {\n // Our single todo item template, each todo item is a single LI tag\n // Note that you can run functions and methods within the ${} template strings\n\n // console.log(todo)\n\n var todoTemplate = `<li class=\"list-group-item\">\n <div class=\"row\">\n <div class=\"col-xs-8\">\n <div class=\"checkbox\">\n <label>\n <input type=\"checkbox\" data-id=\"${todo.id}\" />\n ${todo.todo}\n </label>\n </div>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-danger\">${todo.category.toUpperCase()}</span>\n </div>\n <div class=\"col-sm-2 text-right\">\n <span class=\"label label-default\">${moment(todo.due_date).format('MM/DD/YYYY')}</span>\n </div>\n </div>\n </li>`\n\n // Concatenate our single todo item template onto the end of the existing todo items on the page\n todosContainer.innerHTML += todoTemplate\n}", "render() {\n return (\n <div>\n <h2>Welcome to your Todo App!</h2>\n <TodoList tasks={this.state.tasksOnState} markComplete={this.markComplete} id={Date.now()}/>\n <TodoForm tasks={this.state.tasksOnState} removeTask={this.removeTask} addTask={this.addTask} handleChange={this.handleChange}/>\n </div>\n );\n }", "render() {\n return (\n <div>\n <List todoData={this.state.todoList} toggleTodo={this.toggleTodo} />\n <Form\n addNewTodo={this.addNewTodo}\n changeHandler={this.changeHandler}\n newTodo={this.state.newTodo}\n toggleTodo={this.toggleTodo}\n clearCompleted={this.clearCompleted}\n />\n </div>\n );\n }", "function editTodo(e) {\n const todoItems = todoList.children;\n\n for ( let i = 0; i < todoItems.length; i++ ) {\n //left click: line through\n if ( e.target === todoItems[i] && e.which === 1 ) {\n todoItems[i].classList.toggle('completed');\n toggleTodo(todoItems[i].getAttribute('data-key'));\n }\n //right click: remove item\n if ( e. target === todoItems[i] && e.which === 3 ) {\n deleteTodo(todoItems[i].getAttribute('data-key'));\n todoItems[i].remove();\n }\n }\n}", "editTodo(id, updatedText) {\r\n this.todos = this.todos.map(todo =>\r\n todo.id === id ? { id: todo.id, text: updatedText, complete: todo.complete } : todo\r\n );\r\n\r\n this._changeList(this._currentTab);\r\n }", "function openNotesEditModal(e) {\r\n e.preventDefault();\r\n\r\n dmpNotesModal.style.display = \"block\";\r\n\r\n currentEditDay = e.target.dataset.jsEditNotes;\r\n currentEditDayNumber = parseInt(\r\n currentEditDay.charAt(currentEditDay.length - 1)\r\n );\r\n currentDayDisplay = days[currentEditDayNumber - 1];\r\n\r\n dmpNotesModalHeader.textContent = `${currentDayDisplay} Notes`;\r\n dmpNotesModalInput.value = dmpContent[currentEditDay][\"notes\"];\r\n}", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Modal>\n\t\t\t\t\t{this.state.modalChild}\n\t\t\t\t</Modal>\n\t\t\t\t<ul>\n\t\t\t\t\t {this.state.entries.map((entry) => (\n\t\t\t\t\t\t<li data-index={entry.sort}>\n\t\t\t\t\t\t\t{entry.text}\n\t\t\t\t\t\t\t<span style=\"color: red;\" class=\"delete-item\" onClick={memobind(this, 'removeItem', entry.id)}>x</span>\n\t\t\t\t\t\t\t<span style=\"color: green;\" class=\"edit-item\" onClick={memobind(this, 'editItem', entry)}>e</span>\n\t\t\t\t\t\t</li>))}\n\t\t\t\t</ul>\n\t\t\t\t<form autocomplete=\"off\" class={style['nb-form']} onSubmit={this.handleSubmit}>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={style['nb-form__input']}\n\t\t\t\t\t\tonKeyUp={this.handleTextChange}\n\t\t\t\t\t\tplaceholder=\"New note\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t/>\n\t\t\t\t\t<button type=\"submit\" class=\"hidden-submit\" disabled={'' === this.state.text}>Submit</button>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t);\n\t}", "function manipulateTodo(e) {\n if (e.target.tagName === 'I') {\n button = e.target;\n todo = button.parentNode.parentNode;\n\n if (button.classList.contains('fa-check')) {\n todo.firstChild.classList.toggle('completed')\n if (todo.firstChild.classList.contains('completed')) {\n button.style.color = 'green'\n } else { button.style.color = '' }\n\n } else if (button.classList.contains('fa-trash')) {\n todo.remove();\n\n } else if (button.classList.contains('fa-edit')) {\n\n p = todo.firstElementChild;\n text = p.textContent;\n\n input = document.createElement('input');\n input.type = \"text\";\n input.className = 'editInput';\n input.value = text;\n\n todo.insertBefore(input, p);\n todo.removeChild(p);\n\n todo.children[1].children[1].className = 'fas fa-save';\n\n\n } else if (button.classList.contains('fa-save')) {\n\n\n\n input = todo.firstElementChild;\n text = input.value;\n p = document.createElement('p');\n p.textContent = text;\n\n todo.insertBefore(p, input);\n todo.removeChild(input);\n todo.children[1].children[1].className = 'fas fa-edit';\n\n }\n }\n}", "render() {\n return (\n <div>\n <h2>To Do App: MVP</h2>\n <TodoList toggleCompleted={this.toggleCompleted} listTasks={this.state.tasks} />\n <TodoForm \n newValue={this.state.newTasks} \n addToNewTasks={this.addToNewTasks} \n addToList={this.addToList}\n clearButton={this.clearButton}\n />\n </div>\n );\n }", "function toggleTodoEdit(sender) {\n var todo = jQuery(sender).parents(\".todo\");\n var display = todo.find(\".display\");\n var edit = todo.find(\".edit\");\n\n display.toggle();\n edit.toggle();\n}", "function showTodo(id){\n $('#todoModal').modal('toggle');\n\n $(\"#btnAddTodo\").hide();\n $(\"#btnUpdateTodo\").show();\n $(\"#btnDeleteTodo\").show();\n\n var xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function(){\n if (xhr.readyState == 4 && xhr.status == 200){\n var response = xhr.responseText;\n var title = JSON.parse(response).title;\n var category = JSON.parse(response).category;\n var description = JSON.parse(response).description;\n\n var parent1 = document.getElementById(\"titleTodo\");\n var parent2 = document.getElementById(\"categoryTodo\");\n var parent3 = document.getElementById(\"descriptionTodo\");\n\n parent1.value = title;\n parent2.value = category;\n parent3.value = description;\n }else{\n }\n }\n xhr.open('POST','./ajax/todo.show.php');\n\txhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n var data = 'id=' +id;\n\txhr.send(data);\n}", "editTodo(todo) {\n this.editedTodo = todo;\n // Clone the original todo to restore it on demand.\n this.originalTodo = angular.extend({}, todo);\n }", "renderEditForm(event) {\n let id = event.target.getAttribute('data-id');\n\n document.querySelector('.edit-popup').classList.remove('hide');\n document.querySelector('.edit-popup').classList.add('show');\n document.querySelector('.btn-update').setAttribute('data-id', id);\n\n mockData.forEach(item => {\n if (item.id === id) {\n document.querySelector('.edit-item').value = item.title;\n }\n });\n}", "function edit(req, res) {\n Note.findById(req.params.id)\n .then(function (note) {\n res.render('notes/edit', {\n title: `Editing ${note.content}`,\n note,\n recipeId: req.params.recipeId\n })\n })\n .catch(function (err) {\n console.log(err)\n res.redirect('/')\n })\n}", "function renderAddEditEntry(entry = null) {\n return `\n\t\t<div class=\"nav-bar\">\n\t\t<div class=\"nav-1\">\n\t\t\t<div class=\"nav-link\"><a href=\"\" class=\"my-journal-button\">My Profile</a></div>\n\t\t\t<div class=\"nav-link\"><a href=\"\" class=\"js-logout-button\">Log out</a></div>\n\t\t</div>\n\t</div>\n\t\n\t<main role=\"main\" class=\"edit-journal-entry\">\n\t\t<div class=\"dashboard-header\">\n <h2>Edit My Place</h2>\n <hr class=\"style-two hr-2\">\n\t\t</div>\n\t\t<form id=\"js-edit-form\" ${entry ? `data-entryid=\"${entry.id}\"` : \"\"}>\n\t\t<div class=\"save-delete\">\n\t\t\t<button type = \"submit\" class=\"save\" id=\"js-save-button\">Save</button>\n\t\t\t<button class=\"cancel\" id=\"js-cancel-button\">Cancel</button>\n\t\t</div>\n\t\t<section class=\"edit-entry\">\n\t\t\t<div class=\"entry-title\">\n\t\t\t\t<input type=\"text\" name=\"journal-title\" id=\"journal-title\" placeholder=\"Name of place\" maxlength=\"70\" type=\"text\" \n\t\t\t\t${entry ? `value=\"${entry.title}\"` : \"\"} required>\n </div>\n\t\t\t<div class=\"entry-date\">\n\t\t\t\t<input type=\"date\" name=\"travel-date\" id=\"travel-date\" placeholder=\"Date of place\"\n\t\t\t\t${entry ? `value=\"${entry.travelDate}\"` : \"\"}>\n\t\t\t</div>\n <div class=\"entry-photo\" id = \"entry-photo\">\n\t\t\t\t<input type=\"text\" name=\"entry-photo\" id=\"main-image\" ${\n entry\n ? ` value=\"${entry.coverPhoto}\"`\n : `placeholder=\"Paste Image Link\"`\n }>\n\t\t\t</div>\n\t\t</section>\n\t\t</form>\t\n </main>\n <footer class=\"footer\">\n <p>\n Created by: Brian Thomas\n <a href=\"https://github.com/Bjthomas11\" target=\"_blank\"><i class=\"fab fa-github\"></i></a>\n </p>\n </footer>\n\t`;\n}", "function ToDo () {\n \n console.log('ToDo');\n\n const [todo, setTodo] = useState([\n {title: 'Task 1', completed: false},\n {title: 'Task 2', completed: false}, \n ]);\n\n const [inputValue, setInputValue] = useState('')\n\n function toggleTodo (index) {\n\n setTodo(todo.map((item, i) => {\n if (i === index) {\n item.completed = !item.completed;\n }\n return item;\n }));\n\n };\n\n function deleteTodo (index) {\n setTodo(todo.filter((item, i) => i !== index));\n } \n\n function handleTaskInputChange (value) {\n setInputValue(value);\n }\n\n function addTodo (value) {\n console.log('value', value);\n if(!value.trim()) {\n alert('Пустое поле');\n return;\n }\n \n setTodo(todo.concat([{title: value, completed: false}]));\n }\n\n\n let toDoList = useMemo(() => {\n console.log('useMemo', todo);\n return todo.map((element, index) => {\n return <ToDoItem \n title={element.title} \n completed={element.completed} \n onChange={toggleTodo}\n onDelete={deleteTodo}\n key={index} \n index={index}\n />\n })\n }, [todo]); \n\n return (\n <Block title=\"To do\" >\n <ToDoInput \n onTaskInputChange={handleTaskInputChange} \n inputValue={inputValue}\n onButtonClick={addTodo}\n />\n <List>\n {toDoList}\n </List>\n \n </Block>\n\n )\n}", "edit(id) {\n this.setState((state) => ({\n ...state,\n todos: state.todos.map(todo => ({ ...todo, editing: todo.editing || todo._id === id }))\n }));\n }", "render() {\n return (\n <div className='App'>\n <h1>Todo List</h1>\n <h2 className=\"todo-items\"><TodoList \n todos={this.state.todos}\n toggleItem={this.toggleItem} \n /></h2>\n \n <TodoForm\n addTodo={this.addTodo}\n clearTodos={this.handleTodoDoneClick}\n />\n <Footer/>\n </div>\n );\n }", "function addChangeTodoItemClickHandler(e) { \r\n var $el = $(this);\r\n var $input = $el.parent().find(\".work-todo-list-item-edit\");\r\n $el.hide();\r\n $input.show();\r\n $input.focus();\r\n}", "function toggleTodo(event) {\n // this funciton gets called when somebody clicks a todo\n // and the click event gets triggered.\n event.preventDefault();\n\n // if it's already marked as done let's unmark it (remove class done)\n // if it's pending let's mark it as done (add class done)\n event.target.classList.toggle(\"done\");\n\n // let's get the id of that todo from the element\n // that was clicked\n var todoId = event.target.getAttribute(\"id\");\n\n // the id has this form \"todo-1\", we only care about\n // the number, so let's extract it\n var id = todoId.split(\"-\")[1];\n\n // get the todo from the repository, the id is a tring and find\n // accepts a number, so let's convert it to a number.\n // Find returns a list, if find... well... finds the todo\n // it will return a list with only one todo.\n // So let's extract the todo from the list\n var todo = global.TodoRepository.find(Number(id))[0];\n\n // if it's already marked as done let's unmark it\n // if it's pending let's mark it as done\n todo.complete = !todo.complete;\n\n // don't create a new one, just update the existing one\n global.TodoRepository.save(todo, false);\n\n // print (update) the todo list on the screen!\n render();\n }", "formTodoList(){\n\t\tlet filteredTodo = this.getFilterTodo();\n\n\t\treturn filteredTodo.map(item => {\n\t\t\t\t\t\t\treturn <ListGroupItem \n\t\t\t\t\t\t\t\tclassName=\"listGrpItem\"\n\t\t\t\t\t\t\t\tkey={item.id}> \n\t\t\t\t\t\t\t\t<TodoItem toggleTodo={this.toggleTodo.bind(this)} \n\t\t\t\t\t\t\t\tremoveTodo={this.removeTodo.bind(this)} \n\t\t\t\t\t\t\t\teditTodo={this.editTodo.bind(this)}\n\t\t\t\t\t\t\t\ttodo={item}/>\n\t\t\t\t\t\t\t</ListGroupItem>\n\t\t\t\t\t\t\t});\n\t}", "handleEdit(evt) {\n evt.preventDefault();\n this.props.handleEdit(this.props.id, this.state.task);\n this.toggleForm();\n }", "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "editToDo(toDo){\n fetch(`http://localhost:8000/todos/${toDo._id}`,{\n method: 'PUT',\n body: JSON.stringify(toDo),\n headers: {\n 'Accept':'application/json',\n 'Content-Type':'application/json'\n }\n })\n .then(res=>res.json())\n .then(data=>{\n this.getToDos();\n notify.show(data.message,data.type);\n })\n .catch(err=>{\n console.log(err)\n })\n }", "editItem() {\n this.view.resetValidity();\n this.view.removeNewMark();\n this.view.setDescription(this.item.getDescription());\n this.view.setExpireDate(this.item.getExpireDate());\n this.view.setCurrentDate(this.item.getCreationDate());\n this.view.editMe();\n }", "getTitulo() {\n if ( this.state.isEditar ) {\n return <h2>Modificar</h2>\n } else {\n return <h2>Nuevo</h2>\n }\n }", "function editToDo(e) {\n let item = e.target\n if (item.classList[0] === \"todo-item\") {\n let texte = item.innerText\n let inputTexte = document.createElement(\"input\") \n inputTexte.type = \"text\"\n inputTexte.value = texte\n item.innerText = \"\"\n item.appendChild(inputTexte)\n item.addEventListener('keyup', (e) => {\n if (e.keyCode === 13) {\n let newTexte = inputTexte.value\n item.innerText = newTexte\n }\n })\n }\n}", "function editTask(e) {\n\n // const projectid = document.querySelector('.edit_task_wrapper').getAttribute('data-id');\n const projectid = e.target.closest('.parent_wrapper').getAttribute('data-id');\n const taskid = document.querySelector('.edit_task_wrapper').getAttribute('data-taskid');\n\n\n const task_name = document.querySelector('.edit_name').value;\n const task_description = document.querySelector('.edit_description').value;\n const task_date = document.querySelector('.edit_date').value;\n let edited_priority = '';\n\n if (document.querySelector('.edit_priority1').checked)\n edited_priority = '1';\n else if (document.querySelector('.edit_priority2').checked)\n edited_priority = '2';\n else if (document.querySelector('.edit_priority3').checked)\n edited_priority = '3';\n else if (document.querySelector('.edit_priority4').checked)\n edited_priority = '4';\n\n if (task_name == '' || task_description == '' || task_date == '' || edited_priority == '')\n return;\n\n data.projects[projectid].tasks[taskid]._priority = edited_priority;\n data.projects[projectid].tasks[taskid]._title = task_name\n data.projects[projectid].tasks[taskid]._description = task_description\n data.projects[projectid].tasks[taskid]._date = task_date\n\n\n }", "function changeTask(event) {\n event.preventDefault();\n const key = Number(event.target.getAttribute(\"data-id\"));\n const title = document.querySelector(\"#editTitle\").value;\n const description = document.querySelector(\"#editDescription\").value;\n const task = {title, description, key};\n const form = document.querySelector(\"#task-edit\")\n const transaction = database.saveChanges(task, () => form.reset());\n transaction.oncomplete = () => {\n closeModal();\n console.log(\"Task edited successfully!\");\n showTasks();\n }\n }", "renderEditModal(id) {\n this.setState({\n editModal: true,\n editId: id\n })\n }", "render() {\n return (\n <div>\n <h2>Welcome to your Todo App!</h2>\n <TodoList todos={this.state.todos} toggleTodo={this.toggleTodo}/>\n <TodoForm addTodo={this.addTodo} clearTodos={this.clearTodos} />\n </div>\n );\n }", "function renderTodo(items=[]) {\n\t\t\t\tvar item = ``;\n\t\t\t\tfor(var i=0;i<items.length;i++) {\n\t\t\t\t\t\t\t\titem += `\n\t\t\t\t\t\t\t\t\t\t\t\t<li class=\"collection-item\">\n \t\t\t\t\t\t\t\t\t\t\t${items[i]}\n \t\t\t\t\t\t\t\t\t\t\t<a data-id=\"${i}\" href=\"#!\" class=\"secondary-content delete-todo\">\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t <i class=\"material-icons small red-text\">delete</i>\n \t\t\t\t\t\t\t\t\t\t\t</a>\n \t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdocument.querySelector(\".list-todoo\").innerHTML = item;\n\t\t\t\t\n\t\t\t\t// Delete todoo\n \t\tconst btnDeleteTodos = Array.from(document.querySelectorAll(\".delete-todo\"));\n \t\tif (btnDeleteTodos != null ) {\t\t\t\n \t\tbtnDeleteTodos.forEach((btn) => {\n \t\t\t\tbtn.addEventListener(\"click\", function() {\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tconst id = parseInt(this.dataset.id);\n \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\tSwal.fire({\n \t\t\t\t\t\t\t\t\t\t\t\ttitle: 'Are you sure?',\n \t\t\t\t\t\t\t\t\t\t\t\ttext: \"You won't be able to revert this!\",\n \t\t\t\t\t\t\t\t\t\t\t\ticon: 'warning',\n \t\t\t\t\t\t\t\t\t\t\t\tshowCancelButton: true,\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonColor: '#3085d6',\n \t\t\t\t\t\t\t\t\t\t\t\tcancelButtonColor: '#d33',\n \t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonText: 'Yes, delete it!'\n\t\t\t\t\t\t\t\t\t\t}).then((result) => {\n \t\t\t\t\t\t\t\t\t\t\t\tif (result.isConfirmed) {\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titems.splice(id, 1);\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tToast.fire({\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon: 'success',\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle: \"Your todo has been deleted\"\n \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\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trenderTodo(items);\n \t\t\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});\n \t\t});\n \t\t\t\n \t\t} \n\t\t\t\n}", "function doEditInShowList(li){\n\n li.children[1].innerText = document.getElementById(\"task\").value ;\n li.id = document.getElementById(\"task\").value ;\n\n }", "function handleEditTodo(index,item){\n dispatch(editTodo(index,item))\n }", "function todoEdit(id, todo) {\n \t// Inititate the promise to be returned.\n \tvar defer = $q.defer();\n \t// Use $http.put to put the generated API key to use, for the edit function.\n \t$http.put('http://localhost:60401/api/VSTDAs' + '/' + id, todo).then(\n \t\t// If the promise succeeds, return the data using the following code.\n \t\tfunction(response) {\n \t\t\tdefer.resolve(response.data);\n \t\t},\n \t\t// If the promise fails, reject the data using the following.\n \t\tfunction(error) {\n \t\t\tdefer.reject(error);\n \t\t}\n \t);\n \treturn defer.promise;\n }", "cancelEdit(todo) {\n this.editTodo = null;\n todo.isEdited = false;\n }" ]
[ "0.7879672", "0.72978574", "0.71237314", "0.679732", "0.6789736", "0.6735313", "0.67139035", "0.6689956", "0.6672412", "0.66141886", "0.66096693", "0.6608107", "0.65953094", "0.6585301", "0.656784", "0.65665364", "0.6566337", "0.65657467", "0.6564237", "0.65475243", "0.6471488", "0.6469861", "0.6444875", "0.6404861", "0.63855267", "0.6382647", "0.6348692", "0.631262", "0.631262", "0.631262", "0.631262", "0.631262", "0.631262", "0.631262", "0.62846947", "0.6269013", "0.6256986", "0.625181", "0.6242912", "0.62246066", "0.62206215", "0.621805", "0.6201301", "0.61927277", "0.616773", "0.6165955", "0.6157185", "0.6156262", "0.613463", "0.6115033", "0.6114896", "0.6103664", "0.60992754", "0.6087225", "0.6082655", "0.60761935", "0.6074271", "0.60739094", "0.6072603", "0.60672665", "0.60552496", "0.6050663", "0.60433364", "0.6042145", "0.6025537", "0.6021067", "0.6017597", "0.6005398", "0.6003972", "0.5998493", "0.5997323", "0.59955674", "0.5986903", "0.59868306", "0.5983453", "0.5983434", "0.59829205", "0.59717077", "0.5959534", "0.5959488", "0.59568626", "0.5937032", "0.59362125", "0.59237045", "0.591571", "0.5906044", "0.59028065", "0.58971536", "0.5890046", "0.58827907", "0.58825076", "0.58754706", "0.58676434", "0.5863763", "0.5856145", "0.5854685", "0.585136", "0.58508617", "0.5840378", "0.5836853" ]
0.8279227
0
returns duration in string
function getDuration(createdAt, elapsed) { var elapsedTime = moment(createdAt).add(elapsed,'seconds').format('X'); var initTime = moment(createdAt).format('X'); var delta = elapsedTime - initTime; delta = moment.duration(delta, "s"); var duration = delta.hours() + 'h ' + delta.minutes() + 'm ' + delta.seconds() + 's'; return duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDurationStr(duration) {\n return utils.round(duration);\n}", "toString() {\n\t\tlet difference;\n\t\tif (this.options && this.options.ms) {\n\t\t\tdifference = this.toMs(this.difference);\n\t\t} else {\n\t\t\tdifference = `${this.difference} ms`;\n\t\t}\n\t\treturn `Timer took ${difference}`;\n\t}", "function makeDurationString(duration, shortInfo) {\r\n\t\tif (isDateObj(duration)) {\r\n\t\t\tduration = round(duration.getTime() / 1000 / 60, 0);\r\n\t\t}\r\n\t\tif (!isInteger(duration)) {\r\n\t\t\tduration = getInteger(duration);\r\n\t\t}\r\n\t\tif (duration != 0 && duration != Number.MAX_SAFE_INTEGER) {\r\n\t\t\tvar t = new Date(duration * 60 * 1000);\r\n\t\t\tvar d = Math.floor(duration / 60 / 24);\r\n\t\t\tvar h = t.getHours() - 1;\r\n\t\t\tvar m = t.getMinutes();\r\n\t\t\tif (shortInfo) {\r\n\t\t\t\th = d * 24 + h;\r\n\t\t\t\treturn (h + \":\" + pad(m) + \" h\");\r\n\t\t\t} else {\r\n\t\t\t\treturn ((d > 0 ? (d + \" Tage \") : \"\") + (h > 0 ? (h + \" Std. \") : \"\") + (m > 0 ? (m + \"Min.\") : \"\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (shortInfo ? \"N/A\" : \"nicht angegeben\");\r\n\t}", "get duration() {\n return this._duration + 's';\n }", "getDuration(diff) {\n const duration = dateProcessor(diff * 1000);\n const t = this.t;\n let duration_str = '';\n if (duration.days()) duration_str += t.translate('[n] day', '[n] days', {\n n: duration.days()\n });\n if (duration.hours())\n duration_str += duration_str ? ' ' + t.translate('[n] hour', '[n] hours', {\n n: duration.hours()\n }) : t.translate('[n] hour', '[n] hours', {\n n: duration.hours()\n });\n if (duration.minutes())\n duration_str += duration_str ? ' ' + t.translate('[n] minute', '[n] minutes', {\n n: duration.minutes()\n }) : t.translate('[n] minute', '[n] minutes', {\n n: duration.minutes()\n });\n if (duration.seconds())\n duration_str += duration_str ? ' ' + t.translate('[n] second', '[n] seconds', {\n n: duration.seconds()\n }) : t.translate('[n] second', '[n] seconds', {\n n: duration.seconds()\n });\n\n return duration_str;\n }", "function formatDuration(duration) {\n if (duration < 1000) {\n duration += 'ms';\n } else if (duration > 1000) {\n duration /= 1000;\n duration += 's';\n }\n return duration;\n}", "function getDurationStr(elem){\n var style = window.getComputedStyle(elem);\n var browserDurationName = xtag.prefix.js+\"TransitionDuration\";\n \n if(style.transitionDuration){\n return style.transitionDuration;\n }\n else{\n return style[browserDurationName];\n }\n }", "formatDuration(duration) {\n const hours = Math.floor(duration / 3600);\n const minutes = Math.floor(duration / 60) % 60;\n const seconds = duration % 60;\n\n return `${hours}:${('0' + minutes).substr(-2)}:${('0' + seconds).substr(-2)}`;\n }", "function toDurationString(iDuration) {\n if (iDuration <= 0) return '';\n var m = Math.floor((iDuration/60)%60);\n var h = Math.floor((iDuration/3600)%24);\n var d = Math.floor(iDuration/86400);\n result = ''\n if (d > 0) result = result + d + 'd ';\n if (h > 0) result = result + h + 'h ';\n if (m > 0) result = result + m + 'm ';\n return result.substring(0, result.length - 1);\n}", "function formatDuration(duration) {\n if (duration > 3600) {\n var hours = Math.floor(duration / 3600);\n var remainingSeconds = duration % 3600;\n var minutes = Math.floor(remainingSeconds / 60);\n return hours + ' h ' + minutes + ' minutes';\n } else if (duration > 60) {\n var minutes = Math.floor(duration / 60);\n var remainingSeconds = duration % 60;\n return minutes + ' min ' + remainingSeconds + ' sec';\n } else {\n return duration + ' sec';\n }\n}", "get duration() {\n if (!this.endedLocal) {\n return null;\n }\n const ns = this.diff[0] * 1e9 + this.diff[1];\n return ns / 1e6;\n }", "toDurationString(val, options = {}) {\n\t\t// TODO: replace by Intl.DurationFormat or equivalent when it becomes available (ECMA-402)\n\t\t// https://github.com/tc39/ecma402/issues/47\n\t\tconst date = new Date(+val);\n\t\tconst parts = [\n\t\t\tdate.getUTCFullYear() - 1970, date.getUTCMonth(), date.getUTCDate() - 1,\n\t\t\tdate.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(),\n\t\t];\n\t\tconst roundingBoundaries = [6, 15, 12, 30, 30];\n\t\tconst unitNames = [\"second\", \"minute\", \"hour\", \"day\", \"month\", \"year\"];\n\t\tconst positiveIndex = parts.findIndex(elem => elem > 0);\n\t\tconst precision = (options && options.precision ? options.precision : parts.length);\n\t\tif (options && options.hhmmss) {\n\t\t\tconst str = parts.slice(positiveIndex).map(value => value < 10 ? \"0\" + value : \"\" + value).join(\":\");\n\t\t\treturn str.length === 2 ? \"00:\" + str : str;\n\t\t}\n\t\t// round least significant displayed unit\n\t\tif (positiveIndex + precision < parts.length && precision > 0 && positiveIndex >= 0) {\n\t\t\tif (parts[positiveIndex + precision] >= roundingBoundaries[positiveIndex + precision - 1]) {\n\t\t\t\tparts[positiveIndex + precision - 1]++;\n\t\t\t}\n\t\t}\n\t\treturn parts\n\t\t\t.slice(positiveIndex)\n\t\t\t.reverse()\n\t\t\t.map((value, index) => value ? value + \" \" + unitNames[index] + (value > 1 ? \"s\" : \"\") : \"\")\n\t\t\t.reverse()\n\t\t\t.slice(0, precision)\n\t\t\t.join(\" \")\n\t\t\t.trim();\n\t}", "function toDurationString(iDuration) {\n if (iDuration <= 0) return '';\n var m = Math.floor((iDuration/60)%60), // discard seconds.\n h = Math.floor((iDuration/3600)%24),\n d = Math.floor(iDuration/86400),\n result = '';\n\n if (d > 0) result = result + d + 'd ';\n if (h > 0) result = result + h + 'h ';\n if (m > 0) result = result + m + 'm ';\n return result.substring(0, result.length - 1);\n}", "function duration(ms) { \n const sec = Math.floor(ms / 1000 % 60).toString();\n const min = Math.floor(ms / (60*1000) % 60).toString();\n const hrs = Math.floor(ms / (60*60*1000) % 60).toString();\n const days = Math.floor(ms / (24*60*60*1000) % 60).toString();\n return `\\`${days} Gün\\`, \\`${hrs} Saat\\`, \\`${min} Dakika\\`, \\`${sec} Saniye\\``\n }", "function print_duration(timestamp) {\n var result = '',\n hours,\n minutes;\n\n // Change to minutes\n timestamp = Math.floor(timestamp / 60);\n hours = Math.floor(timestamp / 60);\n if (hours < 10) {\n result += '0';\n }\n result += hours + ':';\n\n minutes = timestamp - hours * 60;\n if (minutes < 10) {\n result += '0';\n }\n result += minutes;\n\n return result;\n}", "function getDuration() {\n\t\tvar displayLength = document.getElementById('vidLength');\n\t\t\n\t\t// Gets the duration of the video\n\t\tvar vidLength = video.duration;\n\t\t\n\t\t// Rounds down video length and displays it\n\t\tvidLength = Math.floor(vidLength);\n\t\tvidLength = '00:' + vidLength;\n\t\tdisplayLength.textContent = vidLength;\n\t}", "duration() {\n return this.d\n }", "function duration(ms) {\n const sec = Math.floor((ms / 1000) % 60).toString()\n const min = Math.floor((ms / (1000 * 60)) % 60).toString()\n const hrs = Math.floor((ms / (1000 * 60 * 60)) % 60).toString()\n const days = Math.floor((ms / (1000 * 60 * 60 * 24)) % 60).toString()\n return `${days.padStart(1, '0')} jour(s), ${hrs.padStart(2, '0')} heure(s), ${min.padStart(2, '0')} minutes, ${sec.padStart(2, '0')} secondes.`\n }", "function Duration(time) {\n var d = document.createElement('span');\n d.classList.add('duration');\n d.innerText = time;\n return d;\n}", "function duration(ms) {\n\t\t\tconst sec = Math.floor((ms / 1000) % 60).toString();\n\t\t\tconst min = Math.floor((ms / (1000 * 60)) % 60).toString();\n\t\t\tconst hrs = Math.floor((ms / (1000 * 60 * 60)) % 60).toString();\n\t\t\tconst day = Math.floor((ms / (1000 * 60 * 60 * 24)) % 60).toString();\n\t\t\treturn `${day.padStart(1, \"0\")} days, ${hrs.padStart(2, \"0\")} hours, ${min.padStart(\n\t\t\t\t2,\n\t\t\t\t\"0\"\n\t\t\t)} minutes, ${sec.padStart(2, \"0\")} seconds`;\n\t\t}", "convertDuration(note) {\n\t\tswitch (note.duration) {\n\t\t\tcase 'w':\n\t\t\t\treturn '1';\n\t\t\tcase 'h':\n\t\t\t\treturn note.isDotted() ? 'd2' : '2';\n\t\t\tcase 'q':\n\t\t\t\treturn note.isDotted() ? 'd4' : '4';\n\t\t\tcase '8':\n\t\t\t\treturn note.isDotted() ? 'd8' : '8';\n\t\t}\n\n\t\treturn note.duration;\n\t}", "function getReadableTime(duration) {\n duration = parseInt(duration);\n\n let horas = Math.floor(duration / 3600),\n minutos = Math.floor((duration - (horas * 3600)) / 60),\n segundos = duration - (horas * 3600) - (minutos * 60),\n tiempo = \"\";\n\n if (horas < 10) { horas = \"0\" + horas; }\n if (minutos < 10) { minutos = \"0\" + minutos; }\n if (segundos < 10) { segundos = \"0\" + segundos; }\n\n if (horas === \"00\") {\n tiempo = minutos + \"<span style='color: yellow'>:</span>\" + segundos;\n } else {\n tiempo = horas + \"<span style='color: yellow'>:</span>\" + minutos + \"<span style='color: yellow'>:</span>\" + segundos;\n }\n return tiempo;\n}", "function format_time_duration(total_seconds) {\n\tvar seconds = total_seconds % 60;\n\tvar total_minutes = Math.floor(total_seconds / 60);\n\tvar minutes = total_minutes % 60;\n\tvar hours = Math.floor(total_minutes / 60);\n\t\n\treturn (\"00\" + hours).substr(-2,2) +\":\"+ (\"00\" + minutes).substr(-2,2) +\":\"+ \n\t\t(\"00\" + seconds).substr(-2,2);\n}", "function durationString(tSeconds) {\n\tvar hh = Math.floor(tSeconds / 3600);\n\tvar mm = Math.floor((tSeconds - (hh * 3600)) / 60);\n\tvar ss = Math.floor(tSeconds % 60);\n\n\tif(hh < 10) {hh = \"0\"+hh;}\n\tif(mm < 10) {mm = \"0\"+mm;}\n\tif(ss < 10) {ss = \"0\"+ss;}\n\n\tif(hh > 0) {\n\t\treturn hh+\":\"+mm+\":\"+ss;\n\t} else {\n\t\treturn mm+\":\"+ss;\n\t}\n}", "getUnits() {\n const seconds = this.props.timeElapsed / 1000;\n var hr = Math.floor(seconds / 3600).toString();\n var min = Math.floor(seconds / 60).toString();\n var sec = Math.floor(seconds % 60).toString();\n var msec = (seconds % 1).toFixed(2).substring(2);\n \n return this.formatTime(hr) + \":\" + this.formatTime(min) + \":\" + this.formatTime(sec) + \".\" + msec;\n }", "function formatTime(duration) {\n\t\tlet hours = Math.floor(duration / 60 / 60);\n\t\tlet minutes = Math.floor(duration / 60 - hours * 60);\n\t\tlet seconds = Math.floor(duration - hours * 3600 - minutes * 60);\n\t\tif ( hours > 0 && minutes < 10 ) minutes = '0' + minutes;\n\t\tif ( seconds < 10 ) seconds = '0' + seconds;\n\t\tlet timeStack = hours > 0 ? [hours] : [];\n\t\ttimeStack.push(minutes, seconds);\n\t\treturn timeStack.join(':');\n\t}", "function getDuration() {\n var duration = editor.player.prop(\"duration\");\n duration = isNaN(duration) ? 0 : parseFloat(duration).toFixed(4);\n return duration;\n}", "function timeText() {\n let t = timeTaken();\n t = Math.floor(t / 1000);\n if (t == -1) {\n return \"did not complete\";\n } else {\n let tString = \"\";\n tString = (t % 60) + \" seconds\" + tString;\n t = Math.floor(t / 60);\n tString = (t % 60) + \" minutes \" + tString;\n return tString;\n }\n }", "get fullDuration() {\n // Used for formatting during export\n return new Duration({\n unit: this.durationUnit,\n magnitude: this.duration\n });\n }", "function duration(s) {\n if (typeof(s) == 'number') return s;\n var units = {\n days: { rx:/(\\d+)\\s*d/, mul:86400 },\n hours: { rx:/(\\d+)\\s*h/, mul:3600 },\n minutes: { rx:/(\\d+)\\s*m/, mul:60 },\n seconds: { rx:/(\\d+)\\s*s/, mul:1 }\n };\n var result = 0, unit, match;\n if (typeof(s) == 'string') for (var key in units) {\n unit = units[key];\n match = s.match(unit.rx);\n if (match) result += parseInt(match[1])*unit.mul;\n }\n return result*1000;\n}", "function ratioToString(duration) {\n\tconst durationLetters = ['s', 'e', 'q', 'h', 'w']\n\tlet string = ''\n\n\t// x is at the same time the index in the duration letters reference and\n\t// the 2 power to apply when substracting the duration.\n\tlet x = 4\n\n\t// While the duration is not entirely looked.\n\twhile (duration > 0 && x > -1) {\n\t\t// If the current 2th power is contained in the duration\n\t\tif (duration - (1 << x) >= 0) {\n\t\t\t// Substract it\n\t\t\tduration -= 1 << x\n\t\t\t// And add the corresponding letter\n\t\t\tstring += durationLetters[x]\n\t\t} else {\n\t\t\t// Otherwise, go to the next letter\n\t\t\tx--\n\t\t}\n\t}\n\treturn string\n}", "function durationToString (durationInMilliseconds) {\n if (!durationInMilliseconds || isNaN(durationInMilliseconds)) {\n return \"0s\";\n }\n let durationInSeconds = durationInMilliseconds * 1e-3;\n if (durationInSeconds < 60) {\n return \"\"+(durationInSeconds.toFixed(0))+\"s\";\n } else if (durationInSeconds < 3600) {\n return \"\"+((durationInSeconds / 60).toFixed(1))+\"m\";\n } else if (durationInSeconds < 86400) {\n return \"\"+((durationInSeconds / 3600).toFixed(1))+\"h\";\n } else {\n return \"\"+((durationInSeconds / 3600).toFixed(1))+\"d\";\n }\n}", "function humanizeDuration(duration) {\n const months = duration.months();\n const weeks = duration.weeks();\n let days = duration.days();\n const hours = duration.hours();\n const minutes = duration.minutes();\n const seconds = duration.seconds();\n\n // console.log(duration);\n\n const str = [];\n\n if (weeks > 0) {\n const weekTitle = pluralize('week', weeks);\n str.push(`${weeks} ${weekTitle}`);\n }\n\n if (days > 0) {\n if (weeks > 0) days -= 7 * weeks;\n\n const dayTitle = pluralize('day', days);\n str.push(`${days} ${dayTitle}`);\n }\n\n if (hours > 0 && (weeks < 1 && days < 2)) {\n const hourTitle = pluralize('hour', hours);\n str.push(`${hours} ${hourTitle}`);\n }\n\n if (minutes > 0 && (weeks < 1 && days < 1)) {\n const minuteTitle = pluralize('minute', minutes);\n str.push(`${minutes} ${minuteTitle}`);\n }\n\n if (seconds > 0 && (weeks < 1 && hours < 1)) {\n const secondTitle = pluralize('second', seconds);\n str.push(`${seconds} ${secondTitle}`);\n }\n\n return str.join(' ');\n}", "elapsed( seconds ) {\n seconds = parseInt( seconds ) || 0;\n if ( !seconds ) return '0s';\n\n let out = [], list = [];\n list.push( [ 'M', Math.floor( seconds / 2419200 ) ] );\n list.push( [ 'w', Math.floor( seconds / 604800 % 4 ) ] );\n list.push( [ 'd', Math.floor( seconds / 86400 % 7 ) ] );\n list.push( [ 'h', Math.floor( seconds / 3600 % 24 ) ] );\n list.push( [ 'm', Math.floor( seconds / 60 % 60 ) ] );;\n list.push( [ 's', Math.floor( seconds % 60 ) ] );\n list.forEach( arr => {\n let [ letter, time ] = arr;\n if ( time ) out.push( time + letter );\n });\n return out.join( ' ' );\n }", "duration() {\n return this.d || (this.context && this.context.song && this.context.song.duration())\n }", "function formatDuration(d) {\n const hours = Math.floor(d / 3600000);\n const minutes = Math.floor((d - hours * 3600000) / 60000);\n const seconds = Math.floor((d - hours * 3600000 - minutes * 60000) / 1000);\n const ms = d - hours * 3600000 - minutes * 60000 - seconds * 1000;\n let s = '.' + padZeros(ms, 3); // milliseconds are shown always;\n if (d >= 1000) {\n // seconds are to be shown;\n s = padZeros(seconds, 2) + s;\n if (d >= 60000) {\n // minutes are to be shown;\n s = padZeros(minutes, 2) + ':' + s;\n if (d >= 3600000) {\n // hours are to be shown;\n s = padZeros(hours, 2) + ':' + s;\n }\n }\n }\n return s;\n}", "get durationMS() {\n if (this.endDate && this.startDate) {\n return this.endDateMS - this.startDateMS;\n } else {\n return DateHelper.asMilliseconds(this.duration || 0, this.durationUnit);\n }\n }", "get durationMS() {\n if (this.endDate && this.startDate) {\n return this.endDateMS - this.startDateMS;\n } else {\n return DateHelper.asMilliseconds(this.duration || 0, this.durationUnit);\n }\n }", "get duration() {\n\t\treturn this.__duration;\n\t}", "function timeConversion(duration) {\n const portions = [];\n duration = parseFloat(duration);\n const msInHour = 1000 * 60 * 60;\n const hours = Math.trunc(duration / msInHour);\n if (hours > 0) {\n portions.push(hours + ' Hours');\n duration = duration - (hours * msInHour);\n }\n\n const msInMinute = 1000 * 60;\n const minutes = Math.trunc(duration / msInMinute);\n if (minutes > 0) {\n portions.push(minutes + ' Minutes');\n duration = duration - (minutes * msInMinute);\n }\n\n const seconds = Math.trunc(duration / 1000);\n if (seconds > 0) {\n portions.push(seconds + ' Seconds');\n }\n\n return portions.join(' ');\n}", "function toMMSS (duration) {\n const min = Math.floor(duration / 60)\n const sec = duration - (min * 60)\n return min + ':' + (sec < 10 ? '0' + sec : sec)\n}", "function formatDuration(timeInMinutes)\r\n{\r\n var minutesInHour = 60;\r\n var hours = Math.floor(timeInMinutes / minutesInHour);\r\n var minutes = timeInMinutes % minutesInHour;\r\n \r\n return hours + \"h \" + minutes + \"m\";\r\n}", "function timeElapsed(){\n\tvar h = Math.floor(sec_elapsed / 3600);\n\tvar m = Math.floor(sec_elapsed / 60);\n\tvar s = sec_elapsed - (m*60);\n\t\n\tif(h<10){\n\t\th = '0' + h;\n\t}\n\tif(m<10){\n\t\tm = '0' + m;\n\t}\n\tif(s<10){\n\t\ts = '0' + s;\n\t}\t\n\t\n\treturn h + ':' + m + ':' + s;\n}", "function fancyTimeFormat(duration)\n{ \n // Hours, minutes and seconds\n var hrs = ~~(duration / 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~duration % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function fancyTimeFormat(duration)\n{ \n // Hours, minutes and seconds\n var hrs = ~~(duration / 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~duration % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function msToTime(duration) {\n var milliseconds = parseInt((duration % 1000))\n var seconds = parseInt((duration / 1000) % 60)\n var minutes = parseInt((duration / (1000 * 60)) % 60)\n var hours = parseInt((duration / (1000 * 60 * 60)) % 24);\n\n hours = (hours < 10) ? \"0\" + hours : hours;\n\tseconds = (seconds < 10) ? \"0\" + seconds : seconds;\n\n\tif (duration < 1000)\n\t\treturn milliseconds;\n\telse if (duration < 6000)\n\t\treturn seconds + \".\" + milliseconds;\n\telse if (duration < 3600000)\n\t\treturn minutes + \":\" + seconds + \".\" + milliseconds;\n\treturn hours + \":\" + minutes + \":\" + seconds + \".\" + milliseconds;\n}", "convertDuration (seconds){\n let hours = Math.floor(seconds / 3600);\n seconds %= 3600;\n let minutes = Math.floor(seconds / 60);\n\n return hours+\"h \"+minutes+\"m\";\n }", "function totalTimeString() {\n\tlet timeStr = 'After ';\n\tif (Math.floor(totalSeconds / 60) === 1) {\n\t\ttimeStr += '1 minute and ';\n\t} else if (Math.floor(totalSeconds / 60) > 1) {\n\t\ttimeStr += Math.floor(totalSeconds / 60) + ' minutes and ';\n\t}\n\tif (totalSeconds % 60 === 1){\n\t\ttimeStr += (totalSeconds % 60) + ' second';\n\t} else {\n\t\ttimeStr += (totalSeconds % 60) + ' seconds';\n\t}\n\treturn timeStr;\n}", "function getDuration(input) {\n let runCommand = `\"${ffprobe}\" -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -sexagesimal \"${input}\"`;\n return runCommand;\n}", "function getStrTimer() {\n\tlet minutes = Math.floor(timerSeconds / 60);\n\tlet seconds = timerSeconds % 60;\n\tlet timerString = '';\n\tif(minutes < 10) {\n\t\ttimerString = timerString.concat('0');\n\t}\n\ttimerString = timerString.concat(minutes +':');\n\tif(seconds < 10) {\n\t\ttimerString = timerString.concat('0');\n\t}\n\ttimerString = timerString.concat(seconds);\n\treturn timerString;\n}", "function text(incomingData){\n return \"Duration:\"+incomingData.durationOfDesertion;\n}", "toString() {\n return constructs_1.Token.asString(() => {\n throw new Error('Duration.toString() was used, but .toSeconds, .toMinutes or .toDays should have been called instead');\n }, { displayHint: `${this.amount} ${this.unit.label}` });\n }", "function duration_ms(durations) {\n\n durations = durations.toString();\n durations = durations.replace(/ms/g, \"\");\n\n // result\n var duration = 0;\n var ms;\n\n // Is multi durations?\n if (durations.indexOf(\",\") != -1) {\n\n var durationsArray = durations.split(\",\");\n\n for (var i = 0; i < durationsArray.length; i++) {\n\n var val = durationsArray[i];\n\n // Has dot?\n if (val.indexOf(\".\") != -1) {\n\n ms = parseFloat(val).toString().split(\".\")[1].length;\n val = val.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n val = val.replace(/s/g, \"0\");\n } else if (ms == 1) {\n val = val.replace(/s/g, \"00\");\n }\n\n } else {\n val = val.replace(/s/g, \"000\");\n }\n\n duration = parseFloat(duration) + parseFloat(val);\n\n }\n\n return duration;\n\n } else {\n\n // Has dot?\n if (durations.indexOf(\".\") != -1) {\n\n ms = parseFloat(durations).toString().split(\".\")[1].length;\n durations = durations.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n durations = durations.replace(/s/g, \"0\");\n } else if (ms == 1) {\n durations = durations.replace(/s/g, \"00\");\n }\n\n } else {\n durations = durations.replace(/s/g, \"000\");\n }\n\n return durations;\n\n }\n\n }", "get remainingTime()\r\n { \r\n if (!this._endOfPath)\r\n {\r\n // Return remaining time in minutes.\r\n let minutesValue = (this._getRemainingTime() / 60).toFixed(2);\r\n if (isNaN(minutesValue))\r\n {\r\n return \"NaN\"\r\n }\r\n return minutesValue.toString() + \" mins\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "get duration() {\n return this._duration;\n }", "function countdown(duration) {\n let sign;\n let seconds, minutes, hours;\n let secondsDivider = 1000;\n let minutesDivider = 1000 * 60;\n let hoursDivider = 1000 * 60 * 60;\n\n if (duration < 0) {\n sign = \"-\";\n duration = Math.abs(duration);\n } else {\n sign = \"+\"\n }\n\n seconds = Math.floor(duration / secondsDivider) % 60;\n minutes = Math.floor(duration / minutesDivider) % 60;\n hours = Math.floor(duration / hoursDivider);\n\n seconds = seconds < 10 ? \"0\" + seconds : seconds;\n minutes = minutes < 10 ? \"0\" + minutes : minutes;\n hours = hours < 10 ? \"0\" + hours : hours;\n\n return `${sign}${hours}:${minutes}:${seconds}`\n}", "get fullDuration() {\n return {\n unit: this.durationUnit,\n magnitude: this.duration\n };\n }", "function _millisecondsToStr(t) {\n\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n var ret = \"\";\n if (hours > 0) {\n ret += hours + ' hour';\n if (hours > 1)\n ret += \"s\";\n ret += \" \";\n }\n return ret + minutes + ' min ' + seconds + \"s\";\n\n }", "getDuration() {\nreturn this.duration;\n}", "duration() {\n if (this.end) return this.end.getTime() - this.start.getTime();\n else return new Date().getTime() - this.start.getTime();\n }", "function sec2hms(diff) {\n var str = \"\";\n var hours = parseInt( diff / 3600 ) % 24;\n var minutes = parseInt( diff / 60 ) % 60;\n var seconds = diff % 60;\n if (hours) str += pad(hours)+\":\";\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "get duration() {\n var _a, _b;\n const current = (_b = (_a = this.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0;\n return this\n .reduce((acc, cur) => acc + (cur.duration || 0), current);\n }", "function GetDurationStringFromMinutes(minutes, hoursDay){\n var arrDuration = GetTimeArrayFromMinutes(minutes, hoursDay);\n var sDuration = arrDuration[0] + \"d \" + arrDuration[1] + \"h:\" + arrDuration[2] + \"m\";\n return sDuration;\n}", "function print_duration_long(timestamp) {\n var result = '',\n hours,\n minutes;\n\n // Change to minutes\n timestamp = Math.floor(timestamp / 60);\n hours = Math.floor(timestamp / 60);\n if(hours > 0) {\n result += hours + ' h ';\n }\n\n minutes = timestamp - hours * 60;\n result += minutes + ' min';\n\n return result;\n}", "function sec2hms(diff) {\n var str = \"\";\n var hours = Math.max(0, parseInt( diff / 3600 ) % 24);\n var minutes = Math.max(0, parseInt( diff / 60 ) % 60);\n var seconds = diff % 60;\n if (hours) {\n str += pad(hours)+\":\";\n }\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function getSecondsTime(duration) {\n if(typeof duration === \"number\") return duration;\n if(typeof duration !== \"string\") return 0;\n\n duration = duration.split(\":\");\n let time = 0;\n\n if(duration.length === 2) {\n time += Number(duration[0]) * 60;\n time += Number(duration[1]);\n } else if(duration.length === 3) {\n time += Number(duration[0]) * 3600;\n time += Number(duration[1]) * 60;\n time += Number(duration[2]);\n }\n\n return time;\n}", "getDuration() {\n\t\tlet time =\n\t\t\tMath.floor(this.audio.duration.toFixed(0)) -\n\t\t\tMath.floor(this.audio.currentTime.toFixed(0));\n\t\tthis.timeRemaining.innerHTML =\n\t\t\tMath.floor(time / 60) +\n\t\t\t\":\" +\n\t\t\t(time < 10\n\t\t\t\t? `0${time}`\n\t\t\t\t: time % 60 < 10\n\t\t\t\t? `0${time % 60}`\n\t\t\t\t: time % 60\n\t\t\t\t? time % 60\n\t\t\t\t: \"00\");\n\t\tif (this.audio.duration - this.audio.currentTime === 0) {\n\t\t\tthis.buttons.src = \"images/playbutton.svg\";\n\t\t}\n\t}", "function format_video_length(milliseconds) {\n var timeInSeconds = milliseconds > 0 ? milliseconds / 1000 : 0;\n var minutes = Math.floor(timeInSeconds / 60);\n var minutesString = minutes < 10 ? \"0\" + minutes : minutes;\n var seconds = Math.floor(timeInSeconds % 60);\n var secondsString = seconds < 10 ? \"0\" + seconds : seconds;\n\t\treturn minutesString + \":\" + secondsString;\n}", "function humanizeSecondsDuration(seconds) {\n let humanText = \"\";\n\n var days = Math.floor(seconds / (24 * 60 * 60));\n seconds -= days * (24 * 60 * 60);\n var hours = Math.floor(seconds / (60 * 60));\n seconds -= hours * (60 * 60);\n var minutes = Math.floor(seconds / 60);\n\n // Unused - Remaining seconds\n seconds -= minutes * 60;\n\n humanText += days > 0 ? days + \" day, \" : \"\";\n humanText += hours > 0 ? hours + \"h and \" : \"\";\n humanText += minutes + \"min\";\n\n return humanText;\n}", "duration() {\n let now = (this.end!==null)\n ? this.end\n : new Date().valueOf();\n return (this.since!==null)\n ? now - this.since.valueOf()\n : 0;\n }", "function convertMinutesToDuration (totalMinutes){\n\n var durationStr = \"\"; \n\n var numHours = parseInt (totalMinutes / 60);\n var numMinutes = parseInt(totalMinutes % 60);\n\n //alert ('h ' + numHours + ' m ' + numMinutes); \n\n if (numHours == 0){\n durationStr = ':' + numMinutes;\n }\n else {\n durationStr = numHours + \":\" + numMinutes; \n }\n return durationStr; \n}", "function _readableDuration(seconds) {\n\n\t\tvar sec = Math.floor( seconds );\n\t\tvar min = Math.floor( sec / 60 );\n\n\t\tmin = min >= 10 ? min : '0' + min;\n\t\tsec = Math.floor( sec % 60 );\n\t\tsec = sec >= 10 ? sec : '0' + sec;\n\n\t\treturn min + ':' + sec;\n\n\t}", "get duration() {\n\t\tconst items = this.items;\n\t\tlet item;\n\t\tlet time = 0;\n\t\tlet id;\n\n\t\tfor (id in items) {\n\t\t\titem = items[id];\n\t\t\ttime = Math.max(time, item.totalDuration / item.playSpeed);\n\t\t}\n\t\treturn time;\n\t}", "function duration (startTime, endTime) {\n let start = moment(startTime)\n let end = moment(endTime)\n let duration = moment.duration(start.diff(end, 'seconds'), 'seconds')\n if (duration.days() !== 0) {\n return duration.humanize()\n }\n return Math.abs(duration.asHours().toFixed(1)) + ' hours'\n}", "get unitFormatted() {\r\n\t\treturn this.count > 1 ? this.unit + 's' : this.unit;\r\n\t}", "function refresh_time(duration) {\n var mm = Math.floor(Math.floor(duration) / 60) + \"\";\n var ss = Math.ceil(Math.floor(duration) % 60) + \"\";\n\n if (mm.length < 2) { mm = \"0\" + mm; }\n if (ss.length < 2) { ss = \"0\" + ss; }\n container.html(mm + \":\" + ss);\n\n }", "function calculateDuration(milliseconds) { //function invoked programmatically when processing the Spotify server's response to a request for an artist's popular tracks\n let seconds = Math.round(milliseconds/1000); //let the 'seconds' variable represent the rounded result of the 'milliseconds' argument divided by 1000\n let mins = Math.floor(seconds/60); //let the 'mins' variable represent the rounded-down integer value of seconds divided by 60\n seconds = seconds % 60; //set 'seconds' equal to the remainder of 'seconds' divided by 60\n if(mins < 10) { //if 'mins' is less than 10\n mins = \"0\" + mins; //set 'mins' equal to \"0\" + mins\n }\n if (seconds < 10) { //if 'seconds' is less than 10\n seconds = \"0\" + seconds; //set 'seconds' equal to \"0\" + seconds\n }\n return mins + \":\" + seconds; //return the track duration in the format mm:ss (mins:seconds)\n}", "function describePeriod(seconds) {\n if (seconds === 60) {\n return '1 minute';\n }\n if (seconds === 1) {\n return '1 second';\n }\n if (seconds > 60) {\n return (seconds / 60) + ' minutes';\n }\n return seconds + ' seconds';\n}", "static format(msec) {\n const m = Math.floor(msec / 1000 / 60)\n const s = Math.floor(msec / 1000) - (m * 60)\n const ms = msec - (m * 1000 * 60) - (s * 1000)\n return `${pad(m)} : ${pad(s)} : ${pad(ms)}`\n }", "duration() {\n return this.tracks.reduce((trackMax, track) => Math.max(trackMax, track.keyframes.reduce((kfMax, kf) => Math.max(kfMax, kf.time), 0)), 0);\n }", "function millisecondsToStr(a){\"use strict\";function b(a){return a>1?\"s ago\":\" ago\"}var c=Math.floor(a/1e3),d=Math.floor(c/31536e3);if(d)return d+\" year\"+b(d);var e=Math.floor((c%=31536e3)/2592e3);if(e)return e+\" month\"+b(e);var f=Math.floor((c%=2592e3)/86400);if(f)return f+\" day\"+b(f);var g=Math.floor((c%=86400)/3600);if(g)return\"about \"+g+\" hour\"+b(g);var h=Math.floor((c%=3600)/60);if(h)return h+\" minute\"+b(h);var i=c%60;return i?i+\" second\"+b(i):\"just now\"}", "function TimeDuration2String( aTimeMilliseconds ) {\n\n if( isNaN( aTimeMilliseconds ) ) {\n aTimeMilliseconds = 0;\n }\n\n if( aTimeMilliseconds < 0 ) {\n aTimeMilliseconds = 0;\n }\n\n var seconds = Math.floor(aTimeMilliseconds / 1000);\n\n var minutes = Math.floor(seconds/60);\n seconds = seconds%60;\n\n var hours = Math.floor(minutes/60);\n minutes = minutes%60;\n\n var secondsString = ':' + seconds;\n if( seconds<10 ) {\n secondsString = ':0' + seconds;\n }\n\n var minutesString = '' + minutes;\n if( minutes<10 ) {\n minutesString = '0' + minutes;\n }\n\n if( hours != 0 ) {\n return hours + ':' + minutesString + secondsString;\n }\n\n return minutesString + secondsString;\n}", "function convertDuration(duration) {\n let timePieces = duration.split(' '); // split will divide the duration string into two strings (hours & minutes)\n \n // reduce to sum hours (in minutes) and minutes\n let minutes = timePieces.reduce((sum, onePiece) => {\n if (onePiece.includes('h')) {\n return sum + convertHours(onePiece); \n }\n return sum + convertMinutes(onePiece);\n }, 0);\n \n return minutes; // return total minutes\n }", "function msToTime(duration) {\n let milliseconds = parseInt((duration % 1000) / 100);\n let seconds = Math.floor((duration / 1000) % 60);\n let minutes = Math.floor((duration / (1000 * 60)) % 60);\n\n minutes = (minutes < 10) ? \"0\" + minutes : minutes;\n seconds = (seconds < 10) ? \"0\" + seconds : seconds;\n\n return minutes + \":\" + seconds + \".\" + milliseconds;\n}", "get timingDuration () {\n\t\treturn this._timingDuration;\n\t}", "getTimeString(milliseconds) {\n let seconds = Math.ceil(milliseconds / 1000);\n let minutes = Math.floor(seconds / 60);\n seconds -= minutes * 60;\n let hours = Math.floor(minutes / 60);\n minutes -= hours * 60;\n \n let output = '';\n if(hours) {\n output += hours + (hours > 1 ? ' hours' : ' hour');\n }\n if(minutes) {\n if(output) {\n output += (seconds ? ', ' : ' and ');\n }\n output += minutes + (minutes > 1 ? ' minutes' : ' minute');\n }\n if(seconds) {\n if(output) output += ' and ';\n output += seconds + (seconds > 1 ? ' seconds' : ' second');\n }\n \n return output;\n\t}", "function time_string(ms) {\n let secs = Math.floor(ms / 1000)\n ms = ms - (secs * 1000)\n let mins = Math.floor(secs / 60)\n secs = secs - (mins * 60)\n return mins.toString() + ' m ' + secs.toString() + ' s ' + ms.toString() + ' ms' \n}", "getDuration() {\n return this.video.duration;\n }", "function convertDurationToMinutes (durationStr){\n\n var totalMinutes = 0; \n\n var numHours = getNumHours(durationStr);\n var numMinutes = getNumMinutes(durationStr); \n //alert ('h ' + numHours + ' m ' + numMinutes); \n\n totalMinutes = parseInt ((numHours * 60)) + parseInt (numMinutes); \n return totalMinutes; \n} // convertDurationToMinutes", "function formatDuration (seconds)\n{\n if (seconds == 0) return \"now\";\n \n var sec = seconds % 60 + \" second\";\n var min = parseInt(seconds / 60 % 60) + \" minute\";\n var hour = parseInt(seconds / 60 / 60 % 24) + \" hour\";\n var day = parseInt(seconds / 60 / 60 / 24 % 365) + \" day\";\n var year = Math.floor(seconds / 60 / 60 / 24 / 365) + \" year\";\n \n var dur = [year, day, hour, min, sec];\n var rtn = \"\";\n \n for (var item in dur)\n {\n if (parseInt(dur[item]) > 0)\n {\n if (parseInt(dur[item]) >= 2)\n dur[item] += \"s\";\n rtn += dur[item] + \", \";\n }\n else\n dur[item] = \"\";\n }\n \n rtn = rtn.substring(0, rtn.lastIndexOf(\", \"));\n if (rtn.lastIndexOf(\", \") > 0)\n rtn = rtn.substring(0, rtn.lastIndexOf(\", \")) + \" and \" + rtn.substring(rtn.lastIndexOf(\", \") + 2);\n \n return rtn;\n}", "function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}", "get duration () {\n return this.player.duration();\n }", "function getEndTimer() {\n if (secs >= 10) {\n return `${mins}:${secs}`;\n } else {\n return `${mins}:0${secs}`;\n }\n}", "function o(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),\"days\"),ms:a.time()-c.time()})}", "function getMediaFileDuration (filePath, cb) {\n getMetaData(filePath, function (metadata) {\n cb(metadata ? metadata['format']['duration'] : 0)\n })\n}", "function short (ms) {\n if (ms >= d) return Math.round(ms / d) + 'd'\n if (ms >= h) return Math.round(ms / h) + 'h'\n if (ms >= m) return Math.round(ms / m) + 'm'\n if (ms >= s) return Math.round(ms / s) + 's'\n return ms + 'ms'\n}", "toIsoString() {\n if (this.amount === 0) {\n return 'PT0S';\n }\n switch (this.unit) {\n case TimeUnit.Seconds: return `PT${this.fractionDuration('S', 60, Duration.minutes)}`;\n case TimeUnit.Minutes: return `PT${this.fractionDuration('M', 60, Duration.hours)}`;\n case TimeUnit.Hours: return `PT${this.fractionDuration('H', 24, Duration.days)}`;\n case TimeUnit.Days: return `PT${this.amount}D`;\n default:\n throw new Error(`Unexpected time unit: ${this.unit}`);\n }\n }", "function d() {\n var a = new Date,\n b = a.getTime(); //get time in MS\n return b = b.toString(), b = b.substr(b.length - 4)\n }", "CD(){\n\t\tswitch(this.duration){\n\t\t\tcase ('DL'):\n\t\t\t\treturn 0.9\n\t\t\t\tbreak\n\t\t\tcase ('LL'):\n\t\t\t\treturn 1\n\t\t\t\tbreak\n\t\t\tcase ('SL'):\n\t\t\t\treturn 1.15\n\t\t\t\tbreak\n\t\t\tcase ('Const'):\n\t\t\t\treturn 1.25\n\t\t\t\tbreak\n\t\t\tcase ('WL'):\n\t\t\t\treturn 1.6\n\t\t\t\tbreak\n\t\t\tcase ('EL'):\n\t\t\t\treturn 1.6\n\t\t\t\tbreak\n\t\t\tcase ('Impact'):\n\t\t\t\treturn 2\n\t\t\t\tbreak\n\t\t}//SWITCH\n\t}", "function getTimeString(totalSeconds) {\n\tvar hours = Math.floor(totalSeconds / 3600);\n\ttotalSeconds %= 3600;\n\tvar minutes = Math.floor(totalSeconds / 60);\n\tvar seconds = totalSeconds % 60;\n\n\treturn `${appendZero(hours)}:${appendZero(minutes)}:${appendZero(seconds)}`;\n}", "function getTime(timer) {\n var minutes = timer;\n var seconds = 0;\n\n if(minutes < 10) {\n var timeHTML = \"0\" + minutes;\n } else {\n timeHTML = minutes;\n }\n timeHTML += \":\";\n\n if(seconds < 10) {\n timeHTML += \"0\";\n }\n timeHTML += seconds;\n\n return timeHTML;\n }" ]
[ "0.8008544", "0.7346449", "0.7295704", "0.7259352", "0.7213701", "0.71944994", "0.7163233", "0.7145003", "0.7042864", "0.7009834", "0.6949314", "0.69286734", "0.69119906", "0.68601567", "0.6777103", "0.6775744", "0.6729581", "0.67156386", "0.6691657", "0.668552", "0.6650191", "0.6649676", "0.65763134", "0.6575129", "0.6572895", "0.65645707", "0.6563639", "0.65597254", "0.6549706", "0.6539752", "0.65253794", "0.65232587", "0.6502952", "0.6500151", "0.64775974", "0.64673555", "0.6447642", "0.6447642", "0.6415153", "0.64122546", "0.6410469", "0.63983226", "0.6385687", "0.63726526", "0.63726526", "0.6357191", "0.63527393", "0.63439864", "0.6339466", "0.6338142", "0.6332985", "0.6329011", "0.6316899", "0.6294401", "0.62885183", "0.6288443", "0.62632245", "0.62621045", "0.6244195", "0.6235629", "0.6225684", "0.6204708", "0.620103", "0.620017", "0.61927974", "0.618881", "0.6162902", "0.6162127", "0.6147985", "0.6137661", "0.6120414", "0.60961735", "0.60886425", "0.6064753", "0.6051652", "0.6047489", "0.6041986", "0.60222936", "0.59942335", "0.5991997", "0.59909785", "0.5985845", "0.5976541", "0.59708935", "0.5960482", "0.59602684", "0.5956003", "0.5955463", "0.59507334", "0.5950528", "0.5942487", "0.5934922", "0.59312767", "0.59239143", "0.5912434", "0.5878756", "0.58629405", "0.58628803", "0.5859921", "0.5843454", "0.5832104" ]
0.0
-1
returns elapsed time in string
function getElapsed(createdAt, elapsed) { var elapsedTime = moment(createdAt).add(elapsed,'seconds').format('X'); var initTime = moment(createdAt).format('X'); var delta = elapsedTime - initTime; delta = moment.duration(delta, "s"); var duration = delta.hours() + ':' + delta.minutes() + ':' + delta.seconds(); return duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeElapsed(){\n\tvar h = Math.floor(sec_elapsed / 3600);\n\tvar m = Math.floor(sec_elapsed / 60);\n\tvar s = sec_elapsed - (m*60);\n\t\n\tif(h<10){\n\t\th = '0' + h;\n\t}\n\tif(m<10){\n\t\tm = '0' + m;\n\t}\n\tif(s<10){\n\t\ts = '0' + s;\n\t}\t\n\t\n\treturn h + ':' + m + ':' + s;\n}", "toString() {\n\t\tlet difference;\n\t\tif (this.options && this.options.ms) {\n\t\t\tdifference = this.toMs(this.difference);\n\t\t} else {\n\t\t\tdifference = `${this.difference} ms`;\n\t\t}\n\t\treturn `Timer took ${difference}`;\n\t}", "function timeText() {\n let t = timeTaken();\n t = Math.floor(t / 1000);\n if (t == -1) {\n return \"did not complete\";\n } else {\n let tString = \"\";\n tString = (t % 60) + \" seconds\" + tString;\n t = Math.floor(t / 60);\n tString = (t % 60) + \" minutes \" + tString;\n return tString;\n }\n }", "elapsed( seconds ) {\n seconds = parseInt( seconds ) || 0;\n if ( !seconds ) return '0s';\n\n let out = [], list = [];\n list.push( [ 'M', Math.floor( seconds / 2419200 ) ] );\n list.push( [ 'w', Math.floor( seconds / 604800 % 4 ) ] );\n list.push( [ 'd', Math.floor( seconds / 86400 % 7 ) ] );\n list.push( [ 'h', Math.floor( seconds / 3600 % 24 ) ] );\n list.push( [ 'm', Math.floor( seconds / 60 % 60 ) ] );;\n list.push( [ 's', Math.floor( seconds % 60 ) ] );\n list.forEach( arr => {\n let [ letter, time ] = arr;\n if ( time ) out.push( time + letter );\n });\n return out.join( ' ' );\n }", "static getTimerClockFaceText() {\n if (!this.timerState.started) {\n return \"\";\n }\n\n // Calculate current unix ts with server offset correction\n let nowUnix = Date.now() / 1000;\n nowUnix += this.timeOffset;\n\n // Calculate diff (total run time)\n let thenUnix = this.timerState.started_at;\n let totalSecondsActive = Math.round(nowUnix - thenUnix);\n\n // Format nicely\n let totalMinutes = Math.floor(totalSecondsActive / 60);\n let totalHours = Math.floor(totalMinutes / 60);\n\n let displayHours = totalHours;\n let displayMinutes = (totalMinutes - (totalHours * 60));\n let displaySeconds = Math.round(totalSecondsActive - (((totalHours * 60) + displayMinutes) * 60));\n\n displayHours = displayHours.toString();\n displayMinutes = displayMinutes.toString();\n displaySeconds = displaySeconds.toString();\n\n if (displayMinutes.length === 1) { displayMinutes = `0${displayMinutes}`; }\n if (displaySeconds.length === 1) { displaySeconds = `0${displaySeconds}`; }\n\n let strHoursMins = `${displayHours}:${displayMinutes}`;\n let strHoursMinsSecs = `${strHoursMins}:${displaySeconds}`;\n\n return {\n \"short\": strHoursMins,\n \"full\": strHoursMinsSecs\n };\n }", "function time() {\n\treturn `[${(new Date()).toTimeString().substr(0,8)}]`\n}", "function get_elapsed_time(start_time) {\n\tnow = new Date();\n\treturn (now.getTime() - start_time) / 1000;\n}", "function totalTimeString() {\n\tlet timeStr = 'After ';\n\tif (Math.floor(totalSeconds / 60) === 1) {\n\t\ttimeStr += '1 minute and ';\n\t} else if (Math.floor(totalSeconds / 60) > 1) {\n\t\ttimeStr += Math.floor(totalSeconds / 60) + ' minutes and ';\n\t}\n\tif (totalSeconds % 60 === 1){\n\t\ttimeStr += (totalSeconds % 60) + ' second';\n\t} else {\n\t\ttimeStr += (totalSeconds % 60) + ' seconds';\n\t}\n\treturn timeStr;\n}", "getUnits() {\n const seconds = this.props.timeElapsed / 1000;\n var hr = Math.floor(seconds / 3600).toString();\n var min = Math.floor(seconds / 60).toString();\n var sec = Math.floor(seconds % 60).toString();\n var msec = (seconds % 1).toFixed(2).substring(2);\n \n return this.formatTime(hr) + \":\" + this.formatTime(min) + \":\" + this.formatTime(sec) + \".\" + msec;\n }", "function formatTime(time) {\n if (time) {\n return format.niceElapsedTime(time);\n }\n }", "function getTimeString(totalSeconds) {\n\tvar hours = Math.floor(totalSeconds / 3600);\n\ttotalSeconds %= 3600;\n\tvar minutes = Math.floor(totalSeconds / 60);\n\tvar seconds = totalSeconds % 60;\n\n\treturn `${appendZero(hours)}:${appendZero(minutes)}:${appendZero(seconds)}`;\n}", "get elapsedTime() {\n return this._t;\n }", "function getTimeString(totalSeconds) {\n function timeToString(num) {\n return ( num < 10 ? \"0\" : \"\" ) + num;\n }\n \n hours = Math.floor(totalSeconds / 3600);\n totalSeconds = totalSeconds % 3600;\n\n minutes = Math.floor(totalSeconds / 60);\n totalSeconds = totalSeconds % 60;\n\n seconds = Math.floor(totalSeconds);\n\n // Pad the minutes and seconds with leading zeros, if required\n \n hours = timeToString(hours);\n minutes = timeToString(minutes);\n seconds = timeToString(seconds);\n\n // Compose the string for display\n var currentTimeString = minutes + \":\" + seconds;\n\n return currentTimeString;\n }", "getElapsedTime() {\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\t}", "get time() {\n return (process.hrtime()[0] * 1e9 + process.hrtime()[1]) / 1e6;\n }", "function Time(){\r\n\t\tvar stop = new Date();\r\n\t\tvar s = stop.getSeconds();\r\n\t\tvar tim = (n - s);\r\n\r\n\t\tDuration = \"Number Of Moves Made : \" +MOVES + \"Time Taken : \" +tim + \"seconds\";\r\n\t}", "function currTime(){\n let timeout = new Date();\n return timeout.toString();\n}", "function seconds_elapsed() {\n var date_now = new Date();\n var time_now = date_now.getTime();\n var time_diff = time_now - startTime;\n var seconds_elapsed = Math.floor(time_diff / 1000);\n return (seconds_elapsed);\n}", "function time(start) {\n const delta = Date.now() - start;\n return (0, _humanizeNumber2.default)(delta < 10000 ? delta + 'ms' : Math.round(delta / 1000) + 's');\n}", "function getTimeElapsedString(timeStamp) {\n\tconst minute = 1000 * 60;\n\tconst hour = 1000 * 60 * 60;\n\tconst day = 1000 * 60 * 60 * 24;\n const now = new Date(Date.now());\n\tconst timeElapsed = Date.now() - timeStamp;\n\n\tif(timeElapsed < minute) return \"just now\";\n\tif(timeElapsed < hour) {\n\t\tconst temp = Math.floor(timeElapsed / minute);\n\t\tif(temp === 1) return temp + \" minute ago\";\n\t\treturn temp + \" minutes ago\";\n\t}\n if(timeElapsed < day) {\n\t\tconst temp = Math.floor(timeElapsed / hour);\n\t\tif(temp === 1) return temp + \" hour ago\";\n\t\treturn temp + \" hours ago\";\n\t}\n if(timeElapsed < day * 30) {\n\t\tconst temp = Math.floor(timeElapsed / day);\n\t\tif(temp === 1) return temp + \"day ago\";\n\t\treturn temp + \" days ago\";\n\t}\n if(timeElapsed < day * 365) {\n\t\tconst temp = (now.getMonth() - timeStamp.getMonth());\n\t\tif(temp === 1) return temp + \" month ago\";\n\t\treturn temp + \" months ago\";\n\t} \n\tconst temp = (now.getFullYear() - timeStamp.getFullYear());\n\tif(temp === 1) return temp + \" year ago\";\n return temp + \" years ago\";\n}", "function getFormattedSeconds() {\n var secondsLeft = (totalSeconds - secondsElapsed) % 60;\n var formattedSeconds;\n \n if (secondsLeft < 10) {\n formattedSeconds = \"0\" + secondsLeft;\n } else {\n formattedSeconds = secondsLeft;\n }\n\n return formattedSeconds;\n}", "function getTime() {\n let hours = Math.floor(clock.getTime().time / 3600);\n let minutes = Math.floor((clock.getTime().time % 3600) / 60);\n let seconds = Math.floor((clock.getTime().time % 3600) % 60);\n\n if (hours === 0 && minutes === 0) {\n return `${seconds} Seconds`;\n } else if (hours === 0) {\n return `${minutes} ${(minutes === 1) ? \"Minute\" : \"Minutes\"}, ${seconds} ${(seconds === 1 || seconds === 0) ? \"Second\" : \"Seconds\"}`;\n } else {\n return `${hours}:${minutes}:${seconds}`;\n }\n\n}", "formatTime() {\n // Create a function to add leading zeros\n function pad(number, length, ending) {\n return (`0000${number}`).slice(-length) + ending;\n }\n\n // Get current ms running\n let ms = (new Date()).getTime();\n if (this.state.startTime === 0) { // Not currently running\n ms = 0;\n }\n\n // Find total elapsed time and separate it into its components\n let elapsed = ms - this.state.startTime + this.state.accTime;\n let sec = Math.floor(elapsed / 1000);\n elapsed %= 1000;\n let min = Math.floor(sec / 60);\n sec %= 60;\n const hour = Math.floor(min / 60);\n min %= 60;\n\n // Update the time string\n this.setState({\n time: pad(hour, 2, ':') + pad(min, 2, ':') + pad(sec, 2, '.') + pad(elapsed, 3, ''),\n });\n }", "function get_timestr() { \n\tvar d = new Date();\n\treturn d.toLocaleString() + \"<br />\\n\";\n}", "function getTimeElapsed() {\n return now() - _roundTimeStamp;\n }", "function timeElapsed(){\n var startTime = startTable.rows.item(1).cells.item(0).innerHTML;\n var stopTime = stopTable.rows.item(1).cells.item(0).innerHTML;\n var startTimeString = startTime.toString();\n var stopTimeString = stopTime.toString();\n var startHours = startTimeString.slice(0,2);\n var startMinutes = startTimeString.slice(3,5);\n var startSeconds = startTimeString.slice(6);\n var stopHours = stopTimeString.slice(0,2);\n var stopMinutes = stopTimeString.slice(3,5);\n var stopSeconds = stopTimeString.slice(6);\n var startTimeinSec = (Number.parseInt(startHours) * 3600) + (Number.parseInt(startMinutes) * 60) + Number.parseInt(startSeconds);\n var stopTimeinSec = (Number.parseInt(stopHours) * 3600) + (Number.parseInt(stopMinutes) * 60) + Number.parseInt(stopSeconds);\n totalTimeElapsed = Math.abs(stopTimeinSec - startTimeinSec) + \" \" + \"seconds\";\n}", "getTimeString(milliseconds) {\n let seconds = Math.ceil(milliseconds / 1000);\n let minutes = Math.floor(seconds / 60);\n seconds -= minutes * 60;\n let hours = Math.floor(minutes / 60);\n minutes -= hours * 60;\n \n let output = '';\n if(hours) {\n output += hours + (hours > 1 ? ' hours' : ' hour');\n }\n if(minutes) {\n if(output) {\n output += (seconds ? ', ' : ' and ');\n }\n output += minutes + (minutes > 1 ? ' minutes' : ' minute');\n }\n if(seconds) {\n if(output) output += ' and ';\n output += seconds + (seconds > 1 ? ' seconds' : ' second');\n }\n \n return output;\n\t}", "function time(text, contextTimer) {\n\t\tvar all = timer(),\n\t\t\ttiming = \"(total: \" + \n\t\t\t\t(contextTimer\n\t\t\t\t\t? all.total + \"ms, context: \" + contextTimer()\n\t\t\t\t\t: all)\n\t\t\t\t+ \"): \";\n\t\treturn \"DEBUG \" + timing + text;\n\t}", "function t_now(){\n\tlet time = process.hrtime(); //returns [sec, remaining nanosec];\n\treturn time[0] + time[1]*10**-9;\n}", "function time (start) {\n var delta = new Date() - start\n return humanize(\n delta < 10000\n ? delta + 'ms'\n : Math.round(delta / 1000) + 's'\n )\n}", "function time_string(ms) {\n let secs = Math.floor(ms / 1000)\n ms = ms - (secs * 1000)\n let mins = Math.floor(secs / 60)\n secs = secs - (mins * 60)\n return mins.toString() + ' m ' + secs.toString() + ' s ' + ms.toString() + ' ms' \n}", "static getTimeInMs() {\n let seconds;\n let nanoseconds;\n [seconds, nanoseconds] = process.hrtime();\n return seconds * 1000 + nanoseconds / 1000000;\n }", "function sec2hms(diff) {\n var str = \"\";\n var hours = parseInt( diff / 3600 ) % 24;\n var minutes = parseInt( diff / 60 ) % 60;\n var seconds = diff % 60;\n if (hours) str += pad(hours)+\":\";\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function getStrTimer() {\n\tlet minutes = Math.floor(timerSeconds / 60);\n\tlet seconds = timerSeconds % 60;\n\tlet timerString = '';\n\tif(minutes < 10) {\n\t\ttimerString = timerString.concat('0');\n\t}\n\ttimerString = timerString.concat(minutes +':');\n\tif(seconds < 10) {\n\t\ttimerString = timerString.concat('0');\n\t}\n\ttimerString = timerString.concat(seconds);\n\treturn timerString;\n}", "function get_time() {\n let d = new Date();\n if (start_time != 0) {\n d.setTime(Date.now() - start_time);\n } else {\n d.setTime(0);\n }\n return d.getMinutes().toString().padStart(2,\"0\") + \":\" + d.getSeconds().toString().padStart(2,\"0\");\n }", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n\n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n\n let formattedHH = hh.toString().padStart(2, '0');\n let formattedMM = mm.toString().padStart(2, '0');\n let formattedSS = ss.toString().padStart(2, '0');\n let formattedMS = ms.toString().padStart(2, '0');\n\n return (\n 'Timer ' + `${formattedHH}:${formattedMM}:${formattedSS}:${formattedMS}`\n );\n}", "function time() {\n return (Date.now() / 1000);\n }", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function time(start) {\n const delta = new Date - start;\n return humanize(delta < 10000\n ? delta + 'ms'\n : Math.round(delta / 1000) + 's');\n}", "function time(){\n\tvar d = new Date();\n\tvar hours = function() {\n\t\th = d.getHours();\n\t\tif (h <= 9) {\n\t\t\th = 0 + \"\" + h;\n\t\t}\n\t\treturn h;\n\t};\n\tvar mins = function() {\n\t\tvar m = d.getMinutes();\n\t\tif (m <= 9 ) {\n\t\t\tm = 0 + \"\" + m;\n\t\t}\n\t\treturn m\n\t}\n\tt = hours() + \"\" + mins();\n\tt = parseFloat(t);\n\treturn t;\n}", "function currentTimeString(){\n\treturn new Date().toLocaleString(\"en-US\",{hour:\"numeric\",minute:\"numeric\",hour12:true,second:\"numeric\"});\n}", "function getTime(timer) {\n var minutes = timer;\n var seconds = 0;\n\n if(minutes < 10) {\n var timeHTML = \"0\" + minutes;\n } else {\n timeHTML = minutes;\n }\n timeHTML += \":\";\n\n if(seconds < 10) {\n timeHTML += \"0\";\n }\n timeHTML += seconds;\n\n return timeHTML;\n }", "get elapsedTime() {\n\t\treturn this.__Internal__Dont__Modify__.elapsedTime;\n\t}", "getTime(){\n let hh = new Date().getHours()\n let mm = new Date().getMinutes()\n return `[${this.helper(hh)}:${this.helper(mm)}]`\n }", "function recTime(tVal) {\n var out = '';\n var a = 0,\n b = 0;\n a = (parseInt(tVal) - parseInt(tVal) % 100) / 100;\n b = parseInt(tVal) % 100;\n if (a < 10)\n out += '0';\n out += a;\n out += ':';\n if (b < 10)\n out += '0';\n out += b;\n return out;\n}", "function millisecondsToStr(a){\"use strict\";function b(a){return a>1?\"s ago\":\" ago\"}var c=Math.floor(a/1e3),d=Math.floor(c/31536e3);if(d)return d+\" year\"+b(d);var e=Math.floor((c%=31536e3)/2592e3);if(e)return e+\" month\"+b(e);var f=Math.floor((c%=2592e3)/86400);if(f)return f+\" day\"+b(f);var g=Math.floor((c%=86400)/3600);if(g)return\"about \"+g+\" hour\"+b(g);var h=Math.floor((c%=3600)/60);if(h)return h+\" minute\"+b(h);var i=c%60;return i?i+\" second\"+b(i):\"just now\"}", "function sec2hms(diff) {\n var str = \"\";\n var hours = Math.max(0, parseInt( diff / 3600 ) % 24);\n var minutes = Math.max(0, parseInt( diff / 60 ) % 60);\n var seconds = diff % 60;\n if (hours) {\n str += pad(hours)+\":\";\n }\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "static _getTimeInMs() {\n const [seconds, nanoseconds] = process.hrtime();\n return seconds * 1000 + nanoseconds / 1000000;\n }", "getReadableTime() {\n // Debugging line.\n Helper.printDebugLine(this.getReadableTime, __filename, __line);\n\n // Stop the time please. How long was the crawling process?\n let ms = new Date() - this.startTime,\n time = Parser.parseTime(ms),\n timeString = `${time.d} days, ${time.h}:${time.m}:${time.s}`;\n\n this.output.write(timeString, true, 'success');\n this.output.writeLine(`Stopped at: ${new Date()}`, true, 'success');\n }", "function MilliSecondsElapsed()\r\n{\r\n\toTimeNow = new Date();\r\n\treturn (oTimeNow - ACROSDK.oTimeStart);\r\n}", "function formatTime(){\r\n var response = \"\",\r\n hours = 0,\r\n mins = 0,\r\n secs = time;\r\n\r\n while (secs >= 60){\r\n secs -= 60;\r\n mins += 1;\r\n }\r\n\r\n while (mins >= 60){\r\n mins -= 60;\r\n hours += 1;\r\n }\r\n\r\n if (secs == 0) {\r\n secs = \"\";\r\n } else if (secs == 1) {\r\n secs += \" second\";\r\n } else if (secs > 1) {\r\n secs += \" seconds\";\r\n }\r\n\r\n if (mins == 0) {\r\n mins = \"\";\r\n } else if (mins == 1) {\r\n mins += \" minute\";\r\n } else if (mins > 1) {\r\n mins += \" minutes\";\r\n }\r\n\r\n if (hours == 0) {\r\n hours = \"\";\r\n } else if (hours == 1) {\r\n hours += \" hour\";\r\n } else if (hours > 1) {\r\n hours += \" hours\";\r\n }\r\n\r\n if (hours != \"\"){\r\n response += hours + \" \";\r\n }\r\n\r\n if (mins != \"\"){\r\n response += mins + \" \";\r\n }\r\n\r\n if (secs != \"\"){\r\n response += secs;\r\n }\r\n\r\n return response;\r\n }", "function time() {\n\treturn Date.now() / 1000.0;\n}", "function nowString () {\n const stamp = new Date()\n const h = stamp.getHours().toString().padStart(2, '0')\n const m = stamp.getMinutes().toString().padStart(2, '0')\n const s = stamp.getSeconds().toString().padStart(2, '0')\n const ms = stamp.getMilliseconds().toString().padStart(3, '0')\n return `${h}:${m}:${s}.${ms}`\n}", "function _millisecondsToStr(t) {\n\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n var ret = \"\";\n if (hours > 0) {\n ret += hours + ' hour';\n if (hours > 1)\n ret += \"s\";\n ret += \" \";\n }\n return ret + minutes + ' min ' + seconds + \"s\";\n\n }", "function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}", "updateTime() {\n\t\tlet now = new Date().getTime();\n\t\tlet x = now - this.startTime;\n\t\tlet time = moment.duration(x);\n\t\tthis.elapsedTime = clc.xterm(242)(time.hours() + 'h ') + clc.xterm(242)(time.minutes() + 'm ') + clc.xterm(242)(time.seconds() + 's');\n\t}", "function timerToString(time) {\n let differenceInHours = time / 3600000;\n let hour = Math.floor(differenceInHours);\n \n let differenceInMinutes = (differenceInHours - hour) * 60;\n let minute = Math.floor(differenceInMinutes);\n \n let differenceInSeconds = (differenceInMinutes - minute) * 60;\n let second = Math.floor(differenceInSeconds);\n \n let differenceInMilliseconds = (differenceInSeconds - second) * 100;\n let millisecond = Math.floor(differenceInMilliseconds);\n \n // Here we will format and pad the timer:\n let MINUTE = minute.toString().padStart(2, \"0\");\n let SECOND = second.toString().padStart(2, \"0\");\n let MILLISECOND = millisecond.toString().padStart(2, \"0\");\n \n return `${MINUTE}:${SECOND}:${MILLISECOND}`;\n}", "_getTimeInDecimalSecondString(timeMs) {\n var seconds = Math.floor(timeMs / 1000);\n var decimals = Math.floor((timeMs / 10) % 100);\n decimals = decimals < 10 ? '0' + decimals : decimals;\n return seconds + '.' + decimals;\n }", "function calculateTime(diff) {\n\tvar x = diff;\n\tvar days, hours, minutes, seconds; \n\tvar output = \"\";\n\n\tif (x >= 86400000) {\n\t\tdays = Math.floor(x/86400000);\n\t\tif (days > 1) { \n\t\t\toutput += days + \" days, \"; \n\t\t} else { output += days + \" day, \"; };\n\t\tx = x%86400000;\n\t\tif (x < 1000) { output = output.substring(0, output.length - 2) + \" and \"; };\n\t};\n\tif (x >= 3600000) {\n\t\thours = Math.floor(x/3600000);\n\t\tif (hours > 1) { \n\t\t\toutput += hours + \" hours, \"; \n\t\t} else { output += hours + \" hour, \"; };\n\t\tx = x%3600000;\n\t\tif (x < 1000) { output = output.substring(0, output.length - 2) + \" and \"; };\n\t};\n\tif (x >= 60000) {\n\t\tminutes = Math.floor(x/60000);\n\t\tif (minutes > 1) { \n\t\t\toutput += minutes + \" minutes and \"; \n\t\t} else { output += minutes + \" minute and \"; };\n\t\tx = x%60000;\n\t};\n\n\tseconds = x/1000;\n\toutput += seconds + \" seconds\";\n\treturn output;\n}", "getTimeElapsed(timestamp) {\n\t\t// take date difference and unit, then format to string\n\t\tconst formatDateDiff = (diff, unit) => {\n\t\t\tif (diff !== 1) unit += \"s\"; // plural\n\t\t\treturn `${diff} ${unit} ago`;\n\t\t};\n\n\t\tconst ms = new Date().getTime() - timestamp; // in milliseconds\n\t\tconst sec = ms / 1000;\n\t\tif (sec < 10) return \"a moment ago\";\n\t\tif (sec < 60) return formatDateDiff(Math.floor(sec), \"second\");\n\n\t\tconst min = sec / 60;\n\t\tif (min < 60) return formatDateDiff(Math.floor(min), \"minute\");\n\n\t\tconst h = min / 60;\n\t\tif (h < 24) return formatDateDiff(Math.floor(h), \"hour\");\n\n\t\tconst d = h / 24;\n\t\tif (d < 30) return formatDateDiff(Math.floor(d), \"day\");\n\n\t\tconst month = d / 30;\n\t\tif (month < 12) return formatDateDiff(Math.floor(month), \"month\");\n\n\t\tconst y = month / 12;\n\t\treturn formatDateDiff(Math.floor(y), \"year\");\n\t}", "function o2ws_get_time() { return o2ws_get_float(); }", "function timedisplay (num) {\n\tvar ret='';\n\tif (num <0){ \n\t\tnum = -num;\n\t\tret +='-'\n\t};\n\tvar timestamp = new Date(num - num%1000);\n\tvar s = timestamp.getSeconds();\n\tvar i = timestamp.getMinutes();\n\tvar h = (timestamp - s*1000 - i*60000)/3600000;\n\tret +=(h<10?'0'+h : h)+':';\n\tret +=(i<10?'0'+i : i)+':';\n\tret +=(s<10?'0'+s : s);\n\treturn ret;\n}", "function getTimeString(timeInSec){\n var minutes = parseInt(timeInSec / 60);\n var seconds = timeInSec % 60;\n return minutes + ':' + (seconds < 10 ? ('0' + seconds) : seconds);\n}", "function timerToText(input) {\r\n //Variables\r\n ///The number of milliseconds to be converted\r\n var timer = input;\r\n\r\n ///The string to be returned at the end of the function\r\n var output = \"\";\r\n\r\n //Display handling\r\n ///If the timer contains hours\r\n if(timer % 3600000 != timer){\r\n ///Add an integer number of hours to the string\r\n output += Math.floor(timer / 3600000) + \"h \";\r\n\r\n ///Remove thr hours from the timer\r\n timer = timer % 3600000;\r\n }\r\n\r\n ///If the timer contains minutes\r\n if(timer % 60000 != timer){\r\n ///Add an integer number of minutes to the string\r\n output += Math.floor(timer / 60000) + \"m \";\r\n\r\n ///Remove thr hours from the timer\r\n timer = timer % 60000;\r\n }\r\n\r\n ///Add an integer number of seconds to the string\r\n output += Math.floor(timer / 1000) + \"s \";\r\n\r\n return output;\r\n}", "function timeString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n let formattedHH = hh.toString().padStart(2, \"0\");\n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n return `${formattedHH}:${formattedMM}:${formattedSS}`;\n}", "function Common_GetElapsedTime(previousTime)\n{\n\t//get time difference\n\treturn new Date().getTime() - previousTime;\n}", "get elapsedTime() {\n return this._elapsedTime\n }", "function timeElapsed() {\n timer.textContent = `Timer: ${seconds}`;\n seconds++;\n }", "static convertToIGTString(time)\n {\n const t = parseInt(time);\n //invalid time value\n if(isNaN(t) || t===Number.MAX_SAFE_INTEGER)\n {\n return \"N/A\";\n }\n\n //add extra times\n let ms = t%1000;\n if(ms < 10)\n {\n ms = \"00\" + ms;\n }\n else if(ms < 100)\n {\n ms = \"0\" + ms;\n }\n let secs = parseInt((t%60000)/1000);\n if(secs < 10)\n {\n secs = \"0\" + secs;\n }\n let mins = parseInt(t/60000);\n\n return \"\" + mins + \":\" + secs + \":\" + ms;\n }", "function TimeDemo(){\r\n var d, s = \"\";\r\n var c = \":\";\r\n d = new Date();\r\n s += d.getHours() + c;\r\n s += d.getMinutes() ;\r\n //s += d.getSeconds() + c;\r\n //s += d.getMilliseconds();\r\n return(s);\r\n}", "function getTimeString() \n{\n var current_date = new Date();\n return current_date.getHours() + \":\" + current_date.getMinutes();\n}", "function responseTime (req, res) {\n if (!res._header || !req._startAt) {\n return ''\n }\n\n var tdiff = process.hrtime(req._startAt)\n , ms = tdiff[0] * 1e3 + tdiff[1] * 1e-6\n\n return ms.toFixed(3)\n}", "_getTime() {\n const date = new Date();\n const hours = ('0' + date.getHours()).slice(-2);\n const minutes = ('0' + date.getUTCMinutes()).slice(-2);\n const seconds = ('0' + date.getUTCSeconds()).slice(-2);\n const days = ('0' + date.getDate()).slice(-2);\n const months = ('0' + (date.getMonth() + 1)).slice(-2);\n const years = date.getFullYear();\n return `${days}.${months}.${years} / ${hours}:${minutes}:${seconds} `;\n }", "function time() {\r\n return Math.round((new Date()).getTime() / 1000); \r\n}", "function timeToString (time) {\r\n let diffInHrs = time / 3600000;\r\n let hh = Math.floor(diffInHrs);\r\n\r\n let diffInMin = (diffInHrs - hh) * 60;\r\n let mm = Math.floor(diffInMin);\r\n\r\n let diffInSec = (diffInMin - mm) * 60;\r\n let ss = Math.floor(diffInSec);\r\n\r\n let diffInMs = (diffInSec - ss) * 100;\r\n let ms = Math.floor(diffInMs);\r\n\r\n let formatHH = formatToTwoDigits(hh);\r\n let formatMM = formatToTwoDigits(mm);\r\n let formatSS = formatToTwoDigits(ss);\r\n let formatMS = formatToTwoDigits(ms)\r\n return `${formatMM}:${formatSS}:${formatMS}`;\r\n }", "function d() {\n var a = new Date,\n b = a.getTime(); //get time in MS\n return b = b.toString(), b = b.substr(b.length - 4)\n }", "function elapsedTime() {\r\n\tvar span = document.getElementById('elapsedTime');\r\n\tif (!span) return;\r\n\tvar now = new Date();\r\n\tvar time = new Date(now.getTime() - span.getAttribute('createdat'));\r\n\tvar strTime = (time.getMinutes() < 10 ? '0' : '') + time.getMinutes() + '\\'' + (time.getSeconds() < 10 ? '0' : '') + time.getSeconds() + '\"';\r\n\tif (time.getHours() > 1) {\r\n\t\tstrTime = (time.getHours() <= 10 ? '0' : '') + (time.getHours() - 1) + 'h' + strTime;\r\n\t}\r\n\tspan.replaceChild(document.createTextNode(' (' + strTime + ' ago)'), span.firstChild);\r\n\tsetTimeout(elapsedTime, 200);\r\n}", "function ts() { return m().format(\"HH:mm:ss.SSS\") }", "get remainingTime()\r\n { \r\n if (!this._endOfPath)\r\n {\r\n // Return remaining time in minutes.\r\n let minutesValue = (this._getRemainingTime() / 60).toFixed(2);\r\n if (isNaN(minutesValue))\r\n {\r\n return \"NaN\"\r\n }\r\n return minutesValue.toString() + \" mins\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function getDurationStr(duration) {\n return utils.round(duration);\n}", "function elapsed(start) {\n\t\treturn now() - start;\n\t}", "function time() {\n\t\t\treturn (new Date()).getTime();\n\t\t}", "function time() {\n let timestamp = Math.floor(new Date().getTime() / 1000)\n return timestamp;\n }", "function time() {\n\tvar tmp = new Date;\n\treturn tmp.getTime() / 1000;\n}", "timeFormatter (time) {\n var timeArr = time.split('T');\n var finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n return finalTime;\n }", "get(){\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::get\");\t\n\t\treturn this.elapsed;\n\t}", "getDeltaTime() {\n var binary = parseInt(this.deltaTime, 16).toString(2);\n var value = '';\n for (var i = 0, len = binary.length; i < len; i += 8) {\n var bstring = binary.slice(i, i + 8);\n if(bstring.length < 8) {\n value += bstring;\n } else {\n value += bstring.slice(1, 8);\n }\n }\n return parseInt(value, 2);\n }", "function getTimeStr(time) {\n\t\tvar d = new Date(START_OF_DAY + (time * 1000 * 60)),\n\t\t\thours = d.getHours(),\n\t\t\tmins = d.getMinutes(),\n\t\t\tamPM = getAMPM(hours);\n\n\t\thours = hours > 12 ? hours - 12 : hours || 12;\n\t\tmins = mins ? ':' + (mins < 10 ? '0' + mins : mins) : '';\n\n\t\treturn hours + mins + ' ' + amPM;\n\t}", "function TimeString() {\n const { timer } = useContext(TimerContext);\n const [myTimer] = useState(timer);\n\n return <span>{secsToTimeString(myTimer)}</span>;\n}", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n \n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n \n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n \n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n \n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n let formattedMS = ms.toString().padStart(2, \"0\");\n \n return `${formattedMM}:${formattedSS}:${formattedMS}`;\n}", "function getEndTimer() {\n if (secs >= 10) {\n return `${mins}:${secs}`;\n } else {\n return `${mins}:0${secs}`;\n }\n}", "function getTime() {\n\t\tvar currentTime = new Date();\n\t\tvar day = getDay(currentTime.getDay());\n\t\tvar month = getMonth(currentTime.getMonth());\n\t\tvar date = currentTime.getDate();\n\t\tvar year = currentTime.getFullYear();\n\n\t\treturn day + \" \" + month + \" \" + date + \" \" + year;\n\n\t\t/*var currentTime = new Date();\n\t\t var hours = currentTime.getHours();\n\t\t var minutes = currentTime.getMinutes();\n\t\t return hours + \":\" + minutes;*/\n\t}", "function printElapsedTime(fTest) {\n\tlet sT = Date.now();\n\tvReturn = fTest();\n\teT = Date.now();\n\n\tconsole.log(`Elapsed time: ${String(eT - sT)} milliseconds`);\n\treturn vReturn;\n}", "function getTime() {\r\n var currentTime = new Date();\r\n var hours = currentTime.getHours();\r\n var minutes = currentTime.getMinutes();\r\n if (minutes < 10) {\r\n minutes = \"0\" + minutes;\r\n }\r\n return hours + \":\" + minutes;\r\n}", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n let formattedHH = hh.toString().padStart(2, \"0\");\n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n let formattedMS = ms.toString().padStart(2, \"0\");\n return `${formattedHH}:${formattedMM}:${formattedSS}:${formattedMS}`;\n}", "time() {\n\n var d = new Date();\n\n t = d.getTime()\n\n return t;\n\n }", "function getStats() {\n let timestamp = new Date(Date.now());\n let dateTime = timestamp.toDateString() + \" \" + timestamp.toLocaleTimeString()\n return dateTime;\n}", "function _returnTimeCode(ms) {\n if (ms <= 0) {\n return '00:00';\n }\n\n var seconds = Math.floor((ms / MS_PER_SEC) % 60).toString(),\n minutes = Math.floor((ms / (MS_PER_MIN)) % 60).toString(),\n MS_PER_HOURs = Math.floor((ms / (MS_PER_HOUR)) % 60).toString();\n\n if (seconds.length === 1) {\n seconds = '0' + seconds;\n }\n\n if (minutes.length === 1) {\n minutes = '0' + minutes;\n }\n\n if (MS_PER_HOURs.length === 1) {\n MS_PER_HOURs = '0' + MS_PER_HOURs;\n }\n\n // just want a simple format for now\n return minutes + ':' + seconds;\n }", "function formatTime() {\n\n // get whole minutes\n var minutes = Math.floor(timer / 60);\n\n // get remaining seconds\n var seconds = timer % 60;\n\n // add leading \"0\"s\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n return minutes + \":\" + seconds;\n}", "function getTimeString(n, isSeconds) {\n \n if (isSeconds) n = Math.ceil(n / 60); ;\n \n var hours = (n < 60) ? 0 : Math.floor(n / 60);\n \n var minutes = n % 60;\n \n hours = hours.toString();\n \n if (hours.length == 1) hours = \"0\" + hours;\n \n minutes = minutes.toString();\n \n if (minutes.length == 1) minutes = \"0\" + minutes;\n \n \n \n return hours + \"h:\" + minutes + \"m\";\n \n }" ]
[ "0.8201184", "0.76156014", "0.7572001", "0.7549486", "0.68174595", "0.6746245", "0.6639818", "0.6627749", "0.65106666", "0.64950687", "0.6494705", "0.6493344", "0.64827216", "0.6478704", "0.64257", "0.64121014", "0.6372463", "0.6347693", "0.63442135", "0.63289857", "0.6318888", "0.6308262", "0.62685794", "0.62512636", "0.62509376", "0.62326366", "0.622758", "0.622161", "0.621046", "0.62099034", "0.6194053", "0.6193742", "0.6184577", "0.6184395", "0.6173173", "0.61525565", "0.61471987", "0.6143477", "0.6143477", "0.61425817", "0.6139581", "0.6108176", "0.61064655", "0.61060756", "0.6094492", "0.6091674", "0.6091169", "0.60886854", "0.6087793", "0.607481", "0.6070161", "0.60529685", "0.60513014", "0.6049834", "0.6048396", "0.60315216", "0.60289913", "0.6028962", "0.60252243", "0.60056776", "0.6005127", "0.5988653", "0.5983379", "0.597466", "0.5974365", "0.5966944", "0.5959517", "0.5953188", "0.59522444", "0.5936389", "0.5934559", "0.59339345", "0.5932552", "0.59171456", "0.5917004", "0.5905973", "0.5903083", "0.59016263", "0.5900537", "0.58999497", "0.58938986", "0.5875329", "0.58711135", "0.58600754", "0.5859827", "0.58596474", "0.5855703", "0.5853787", "0.5850434", "0.58477104", "0.58455914", "0.58433366", "0.5843145", "0.58329725", "0.58279634", "0.58276445", "0.5817912", "0.5815168", "0.5810494", "0.5788293", "0.57875574" ]
0.0
-1
returns date in string
function getDate(datetime) { return moment(datetime).format("DD MMM, YYYY"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDateString() {\n // Initializing variables for date, month and year\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear() - 2000;\n \n let strDate = month.toString() + \"/\" + day.toString() + \"/\" + year.toString();\n return strDate\n }", "function getDateString() {\n var now = new Date();\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n return (month) + \"/\" + (day) + \"/\" + now.getFullYear();\n }", "function getDateString(date)\n{\n\tlet year = date.getFullYear();\n\tlet month = date.getMonth() + 1;\n\tlet day = date.getDate();\n\tlet content = \"\";\n\n\tcontent += year;\n\tif(month < 9) content += \"-0\" + month;\n\telse content += \"-\" + month;\n\n\tif(day < 9) content += \"-0\" + day;\n\telse content += \"-\" + day;\n\treturn content;\n\t\n}", "function dateToString(date) {\n return date.year + '-' + date.month + '-' + date.day\n}", "returnDateFormat(date){\n var day = new Date(date);\n return day.toDateString();\n }", "function getFormattedDateString() {\n const now = new Date();\n const date_string = `${now.getFullYear().toString()}${(now.getMonth() < 10 ? (\"0\" + (now.getMonth() + 1).toString()) : (now.getMonth() + 1).toString())}${(now.getDate < 10 ? (\"0\" + now.getDate().toString()) : now.getDate().toString())}`;\n return date_string;\n }", "function _getDateString() {\n var myDate = new Date();\n // forward compatability with ES5 Shims\n if (typeof myDate.getFullYear !== \"function\") {\n myDate.getFullYear = function() {\n return (myDate.getYear + 1900); // offset from year 1900\n };\n }\n\n var myYear = myDate.getFullYear().toString();\n var myMonth = _zeroPad(myDate.getMonth() + 1, 2); // counts from 0\n var myDay = _zeroPad(myDate.getDate(), 2);\n var myHours = _zeroPad(myDate.getHours(), 2);\n var myMinutes = _zeroPad(myDate.getMinutes(), 2);\n var mySeconds = _zeroPad(myDate.getSeconds(), 2);\n\n return myYear + \n \"-\" + myMonth + \n \"-\" + myDay + \n \"T\" + myHours + \n ':' + myMinutes + \n ':' + mySeconds +\n '.' + (myDate.getMilliseconds() / 1000).toFixed(3).slice(2, 5);\n }", "function dateTimeString(date) {\n return `${date.getDate()} ${convertMonthInWord(\n date.getMonth()\n )} ${date.getFullYear()}`;\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "static getDateString(date)\r\n\t{\r\n\t\tlet month = date.getMonth() + 1; //months are counted from zero, we need to format it correctly.\r\n\t\tlet addZero = '';\r\n\t\tlet addZeroToDay = '';\r\n\t\tif(month < 10) //add a leading zero in case month is one digit, needed for correct formatting.\r\n\t\t\taddZero = '0';\r\n\t\tif(date.getDate() < 10)\r\n\t\t\taddZeroToDay = '0'\r\n\r\n\t\treturn date.getFullYear() + '-' + addZero + month + '-' + addZeroToDay + date.getDate();\r\n\t}", "function dateToString(date) {\n let yangi = new Date(date).toDateString().slice(4);\n return yangi;\n}", "function getDateString() {\n var d = new Date();\n return d.getDate() + \" \" + months[d.getMonth()] + \" \" + (d.getYear() + 1900);\n}", "function dateTodayStr() {\n\n var today = new Date();\n return dateFmtStr(today);\n}", "function date_str() {\n return Date().substring(0,24);\n}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "function date2str(date) {\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n }", "function getDateString(date) {\n var m = date.getMonth() + 1;\n if (m < 10) m = '0' + m;\n\n var d = date.getDate();\n if (d < 10) d = '0' + d;\n \n return '' + date.getFullYear() + m + d;\n }", "function buildStringFromDate(date){\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth();\r\n\tvar day = date.getDate();\r\n\tvar hours = date.getHours();\r\n\tvar minutes = date.getMinutes();\r\n\tvar seconds = date.getSeconds();\r\n\t\r\n\tif(month < 10){\r\n\t\tmonth = \"0\" + month;\r\n\t}\r\n\t\r\n\tif(day < 10){\r\n\t\tday = \"0\" + day;\r\n\t}\r\n\t\r\n\tif(hours < 10){\r\n\t\thours = \"0\" + hours;\r\n\t}\r\n\t\r\n\tif(minutes < 10){\r\n\t\tminutes = \"0\" + minutes;\r\n\t}\r\n\t\r\n\tif(seconds < 10){\r\n\t\tseconds = \"0\" + seconds;\r\n\t}\r\n\t\t\r\n\tvar sDate = year + \"-\" + month + \"-\" + day + \" \" + hours + \":\" + minutes + \":\"+ seconds + \" AST\";\r\n\treturn sDate;\r\n}", "function getDateString() {\n var today = new Date();\n var month = monthNames[today.getMonth()];\n var day = getOrdinal(today.getDate());\n var year = today.getFullYear();\n return month + ' ' + day + ', ' + year;\n}", "function stringifiedDate(){\r\n var date=new Date();\r\n var d = date.getDate();\t\r\n var m = date.getMonth()+1;\t\r\n var y = date.getFullYear().toString().substr(-2);\t\r\n\r\n if(d<10)d=\"0\"+d;\r\n if(m<10)m=\"0\"+m;\r\n \r\n return fullDate=d+\"-\"+m+\"-\"+y;\r\n}", "function getFormattedDate() {\n return \"[\" + new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '') + \"] \";\n}", "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "function get_date(){\n var d = new Date();\n var date_string = \"\" + d.getFullYear().toString() + \"-\";\n var month = (d.getMonth() + 1);\n date_string += (month < 10 ? \"0\" + month.toString() : month.toString());\n date_string += \"-\" + d.getDate().toString();\n return date_string;\n}", "function _getFormattedDate(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return month + '/' + day + '/' + year;\n }", "function xl_GetDateStr()\n{\n\tvar today = new Date()\n\tvar year = today.getYear()\n\tif(year<1000) year+=1900\n\t\tvar todayStr = GetMonth(today.getMonth()) + \" \" + today.getDate()\n\ttodayStr += \", \" + year\n\treturn todayStr\n}", "_stringify(date){\n date = date.toLocaleDateString();\n return date;\n }", "function dateString () {\n now = new Date();\n year = \"\" + now.getFullYear();\n month = \"\" + (now.getMonth() + 1); if (month.length == 1) { month = \"0\" + month; }\n day = \"\" + now.getDate(); if (day.length == 1) { day = \"0\" + day; }\n hour = \"\" + now.getHours(); if (hour.length == 1) { hour = \"0\" + hour; }\n minute = \"\" + now.getMinutes(); if (minute.length == 1) { minute = \"0\" + minute; }\n second = \"\" + now.getSeconds(); if (second.length == 1) { second = \"0\" + second; }\n return year + \"-\" + month + \"-\" + day + \" \" + hour + \"_\" + minute + \"_\" + second;\n}", "function getDate()\n\t\t\t{\n\t\t\t\tvar date = new Date();\n\t\t\t\treturn date.toDateString();\n\t\t\t}", "function showDate() {\n return `The date is: '01.01.1990'`;\n }", "function getDateAsString() {\n var currentDate = new Date(); //We use the JavaScript Date object/function and then configure it\n\n var currentMonth;\n var currentDay;\n\n if(currentDate.getMonth() < 10) {\n currentMonth = \"0\" + String(currentDate.getMonth()+1); //0 indexed month, january is 0\n } else {\n currentMonth = String(currentDate.getMonth()+1);\n }\n\n if(currentDate.getDate() < 10) {\n currentDay = \"0\" + String(currentDate.getDate());\n } else {\n currentDay = String(currentDate.getDate());\n }\n\n var date = currentDate.getFullYear() + \".\" + currentMonth + \".\" + currentDay;\n return date; //returns the date string\n}", "getFormattedDate(date) {\n return dayjs(date).format(\"MMM MM, YYYY\");\n }", "function date(data) {\n try {\n let date = new Date(data);\n const ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date)\n const mo = new Intl.DateTimeFormat('en', { month: 'short' }).format(date)\n const da = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date)\n return `${da} ${mo} ${ye}`;\n } catch (error) {\n console.log(error);\n }\n}", "dateToString(date) {\n let year = date.getFullYear();\n let month = (1 + date.getMonth()).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n \n return month + '/' + day + '/' + year;\n }", "function toString(date) {\n return date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? \n '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + '-' + \n date.getDate()\n }", "function toString(date) {\n return date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? \n '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + '-' + \n date.getDate()\n }", "function getDateAsString(dateVal) {\n if (dateVal) {\n var dateAsYYYYMMDD = dateVal.toString(),\n year = dateAsYYYYMMDD.substr(2, 2),\n month = dateAsYYYYMMDD.substr(4, 2),\n day = dateAsYYYYMMDD.substr(6, 2);\n\n return month + '/' + day + '/' + year;\n }\n}", "function createDateString(date) {\n var dateArray = date.split(' ');\n return dateArray[1] + dateArray[2] + dateArray[3];\n}", "get date_string() {\n return dayjs__WEBPACK_IMPORTED_MODULE_3__(this.date).format('DD MMM YYYY');\n }", "function dateToFullAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds();\r\n}", "function dateToString(date) {\r\n var month = \"\" + (date.getMonth() + 1),\r\n day = \"\" + date.getDate(),\r\n year = date.getFullYear();\r\n\r\n if (month.length < 2) month = \"0\" + month;\r\n if (day.length < 2) day = \"0\" + day;\r\n\r\n return [day, month, year].join(\"-\");\r\n}", "function getFormatedDate(date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}", "fullDateString(date) {\n return {\n day: this.getDayName(date.getDay()),\n month: this.getMonthName(date.getMonth()),\n year: date.getFullYear(),\n d: date.getDate()\n };\n }", "function getDate()\n {\n var date = new Date();\n\n var month = date.getMonth()+1;\n var day = date.getDate();\n\n if (date.getMonth() < 10)\n {\n month = \"0\" + month;\n }\n\n if (date.getDate() < 10)\n {\n day = \"0\" + day;\n }\n\n var datestring = \"\" + date.getFullYear() + month + day;\n\n return datestring;\n }", "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "function getDate() {\n document.write((new Date()).toDateString());\n}", "formatDate (date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n return [year, month, day].join('-');\n }", "display_date_formate(date) {\n if (!date)\n return null;\n const [year, month, day] = date.split('-');\n let new_date = `${day}-${month}-${year}`;\n return new_date;\n }", "function getDateString(date) {\n let result = ''\n\n result += MONTHS[`${date.slice(5, 7)}`]\n result += ` ${parseInt(date.slice(8, 10), 10)}`\n\n return result\n}", "function dateToString(date) {\n let dd = date.getDate();\n let mm = date.getMonth() + 1;\n if (dd < 10) {\n dd = '0' + dd\n }\n if (mm < 10) {\n mm = '0' + mm\n }\n return date.getFullYear() + '-' + mm + '-' + dd;\n}", "function getDateString()\n{ \n var d = new Date();\n var year = d.getUTCFullYear();\n var month = d.getUTCMonth()+1;\n var day = d.getUTCDay()+1;\n var date=\"\";\n if(day<10)\n {\n date = \"\"+year+\"\"+month+\"0\"+day;\n }\n else\n {\n date = \"\"+year+\"\"+month+\"\"+day;\n }\n return date;\n}", "function gexfDateString(date) {\n\tvar ye = '' + date.getFullYear();\n\tvar mo = '' + (date.getMonth() + 1);\n\tvar da = '' + date.getDate();\n\tvar ho = '' + date.getHours();\n\tvar mi = '' + date.getMinutes();\n\tvar se = '' + date.getSeconds();\n\twhile (mo.length < 2) mo = '0' + mo;\n\twhile (da.length < 2) da = '0' + da;\n\twhile (ho.length < 2) ho = '0' + ho;\n\twhile (mi.length < 2) mi = '0' + mi;\n\twhile (se.length < 2) se = '0' + se;\n\treturn [ye,'-',mo,'-',da,'T',ho,':',mi,':',se].join('');\n}", "function formatDateString (date) {\n var month = (date.getMonth() + 1); \n var day = date.getDate();\n if (month < 10) month = '0' + month;\n if (day < 10) day = '0' + day;\n var dateString = date.getFullYear() + '-' + month + '-' + day;\n return dateString;\n }", "getDateString() {\n return this.month.toString().padStart(2, \"0\") + \"/\" + this.year.toString().padStart(2, \"0\");\n }", "function convertDateToString(date){\n var parts = date.split('-')\n var year = parts[0];\n var month = parseInt(parts[1])-1;\n var day = parts[2];\n var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']\n return year + '-' + months[month] + '-'+day;\n}", "function invoiceDateString() {\n return this.invoiceDate.split('T')[0];\n }", "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "stringFormatDate(date) {\n let dateFormat = date.split(\"-\").reverse().join(\"-\");\n return dateFormat;\n }", "function dateToAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear();\r\n}", "function dateFormat(d){\n\t\tvar string = d.getFullYear() +'/';\n\t\tstring += ( (d.getMonth() < 9) ? '0'+(d.getMonth()+1) : d.getMonth()+1) +'/';\n\t\tstring += d.getDate();\n\t\treturn string;\n\t}", "function xl_GetDateStrWithDOW()\n{\n\tvar today = new Date()\n\tvar year = today.getYear()\n\tif(year<1000) year+=1900\n\t\tvar todayStr = GetDay(today.getDay()) + \", \"\n\ttodayStr += GetMonth(today.getMonth()) + \" \" + today.getDate()\n\ttodayStr += \", \" + year\n\treturn todayStr\n}", "formatDate(date) {\n return date.toISOString().replaceAll(\"-\", \"\").substring(0, 8);\n }", "function formattedDate(date) {\n\n // Récupération\n var month = String(date.getMonth() + 1);\n var day = String(date.getDate());\n var year = String(date.getFullYear());\n\n // Ajout du 0\n if (month.length < 2) \n month = '0' + month;\n\n // Ajout du 0\n if (day.length < 2) \n day = '0' + day;\n\n return day+'/'+month+'/'+year;\n }", "function formatDate(date) {\n let source = new Date(date);\n let day = source.getDate();\n let month = source.getMonth() + 1;\n let year = source.getFullYear();\n\n return `${day}/${month}/${year}`;\n }", "function getDateString(d){\n\t\tvar days = ['SUN','MON','TUES','WED','THURS','FRI','SAT'];\n\t\tvar spaces = [' ',' '];\n\t\tvar t = days[d.getDay()] + spaces.join('') + d.getDate();\n\t\treturn t\n\t}", "function getFormattedDate(date) {\n var year = date.getFullYear();\n\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n\n return day + '/' + month + '/' + year;\n}", "function dateToString(_date, symbol){\n if(symbol == undefined) symbol = \"/\";\n return _date.getFullYear() + symbol + \n (\"0\" + (_date.getMonth() + 1)).substr(-2) + symbol + \n (\"0\" + _date.getDate()).substr(-2);\n}", "function formattedDate(date) {\r\n\t\t\t\t\tvar d = new Date(date),\r\n\t\t\t\t\t\tmonth = '' + (d.getMonth() + 1),\r\n\t\t\t\t\t\tday = '' + d.getDate(),\r\n\t\t\t\t\t\tyear = d.getFullYear();\r\n\r\n\t\t\t\t\tif (month.length < 2) month = '0' + month;\r\n\t\t\t\t\tif (day.length < 2) day = '0' + day;\r\n\t\t\t\t\treturn [year, month, day].join('-');\r\n\t\t\t\t}", "function createDateString(data){\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var date = new Date(data);\n var day = date.getDate();\n var month = months[date.getMonth()];\n var year = date.getFullYear();\n return day + ' ' + month + ' ' + year;\n}", "function formatDate(date) {\n result = \"\";\n if (date) {\n result += date.getDate() + \"/\"; // Day\n result += (date.getMonth() + 1) + \"/\";\n result += (date.getYear() + 1900);\n }\n return result;\n}", "function str(date) {\n return [\n date.getUTCFullYear(),\n _.padLeft(date.getUTCMonth() + 1, 2, '0'),\n _.padLeft(date.getUTCDate(), 2, '0')\n ].join('-');\n }", "function date_to_str(date)\n{\n return format(\"%02u/%02u/%02u\", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100);\n}", "function convertDateToString(date) {\n return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();\n }", "function formatDate(date) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day = date.getDate();\n return [year, month, day].join('-');\n}", "getDate() {\n // intialzie te Date object\n const d = new Date();\n\n // retturns the date converted to string\n return `${d.getDate()}/${d.getMonth()}/${d.getFullYear()}`;\n }", "function formatDate(date) {\n\treturn new Date(date.split(' ').join('T'))\n}", "function getDateString(now)\n{\n const options={year:'numeric',month:'long',day:'numeric'};\n return now.toLocaleDateString('en-Us',options);\n \n}", "static formatDate(date) {\n let formattedDate = '';\n\n formattedDate += date.getUTCFullYear();\n formattedDate += '-' + ('0' + (date.getUTCMonth() + 1)).substr(-2);\n formattedDate += '-' + ('0' + date.getUTCDate()).substr(-2);\n\n return formattedDate;\n }", "function makeDateStr(date) {\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n\n if (day < 10) {\n day = '0' + day;\n }\n if (month < 10) {\n month = '0' + month;\n }\n if (hours < 10) {\n hours = '0' + hours;\n }\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n\n let dateStr = day + '.' + month + '.' + year + ' ' + hours + ':' + minutes + ' Uhr';\n return dateStr;\n}", "function dateFmtStr(today) {\n\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n return mm + '/' + dd + '/' + yyyy;\n}", "function getDate() {\n let date = new Date();\n let dateString = (date.getMonth()+1) + \".\"+date.getDate()+\".\"+date.getFullYear();\n return dateString;\n}", "function _getDateString() {\n return Utilities.formatDate((new Date()), AdWordsApp.currentAccount().getTimeZone(), \"yyyy-MM-dd\");\n}", "function getDateTimeString(date) {\n\tfunction pad10(n) {\n\t\treturn n < 10 ? '0' + n : n;\n\t}\t\n\treturn date.getFullYear() + \"-\" + pad10(date.getMonth()) + \"-\" + pad10(date.getDate()) + \" \" + pad10(date.getHours()) + \":\" + pad10(date.getMinutes()) + \":\" + pad10(date.getSeconds());\n}", "function formatDate(date) {\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear().toString().slice(-2);\n return day + month + year;\n}", "function date(date) {\n var monthNames = [\n \"January\", \"February\", \"March\",\n \"April\", \"May\", \"June\", \"July\",\n \"August\", \"September\", \"October\",\n \"November\", \"December\"\n ];\n var day = date.getDate();\n var monthIndex = date.getMonth();\n var year = date.getFullYear();\n return day + ' ' + monthNames[monthIndex] + ' ' + year;\n}", "function formatDate(date) { \n var dateString = date + \"\";\n return dateString.substring(2);\n}", "function dateMaker (){\n var d = new Date();\n var date = d.toString().split(\" \")\n var arrayDate = [];\n for(i = 0; i < 4; i ++){\n arrayDate.push(date[i]);\n }\n var dateSentence = arrayDate.join(\" \");\n return dateSentence;\n}", "function getCurrentDateString() {\n return dataUtils_1.formatDate.bind(new Date())('yyyy-MM-dd-hhmm');\n}", "dateFormat(date) {\n if (date != '') {\n let newdate = new Date(date);\n let dd = newdate.getDate();\n let mm = newdate.getMonth() + 1;\n let yy = newdate.getFullYear();\n return mm + \"/\" + ('0' + dd).slice(-2) + \"/\" + yy;\n } else {\n return \"\";\n }\n }", "function datestring() {\n var d = new Date(Date.now() - 5 * 60 * 60 * 1000); //est timezone\n return d.getUTCFullYear() + \"-\" +\n (d.getUTCMonth() + 1) + \"-\" +\n d.getDate();\n}", "function formatDate(date) {\n const month = date.getMonth() + 1;\n const day = date.getDate();\n const year = date.getFullYear();\n \n return `${month}/${day}/${year}`;\n }", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function formatDate(date) {\r\n var day = '',\r\n month = '',\r\n year = '',\r\n tmp = [],\r\n str = '';\r\n tmp = date.split('/');\r\n day = tmp[1];\r\n month = tmp[0];\r\n year = '20' + tmp[2];\r\n str = year + '-' + month + '-' + day;\r\n return str;\r\n}", "function dateFormatted(date) {\n let d = null;\n\n if (date.toString() == 'Invalid Date') return ''; // eg MySQL 0000-00-00\n\n try {\n switch (config.dateFormat) {\n case 'ISO': // YYYY-MM-DDTHH:MM:SS.mmmZ\n d = date.toISOString();\n break;\n case 'SQL': // YYYY-MM-DD HH:MM:SS\n d = date.toISOString().replace('T', ' ').split('.')[0];\n break;\n case 'JS': // JavaScript date format\n d = date.toString();\n break;\n default:\n throw new Error('Xmlify: Unknown date format '+config.dateFormat);\n }\n } catch (e) {\n throw new Error('Xmlify: Invalid date '+date);\n }\n return d;\n }", "function datestring(datest) {\n var d = new Date(datest);\n return d;\n }", "function datestr (date) {\n const local = new Date(date);\n local.setMinutes(date.getMinutes() - date.getTimezoneOffset());\n return local.toJSON().slice(0, 10);\n}", "function datestring() {\n var d = new Date(Date.now() - 5 * 60 * 60 * 1000); //est timezone - 5 hours\n return d.getUTCFullYear() + '-' + (d.getUTCMonth() + 1) + '-' + d.getDate();\n}", "function formatDate(date) {\n var day = date.getDate();\n var month = date.getMonth() + 1; //Months are zero based\n var year = date.getFullYear();\n var formattedDate = year + \"-\" + month + \"-\" + day;\n return formattedDate;\n }", "function formatted_date()\n{\n var result=\"\";\n var d = new Date();\n var month = (d.getMonth()+1);\n var day = d.getDate();\n if (d.getMonth()+1 < 10){\n \t\tvar month = '0' + (d.getMonth()+1);\n }\n if (d.getDate()+1 < 10){\n \t\tvar day = '0' + d.getDate();\n }\n result += d.getFullYear() +''+ month +''+ day;\n console.log(result);\n return result;\n}" ]
[ "0.7865741", "0.7733878", "0.7722129", "0.75780684", "0.75453395", "0.7509569", "0.75010115", "0.74770427", "0.7459786", "0.7407767", "0.74073", "0.73844194", "0.7371184", "0.7329175", "0.7314917", "0.731109", "0.7275957", "0.7269731", "0.7266134", "0.7263692", "0.7257782", "0.72314847", "0.72232896", "0.72187513", "0.7200068", "0.7197832", "0.71886593", "0.71857345", "0.7166184", "0.7162034", "0.71496314", "0.7148989", "0.71464485", "0.71458155", "0.7139561", "0.7139561", "0.7136099", "0.7116612", "0.71120185", "0.7101809", "0.7100133", "0.7097175", "0.709157", "0.708052", "0.707918", "0.707918", "0.70675874", "0.70572716", "0.7049387", "0.7027259", "0.70258904", "0.7023997", "0.7018431", "0.70118463", "0.6992273", "0.69753915", "0.6967527", "0.69617957", "0.6957609", "0.6956591", "0.6954262", "0.69455636", "0.6945125", "0.69451183", "0.69353795", "0.693235", "0.69281125", "0.69278693", "0.6922115", "0.6912385", "0.6911176", "0.6906597", "0.69024116", "0.6901202", "0.68743074", "0.68609977", "0.6860006", "0.6856501", "0.68487585", "0.68399364", "0.68398035", "0.6833631", "0.68306434", "0.6830234", "0.68294674", "0.68288326", "0.6823342", "0.68196744", "0.6809602", "0.68088543", "0.6808723", "0.68067044", "0.6788602", "0.6788602", "0.6787692", "0.67824656", "0.67774016", "0.67673963", "0.67597705", "0.6754313", "0.6739182" ]
0.0
-1
returns time in string
function getTime(datetime) { return moment(datetime).format("HH:MM"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function time() {\n\treturn `[${(new Date()).toTimeString().substr(0,8)}]`\n}", "function get_timestr() { \n\tvar d = new Date();\n\treturn d.toLocaleString() + \"<br />\\n\";\n}", "function time_str() {\n var d = new Date();\n var date = two(d.getDate());\n var month = two(d.getMonth() + 1);\n var hour = two(d.getHours());\n var minutes = two(d.getMinutes());\n return month + date + '-' + hour + minutes;\n}", "function timeUtil(){\n var timestr = new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '');\n return timestr;\n}", "timeFormatter (time) {\n var timeArr = time.split('T');\n var finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n return finalTime;\n }", "function getTimeStr(time) {\n\t\tvar d = new Date(START_OF_DAY + (time * 1000 * 60)),\n\t\t\thours = d.getHours(),\n\t\t\tmins = d.getMinutes(),\n\t\t\tamPM = getAMPM(hours);\n\n\t\thours = hours > 12 ? hours - 12 : hours || 12;\n\t\tmins = mins ? ':' + (mins < 10 ? '0' + mins : mins) : '';\n\n\t\treturn hours + mins + ' ' + amPM;\n\t}", "function timeString(){\r\n var date = new Date()\r\n var current_hour = date.toLocaleString()\r\n current_hour = pad(current_hour, 23, 1, \" \")\r\n return current_hour\r\n}", "function getFormattedTime() {\n var today = new Date();\n\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "function currentTimeString(){\n\treturn new Date().toLocaleString(\"en-US\",{hour:\"numeric\",minute:\"numeric\",hour12:true,second:\"numeric\"});\n}", "function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}", "function getTimeString(time) {\n let result = ''\n let format = time.split('.')[0].split(':')\n let hour = parseInt(format[0], 10)\n let meridiem = (hour / 12) >= 1 ? 'PM' : 'AM'\n\n result += hour % 12 === 0 ? 12 : hour % 12\n result += ':'\n result += format[1]\n\n return result + ' ' + meridiem\n}", "function time(){\n\tvar d = new Date();\n\tvar hours = function() {\n\t\th = d.getHours();\n\t\tif (h <= 9) {\n\t\t\th = 0 + \"\" + h;\n\t\t}\n\t\treturn h;\n\t};\n\tvar mins = function() {\n\t\tvar m = d.getMinutes();\n\t\tif (m <= 9 ) {\n\t\t\tm = 0 + \"\" + m;\n\t\t}\n\t\treturn m\n\t}\n\tt = hours() + \"\" + mins();\n\tt = parseFloat(t);\n\treturn t;\n}", "function timeString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n let formattedHH = hh.toString().padStart(2, \"0\");\n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n return `${formattedHH}:${formattedMM}:${formattedSS}`;\n}", "function timeToString(t) {\n var s = t.hours + \":\" + t.mins + \" \";\n s += t.isAM ? \"AM\" : \"PM\";\n return s;\n }", "function getTimeString() \n{\n var current_date = new Date();\n return current_date.getHours() + \":\" + current_date.getMinutes();\n}", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 'sn.';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400));\r\n m.push ('Gün');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600));\r\n m.push ('Saat ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60));\r\n m.push ('Dk.');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('sn.'); \r\n }\r\n return m.join ('');\r\n}", "function getTime(time) {\n var minute = Math.floor(time / 60);\n var second = Math.floor(time % 60);\n if (minute < 10) {\n minute = \"0\" + minute;\n }\n\n if (second < 10) {\n second = \"0\" + second;\n }\n\n return minute + \":\" + second;\n }", "function getFormattedTime() {\n var today = new Date();\n //return moment(today).format(\"YYYYMMDDHHmmssSSS\");\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 's';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400)); \r\n m.push ('d ');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600)); \r\n m.push ('h ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60)); \r\n m.push ('m');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('s'); \r\n }\r\n return m.join ('');\r\n}", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 's';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400));\r\n m.push ('d ');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600));\r\n m.push ('h ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60));\r\n m.push ('m');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('s'); \r\n }\r\n return m.join ('');\r\n}", "static convertToIGTString(time)\n {\n const t = parseInt(time);\n //invalid time value\n if(isNaN(t) || t===Number.MAX_SAFE_INTEGER)\n {\n return \"N/A\";\n }\n\n //add extra times\n let ms = t%1000;\n if(ms < 10)\n {\n ms = \"00\" + ms;\n }\n else if(ms < 100)\n {\n ms = \"0\" + ms;\n }\n let secs = parseInt((t%60000)/1000);\n if(secs < 10)\n {\n secs = \"0\" + secs;\n }\n let mins = parseInt(t/60000);\n\n return \"\" + mins + \":\" + secs + \":\" + ms;\n }", "function nowString () {\n const stamp = new Date()\n const h = stamp.getHours().toString().padStart(2, '0')\n const m = stamp.getMinutes().toString().padStart(2, '0')\n const s = stamp.getSeconds().toString().padStart(2, '0')\n const ms = stamp.getMilliseconds().toString().padStart(3, '0')\n return `${h}:${m}:${s}.${ms}`\n}", "function getTimeAsString() {\n var currentTime = new Date(); //We use the JavaScript Date object/function and then configure it\n\n var currentHour;\n var currentMinute;\n var currentSecond;\n\n if(currentTime.getHours() < 10) {\n currentHour = \"0\" + String(currentTime.getHours());\n } else {\n currentHour = String(currentTime.getHours());\n }\n\n if(currentTime.getMinutes() < 10) {\n currentMinute = \"0\" + String(currentTime.getMinutes());\n } else {\n currentMinute = String(currentTime.getMinutes());\n }\n\n if(currentTime.getSeconds() < 10) {\n currentSecond = \"0\" + String(currentTime.getSeconds());\n } else {\n currentSecond = String(currentTime.getSeconds());\n }\n\n var time = currentHour + \":\" + currentMinute + \":\" + currentSecond;\n return time; //returns the time string\n}", "function getTimeString(date) {\n\treturn ('0' + date.getHours()).slice(-2) + \":\" + ('0' + date.getMinutes()).slice(-2) + \":\" + ('0' + date.getSeconds()).slice(-2);\n}", "function timeToString (time) {\r\n let diffInHrs = time / 3600000;\r\n let hh = Math.floor(diffInHrs);\r\n\r\n let diffInMin = (diffInHrs - hh) * 60;\r\n let mm = Math.floor(diffInMin);\r\n\r\n let diffInSec = (diffInMin - mm) * 60;\r\n let ss = Math.floor(diffInSec);\r\n\r\n let diffInMs = (diffInSec - ss) * 100;\r\n let ms = Math.floor(diffInMs);\r\n\r\n let formatHH = formatToTwoDigits(hh);\r\n let formatMM = formatToTwoDigits(mm);\r\n let formatSS = formatToTwoDigits(ss);\r\n let formatMS = formatToTwoDigits(ms)\r\n return `${formatMM}:${formatSS}:${formatMS}`;\r\n }", "stringifyTime(t) {\n return (t < 10) ? '0' + t : t;\n }", "function TimeDemo(){\r\n var d, s = \"\";\r\n var c = \":\";\r\n d = new Date();\r\n s += d.getHours() + c;\r\n s += d.getMinutes() ;\r\n //s += d.getSeconds() + c;\r\n //s += d.getMilliseconds();\r\n return(s);\r\n}", "function toTimeString(time) {\n var date = new Date(time);\n var hours = date.getHours();\n if(hours < 10) hours = \"0\" + hours;\n var minutes = date.getMinutes();\n if(minutes < 10) minutes = \"0\" + minutes;\n return hours + \":\" + minutes;\n}", "toString() {\n return this.time.toLocaleTimeString('en-US', {hour12: false});\n }", "function time() {\n var date = new Date();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n var time = hours + \":\" + minutes\n return time;\n}", "_toHHMMSS(ms) {\n return new Date(ms).toISOString().slice(11, -1);\n // console.log( time(1234567890) ); // \"06:56:07.890\"\n }", "function getTime() {\n\tvar Time = new Date();\n\treturn Time.toISOString().slice(0,10) + \" \" + Time.getHours() + \":\" + Time.getMinutes() + \":\" + Time.getSeconds();\n}", "function getTime() {\n let date = new Date(),\n hour = date.getHours(),\n min = date.getMinutes();\n // sec = date.getSeconds();\n\n return \"\" +\n (hour < 10 ? (\"0\" + hour) : hour) +\n \":\" +\n (min < 10 ? (\"0\" + min) : min);\n // + \":\" + (sec < 10 ? (\"0\" + sec) : sec);\n}", "function time(s) {\n\t\treturn new Date(s * 1e3).toISOString().slice(-13, -5);\n\t}", "function timeFormatFn() {\n let now = new Date();\n return now.toUTCString();\n}", "function getTime() {\r\n var currentTime = new Date();\r\n var hours = currentTime.getHours();\r\n var minutes = currentTime.getMinutes();\r\n if (minutes < 10) {\r\n minutes = \"0\" + minutes;\r\n }\r\n return hours + \":\" + minutes;\r\n}", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n let formattedHH = hh.toString().padStart(2, \"0\");\n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n let formattedMS = ms.toString().padStart(2, \"0\");\n return `${formattedHH}:${formattedMM}:${formattedSS}:${formattedMS}`;\n}", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n \n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n \n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n \n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n \n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n let formattedMS = ms.toString().padStart(2, \"0\");\n \n return `${formattedMM}:${formattedSS}:${formattedMS}`;\n}", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n\n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n\n let formattedHH = hh.toString().padStart(2, '0');\n let formattedMM = mm.toString().padStart(2, '0');\n let formattedSS = ss.toString().padStart(2, '0');\n let formattedMS = ms.toString().padStart(2, '0');\n\n return (\n 'Timer ' + `${formattedHH}:${formattedMM}:${formattedSS}:${formattedMS}`\n );\n}", "function getFormattedTime() {\n var today = new Date();\n //return moment(today).format(\"YYYYMMDDHHmmssSSS\");\n return moment(today).format(\"DDHHmmssSSS\");\n }", "static get_time() {\n return (new Date()).toISOString();\n }", "function timeFormatString() {\n return is24HourTime() ? 'HH:mm' : 'hh:mm a';\n}", "function getTimeStr(time,hideSeconds){ // was int2timestr\n\t// returns like \"1d 12:30:42\"\n\tvar str,help;\n\tif(time<0){ time *= -1; }\n\tif (hideSeconds) {\n\t\tstr = timeFormatHM;\n\t} else {\n\t\tstr = timeFormatHMS;\n\t\thelp = time%60;\n\t\tstr = str.replace(\"sec\",((help<10)?\"0\":\"\")+Math.floor(help));\n\t}\n\ttime=time/60;\n\thelp = time%60;\n\tstr = str.replace(\"min\",((help<10)?\"0\":\"\")+Math.floor(help));\n\ttime=time/60;\n\thelp = time%24;\n\tstr = str.replace(\"hour\",((help<10)?\"0\":\"\")+Math.floor(help));\n\ttime=time/24;\n\tif (time>=1){ str=Math.floor(time)+\"d&nbsp;\"+str; }\n\treturn str;\n}", "function getTimeString(date) {\n var hh = ('0' + date.getHours()).slice(-2);\n var mm = ('0' + date.getMinutes()).slice(-2);\n var ss = ('0' + date.getSeconds()).slice(-2);\n return hh + ':' + mm + ':' + ss;\n}", "function timeFormatter (time) {\n\tvar timeArr = time.split('T');\n\tvar finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n\treturn finalTime;\n}", "getTime(){\n var date = new Date();\n return [('00'+date.getHours()).slice(-2), ('00'+date.getMinutes()).slice(-2), ('00'+date.getSeconds()).slice(-2)].join(':');\n }", "function time_string(ms) {\n let secs = Math.floor(ms / 1000)\n ms = ms - (secs * 1000)\n let mins = Math.floor(secs / 60)\n secs = secs - (mins * 60)\n return mins.toString() + ' m ' + secs.toString() + ' s ' + ms.toString() + ' ms' \n}", "function getTime() {\n\treturn new Date().toUTCString();\n}", "function getTime() {\n var date = new Date();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n return \"(\" +hours + \":\" + minutes + \")\";\n}", "function timeString(num) {\n return (num < 10 ? '0' : '') + num;\n }", "function timeToString(time) {\n let diffInHrs = time / 3600000;\n let hh = Math.floor(diffInHrs);\n\n let diffInMin = (diffInHrs - hh) * 60;\n let mm = Math.floor(diffInMin);\n\n let diffInSec = (diffInMin - mm) * 60;\n let ss = Math.floor(diffInSec);\n\n let diffInMs = (diffInSec - ss) * 100;\n let ms = Math.floor(diffInMs);\n\n let formattedMM = mm.toString().padStart(2, \"0\");\n let formattedSS = ss.toString().padStart(2, \"0\");\n let formattedMS = ms.toString().padStart(2, \"0\");\n\n return `${formattedMM}:${formattedSS}:${formattedMS}`;\n}", "formatTime(time) {\n return (time < 10) ? `0${time}` : time;\n }", "function timeShort() {\n return doFormat(date, {\n hour: 'numeric',\n minute: '2-digit'\n });\n }", "function getTimeString(time, showMillisecond) {\n\tfunction pad10(n) {\n\t\treturn n < 10 ? '0' + n : n;\n\t}\n\tfunction pad100(n) {\n\t\treturn n < 10 ? '00' + n : (n < 100 ? '0' + n : n);\n\t}\n\t\n\treturn pad10(time.getHours()) + \":\" + pad10(time.getMinutes()) + \":\" + pad10(time.getSeconds()) + (showMillisecond ? \".\" + pad100(time.getMilliseconds()) : \"\");\n}", "function time() {\r\n var data = new Date();\r\n var ora = addZero( data.getHours() );\r\n var minuti = addZero( data.getMinutes() );\r\n return orario = ora + ':' + minuti;\r\n }", "function getTime() {\n\t\tvar currentTime = new Date();\n\t\tvar day = getDay(currentTime.getDay());\n\t\tvar month = getMonth(currentTime.getMonth());\n\t\tvar date = currentTime.getDate();\n\t\tvar year = currentTime.getFullYear();\n\n\t\treturn day + \" \" + month + \" \" + date + \" \" + year;\n\n\t\t/*var currentTime = new Date();\n\t\t var hours = currentTime.getHours();\n\t\t var minutes = currentTime.getMinutes();\n\t\t return hours + \":\" + minutes;*/\n\t}", "function timeText() {\n let t = timeTaken();\n t = Math.floor(t / 1000);\n if (t == -1) {\n return \"did not complete\";\n } else {\n let tString = \"\";\n tString = (t % 60) + \" seconds\" + tString;\n t = Math.floor(t / 60);\n tString = (t % 60) + \" minutes \" + tString;\n return tString;\n }\n }", "function timeFormat(time) {\n return time < 10 ? \"0\"+time : time;\n }", "function get_time() {\n let d = new Date();\n if (start_time != 0) {\n d.setTime(Date.now() - start_time);\n } else {\n d.setTime(0);\n }\n return d.getMinutes().toString().padStart(2,\"0\") + \":\" + d.getSeconds().toString().padStart(2,\"0\");\n }", "function getDateTimeString(date, time) {\n return getDateString(date) + 'T' + getTimeString(time);\n }", "function getTime() {\n return new Date().toLocaleTimeString('en-GB', {\n hour: \"numeric\",\n minute: \"numeric\"\n });\n}", "helper(time){\n time = time.toString()\n if(time.length == 1) return `0${time}`\n else return time\n }", "function time_repr(time) {\n var local_time = new Date(time.getTime() + timezone_offset);\n var hrs = local_time.getHours(),\n min = local_time.getMinutes(),\n sec = local_time.getSeconds(),\n converted_tz = timezone_offset / 36;\n\n if(converted_tz < 1000) {\n if(converted_tz < 0) {\n converted_tz = \"-0\" + converted_tz.toString().substring(1);\n }\n else {\n converted_tz = \"0\" + converted_tz.toString();\n }\n }\n\n return (hrs >= 10 ? hrs : \"0\" + hrs.toString()) + \":\"\n + (min >= 10 ? min : \"0\" + min.toString()) + \":\"\n + (sec >= 10 ? sec : \"0\" + sec.toString())\n + \" UTC\" + converted_tz;\n}", "formatTime(time) {\n var sec_num = parseInt(time, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) { hours = \"0\" + hours; }\n if (seconds < 10) { seconds = \"0\" + seconds; }\n return (hours < 1 ? '' : hours + ':') + (minutes < 1 ? '0:' : minutes + ':') + seconds;\n }", "function formatTime(){\r\n var response = \"\",\r\n hours = 0,\r\n mins = 0,\r\n secs = time;\r\n\r\n while (secs >= 60){\r\n secs -= 60;\r\n mins += 1;\r\n }\r\n\r\n while (mins >= 60){\r\n mins -= 60;\r\n hours += 1;\r\n }\r\n\r\n if (secs == 0) {\r\n secs = \"\";\r\n } else if (secs == 1) {\r\n secs += \" second\";\r\n } else if (secs > 1) {\r\n secs += \" seconds\";\r\n }\r\n\r\n if (mins == 0) {\r\n mins = \"\";\r\n } else if (mins == 1) {\r\n mins += \" minute\";\r\n } else if (mins > 1) {\r\n mins += \" minutes\";\r\n }\r\n\r\n if (hours == 0) {\r\n hours = \"\";\r\n } else if (hours == 1) {\r\n hours += \" hour\";\r\n } else if (hours > 1) {\r\n hours += \" hours\";\r\n }\r\n\r\n if (hours != \"\"){\r\n response += hours + \" \";\r\n }\r\n\r\n if (mins != \"\"){\r\n response += mins + \" \";\r\n }\r\n\r\n if (secs != \"\"){\r\n response += secs;\r\n }\r\n\r\n return response;\r\n }", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function formatTime(d){\n\treturn d.toTimeString().split(' ')[0];\n}", "function printTime(){\n var currentTime = new Date();\n var time = currentTime.getHours() + \":\" + currentTime.getMinutes() + \":\" + currentTime.getSeconds();\n return time;\n}", "timeString(hours, minutes) {\n if (hours == 0) {\n return (hours + 12) + \":\" + minutes + \" AM\";\n } else if (hours < 12) {\n return hours + \":\" + minutes + \" AM\";\n } else if (hours == 12) {\n return hours + \":\" + minutes + \" PM\";\n } else {\n return (hours - 12) + \":\" + minutes + \" PM\";\n }\n }", "getTime(){\n var date = new Date();\n var heure= date.getHours().toString(); //l'heure\n var minute= date.getMinutes().toString();//a la minute\n if(heure===\"0\"){\n heure=\"00\";\n }\n if(heure.length===1 && heure!=\"0\"){\n heure=\"0\"+heure;\n }\n if(minute===\"0\"){\n minute=\"00\";\n }\n if(minute.length===1 && minute!=\"0\"){\n minute = \"0\"+minute;\n }\n\n var time = heure+\":\"+minute;\n return time;\n }", "getTime(){\n let hh = new Date().getHours()\n let mm = new Date().getMinutes()\n return `[${this.helper(hh)}:${this.helper(mm)}]`\n }", "function getTime()\n{\n var time = new Date();\n var year = time.getFullYear();\n var month = time.getMonth() + 1;\n var date = time.getDate();\n var hours = time.getHours();\n var minutes = time.getMinutes();\n var seconds = time.getSeconds();\n\t\tvar milisec = time.getMilliseconds();\n\t\t\n\t\treturn year + \"-\" + month + \"-\" + date + \" \" + hours + \":\" + minutes + \":\" + seconds + \".\" + milisec; \n}", "function formatTime(time) {\n if (time > 9) {\n return time;\n } else {\n return \"0\" + time;\n }\n }", "function currentTime() { //returns current time in \"[HH:MM] \" 24hr format (string)\n var d = new Date();\n return '['+d.toTimeString().substr(0,5)+'] ';\n}", "function timerToString(time) {\n let differenceInHours = time / 3600000;\n let hour = Math.floor(differenceInHours);\n \n let differenceInMinutes = (differenceInHours - hour) * 60;\n let minute = Math.floor(differenceInMinutes);\n \n let differenceInSeconds = (differenceInMinutes - minute) * 60;\n let second = Math.floor(differenceInSeconds);\n \n let differenceInMilliseconds = (differenceInSeconds - second) * 100;\n let millisecond = Math.floor(differenceInMilliseconds);\n \n // Here we will format and pad the timer:\n let MINUTE = minute.toString().padStart(2, \"0\");\n let SECOND = second.toString().padStart(2, \"0\");\n let MILLISECOND = millisecond.toString().padStart(2, \"0\");\n \n return `${MINUTE}:${SECOND}:${MILLISECOND}`;\n}", "function getTime() {\n var time = $('#time').val();\n return (time.indexOf(':') == 1 ? '0' + time : time) + ':00';\n }", "function getTime() {\n let date = new Date(),\n min = date.getMinutes(),\n sec = date.getSeconds(),\n hour = date.getHours();\n\n return (\n \"\" +\n (hour < 10 ? \"0\" + hour : hour) +\n \":\" +\n (min < 10 ? \"0\" + min : min) +\n \":\" +\n (sec < 10 ? \"0\" + sec : sec)\n );\n}", "function fetchTime() {\n let time = new Date();\n return time.toLocaleString(\"en-PK\", {\n hour: \"numeric\",\n minute: \"numeric\",\n hour12: true,\n });\n}", "function getTime() {\n let hours = Math.floor(clock.getTime().time / 3600);\n let minutes = Math.floor((clock.getTime().time % 3600) / 60);\n let seconds = Math.floor((clock.getTime().time % 3600) % 60);\n\n if (hours === 0 && minutes === 0) {\n return `${seconds} Seconds`;\n } else if (hours === 0) {\n return `${minutes} ${(minutes === 1) ? \"Minute\" : \"Minutes\"}, ${seconds} ${(seconds === 1 || seconds === 0) ? \"Second\" : \"Seconds\"}`;\n } else {\n return `${hours}:${minutes}:${seconds}`;\n }\n\n}", "function getTime() {\n\ttest = new Date();\n\thour = test.getHours();\n\tminutes = test.getMinutes();\n\tvar suffix = hour >= 12 ? \"pm\":\"am\";\n\thour = ((hour + 11) % 12 + 1);\n\ttime = hour + \":\" + minutes + suffix;\n\treturn time;\n}", "function getTime() {\n\n var currentTime = new Date();\n var hours = currentTime.getHours();\n var minutes = currentTime.getMinutes();\n var amOrPm = (hours > 11 ? 'PM':'AM');\n \n if( hours===0 ) hours = 12;\n else if( hours>12 ) hours = hours - 12;\n\n minutes = ( minutes < 10 ? '0' + minutes : minutes );\n\n return hours + ':' + minutes + amOrPm;\n}", "formatTime(n) {\n if ((n + '').length > 2) {\n\treturn n;\n }\n const padding = new Array(2).join('0');\n return (padding + n).slice(-2);\n }", "function getTime() {\n const date = new Date(); //Create new date object\n\n let hours = date.getHours(); //Get the hours\n let minutes = date.getMinutes(); //Get the minutes\n let seconds = date.getSeconds(); //Get the seconds\n\n\n if (hours < 10) {\n hours = `0${hours}`; //Adds a 0 in front of the hours variable if the hours are before 10:00\n }\n\n if (minutes < 10) {\n minutes = `0${minutes}`; //Adds a 0 in front of the minutes variable if the minutes are before :10\n }\n\n if (seconds < 10) {\n seconds = `0${seconds}`; //Adds a 0 in front of the seconds variable if the secpmds are before ::10\n }\n\n return `${hours}:${minutes}:${seconds}`; //returns time properly formatted HH:MM:SS\n}", "function getCurrentTimeString() {\n const date = new Date();\n return date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();\n}", "function formatTime(time) {\n if (time) {\n return format.niceElapsedTime(time);\n }\n }", "function format_time(departure) {\n var dep_array = departure.split('T');\n var time = dep_array[1];\n return time.substr(0, 5);\n }", "function timestrShort(time) {\r\n time = parseInt (time);\r\n if (time > 86400){\r\n var m = [];\r\n time /= 3600;\r\n m.push (parseInt(time/24));\r\n m.push ('Gün ');\r\n m.push (parseInt(time%24));\r\n m.push ('Saat ');\r\n return m.join (''); \r\n } else\r\n return timestr (time);\r\n}", "function formatTime(time) {\r\n return time < 10 ? `0${time}` : time;\r\n}", "formatTime(time) {\n time = parseInt(time, 10);\n if (time < 10) return '0' + time;\n return time;\n }", "function fancyTimeFormat(time)\r\n\t\t{ \r\n \t\tvar hrs = ~~(time / 3600);\r\n \t\tvar mins = ~~((time % 3600) / 60);\r\n \t\tvar secs = time % 60;\r\n\t\t\tvar ret = \"\";\r\n \t\tif (hrs > 0) {\r\n \tret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\r\n \t\t}\r\n \t\tret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\r\n \t\tret += \"\" + secs;\r\n \t\treturn ret;\r\n\t\t}", "function timeNow() {\n var d = new Date(),\n h = (d.getHours()<10?'0':'') + d.getHours(),\n m = (d.getMinutes()<10?'0':'') + d.getMinutes(),\n s = (d.getSeconds()<10?'0':'') + d.getSeconds();\n return h + ':' + m + ':' + s;\n }", "function timestrShort(time) {\r\n time = parseInt (time);\r\n if (time > 86400){\r\n var m = [];\r\n time /= 3600;\r\n m.push (parseInt(time/24)); \r\n m.push ('d ');\r\n m.push (parseInt(time%24)); \r\n m.push ('h ');\r\n return m.join (''); \r\n } else\r\n return timestr (time);\r\n}", "function timestrShort(time) {\r\n time = parseInt (time);\r\n if (time > 86400){\r\n var m = [];\r\n time /= 3600;\r\n m.push (parseInt(time/24));\r\n m.push ('d ');\r\n m.push (parseInt(time%24));\r\n m.push ('h ');\r\n return m.join (''); \r\n } else\r\n return timestr (time);\r\n}", "function getTimeString(n, isSeconds) {\n \n if (isSeconds) n = Math.ceil(n / 60); ;\n \n var hours = (n < 60) ? 0 : Math.floor(n / 60);\n \n var minutes = n % 60;\n \n hours = hours.toString();\n \n if (hours.length == 1) hours = \"0\" + hours;\n \n minutes = minutes.toString();\n \n if (minutes.length == 1) minutes = \"0\" + minutes;\n \n \n \n return hours + \"h:\" + minutes + \"m\";\n \n }", "getTimeString(milliseconds) {\n let seconds = Math.ceil(milliseconds / 1000);\n let minutes = Math.floor(seconds / 60);\n seconds -= minutes * 60;\n let hours = Math.floor(minutes / 60);\n minutes -= hours * 60;\n \n let output = '';\n if(hours) {\n output += hours + (hours > 1 ? ' hours' : ' hour');\n }\n if(minutes) {\n if(output) {\n output += (seconds ? ', ' : ' and ');\n }\n output += minutes + (minutes > 1 ? ' minutes' : ' minute');\n }\n if(seconds) {\n if(output) output += ' and ';\n output += seconds + (seconds > 1 ? ' seconds' : ' second');\n }\n \n return output;\n\t}", "function d() {\n var a = new Date,\n b = a.getTime(); //get time in MS\n return b = b.toString(), b = b.substr(b.length - 4)\n }", "function stringifiedHour(){\r\n var date=new Date();\r\n var h = date.getHours();\t\r\n var m = date.getMinutes();\t\r\n var s = date.getSeconds();\t\r\n\r\n if(h<10)h=\"0\"+h;\r\n if(m<10)m=\"0\"+m;\r\n if(s<10)s=\"0\"+s;\r\n\r\n return h+\":\"+m+\":\"+s;\t\r\n\r\n}", "function numberToStringTime(numberTime) {\n textTime = numberTime.toString();\n return textTime + \":00\";\n}", "function format_time_output(time) {\n var h = 0; \n var m = 0;\n var s = 0;\n var ms = 0;\n var formated_time;\n\n h = Math.floor( time / (60 * 60 * 1000) );\n time = time % (60 * 60 * 1000);\n m = Math.floor( time / (60 * 1000) );\n time = time % (60 * 1000);\n s = Math.floor( time / 1000 );\n ms = time % 1000;\n\n newTime = pad(h, 2) + ':' + pad(m, 2) + ':' + pad(s, 2) + ':' + pad(ms,3);\n return newTime;\n}", "function nowAsString() {\n return new Date().toISOString().replace(\"T\", \" \").replace(\"Z\",\" \");\n}" ]
[ "0.82413846", "0.7740092", "0.7722576", "0.7689842", "0.7612112", "0.7598986", "0.7584392", "0.75562626", "0.75352097", "0.7532658", "0.7513505", "0.75134856", "0.74821216", "0.74804187", "0.7444703", "0.7435134", "0.7388182", "0.7376904", "0.73646927", "0.73614186", "0.73538023", "0.73471093", "0.734048", "0.73323786", "0.7316444", "0.73038036", "0.7256768", "0.7250688", "0.7247735", "0.72471535", "0.7246881", "0.7241646", "0.7220762", "0.72185236", "0.72170264", "0.72053254", "0.71998405", "0.7197275", "0.71864927", "0.7186344", "0.7182172", "0.71794283", "0.7179376", "0.7159842", "0.7150416", "0.7141851", "0.7136893", "0.71300167", "0.7109701", "0.70990753", "0.70945925", "0.7065333", "0.70609915", "0.70561266", "0.7054178", "0.70481634", "0.703076", "0.70286024", "0.7019231", "0.7006908", "0.7005948", "0.69959766", "0.69924563", "0.69888514", "0.6985249", "0.6984423", "0.6984423", "0.69788903", "0.6972655", "0.6971422", "0.6968813", "0.695096", "0.694854", "0.6940099", "0.69338226", "0.6927931", "0.69122565", "0.6904623", "0.6902403", "0.68892556", "0.6883354", "0.68816614", "0.68686163", "0.68639374", "0.685575", "0.68514395", "0.684684", "0.68453383", "0.6841686", "0.68405735", "0.68385947", "0.6831417", "0.68290836", "0.6828584", "0.6828442", "0.6827974", "0.68233484", "0.68208075", "0.6811755", "0.68114775", "0.6798083" ]
0.0
-1
joins elapsed time and returns seconds
function joinElapsed(elapsedHours, elapsedMinutes, elapsedSeconds) { var h = parseInt(elapsedHours); var m = parseInt(elapsedMinutes); var s = parseInt(elapsedSeconds); var joined = moment.duration(h, 'h'); joined = joined.add(moment.duration(m, 'm')); joined = joined.add(moment.duration(s, 's')); return joined.asSeconds(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seconds_elapsed() {\n var date_now = new Date();\n var time_now = date_now.getTime();\n var time_diff = time_now - startTime;\n var seconds_elapsed = Math.floor(time_diff / 1000);\n return (seconds_elapsed);\n}", "function timeElapsed(){\n\tvar h = Math.floor(sec_elapsed / 3600);\n\tvar m = Math.floor(sec_elapsed / 60);\n\tvar s = sec_elapsed - (m*60);\n\t\n\tif(h<10){\n\t\th = '0' + h;\n\t}\n\tif(m<10){\n\t\tm = '0' + m;\n\t}\n\tif(s<10){\n\t\ts = '0' + s;\n\t}\t\n\t\n\treturn h + ':' + m + ':' + s;\n}", "function timeElapsed(){\n var startTime = startTable.rows.item(1).cells.item(0).innerHTML;\n var stopTime = stopTable.rows.item(1).cells.item(0).innerHTML;\n var startTimeString = startTime.toString();\n var stopTimeString = stopTime.toString();\n var startHours = startTimeString.slice(0,2);\n var startMinutes = startTimeString.slice(3,5);\n var startSeconds = startTimeString.slice(6);\n var stopHours = stopTimeString.slice(0,2);\n var stopMinutes = stopTimeString.slice(3,5);\n var stopSeconds = stopTimeString.slice(6);\n var startTimeinSec = (Number.parseInt(startHours) * 3600) + (Number.parseInt(startMinutes) * 60) + Number.parseInt(startSeconds);\n var stopTimeinSec = (Number.parseInt(stopHours) * 3600) + (Number.parseInt(stopMinutes) * 60) + Number.parseInt(stopSeconds);\n totalTimeElapsed = Math.abs(stopTimeinSec - startTimeinSec) + \" \" + \"seconds\";\n}", "function get_elapsed_time(start_time) {\n\tnow = new Date();\n\treturn (now.getTime() - start_time) / 1000;\n}", "elapsed( seconds ) {\n seconds = parseInt( seconds ) || 0;\n if ( !seconds ) return '0s';\n\n let out = [], list = [];\n list.push( [ 'M', Math.floor( seconds / 2419200 ) ] );\n list.push( [ 'w', Math.floor( seconds / 604800 % 4 ) ] );\n list.push( [ 'd', Math.floor( seconds / 86400 % 7 ) ] );\n list.push( [ 'h', Math.floor( seconds / 3600 % 24 ) ] );\n list.push( [ 'm', Math.floor( seconds / 60 % 60 ) ] );;\n list.push( [ 's', Math.floor( seconds % 60 ) ] );\n list.forEach( arr => {\n let [ letter, time ] = arr;\n if ( time ) out.push( time + letter );\n });\n return out.join( ' ' );\n }", "seconds(prevTime, curTime){\n let time = curTime - prevTime;\n let seconds = time/1000;\n return seconds.toFixed(2);\n}", "function getTimeElapsed(){\n var t = Date.parse(new Date()) - initTime;\n var seconds = Math.floor( (t/1000) % 60 );\n var minutes = Math.floor( (t/1000/60) % 60 );\n var hours = Math.floor( (t/(1000*60*60)) % 24 );\n return{seconds, minutes, hours}\n\n}", "function getTimeElapsed() {\n return now() - _roundTimeStamp;\n }", "function getTimeDiff(first, second){\n\treturn Math.round((second-first)/(60*60*1000));\n}", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "function MilliSecondsElapsed()\r\n{\r\n\toTimeNow = new Date();\r\n\treturn (oTimeNow - ACROSDK.oTimeStart);\r\n}", "function timeSeconds() {\n return timeMS() / 1000;\n}", "function elapsedTime(start, end) {\n start = new Date(start);\n end = new Date(end);\n\n var timeDiff = end - start,\n seconds, minutes, hours; \n\n timeDiff = Math.floor(timeDiff / 1000);\n seconds = Math.round(timeDiff % 60);\n\n timeDiff = Math.floor(timeDiff / 60);\n minutes = Math.round(timeDiff % 60);\n\n timeDiff = Math.floor(timeDiff / 60);\n hours = Math.round(timeDiff % 24);\n \n return {hours:hours, minutes:minutes, seconds:seconds};\n}", "function getTimeSecs()\n{\n return (new Date()).getTime() / 1000;\n}", "function getTotalSeconds(time) {\n var parts = time.split(':');\n return ((parseInt(parts[0]) * 60) + parseInt(parts[1]));\n }", "function calculateGameTime() {\n var d = new Date();\n endTime = d.getTime();\n\n var elapsedTime = endTime - startTime;\n\n metrics.set(\"elapsedTime\", elapsedTime);\n}", "function sec2hms(diff) {\n var str = \"\";\n var hours = parseInt( diff / 3600 ) % 24;\n var minutes = parseInt( diff / 60 ) % 60;\n var seconds = diff % 60;\n if (hours) str += pad(hours)+\":\";\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function elapsed(start) {\n\t\treturn now() - start;\n\t}", "function Common_GetElapsedTime(previousTime)\n{\n\t//get time difference\n\treturn new Date().getTime() - previousTime;\n}", "function msToSec(time) {\n\t return time / 1000;\n\t}", "function charsec(time, text) {\r\n for (let i = 0; i < time.length - 1; i++) {\r\n let duration = (time[i + 1] - time[i]) / 1000;\r\n let diff = duration / text[i].length;\r\n Sub.charsec.push(diff);\r\n // sLog(diff);\r\n }\r\n let temp = Sub.charsec;\r\n sLog(temp, \"st\");\r\n}", "getElapsedTime() {\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\t}", "function calculateDuration() {\n return endTime - startTime;\n }", "getUnits() {\n const seconds = this.props.timeElapsed / 1000;\n var hr = Math.floor(seconds / 3600).toString();\n var min = Math.floor(seconds / 60).toString();\n var sec = Math.floor(seconds % 60).toString();\n var msec = (seconds % 1).toFixed(2).substring(2);\n \n return this.formatTime(hr) + \":\" + this.formatTime(min) + \":\" + this.formatTime(sec) + \".\" + msec;\n }", "function o(a,c){return b.duration({days:a.clone().stripTime().diff(c.clone().stripTime(),\"days\"),ms:a.time()-c.time()})}", "function CalculateTime(){\n now = Date.now();\n deltaTime = (now - lastUpdate) / 1000;\n lastUpdate = now;\n}", "function getSeconds() {\n const [ seconds, nanoseconds ] = process.hrtime();\n return seconds + nanoseconds / 1000000000;\n}", "function sec2hms(diff) {\n var str = \"\";\n var hours = Math.max(0, parseInt( diff / 3600 ) % 24);\n var minutes = Math.max(0, parseInt( diff / 60 ) % 60);\n var seconds = diff % 60;\n if (hours) {\n str += pad(hours)+\":\";\n }\n return str+pad(minutes)+\":\"+pad(seconds);\n}", "function ms_seconds(x){ return x / 1000;}", "function timeElapsed() {\n timer.textContent = `Timer: ${seconds}`;\n seconds++;\n }", "function msToSec(time) {\n return time / 1000;\n}", "function msToSec(time) {\n return time / 1000;\n }", "get elapsedTime() {\n return this._t;\n }", "function calculateDuration() {\n return endTime - startTime;\n }", "function msToSec(time) {\n return time / 1000;\n}", "updateTime() {\n\t\tlet now = new Date().getTime();\n\t\tlet x = now - this.startTime;\n\t\tlet time = moment.duration(x);\n\t\tthis.elapsedTime = clc.xterm(242)(time.hours() + 'h ') + clc.xterm(242)(time.minutes() + 'm ') + clc.xterm(242)(time.seconds() + 's');\n\t}", "function sc_time(proc) {\n var start = sc_currentMicroseconds();\n var res = proc();\n var stop = sc_currentMicroseconds();\n\n return sc_values( res, stop - start, 0, 0 );\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n }", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n }", "function calculateTime() {\n displayTime(Date.now() - startTime);\n}", "function utregningTid() {\n spentMilliseconds = Math.floor(finishTime - startTime);\n //spentSeconds = spentMilliseconds / 1000;?\n totalTider.push(spentMilliseconds);\n total = totalTider.reduce((a, b) => a + b, 0);\n snitt = total / totalTider.length;\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n }", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function getElapsed(createdAt, elapsed) {\n\t\tvar elapsedTime = moment(createdAt).add(elapsed,'seconds').format('X');\n\t\tvar initTime = moment(createdAt).format('X');\n\t\tvar delta = elapsedTime - initTime;\n\t\tdelta = moment.duration(delta, \"s\");\n\t\tvar duration = delta.hours() + ':' + delta.minutes() + ':' + delta.seconds();\n\t\t\n\t\treturn duration;\n\t}", "function elapsedTime(time_created) {\n var curr_time = new Date();\n var diff_in_sec = Math.ceil((curr_time - time_created) / 1000);\n \n if (diff_in_sec > 59) {\n var diff_in_min = Math.ceil(diff_in_sec / 59);\n if (diff_in_min > 59) {\n var diff_in_hrs = Math.ceil(diff_in_min / 59);\n if (diff_in_hrs > 24) {\n var diff_in_days = Math.ceil(diff_in_hrs / 24);\n return format_time(diff_in_days, \"day\");\n }\n else {\n return format_time(diff_in_hrs, \"hour\");\n }\n }\n else {\n return format_time(diff_in_min, \"min\");\n }\n }\n else {\n return format_time(diff_in_sec, \"sec\");\n }\n}", "function timeTaken() {\n let t = -1;\n for (let i = 0; i < result.length; i++) {\n if (result[i].time > t) {\n t = result[i].time;\n }\n }\n\n return t;\n }", "function getCurTime(){\n var curTime = new Date();\n return ((curTime.getTime() - experimentData.startTime.getTime())/1000)/60;\n}", "function timeRun() {\n return ((new Date()).getTime() - START_TIME)/1000;\n}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function hrtime(previousTimestamp){\n\t var clocktime = performanceNow.call(performance$1)*1e-3;\n\t var seconds = Math.floor(clocktime);\n\t var nanoseconds = Math.floor((clocktime%1)*1e9);\n\t if (previousTimestamp) {\n\t seconds = seconds - previousTimestamp[0];\n\t nanoseconds = nanoseconds - previousTimestamp[1];\n\t if (nanoseconds<0) {\n\t seconds--;\n\t nanoseconds += 1e9;\n\t }\n\t }\n\t return [seconds,nanoseconds]\n\t}", "function getSecondsTime(duration) {\n if(typeof duration === \"number\") return duration;\n if(typeof duration !== \"string\") return 0;\n\n duration = duration.split(\":\");\n let time = 0;\n\n if(duration.length === 2) {\n time += Number(duration[0]) * 60;\n time += Number(duration[1]);\n } else if(duration.length === 3) {\n time += Number(duration[0]) * 3600;\n time += Number(duration[1]) * 60;\n time += Number(duration[2]);\n }\n\n return time;\n}", "calculateTiming(grossTimeMS, humanReadableTimeElapsed, tests) {\n const netTimeMS = tests.reduce((total, test) => total + test.timeSpentMs, 0);\n const overheadTimeMS = grossTimeMS - netTimeMS;\n return {\n net: netTimeMS,\n overhead: overheadTimeMS < 0 ? 0 : overheadTimeMS,\n humanReadableTimeElapsed,\n };\n }", "function getFormattedSeconds() {\n var secondsLeft = (totalSeconds - secondsElapsed) % 60;\n var formattedSeconds;\n \n if (secondsLeft < 10) {\n formattedSeconds = \"0\" + secondsLeft;\n } else {\n formattedSeconds = secondsLeft;\n }\n\n return formattedSeconds;\n}", "function dateDifferenceSeconds(date1, date2) {\r\n return dateDifferenceMillis(date1, date2) / 1000;\r\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}", "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "function timeToSeconds (time) {\n\t// Break into array by ':'\n\ttime = time.split (\":\");\n\t\n\tvar seconds = 0;\n\t\n\t// Add seconds\n\tseconds += parseInt (time[time.length-1]);\n\t\t\t\n\t// Multiply minutes\n\tseconds += parseInt (time[time.length-2] * 60);\n\t\n\t// Multiply hours if they exist\n\tif (time[time.length-3] !== undefined) {\n\t\tseconds += parseInt (time[time.length-3] * 3600);\n\t}\n\t\n\treturn seconds;\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function Time(){\r\n\t\tvar stop = new Date();\r\n\t\tvar s = stop.getSeconds();\r\n\t\tvar tim = (n - s);\r\n\r\n\t\tDuration = \"Number Of Moves Made : \" +MOVES + \"Time Taken : \" +tim + \"seconds\";\r\n\t}", "diff () {\n if (this.stopped.length === 0) {\n throw new Error('Timer has not been stopped.')\n }\n\n return this.stopped[0] * 1e9 + this.stopped[1]\n }", "function calculateTime(diff) {\n\tvar x = diff;\n\tvar days, hours, minutes, seconds; \n\tvar output = \"\";\n\n\tif (x >= 86400000) {\n\t\tdays = Math.floor(x/86400000);\n\t\tif (days > 1) { \n\t\t\toutput += days + \" days, \"; \n\t\t} else { output += days + \" day, \"; };\n\t\tx = x%86400000;\n\t\tif (x < 1000) { output = output.substring(0, output.length - 2) + \" and \"; };\n\t};\n\tif (x >= 3600000) {\n\t\thours = Math.floor(x/3600000);\n\t\tif (hours > 1) { \n\t\t\toutput += hours + \" hours, \"; \n\t\t} else { output += hours + \" hour, \"; };\n\t\tx = x%3600000;\n\t\tif (x < 1000) { output = output.substring(0, output.length - 2) + \" and \"; };\n\t};\n\tif (x >= 60000) {\n\t\tminutes = Math.floor(x/60000);\n\t\tif (minutes > 1) { \n\t\t\toutput += minutes + \" minutes and \"; \n\t\t} else { output += minutes + \" minute and \"; };\n\t\tx = x%60000;\n\t};\n\n\tseconds = x/1000;\n\toutput += seconds + \" seconds\";\n\treturn output;\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance$1)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance$1)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance$1)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance$1)*1e-3;\n var seconds = Math.floor(clocktime);\n var nanoseconds = Math.floor((clocktime%1)*1e9);\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds<0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n return [seconds,nanoseconds]\n}", "static getTimeInMs() {\n let seconds;\n let nanoseconds;\n [seconds, nanoseconds] = process.hrtime();\n return seconds * 1000 + nanoseconds / 1000000;\n }", "function getSecondsBetween(date_1, date_2) {\n\t\t\t\treturn ((date_1.clone().valueOf() - date_2.clone().valueOf()) / 1000) | 0;\n\t\t\t}", "function statistics() {\n var time = Date.now() - startTime - pauseTime;\n var seconds = (time / 1000 % 60).toFixed(2);\n var minutes = ~~(time / 60000);\n statsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n (seconds < 10 ? ':0' : ':') + seconds;\n}", "calculateSeconds() {\n const millisecondsToSeconds = 0.001;\n let totalmilliseconds = Date.now() - this.birthday.getTime();\n this.secondsCount = totalmilliseconds * millisecondsToSeconds;\n\n return this.secondsCount;\n }", "function getTime(startTime){\n endTime = new Date();\n return (endTime-startTime)/1000;\n }", "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "function getExperimentTime(){\n var curTime = new Date();\n return ((curTime.getTime() - experimentData.startTime.getTime())/1000);\n}", "function calcTimes () {\n //1min = 60*100centiseconds=6000centiseconds\n timeMin = Math.floor(timeCounter/6000);\n // 1 sec = 100 centiseconds\n timeSec = Math.floor((timeCounter%6000)/100);\n // \n timeCentSec = (timeCounter%6000)%100;\n \n $('#timerminute').text(format(timeMin));\n $('#timersecond').text(format(timeSec));\n $('#timercentisecond').text(format(timeCentSec));\n \n //1min=60*100centiseconds=6000centiseconds\n lapMin = Math.floor(lapCounter/6000);\n //1sec=100centiseconds\n lapSec = Math.floor((lapCounter%6000)/100);\n lapCentsec = (lapCounter%6000)%100;\n $(\"#lapminute\").text(format(lapMin));\n $(\"#lapsecond\").text(format(lapSec));\n $(\"#lapcentisecond\").text(format(lapCentsec));\n }", "function timeToSeconds(time) {\n //console.log(time);\n time = time.split(/:/);\n return time[0] * 3600 + time[1] * 60;\n}", "function timeText() {\n let t = timeTaken();\n t = Math.floor(t / 1000);\n if (t == -1) {\n return \"did not complete\";\n } else {\n let tString = \"\";\n tString = (t % 60) + \" seconds\" + tString;\n t = Math.floor(t / 60);\n tString = (t % 60) + \" minutes \" + tString;\n return tString;\n }\n }", "_getTime () {\r\n return (Date.now() - this._startTime) / 1000\r\n }", "getTime() {\n return this.startTime ? Math.floor((Date.now() - this.startTime) / 1000) : 0;\n }", "updateTimer() {\n var currentTime = new Date();\n var timeDifference = this.startTime.getTime() - currentTime.getTime();\n\n this.timeElapsed = Math.abs(timeDifference / 1000);\n\n var timeRemaining = this.totalTime - this.timeElapsed;\n\n var seconds = Math.floor(timeRemaining);\n\n var result = (seconds < 10) ? \"\" + seconds : \"\" + seconds;\n\n if (result >= 0){\n this.timeLabel.text = result;\n }\n }", "function calculateElapsedTime(instagramTime)\r\n{\r\n var msPerMinute = 60 * 1000;\r\n var msPerHour = msPerMinute * 60;\r\n var msPerDay = msPerHour * 24;\r\n var msPerMonth = msPerDay * 30;\r\n var msPerYear = msPerDay * 365;\r\n\r\n var currentTime = new Date().getTime();\r\n var time = new Date(instagramTime * 1000);\r\n var elapsed = currentTime - time;\r\n\r\n if (elapsed < msPerMinute) {\r\n return Math.round(elapsed/1000) + 's';\r\n }\r\n\r\n else if (elapsed < msPerHour) {\r\n return Math.round(elapsed/msPerMinute) + 'm';\r\n }\r\n\r\n else if (elapsed < msPerDay ) {\r\n return Math.round(elapsed/msPerHour ) + 'h';\r\n }\r\n\r\n else if (elapsed < msPerMonth) {\r\n return Math.round(elapsed/msPerDay) + 'd';\r\n }\r\n\r\n else if (elapsed < msPerYear) {\r\n return (Math.round(elapsed/msPerMonth)*4) + 'w';\r\n }\r\n\r\n else {\r\n return Math.round(elapsed/msPerYear ) + 'y';\r\n }\r\n}", "function getElapsedTime (dates = {}) {\n const { startDate, endDate } = { startDate: new Date(), ...dates }\n const elapsedTime = Date.parse(endDate) - Date.parse(startDate)\n\n return {\n time: elapsedTime,\n seconds: Math.floor((elapsedTime / (1000)) % 60),\n minutes: Math.floor((elapsedTime / (1000 * 60)) % 60),\n hours: Math.floor((elapsedTime / (1000 * 60 * 60)) % 24),\n days: Math.floor((elapsedTime / (1000 * 60 * 60 * 24))),\n }\n}", "getSecondsAtTime(time) {\n return this._clock.getSecondsAtTime(time);\n }" ]
[ "0.73675424", "0.7313149", "0.7118391", "0.6913448", "0.6837171", "0.67343444", "0.64772594", "0.64548427", "0.63994884", "0.63948196", "0.63704854", "0.634836", "0.6327369", "0.6316579", "0.63108796", "0.62390286", "0.6205545", "0.6186461", "0.617995", "0.6159959", "0.61380714", "0.6137977", "0.61347055", "0.6127011", "0.612576", "0.61253923", "0.61165833", "0.6077212", "0.60745883", "0.6071479", "0.6043516", "0.60427207", "0.6020675", "0.6012604", "0.60016125", "0.59942406", "0.5993683", "0.59848607", "0.59848607", "0.59713775", "0.59694296", "0.5968237", "0.59546953", "0.59546953", "0.59546953", "0.5922168", "0.5910385", "0.59064376", "0.5902251", "0.5895791", "0.5893729", "0.5893729", "0.5893729", "0.5893729", "0.5893729", "0.5893729", "0.58838624", "0.5879627", "0.58725697", "0.5865872", "0.5853799", "0.584883", "0.584883", "0.5848772", "0.5834136", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.582511", "0.5813317", "0.5813103", "0.5811203", "0.5808033", "0.5808033", "0.5808033", "0.5808033", "0.58068913", "0.5805133", "0.5795198", "0.57927823", "0.5788746", "0.5775001", "0.5775001", "0.57647055", "0.57635975", "0.57601947", "0.5741052", "0.57319635", "0.5727594", "0.5717999", "0.57113785", "0.5708662", "0.5704433" ]
0.6775952
5
manages data and sends add POST
function addTodo(form) { var name = form.find('#inputTitle').val(), priority = form.find('#inputPriority').val(), finishDate = form.find('#inputFinishDate').val(), finishTime = form.find('#inputFinishTime').val().split(':'), details = form.find('#inputDetails').val(); var finishAt = moment(finishDate, 'D MMM, YYYY'); finishAt = finishAt.add(finishTime[0], 'hours').add(finishTime[1], 'minutes'); var json = { "title": name, "priority": priority, "details": details, "createdAt": moment().format(), "elapsedTime": 0, "finishAt": finishAt, "isComplete": false }; $.post( '/api/add', JSON.stringify(json) ).done(function(data) { location.reload(); }).fail(function(error) { console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAdd() {\n const { opps, formData } = this.state\n // Optimistic update\n this.teardownForm()\n this.setState({\n opps: opps.slice().concat([formData])\n })\n\n // Update server\n xhr({\n url: '/api/opps',\n method: 'POST',\n json: formData,\n }, (err, res) => {\n if (err || res.statusCode !== 201) {\n // Rollback if error\n return this.setState({opps})\n }\n\n // Sync client and server\n return this.setState({\n opps: res.body.opps\n })\n })\n }", "handleAdd() {\n\t\t// pega o valor atual do description\n\t\tconst description = this.state.description\n\t\t// chamada de conexao com API (URL)\n\t\t// usando metodo post (inclui dados) em conexao com o banco (URL)\n\t\taxios.post(URL, { description })\n\t\t\t// sempre que insere um novo item na lista, ele chama o metodo refresh para atualizar.\n\t\t\t.then(resp => this.refresh())\n\t\t\t// o axio é baseado em \"promise\", por isso o metodo .then\n\t}", "storeAdd(params) {\n \n }", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "function addNewTag () {\n const name = document.getElementById('nm').value\n const desc = document.getElementById('desc').value\n if(name && desc) {\n fetch(\"http://localhost:3001/api/tags/add\", {\n method : 'POST',\n headers : {\n 'Content-Type' : 'application/json',\n 'Authorization' : 'Bearer ' + token\n },\n body : JSON.stringify({\n name : name,\n desc : desc\n })\n }).then(res => {\n resetInputs()\n renderTags()\n })\n toast.success(\"Les Informations Sont Bien Insérer\", {\n position : \"bottom-right\"\n })\n } else {\n toast.warning(\"Remplir les Inputs SVP !!!\", {\n position: \"bottom-right\"\n })\n }\n renderTags()\n }", "handleAdd() {\n\t\tconsole.log(\"this.data1\", this.data);\n\t\tconsole.log(\"studentname\", studentName);\n\n\t\tvar studentName = $(this.elementConfig.nameInput).val();\n\t\tvar courseName = $(this.elementConfig.courseInput).val();\n\t\tvar gradeVal = $(this.elementConfig.gradeInput).val();\n\t\tvar studentID = null;\n\n\t\tthis.createStudent(studentName, courseName , gradeVal, studentID);\n\t\tthis.addStudentToServer(studentName, courseName , gradeVal);\n\t\tthis.clearInputs();\n\n\t\tconsole.log(\"this.data2\", this.data);\n\t\t\n\n\t}", "function addData(e) {\n // prevent default - we don't want the form to submit in the conventional way\n e.preventDefault();\n\n // grab the values entered into the form fields and store them in an object ready for being inserted into the DB\n let newItem = { title: titleInput.value, body: bodyInput.value };\n\n // open a read/write db transaction, ready for adding the data\n let transaction = db.transaction(['notes_os'], 'readwrite');\n\n // call an object store that's already been added to the database\n let objectStore = transaction.objectStore('notes_os');\n\n // Make a request to add our newItem object to the object store\n let request = objectStore.add(newItem);\n request.onsuccess = function() {\n // Clear the form, ready for adding the next entry\n titleInput.value = '';\n bodyInput.value = '';\n };\n\n // Report on the success of the transaction completing, when everything is done\n transaction.oncomplete = function() {\n console.log('Transaction completed: database modification finished.');\n\n // update the display of data to show the newly added item, by running displayData() again.\n displayData();\n };\n\n transaction.onerror = function() {\n console.log('Transaction not opened due to error');\n };\n}", "handleServerItemAdd(addItem) {\n //作POST\n fetch(`${severUrl}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(addItem)\n })\n .then(response => {\n //ok 代表狀態碼在範圍 200-299\n if (!response.ok) throw new Error(response.statusText);\n return response.json();\n })\n .then(item => {\n //這裡可以顯示一些訊息,或是結束指示動畫…\n this.handleServerItemsLoad();\n });\n }", "add(name, surname, id, gender, drivers_license, contact_number, address, vehicle_make, vehicle_series_name, license_plate, colour, year) {\n\t\tconsole.log('Sending',name, surname, id, gender, drivers_license, contact_number, address, vehicle_make, vehicle_series_name, license_plate, colour, year)\n\t\treturn $.ajax({\n\t\ttype: 'PUT',\n\t\turl: `${apiUrl}/entries`,\n\t\tcontentType: 'application/json; charset=utf-8',\n\t\tdata: JSON.stringify({\n \tname,\n\t\t\tsurname,\n\t\t\tid,\n\t\t\tgender,\n\t\t\tdrivers_license,\n\t\t\tcontact_number,\n\t\t\taddress, vehicle_make,\n\t\t\tvehicle_series_name,\n\t\t\tlicense_plate,\n\t\t\tcolour, \n\t\t\tyear,\n\t\t\t}),\n\t\t\tdataType: 'json',\n });\n}", "function doAdd() {\n try {\n var content = $(\"#note\").val();\n $(\"#note\").val('');\n var xhr1 = Titanium.Network.createHTTPClient();\n var done = false;\n xhr1.onreadystatechange = function() {\n try {\n if (this.readyState == 4 && !done) {\n done = true;\n doIndex();\n \t\t\t}\n }\n catch(e) {\n Titanium.API.debug(e);\n }\n };\n xhr1.open(services.create.method,services.create.getUrl()+\"?note[content]=\"+encodeURI(content));\n xhr1.send();\n }\n catch (e) {\n Titanium.API.debug(e);\n }\n }", "function addNewEntry() {\n \n $('.add').on('click', function(event){\n event.preventDefault();\n\t\t\n const activity = $('#new_activity').val();\n $('#new_activity').val('');\n const distanceCovered = $('#new_distance').val();\n\t\t$('#new_distance').val('');\n const timeElapsed = $('#new_time').val()\n $('#new_time').val('')\n const location = $('#new_location').val()\n $('#new_location').val('')\n const comment = $('#new_comment').val()\n $('#new_comment').val('')\n\t\t\n let data = {activity, distanceCovered, timeElapsed, location, comment};\n\t\t console.log(data.activity, data.timeElapsed);\n if (data.activity === '' || data.timeElapsed === '' || data.location === '') {\n \n\t\t\t $('.errorMsg3').show();\n\t\t }\n else {\t\t \n\t\t \n\t\t\t\t\n let settings = {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: {\n \"Authorization\" : \"Bearer \" + token,\n \"Content-Type\": \"application/json\"\n }\n \n };\n fetch('/sports/create', settings)\n .then(response => {\n if (response.ok){\n return response.json();\n }\n\t\t else{\n throw new Error(\"You need to be authenticated\");\n }\n })\n .then(responseJson => {\n\t\t\t\t addLoadPage();\n\t \n })\n\t\t\t \n .catch(err => { \n\t\t\t $('.errorMsg3').show();\n\t\n });\n\t\t }\n\t\t\t\n })\n }", "function sendData(e) {\n e.preventDefault();\n\n //createing an unique ID\n let inventoryID = category.toUpperCase() + Date.now();\n \n const newItem = {\n inventoryID, name, model, sku, category, supplier, description, mesurement, quantity, restock_level, original_price, date\n }\n\n axios.post(\" http://localhost:5000/inventory/add\", newItem).then(() => {\n\n window.location = \"/inventory-manager\"\n\n }).catch((e) => {\n alert(\"error\");\n })\n\n }", "add(form_data, success_callback, failure_callback) {\n var url = \"/global/str/work/order/add\";\n return WebClient.basicPost(\n form_data,\n url,\n success => {\n success.data.work_order = new EliteAPI.Models.STR.WorkOrder(success.data.work_order);\n if (success_callback) success_callback(success);\n },\n failure_callback\n );\n }", "function post() {\n\tvar p_name = document.getElementsByName(\"product\")[0].value;\n\tvar p_price = document.getElementsByName(\"price\")[0].value;\n\tvar p_description = document.getElementsByName(\"description\")[0].value;\n\tvar result_area = document.getElementById(\"post_result\");\n\tif(p_name == \"\" || p_price == null || p_description == \"\") {\n\t\talert(\"Fields missing\");\n\t\treturn;\n\t}\n\t\n\tconst data = JSON.stringify({\n\t\tname: p_name,\n\t\tprice: p_price,\n\t\tdescription: p_description,\n\t\tsellerID: user.id\n\t});\n\tconst uri = getLink(\"AddProduct\");\n\tvar xhr = createRequest(\"POST\", uri);\n\txhr.onload = function() {\n\t\tif(xhr.status == 400) alert(\"Invalid parameters\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong on the server :/\");\n\t\telse {\n\t\t\tlocalStorage.setItem(\"products\", xhr.response);\n\t\t\tproducts.push(JSON.parse(xhr.response));\n\t\t\tsetUserItems();\n\t\t\tdocument.getElementsByName(\"product\")[0].value = \"\";\n\t\t\tdocument.getElementsByName(\"price\")[0].value = \"\";\n\t\t\tdocument.getElementsByName(\"description\")[0].value = \"\";\n\t\t}\n\t}\n\txhr.send(data);\n}", "add(form_data, success_callback, failure_callback) {\n let url = '/global/str/order/add';\n return WebClient.basicPost(form_data, url, success_callback, failure_callback);\n }", "function addToData(worksetid) {\n addid(worksetid);\n var wsResponse;\n\n function wsListener () {\n wsResponse = JSON.parse(this.responseText);\n wsResponse.forEach(function (d) { \n ldinjs.createDataObject(d.value,d.id);\n });\n ldinjs.markupSearch();\n } \n\n var oReq = new XMLHttpRequest();\n oReq.open(\"POST\", \"/worksets/items\", true);\n oReq.addEventListener(\"load\", wsListener);\n oReq.setRequestHeader(\"Content-type\", \"application/json\");\n oReq.send(JSON.stringify({'id': worksetid}));\n }", "function indivAdd() {\n \n if (selfRequest) {\n userFirst = respFirst;\n userLast = respLast;\n userEmail = respEmail;\n userOrg = respOrg;\n } else {\n userFirst = e.namedValues['User First Name'][0];\n userLast = e.namedValues['User Last Name'][0];\n userEmail = e.namedValues['User Email Address'][0];\n userOrg = e.namedValues['Organization Name'][0];\n }\n \n //check if the submission is a duplicate\n checkIndivDupe();\n \n //if the submission is not a duplicate, then...\n if (!isIndivDupe) {\n //save user information in two-dimensional array\n rawData = [ [], [userFirst, userLast, userEmail, userOrg]];\n //and store the number of users in the submission\n submitUsers = 1;\n }\n\n }", "add(form_data, success_callback, failure_callback, async = true) {\n let url = \"/global/str/product/add\";\n return WebClient.basicPost(\n form_data,\n url,\n success => {\n success.data.product = new EliteAPI.Models.STR.Product(success.data.product);\n if (success_callback) success_callback(success);\n },\n failure_callback,\n async\n );\n }", "'click .add'(e, t) {\n \t\te.preventDefault();\n\n \t/*-------------- Get the value of form elements ---------*/ \n\n \t\tvar fname = t.find('#fname').value;\n \t\tvar lname = t.find('#lname').value;\n \t\tvar email = t.find('#email').value;\n \t\tvar address = t.find('#address').value;\n\n \t/*------------ Call insertRecord method -------------*/\n\n\t\tMeteor.call(\"insertRecord\", fname, lname, email, address);\n \t}", "function processAdd(req, plus, oauth2Client, res) {\n if (req.body.description.length <= 0) {\n console.log('Empty string for a description.');\n res.send('Need a description', 400);\n } else {\n gplus.getDatabaseUserWithPermission(pool, plus, oauth2Client, \"can_add=1\", function(err, gp_user, db_user) {\n if (err != null) {\n res.send(err.message, err.code)\n } else {\n console.log(\"Found a whitelisted user!\");\n console.log(gp_user.displayName + \", \" + gp_user.id);\n\n var query = 'insert into tasks (ordering,description) SELECT 1 + coalesce((SELECT max(ordering)' +\n ' FROM tasks),0), ' + pool.escape(req.body.description) + ';';\n pool.query(query, function(err, info, fields) {\n if (err) {\n console.log('error insert: ' + err);\n res.send('Invalid insertion query', 500);\n } else {\n console.log(info.insertId);\n console.log(\"Submission complete!\");\n res.send({taskId : info.insertId, \n description : req.body.description}, 200);\n }\n });\n }\n });\n }\n}", "function warehouse_create_post(req, res) {\n const warehouseList = JSON.parse(fs.readFileSync(warehouseFile));\n console.log(req);\n const newObject = req.body;\n warehouseList.push(newObject);\n fs.writeFileSync(warehouseFile, JSON.stringify(warehouseList));\n //OPTIONAL RESPONSE\n res.send(newObject);\n}", "async function add(data) {\n // prepare the request body\n const body = {\n header: {\n created: Math.floor(Date.now() / 1000),\n auth_handle: APP_HANDLE,\n user_handle: data.userHandle\n },\n }\n\n // imitates retrieving the entity's private key from your KMS\n const entityInfo = await readFile(`./${data.userHandle}.info.json`, 'utf8')\n const parsedEntityInfo = JSON.parse(entityInfo);\n const encryptedPrivateKey = parsedEntityInfo.USER_PRIVATE_KEY;\n const ENTITY_PRIVATE_KEY = decryptPrivateKey(encryptedPrivateKey);\n\n if(!ENTITY_PRIVATE_KEY) return new Error('No user found');\n\n // add all included fields to the body, to avoid including empty strings\n for(const key of Object.keys(data.updateBody)) {\n body[key] = data.updateBody[key];\n }\n\n // generate authorization headers\n const authSignature = signMessage(APP_PRIVATE_KEY, body);\n const userSignature = signMessage(ENTITY_PRIVATE_KEY, body);\n\n const headers = {\n authsignature: authSignature,\n usersignature: userSignature\n }\n\n // build the request url\n const url = SILA_URLS.ADD + data.type;\n\n // request update\n try {\n return await axios({\n method: 'post',\n url: url,\n headers: headers,\n data: body,\n validateStatus: () => { return true }\n });\n } catch(error) {\n console.log('error: ', error);\n return error;\n }\n}", "async create_post(req,res){\n\t\ttry{\n\t\t\tconst required = {\n\t\t\t\tsecurity_key:req.headers.security_key,\n\t\t\t\tauthorization_key:req.headers.authorization_key,\n\t\t\t\tdata:req.body,\n\t\t\t\tcheckexist:2\n\t\t\t}\t\n\t\t\tconst non_required= {}\n\t\t\tlet requestdata = await App.vaildObject(required,non_required);\n\t\t\tlet total_price=0;\n\t\t\tfor(let price in requestdata.data.product_details){\n\t\t\t\tif(requestdata.data.product_details[price].amount){\n\t\t\t\t\ttotal_price+=requestdata.data.product_details[price].amount;\n\t\t\t\t}else{\n\t\t\t\t\tlet message=\"Amount filed is missing product_details at position \"+JSON.stringify(requestdata.data.product_details[price]);\n\t\t\t\t\tthrow {code:400,message};\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet complete_data={\n\t\t\t\taddresses:requestdata.data.address,\n\t\t\t\tproduct_details:requestdata.data.product_details,\n\t\t\t\tuser_id:requestdata.users.id,\n\t\t\t\tamount:total_price\n\t\t\t};\n\t\t\tlet last_insert_id= await DB.save('create_posts',complete_data);\n\t\t\tcomplete_data.id=last_insert_id; \n\t\t\tcomplete_data.status=0; \n\t\t\tres.status(200).json({\n\t\t\t\t'success':true,\n\t\t\t\t'message':\"Create Post\",\n\t\t\t\t'code':200,\n\t\t\t\t'body':complete_data\n\t\t\t});\n\t\t}catch(err){\n\t\t\t$this.error(res,err);\n\t\t}\n\t}", "submit(data) {\n const { description, seller, item, itemName } = data;\n Reports.insert({ description, seller, item, itemName }, this.insertCallback);\n }", "addPost(){\n\n }", "function add_admin(){\n var name = document.getElementById(\"name\").value;\n var email = document.getElementById(\"email\").value;\n var phone = document.getElementById(\"phone\").value;\n var pin = document.getElementById(\"pin\").value;\n var role = document.getElementById(\"role_body\").value;\n var password = document.getElementById(\"password\").value;\n\n _loading(1);\n $.post('/api/v1/add_admin',{\n 'id': userData['id'],\n 'token': userData['token'],\n 'name': name,\n 'email': email,\n 'phone': phone,\n 'pin': pin,\n 'role': role,\n 'password': password\n }, function (e) {\n if(e['status'] === '00'){\n console.log(e['messages'])\n notif('success', 'Success!', e['messages']);\n\n }else{\n notif('danger', 'System Error!', e['messages']);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n _admins_list(_page);\n });\n\n console.log(name);\n console.log(email);\n console.log(phone);\n console.log(role);\n console.log(\"oit\")\n}", "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}", "function setUpAdd() {\n refreshId();\n $('input[name=_method]').val('post');\n $('h2.title').text('Add New Record Page');\n $('input[name=product]').val('');\n $('input[name=quantity]').val('');\n $('input[name=price]').val('');\n $('.add-record').hide();\n }", "handleSubmit(event, item) {\n var obj = {\n Name: this.state.Name,\n Phone: this.state.Phone\n };\n var id = this.state.items._id;\n\n this.state.items.attending.push(obj);\n this.state.items.availableSeats = this.state.items.availableSeats;\n var yahya = this.state.items;\n\n $.ajax({\n type: \"PUT\",\n url: \"/create/\" + id,\n data: yahya,\n success: function(data) {\n alert(\"successfully attended\");\n document.getElementById(\"name\").value = \"\";\n document.getElementById(\"phone\").value = \"\";\n }\n });\n\n event.preventDefault();\n }", "add(form_data, success_callback, failure_callback) {\n var url = \"/global/str/work/order/product/add\";\n return WebClient.basicPost(\n form_data,\n url,\n success => {\n success.data.work_order_product = new EliteAPI.Models.STR.WorkOrderProduct(success.data.work_order_product);\n if (success_callback) success_callback(success);\n },\n failure_callback\n );\n }", "function addObject(event) {\n event.preventDefault();\n\n // If it is, compile all user info into one object\n var newObject = {\n 'categories': $('#addObject fieldset input#inputCategories').val().split(\",\"),\n 'tags': $('#addObject fieldset input#inputTags').val().split(\",\"),\n 'related': $('#addObject fieldset input#inputRelated').val().split(\",\"),\n }\n\n var clientID = $('#addObject fieldset input#inputClientID').val();\n var customID = $('#addObject fieldset input#inputCustomID').val();\n\n // Use AJAX to post the object to our service\n $.ajax(createRequest('POST','/geo/'+clientID+'/objects/'+customID,newObject)).done(function( response ) {\n console.log(response);\n // Fill the response field on the webpage\n $('#addObjectResponse').text(JSON.stringify(response));\n });\n}", "function addData(req, res) {\n const newData = {date, temperature, content } = req.body;\n Object.assign(projectData, newData);\n console.log(`New data recieved on Server Endpoint from Client on port ${port}`, newData);\n}", "save(data){\nreturn this.post(Config.API_URL + Constant.AGENT_SAVE, data);\n}", "save(data){\nreturn this.post(Config.API_URL + Constant.REFFERAL_SAVE, data);\n}", "function addNew(req, res) {\n res.status(200).send(guestService.addNew(req.body));\n}", "addEntry(){\n var that = this;\n\n fetch(that.props.createApiUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n device_name: that.state.deviceName,\n device_model: that.state.deviceModel,\n mac_address: that.state.macAddress\n })\n })\n }", "static addEntry(data) {\n if (!data || (typeof data) !== 'object') {\n return this.badRequest('the data pass are not right,pleas pass right data');\n }\n const error = DummyDataHelpers.validateEntry(data);\n if (!error) {\n if (DummyDataHelpers.titleExists(dummyEntries, data.title)) {\n return this.conflictError('title already exist,change title');\n }\n // const entryid = (dummyEntries.length - 1) + 1;\n const entryid = dummyEntries[dummyEntries.length - 1].id + 1;\n const newEntry = {\n id: entryid,\n title: data.title,\n note: data.note,\n imageUrl: data.imageUrl,\n createdAt: new Date(),\n updatedAt: new Date(),\n isFavourite: data.isFavourite,\n };\n dummyEntries.push(newEntry);\n return this.createdSuccessfully('A new Entry created successfully', newEntry);\n }\n return this.badRequest(error);\n }", "insertPublishList(data){\nreturn this.post(Config.API_URL + Constant.PUBLISH_INSERTPUBLISHLIST, data);\n}", "function AddNewCoffee(){\n //create json\n const toSend = {\n name: document.getElementById(\"name\").value,\n price: Number(document.getElementById(\"price\").value),\n type: document.getElementById(\"type\").value\n };\n const jsonString = JSON.stringify(toSend);\n\n //create POST method\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://localhost:5001/api/coffee\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n xhr.send(jsonString);\n}", "function addbackendprod(e){\n const uid = e.target.value;\n const name = document.getElementById(\"NC\");\n const quant = document.getElementById(\"QC\");\n const q = quant.value;\n const y = name.value;\n const xhr = new XMLHttpRequest();\n xhr.open('POST','/product')\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n console.log(JSON.stringify({id: uid, name: y, quantity: q}));\n xhr.send(JSON.stringify({id: uid, name: y, quantity: q}));\n document.getElementById(\"forms\").innerHTML = null;\n document.getElementById(\"rows\").innerHTML = null;\n}", "receiveInputData() {\n const receivedItem = {};\n receivedItem.title = document.getElementById('input-item').value;\n // receivedItem.status = \"active\";\n this.data.push(receivedItem);\n this.addItem(receivedItem);\n }", "function addPostData(req,res) {\n console.log('In-> addPostData()'); // DEBUG\n //console.log('Adding: ', req,body);\n projectData.location = req.body.location;\n projectData.start_date = req.body.start_date;\n projectData.end_date = req.body.end_date;\n projectData.pixabay_url = req.body.pixabay_url;\n projectData.weather = req.body.weather;\n res.send(projectData);\n}", "function submitData(key) {\n //If there is no key, this means this is a brand new item and we need a new key.\n if (!key) {\n var generateId = Math.floor(Math.random()*100000001);\n }else{\n //Set the id to the existing key we're editing, so it will save over the data.\n generateId = key;\n }\n \n //Gather up all our form field values and store in an object.\n //Object properties contain array with the form label and input value.\n getSelectedCheckedBoxes(); \n var itemList = {};\n itemList.petname = [\"Pet Name:\", getElements('petname').value];\n itemList.petage = [\"Pet Age:\", getElements('petage').value];\n itemList.pettype = [\"Pet Type:\", getElements('pettype').value];\n itemList.flea = [\"Flea:\", fleaValue];\n itemList.fleaRx = [\"Flea Rx:\", getElements('fleaRx').value];\n itemList.heartworm = [\"Heartworm:\", heartwormValue];\n itemList.other = [\"Other:\", otherValue];\n itemList.date = [\"Date:\", getElements('date').value];\n itemList.range = [\"Range:\", getElements('range').value];\n itemList.note = [\"Note:\", getElements('note').value];\n \n //Save data into Local Storage\n localStorage.setItem(generateId, JSON.stringify(itemList));\n alert(\"Reminder has been added!\");\n }", "async function handleAdd(formInputs) {\n\n try {\n const wish = await fetch('https://project4-wish.herokuapp.com/wishes', {\n method: 'POST',\n headers: {\n 'Content-type': 'Application/json'\n },\n body: JSON.stringify(formInputs)\n }).then(res => res.json());\n setWishesState(prevState => ({ wishes: [wish, ...prevState.wishes]}))\n } catch (error) {\n console.log(error);\n }\n }", "function add(event) {\n event.preventDefault();\n // clear inputs set button\n $('#bomForm input').each(function (index, val) {\n $(this).val('');\n });\n $post.prop(\"hidden\", false);\n $put.prop(\"hidden\", true);\n // set title\n $('#modalTitle').text(\"Add New bom\");\n // spawn modal\n $('#formModal').modal();\n}", "addNewPost(authorIn,textIn, tag){\n if(tag.length >= 2) {\n let vali = [];\n for(let lap=0; lap < tag.length; lap++){\n vali.push({tagId : tag[lap]});\n }\n const data = {author: authorIn, text: textIn, tags: vali};\n console.log(\"data: \" + JSON.stringify(data));\n fetch(\"http://localhost:8080/save\", {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(data),\n }).then(response => {\n console.log(\"data send\");\n });\n } else{\n alert(\"add least 2 tags. (separate tags with ,)\");\n }\n }", "function addProductToDb() {\n if (!checkBasicInputs() || !checkDetailsInputs())\n return\n createDetailsJson()\n\n fetch('https://easybin-backend-app.herokuapp.com/products/add', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-type': 'application/json',\n 'Authorization': `Bearer ${props.token}`\n },\n body: JSON.stringify({\n 'name': productName,\n 'barcode': productBarcode,\n 'items': details,\n\n })\n })\n .then((response) => response.json())\n .then((responseJson) => {\n if (responseJson.error) {\n // display error message\n const snackBar = {\n data: 'Error',\n position: WSnackBar.position.BOTTOM,\n duration: WSnackBar.duration.SHORT,\n textColor: 'white',\n backgroundColor: 'red',\n }\n WSnackBar.show(snackBar)\n } else {\n // display succes message\n const snackBar = {\n data: 'Produit ajouté !',\n position: WSnackBar.position.BOTTOM,\n duration: WSnackBar.duration.SHORT,\n textColor: 'white',\n backgroundColor: 'green',\n }\n WSnackBar.show(snackBar)\n // reset inputs values\n setProductName('')\n setProductBarcode('')\n setDetailName1('')\n setDetailName2('')\n setDetailName3('')\n setDetailPicker1('')\n setDetailPicker2('')\n setDetailPicker3('')\n }\n })\n }", "addToApi() {\n // Invoke the factory function, passing along the form field values to\n const newJournalEntry = renderDom.buildEntry();\n // console.log(\"newJournalEntry\", newJournalEntry)\n API.postJournalEntry(newJournalEntry);\n }", "function postNew() {\n event.preventDefault();\n let title = document.getElementById('todoTitle').value;\n let desc = document.getElementById('todoDescription').value;\n if (title == '' || desc == ''){\n alert('All fields must include data')\n } else {\n let items = { title: title, desc: desc }\n url = 'http://localhost:3000/api/data'\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n redirect: 'follow',\n body: JSON.stringify(items)\n })\n .then((resp) => {\n getAll();\n })\n}\n}", "function AddPostBlg(evt) {\n evt.preventDefault();\n let id_category = evt.target.form[0].value\n let id_users = evt.target.form[1].value\n let title_post = evt.target.form[2].value\n let date_post = evt.target.form[3].value\n const url = window.origin + \"/AddPostBlg/\";\n\n\n var entry = {\n id_category:id_category,\n id_users: id_users,\n title_post: title_post,\n date_post: date_post\n }; \n\n fetch(url, {\n method: \"POST\",\n credentials: \"include\",\n body: JSON.stringify(entry),\n cache: \"no-cache\",\n headers: new Headers({\n \"content-type\": \"application/json\"\n })\n })\n .then(function (response) {\n if (response.status !== 200) {\n console.log(`Looks like there was a problem. Status code: ${response.status}`);\n return;\n }\n response.json().then(function (data) {\n evt.target.form[0].value = \"\"\n evt.target.form[1].value = \"\"\n evt.target.form[2].value = \"\"\n evt.target.form[3].value = \"\"\n });\n })\n .catch(function (error) {\n console.log(\"Fetch error: \" + error);\n }); \n}", "handleAdd(e) {\n e.preventDefault()\n // handle form errors, allows one-time and revenue amounts to be 0\n if (!this.state.newType || !this.state.newName || (!this.state.newOneTime && this.state.newOneTime !== 0) || (!this.state.newMonthly && this.state.newMonthly !== 0)) {\n this.setState({\n error: true\n })\n }\n // if there are no form errors, add accordingly\n else {\n // create body\n const addItem = {\n type: this.state.newType,\n name: this.state.newName,\n oneTime:this.state.newOneTime,\n monthly: this.state.newMonthly\n }\n\n // post add item\n fetch('http://localhost:3001/add', {\n method: 'post',\n headers: {'Content-Type':'application/json'},\n body: JSON.stringify(addItem)\n })\n .then((res) => {\n if(res.ok) {\n return res.json()\n } else {\n throw new Error()\n }\n })\n .then(result => this.setState({\n revenue:result[0].revenue,\n expenses: result[0].expenses,\n oneTimeRevenue: result[0].oneTimeRevenue,\n oneTimeExpense: result[0].oneTimeExpense,\n monthlyRevenue: result[0].monthlyRevenue,\n monthlyExpense: result[0].monthlyExpense,\n newType: '',\n newName: '',\n newOneTime: '',\n newMonthly: '',\n error: false\n }))\n .catch((err)=> console.log(err))\n }\n\n }", "add(form_data, success_callback, failure_callback) {\n let url = \"/global/str/credit/add\";\n return WebClient.basicPost(form_data, url, success_callback, failure_callback);\n }", "function addUser(event) {\n //event.preventDefault();\n\n\n //compile all user info into one object\n var newUser = {\n 'FirstSelection' : '' +ToSaveSplit[0]+ '',\n\t\t\t'SecondSelection' : ''+ToSaveSplit[1]+ '',\n\t\t\t'Description' : ''+Description+''\n }\n\n // Use AJAX to post the object to our adduser service\n $.ajax({\n type: 'POST',\n data: newUser,\n url: '/users/adduser',\n dataType: 'JSON'\n }).done(function( response ) {\n\n // Check for successful (blank) response\n if (response.msg === '') {\n\n }\n else {\n\n // If something goes wrong, alert the error message that our service returned\n alert('Error: ' + response.msg);\n\n }\n });\n}", "function handleNewItemSubmit() {\r\n $('main').on('submit','#new-bookmark-form', event => {\r\n console.log(\"new item submit is listening\");\r\n event.preventDefault();\r\n let data = serializeJson(event.target)\r\n console.log(data)\r\n api.createBookmark(data)\r\n .then((newItem) => {\r\n console.log(newItem);\r\n store.addItem(newItem);\r\n store.error=null;\r\n store.filter = 0;\r\n store.adding = false;\r\n render();\r\n })\r\n .catch((error) => {\r\n store.setError(error.message);\r\n renderError();\r\n });\r\n })\r\n}", "function addJournal(req, res) {\n projectData.data.push(req.body);\n res.send(\"POST received\");\n}", "function addItem() {\n var input = document.getElementById('input-value').value;\n if (input) {\n itemIndex++;\n document.getElementById('list-item').appendChild(generatingItem(itemIndex, input));\n var newItem = {\n id: itemIndex,\n content: input\n };\n // toDoList.push(newItem);\n axios.post(url, newItem)\n .then(function (res) {\n alert(`ADD SUCCESSFULLY `)\n })\n .catch(function (err) {\n alert(\"ADD ERROR \")\n });\n }\n}", "function addEntry(req, res) {\n // console.log(req.body)\n newEntry = {\n date: req.body.date,\n emoji: req.body.emoji,\n feelings: req.body.feelings,\n zipcode: req.body.zipcode,\n weather: req.body.weather \n }\n \n projectData.push(newEntry)\n res.send(projectData)\n console.log(projectData)\n}", "function addData(data) {\n console.log(` Adding: ${data.title}`);\n console.log(` Adding: ${data.date}`);\n console.log(` Adding: ${data.image}`);\n console.log(` Adding: ${data.category}`);\n console.log(` Adding: ${data.price}`);\n console.log(` Adding: ${data.description}`);\n console.log(` Adding: ${data.location}`);\n console.log(` Adding: ${data.owner}`);\n Items.insert(data);\n}", "addRecipe(recipeData) {\n const currentDate = new Date();\n const recipeId = Date.now();\n const singleRecipe = {\n id: recipeId, name: recipeData.name, imagePath: recipeData.imagePath,\n indicator: recipeData.indicator, eatCount: recipeData.eatCount, ingredients: recipeData.ingredients,\n instructions: recipeData.instructions, creationDate: currentDate\n };\n this.recipes.push(singleRecipe);\n const postApi = this.environmentapiUrl + '/posts';\n this.http\n .post(postApi, this.recipes)\n .subscribe(() => {\n this.updatedRecipeEmitter();\n });\n }", "function addButtonClicked () {\n if (!validateName()) return;\n if (!validatePhone()) return;\n if (!validateZip()) return;\n \n var newClient = {\n name: $(\"#name\").val(),\n company: $(\"#company\").val(),\n email: $(\"#email\").val(),\n phone: parseInt($(\"#phone\").val()),\n addr1: $(\"#addr1\").val(),\n addr2: $(\"#addr2\").val(),\n city: $(\"#city\").val(),\n state: $(\"#state\").val(),\n zip: parseInt($(\"#zip\").val())\n };\n \n if (isNaN(newClient.phone))\n newClient.phone = 0;\n \n if (isNaN(newClient.zip))\n newClient.zip = 0;\n \n if (!client)\n $.post('/api/v1/clients/', newClient, function (res) {\n window.location = \"/app/clients\";\n });\n \n else {\n newClient._id = client._id;\n newClient.__v = client.__v;\n $.ajax({\n url: '/api/v1/clients/',\n data: newClient,\n type: 'PUT',\n success: function (res) {\n window.location = \"/app/clients\";\n }\n });\n }\n}", "postdata(data) {\n return axios.post(`${this.apiURL}/location/add`, data);\n }", "async addStore(data, req, res, next) {\n try {\n const userdata = req.body;\n\n await Localbodies.addStore(userdata);\n\n res.json({\n status: 'success',\n message: 'Store added.'\n });\n } catch (err) {\n next(err);\n }\n }", "function add() {\n\tevent.preventDefault();\n\tlet url = \"AddEmployeeServlet\";\n\tlet name = document.querySelector(\"#name\").value;\n\tlet employeeId = document.querySelector(\"#employeeId\").value;\n\tlet mobileNumber = document.querySelector(\"#mobileNumber\").value;\n\tlet email = document.querySelector(\"#email\").value;\n\tlet username = document.querySelector(\"#username\").value;\n\tlet password = document.querySelector(\"#password\").value;\n\tlet joinedDate = document.querySelector(\"#joinedDate\").value;\n\n\tlet employee = {\n\t\t\"name\": name,\n\t\t\"employeeId\": employeeId,\n\t\t\"mobileNumber\": mobileNumber,\n\t\t\"email\": email,\n\t\t\"username\": username,\n\t\t\"password\": password,\n\t\t\"joinedDate\": joinedDate\n\t}\n\taxios.post(url, employee).then(res => {\n\t\tlet data = res.data;\n\t\tif (data) {\n\t\t\ttoastr.success(\"Employee Added Successfully\");\n\t\t\twindow.location.href = \"listemployees.jsp\";\n\t\t}\n\t}).catch(err => {\n\t\tconsole.log(err.response.status);\n\t\ttoastr.error(err.response.data.errorMessage);\n\t});\n}", "function addAction() {\n\t\t\t\t\t\t\t// if (window.confirm(\"Add this book to your collection?\")) {\n\t\t\t\t\t\t\t\tlet bound = this;\n\t\t\t\t\t\t\t\tbound.innerHTML = \"Please Wait...\";\n\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:grey;\");\n\t\t\t\t\t\t\t\tajaxFunctions.ready(ajaxFunctions.ajaxRequest('POST', addLink, 8000, function (err, data, status) {\n\t\t\t\t\t\t\t\t\tif (err) { console.log(err); bound.innerHTML = \"Error\"; }\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t//handle the server response\n\t\t\t\t\t\t\t\t\t\tbound.setAttribute(\"style\", \"background-color:green;\");\n\t\t\t\t\t\t\t\t\t\tbound.innerHTML = \"Added\";\n\t\t\t\t\t\t\t\t\t\t// console.log(data);\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// }//alert box\n\t\t\t\t\t\t}//addAction\t", "function addItemtoDB() {\n //need collection_name, collection_owner, item_name, item_description\n var collectionName = sessionStorage.getItem(\"collectionName\");\n var collectionOwner = sessionStorage.getItem(\"collectionOwner\");\n var itemName = $(\"#itemName\").val();\n var itemDesc = $(\"#itemDesc\").val();\n\n //clear form\n $(\"#itemName\").val(\"\");\n $(\"#itemDesc\").val(\"\");\n \n $.post(\"/newItem\", {collectionName: collectionName, collectionOwner: collectionOwner, itemName: itemName, itemDesc: itemDesc}, function(data) { \n $(\"#addResults\").empty().append(\"<h4>Item Added!</h4>\");\n $(\"#addResults\").append(\"<p> Item:\" + data.item + \" Description: \" + data.description + \"</p>\");\n $(\"#collectionResults\").append(\"<li>\" + data.item + \" -- \" + data.description + \"</li>\"); \n }); \n}", "function addItem(){\n\t\tloadingModal();\n\t\titemName = document.getElementById(\"itemName\").value;\n\t\ttype = document.getElementById(\"itemTypesList\").value;\n\t\t//validating the value of itemName inpuput field\n\t\t\tif(itemName == ''){\n\t\t\t\talert(\"Text field is null\");\n\t\t\t}\n\t\t//validating ending\n\t\t\telse{\n\t\t\t\t//if valid\n\t\t\t\t//calling ajax request\n\t\t\t\t//-----------------------------------------------------------------------------------\n\t\t\t\t//sending and receiving data from php file starting\n\t\t\t\t//-----------------------------------------------------------------------------------\n\t\t\t\tvar xmlhttp = new XMLHttpRequest();\n \t\txmlhttp.onreadystatechange = function() {\n \t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\t\t//showModal();\n\t\t\t\t\thideModal();\n \t\t\tdocument.getElementById(\"errorMessage\").innerHTML= this.responseText;\n\t\t\t\t\tdocument.getElementById(\"itemName\").value =\"\";\n \t\t\t}\n \t\t};\n \t\txmlhttp.open(\"GET\", url+\"addItem.php?itemId=\"+type+\"&iName=\"+itemName , true);//generating get method link\n \t\txmlhttp.send();//sending data\n\t\t\t\t//-----------------------------------------------------------------------------------\n\t\t\t\t\t//sending and receiving data from php file ending\n\t\t\t\t//-----------------------------------------------------------------------------------\n\t\t\t}\n\t}", "function addManager(data) {\n const managerDetail = new manager(data.id, data.name, data.email, data.officeNumber);\n //adding the data to the file\n const read = details(managerDetail);\n fs.appendFileSync('./src/file.html', read, (err) => {\n if (err) {\n console.log(err);\n }\n else {\n console.log(\"suceesfully appended in to the file\")\n }\n });\n //function to ask if wants to add more people\n addMore();\n}", "function postCreate(data){\n $.post(location, data).done(function(_data){\n clearForm();\n updateTableCrate(_data);\n });\n }", "handleAddSubmit() {}", "function handleAddData() {\n hashHistory.push('/sequence/add');\n}", "articleStep1Post () {\n\t\t\tif (this.allKewords.length < 6) this.swalfire('error','6 keywords are required.');\n\t\t\telse {\n\t\t\t\tif (this.manu_script_id) {\n\t\t\t\t\tthis.$axios.patch('api/manuScriptContrlr/'+this.manu_script_id,this.aStep1Data).then(res => {\n\t\t\t\t\t\tthis.swalfire('success','Form data is saved successfully.');\n\t\t\t\t\t\t/*UPDATING KEYWORDS AND FILES ARRAY*/\n\t\t\t\t\t\tthis.uploadKywrds(this.manu_script_id);\n\t\t\t\t\t\tthis.getAllAddFiles(this.manu_script_id);\n\t\t\t\t\t\tthis.getAllMyFiles(this.manu_script_id);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tthis.$axios.post('api/manuScriptContrlr',this.aStep1Data).then(res => {\n\t\t\t\t\t\tthis.manu_script_id = res.data;\n\t\t\t\t\t\tthis.swalfire('success','Form data is saved successfully.');\n\t\t\t\t\t\t/*UPDATING KEYWORDS AND FILES ARRAY*/\n\t\t\t\t\t\tthis.uploadKywrds(res.data);\n\t\t\t\t\t\tthis.getAllAddFiles(res.data);\n\t\t\t\t\t\tthis.getAllMyFiles(res.data);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function add() {\n //get contact information from page\n var values = $('#addForm :input'); //an array of all inputs\n var inputs = $('#addForm').serialize(); //serialized version of the inputs\n\n //get each part of the contact\n var name = values[0].value;\n var alias = values[1].value; //alias = key\n var team = values[2].value;\n var hobbies = values[3].value;\n\n if (name && alias && team) {\n\n console.log($(\"#addForm\").serialize());\n //add contact\n $.post(uri,\n inputs,\n \"json\");\n\n $('#addContact').text(\"Added \" + name + \" [ \" + alias + \" ] to the database.\");\n $('#refresh').show(); //refresh the page to show the updated contact list\n }\n else {\n $('#addContact').text(\"To add a contact, you need NAME, ALIAS and TEAM.\");\n }\n}", "add(form_data, success_callback, failure_callback) {\n let url = \"/global/str/cart/product/add\";\n return WebClient.basicPost(form_data, url, success_callback, failure_callback);\n }", "function submitPost(){\n const title = document.querySelector('#title').value;\n const body = document.querySelector('#body').value;\n const id = document.querySelector('#id').value;\n\n const data = {\n title, // em ES6, esta linha equivale a title:title\n body // em ES6, esta linha equivale a body:body\n }\n\n // verifica que campos do form nao estao vazios\n if (title === '' || body === '') {\n ui.showAlert('Please fill in all fields', 'alert alert-danger');\n } else {\n\n // condicional verifica se eh um estado de ADD ou EDIT, pois o campo oculto de ID vem vazio por padrao, e eh limpo ao cancelar o estado de edicao\n if (id === '') {\n // cria post\n http.post('http://localhost:3000/posts', data)\n .then(data => {\n // confirma envio do post\n ui.showAlert('Post added', 'alert alert-success');\n // limpa campos do formulario\n ui.clearFields();\n \n // retorna na interface todos os posts, inclusive o que acabamos de adicionar\n getPosts();\n })\n .catch(err => console.log(err));\n } else {\n // edita post\n http.put(`http://localhost:3000/posts/${id}`, data)\n .then(data => {\n // confirma edicao do post\n ui.showAlert('Post updated', 'alert alert-success');\n // retorna estado para ADD\n ui.changeFormState('add');\n \n // retorna na interface todos os posts, inclusive o que acabamos de editar\n getPosts();\n })\n .catch(err => console.log(err));\n \n }\n }\n}", "function add(){\n var name = $('#name').val();\n var count = $('#count').val();\n var value = $('#value').val();\n var room = $('#room').val();\n var condition = $('#condition').val();\n var date = $('#date').val();\n\n var item = {};\n item.name = name;\n item.count = count;\n item.value = value;\n item.room = room;\n item.condition = condition;\n item.date = date;\n\n items.push(item);\n Δitems.set(items);\n}", "function storeData() {\n\t// This is a little bit of future proofing \n\tif (!submit.key) {\n\t\t// if there is no key, this is a new item and needs a new key\n\t\tvar id = \"ubuVers\" + Math.floor(Math.random()*10000001);\n\t} else {\n\t\t// set the id to the existing key we are editing\n\t\tid = submit.key;\n\t};\n\t\n // I like to give all my form elements their own id's to give myself access\n\t// outside of the form as well as simple access inside of it\n var ubuVersNumValue = ge('ubuVersNum').value,\n ubuVersNameValue = ge('ubuVersName').value,\n\t\tubuVersDict = {version: ubuVersNumValue, release: ubuVersNameValue};\n\t// log out those values as a double check\n console.log(ubuVersNumValue);\n console.log(ubuVersNameValue);\t\n\t\n\t// set the item in localstorage\n\t// note the stringify function\n\tlocalStorage.setItem(id, JSON.stringify(ubuVersDict));\n\t\n\t// log out the whole local storage\n\tconsole.log(localStorage);\n\tge('submit').value = 'Add';\n\n\n}", "function addData(data) {\n console.log(` Adding: ${data.title} (${data.owner})`);\n Foods.insert(data);\n}", "function addToDbHandler(req,res){\n\n// collect the data (first step)\nlet { name, image, level} = req.query; // name ,level,image is the value for (name) attribute in the form\n // importanttttt (req.body) when the method is (post , PUT,DELETE) , and (req.body) when method is (get)\n // our form is GET method so we used req.query\n// insert the data\nlet sql= `INSERT INTO digi_test (name , image ,level) VALUES ($1,$2,$3);`; // $... THIS TO MAKE SECURE VALUES\nlet safeValues= [ name,image,level] ; // now the values is stored \n\nclient.query(sql,safeValues).then(()=>{ // here there is no result so we put ()\n\nres.redirect('/selectData') // this route will do the selecting the data to render them in/from db\n // now do a route definition for it and a function above \n}) // redirect : have one parameter just , and its pirpose is to activate this route inside it \n\n}", "function add() {\n $.ajax({\n type: \"post\",\n url: \"../api/addshop.php\",\n data: \"username=\" + username + \"&title=\" + title + \"&price=\" + price + \"&img=\" + img + \"&count=\" + counts + \"&goodsid=\" + id.id,\n async: false,\n success: function (str) {\n // console.log(str);\n\n }\n });\n co();\n }", "function saveNewPost(request, response) {\n console.log(request.body.message);\n console.log(request.body.author);\n //write it on the command prompt so we can see\n let post= {};\n let cleanAuthor = filter.clean(request.body.author);\n post.author = sanitizer.sanitize(cleanAuthor);\n let cleanMessage = filter.clean(request.body.message);\n post.message = sanitizer.sanitize(cleanMessage);\n let cleanImage = filter.clean(request.body.image);\n post.image = sanitizer.sanitize(cleanImage);\n if (post.image == \"\") {\n post.image = \"http://4.bp.blogspot.com/-NVNKQIypEFk/T82Of_w1KiI/AAAAAAAAAQE/WXTMrw3dUb8/s1600/mickey-mouse-and-minnie-mouse-cooking-coloring-pages-1.jpg\";\n }\n post.time = new Date();\n post.id = Math.round(Math.random() * 10000);\n posts.push(post);\n response.send(\"thanks for your message. Press back to add another\");\n databasePosts.insert(post);\n}", "createPost(event){\n // prevent default stops the page from auto reloading on form submit\n event.preventDefault();\n // this grabs the data from the form \n let formData = event.target;\n // creates a JavaScript object\n let rawPost = {\n body: formData.body.value\n };\n // console.log(\"creating the post\")\n PostService.createPost(rawPost);\n // form reset says go clear that form\n formData.reset();\n _draw();\n }", "async function postItem() {\n\n // sets var equal to the FormData returned by the function.\n var postData = addItem();\n\n // sets a custom request overriding the const request.\n let customRequest = Object.assign(fetchRequest, {method: 'POST', body: postData});\n\n // get the endpoint from the config file.\n let endpoint = appConfigurations.Endpoints.MostPopularBuilds || '';\n\n // makes a fetch post request with the custom request.\n await fetch(endpoint, customRequest)\n\n // redirects the page to the main page after a submission.\n window.location.assign(\"../MPBmain/MPB.html\")\n}", "addPost(post) {\n console.log(post);\n return this.http.post(\"http://localhost:8080/api/users/addPost/\" + JSON.parse(localStorage.getItem('user')).id, post);\n }", "function addTask() {\n values={};\n values.task=$('#task').val();\n\n $.ajax({\n type: 'POST',\n url: '/task',\n data: values,\n success: function(){\n updateTaskList();\n }\n });\n}", "function addItem( entry ) {\n $http.post( storelist_url, entry ).then(\n function(response) {\n console.log(\"POST success\");\n console.log(response);\n deferred.resolve(response);\n },\n function(error) {\n console.log(\"POST error\");\n deferred.reject(error);\n }\n );\n return deferred.promise;\n }", "function add(response, postData) {\n console.log(\"Request handler 'add' was called.\");\n response.writeHead(200, {\n \"Content-Type\": \"text/plain\"\n });\n var student = {\n name: querystring.parse(postData).name,\n faculty: querystring.parse(postData).faculty,\n course: querystring.parse(postData).course,\n }\n student.hash = crypto.createHash('md5').update(student.name + student.faculty + student.course).digest('hex');\n \n response.write(\"Student: \" + student.name + \"\\n\" +\n \"Faculty: \" + student.faculty + \"\\n\" +\n \"Course: \" + student.course + \"\\n\" +\n \"Hash: \" + student.hash);\n response.end();\n /*\n Connect to base -> write document -> disconnect\n */\n MongoClient.connect(url, function (err, db) {\n\n if (err) {\n throw err;\n } else {\n console.log(\"Connected\");\n }\n students = db.collection('students');\n students.insert(student);\n students.findOne({name: \"123\"}, {}, function (err, doc) {\n if (err) {\n throw err;\n } else {\n console.log(\"Document add:\\n\", doc);\n }\n });\n db.close();\n\n });\n}", "function create(req, res) {\n // add validation kapag empty yung value sa req.body at kapag empty yung request.\n let data = {\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n };\n\n connection.query('INSERT INTO items SET ?', data, function(error, results) {\n if (error) {\n res.status(500).send({ message: 'Error occured while adding item.' });\n }\n // if sucess, add the ID of new item into data object.\n data.id = results.insertId;\n apiResult = {\n message: 'Successfully created.',\n total: results.length,\n data \n };\n\n res.send(apiResult);\n });\n }", "function add() {\r\n DlgHelper.AjaxAction(\"/schedule/add/\", \"POST\", function (data) {\r\n\r\n if (data != null && data != \"\") {\r\n refresh().done(function () { DlgHelper.ShowDialogSuccess(\"Добавлено: \" + data, 1000); });\r\n } else {\r\n DlgHelper.ShowDialogError(\"Неверный ввод...\", 2000);\r\n }\r\n\r\n });\r\n }", "add(name, email, comment) {\n console.log('Sending', name, email, comment)\n return $.ajax({\n type: 'PUT',\n url: `${apiUrl}/entries`,\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify({\n name,\n email,\n comment,\n }),\n dataType: 'json',\n headers: { 'Authorization': 'Bearer ' + (tokens && tokens.accessToken) },\n });\n }", "add(form_data, success_callback, failure_callback) {\n let url = \"/global/str/payment/method/add\";\n return WebClient.basicPost(\n form_data,\n url,\n success => {\n success.data.payment_method = new EliteAPI.Models.STR.PaymentMethod(success.data.payment_method);\n if (success_callback) success_callback(success);\n },\n failure_callback\n );\n }", "function addItem(){\n const value = newItemInput.value;\n\n if(!value){\n alert(\"Please enter a value\");\n return;\n }\n\n const _item = {...item, message: value};\n\n items.push(_item);\n newItemInput.value = \"\";\n render();\n\n postItemToJSON(\"http://localhost:8000/index.php\", _item, items.length - 1);\n}", "function addToList(cakeId, cakeName, quantity, selectedText , price, description, productImage) {\n const item = {\n cakeId: cakeId, \n cakeName: cakeName,\n quantity: quantity, \n weight: selectedText, \n price: price, \n description: description,\n productImage: productImage\n }\n formList.push(item);\n console.log(formList);\n// clear the form for the next input \n clearForm();\n console.log(`Total Submission: ${formList.length}`.formList);\n}", "addOrUpdate (attr) {\n return request({\n url: `${api_name}/saveAttrInfo`,\n method: 'post',\n data: attr\n })\n \n\n }", "async function addExpense(data) {\n setMessage(\"Adding expense!\");\n\n let token = await SecureStorage.getItemAsync(Constants.STORAGE_KEY);\n if (token === null) {\n setMessage(\"Please login to use the system!\");\n return;\n }\n token = token.replace(\"Splitr \", \"\");\n //console.log(token);\n // REF https://www.codota.com/code/javascript/functions/builtins/Headers/append\n var headers = new Headers();\n headers.append(\"Content-Type\", \"application/json\");\n headers.append(\"Authorization\", JSON.parse(token));\n\n await fetch(Variables.SERVER_URL + label + '/expense', {\n method: 'POST',\n headers: headers,\n body: JSON.stringify(data),\n })\n .then((response) => response.text())\n .then((text) => {\n //console.log(text);\n if (text.includes('error')) {\n let json = JSON.parse(text);\n setMessage(\"Status: \" + json[\"status\"] + \" Message: \" + json[\"error\"]);\n } else {\n setMessage(text);\n }\n }).catch((error) => {\n console.log(\"Error: \" + error);\n setMessage(\"Error: \" + error.message);\n });\n }", "function addData(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Patients.insert(data);\n}", "function addEntry(event) {\n\t\n\tlet name = document.getElementById('name').value;\n\tlet city = document.getElementById('city').value;\n\tlet state = document.getElementById('state').value;\n\tlet country = document.getElementById('country').value;\n\tlet owner = document.getElementById('ownerselect').value;\n\n\tif(name == \"\"){\n\t\tdocument.getElementById('badinput').innerHTML=\"Name is required. New Park not added.\";\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\telse if(city == \"\"){\n\t\tdocument.getElementById('badinput').innerHTML=\"City is required. New Park not added.\";\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\telse if(state == \"\"){\n\t\tdocument.getElementById('badinput').innerHTML=\"State is required. New Park not added.\";\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\telse if(country == \"\"){\n\t\tdocument.getElementById('badinput').innerHTML=\"Country is required. New Park not added.\";\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\t\n\tlet tail = '?' + 'name=' + name + '&city=' + city + '&state=' + state + '&country=' + country + '&owner=' + owner;\n\n\tvar req = new XMLHttpRequest();\n\treq.open('GET', FLIP + PORT + '/add-park' + tail, true);\n\treq.addEventListener('load',function(){\n\tif(req.status >= 200 && req.status < 400){\t\t\n\t\n\t\tevent.preventDefault();\n\t\tlocation.reload(true);\n\n } else {\n console.log(\"Error in network request: \" + req.statusText);\n }});\n req.send();\n event.preventDefault();\n}", "_addPotions(){\n // calculate random number of potions from 1 to 5\n var roll = Math.floor((Math.random()*4) + 1);\n var formData = new FormData();\n formData.append(\"name\", this.state.player.name);\n formData.append(\"quantity\", roll);\n const requestOptions = \n {\n method: 'POST',\n body: formData,\n }\n // update database with new potion ammount\n fetch('https://mi-linux.wlv.ac.uk/~2006100/ci3/index.php/Game/addMultiplePotions', requestOptions)\n .then(() => {\n // update affected UI element\n this._updateInventory();\n })\n .catch(console.log);\n\n this._addMessage(\"You found \" + roll + \" potions!\");\n \n //this.render();\n }", "function add(item) {\n data.push(item);\n console.log('Item Added...');\n }", "handleSubmit(e) {\n\n e.preventDefault();\n\n if (this.state.text.length === 0) {\n return;\n }\n\n const newItem = {\n text: this.state.text,\n latitude: 0,\n longitude: 0\n };\n\n submitDataAsync(newItem, \"/journal/add\", true, (responseData) => {\n\n console.log(responseData);\n\n // Add the item to the front of the list\n this.setState(prevState => ({\n items: [responseData.payload].concat(prevState.items),\n text: '',\n public: false\n }));\n });\n }", "function addRequest (req, res) {\r\n\tconsole.log ('POST /requests');\r\n\t//read input data from http body request\r\n\tlet myReq = new Request();\r\n\tmyReq.name = req.body.name;\r\n\t// add the new Target in the DB\r\n\tmyReq.save(function (err, requestSaved) {\r\n\t\tif (err) {\r\n\t\t\tres.status(500).send({ message : 'Error while saving the Request in the DB'});\r\n\t\t} else {\r\n\t\t\tres.status(200).send ({Request : requestSaved});\r\n\t\t}\r\n\t});\t\r\n}", "function addDrink(event) {\n console.log(\"Adding Drink\");\n event.preventDefault();\n var drink = {\n drink_name: $('#drink_Name').val().trim(),\n added_by: $('#addedBy').val().trim(),\n ingredient_1: $('#ingredName').val().trim(),\n ing_qty_1: $('#qty').val().trim(),\n ingredient_2: $('#ingredName2').val() || null,\n ing_qty_2: $('#qty2').val() || 0,\n ingredient_3: $('#ingredName3').val() || null,\n ing_qty_3: $('#qty3').val() || 0,\n ingredient_4: $('#ingredName4').val() || null,\n ing_qty_4: $('#qty4').val() || 0,\n ingredient_5: $('#ingredName5').val() || null,\n ing_qty_5: $('#qty5').val() || 0,\n description: $('#description').val(),\n };\n\n $.post(\"/api/drinks\", drink);\n console.log(drink);\n add_form.reset();\n showAdded();\n}" ]
[ "0.6969995", "0.68774486", "0.67415947", "0.67207855", "0.67141575", "0.67140734", "0.6671303", "0.6559669", "0.65168726", "0.6485735", "0.64642763", "0.64597607", "0.6459527", "0.64586073", "0.64454645", "0.6406801", "0.6396785", "0.6371603", "0.63156044", "0.6299307", "0.6299008", "0.6295848", "0.62920886", "0.6281602", "0.6280649", "0.6265719", "0.6259754", "0.62518233", "0.62438005", "0.62279993", "0.6225137", "0.6219717", "0.6218041", "0.62006205", "0.61995214", "0.61976314", "0.6194049", "0.61928517", "0.61913586", "0.61890733", "0.6185312", "0.6183801", "0.6173807", "0.61688685", "0.61641896", "0.6162314", "0.61563295", "0.6156239", "0.6154234", "0.61493826", "0.6145547", "0.6141665", "0.6133995", "0.61309624", "0.612953", "0.6127489", "0.6119428", "0.6110143", "0.610609", "0.6102743", "0.60917807", "0.60907954", "0.60907257", "0.6088421", "0.6086495", "0.60756", "0.60718924", "0.60711205", "0.60695595", "0.6066346", "0.6063567", "0.6054684", "0.60509473", "0.60509", "0.60499126", "0.6042862", "0.6041788", "0.6039419", "0.6038463", "0.6035454", "0.60343033", "0.6032043", "0.60315824", "0.6029259", "0.6027305", "0.6026444", "0.6024954", "0.60245717", "0.6020725", "0.6019963", "0.6002715", "0.5990089", "0.59870905", "0.5986495", "0.59855354", "0.59787214", "0.5977864", "0.59719294", "0.59673023", "0.5966161", "0.59649265" ]
0.0
-1
manages data and sends edit POST
function editTodo(form) { var id = form.find("#inputId").val(), name = form.find('#inputTitle').val(), priority = form.find('#inputPriority').val(), beginDate = form.find('#inputCreatedDate').val(), beginTime = form.find('#inputCreatedTime').val().split(':'), finishDate = form.find('#inputFinishDate').val(), finishTime = form.find('#inputFinishTime').val().split(':'), elapsedHours = form.find('#inputElapsedHours').val(), elapsedMinutes = form.find('#inputElapsedMinutes').val(), elapsedSeconds = form.find('#inputElapsedSeconds').val(), details = form.find('#inputDetails').val(), complete = form.find('#inputComplete'), elapsedTime = joinElapsed(elapsedHours, elapsedMinutes, elapsedSeconds); var isComplete = (complete == 'checked') ? true : false; console.log(complete); var createdAt = moment(beginDate, 'D MMM, YYYY'); createdAt = createdAt.add(beginTime[0], 'hours').add(beginTime[1], 'minutes'); var finishAt = moment(finishDate, 'D MMM, YYYY'); finishAt = finishAt.add(finishTime[0], 'hours').add(finishTime[1], 'minutes'); // var json = { "id": id, "title": name, "priority": priority, "details": details, "createdAt": createdAt, "elapsedTime": elapsedTime, "finishAt": finishAt, "isComplete": isComplete }; console.log(json); // // $.post( // '/api/add', // JSON.stringify(json) // ).done(function(data) { // location.reload(); // }).fail(function(error) { // console.log(error); // }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async edit({ params, request, response, view }) {}", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "function EditHandler() {\n fetch(GetApi, {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(GetData),\n }).then((res) => {\n if (res.status === 200) {\n fetch(GetApi)\n .then((res) => res.json())\n .then((data) => SetstatusApi(data));\n }\n });\n\n SetEditdata(!EditData);\n }", "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "handleEditFormSubmission() {\n\t\tthis.getPortfolioItemData();\n\t}", "edit(req, res) {\n\n\t}", "function edit_admin(){\n var name = document.getElementById(\"name2\").value;\n var email = document.getElementById(\"email2\").value;\n var phone = document.getElementById(\"phone2\").value;\n var role = document.getElementById(\"role_body2\").value;\n var user_id = document.getElementById('detail_id').innerHTML;\n\n _loading(1);\n $.post('/api/v1/edit_admin',{\n 'id_admin': userData['id'],\n 'token': userData['token'],\n 'user_id':user_id,\n 'name': name,\n 'email': email,\n 'phone': phone,\n 'role': role,\n }, function (e) {\n if(e['status'] === '00'){\n console.log(e['messages'])\n notif('success', 'Success!', e['messages']);\n\n }else{\n notif('danger', 'System Error!', e['messages']);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n _admins_list(_page);\n });\n}", "function _edit() {\n $('name').value = this.name;\n $('key').value = this.key;\n $('action').value = this.action;\n switchToView('edit-form');\n}", "function edit(val) {\n resetAll();\n try {\n var data = JSON.parse(val[1]);\n if (val[0] != \"0\") {\n fillControlsFromJson(data[0]);\n \n if (data[0].image != \"\" && data[0].image != null) {\n $(\"#divuploadimage img\").prop(\"src\", data[0].image);\n $(\"#imgItemURL\").prop(\"src\", data[0].image);\n } else {\n $(\"#divuploadimage img\").prop(\"src\", \"\");\n $(\"#imgItemURL\").prop(\"src\", \"\");\n }\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#lblmainid\").val( data[0].id);\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n implementers.GetWorkerInfo(data[0].id, function (val) {\n if (val[0] == \"1\") {\n var data = JSON.parse(val[1]);\n $(\"#user_nm\").val(data[0].User_Name);\n $(\"#password\").val(data[0].User_Password);\n } else {\n $(\"#user_nm\").val(\"\");\n $(\"#password\").val(\"\");\n }\n });\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "async function edit(req, res) {}", "function edit(val) {\n resetAll();\n try {\n var data = JSON.parse(val[1]);\n if (val[0] != \"0\") {\n fillControlsFromJson(data[0]);\n \n if (data[0].image != \"\" && data[0].image != null) {\n $(\"#divuploadimage img\").prop(\"src\", data[0].image);\n $(\"#imgItemURL\").prop(\"src\", data[0].image);\n } else {\n $(\"#divuploadimage img\").prop(\"src\", \"\");\n $(\"#imgItemURL\").prop(\"src\", \"\");\n }\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#lblmainid\").val( data[0].id);\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n //implementers.GetWorkerInfo(data[0].id, function (val) {\n // if (val[0] == \"1\") {\n // var data = JSON.parse(val[1]);\n // $(\"#user_nm\").val(data[0].User_Name);\n // $(\"#password\").val(data[0].User_Password);\n // } else {\n // $(\"#user_nm\").val(\"\");\n // $(\"#password\").val(\"\");\n // }\n //});\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "function updateEditForm(data){\n $('#editRoomTheaterSelect').val(data.theater_id);\n $('#editRoomCapacity').val(data.capacity);\n }", "function editToDo() {\t\t\n\t\tasync function fetchRequest(path, newData) {\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(`${ AppHelper.API_URL }/users/edit/${ path }/${ id }`, {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\tAuthorization: `Bearer ${ token }`\n\t\t\t\t\t},\n\t\t\t\t\tbody: JSON.stringify(newData)\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tconst success = await response.json();\n\t\t\t\t\n\t\t\t\tif (success) {\n\t\t\t\t\t// Clears the form fields when finished\n\t\t\t\t\tclearFields();\n\t\t\t\t\t\n\t\t\t\t\t// Success message\n\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\ticon: 'success',\n\t\t\t\t\t\ttitle: 'Yay!',\n\t\t\t\t\t\ttext: 'Your To Do has been edited.',\n\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t\ttimer: 2468\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t// router\n\t\t\t\t\trouter.push('/dashboard');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(err);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// CONTROL STATEMENTS\n\t\t// If all three fields are filled up\n\t\tif (name !== '' && description !== '' && date !== '') {\n\t\t\tconst editedFields = {\n\t\t\t\tname: name,\n\t\t\t\tdescription: description,\n\t\t\t\ttoDoDate: date\n\t\t\t};\n\t\t\t\n\t\t\tfetchRequest('to-do', editedFields);\n\t\t\t\n\t\t\t// Name field is the only one with content\n\t\t} else if (name !== '') {\n\t\t\tconst editedField = { name: name };\n\t\t\t\n\t\t\tfetchRequest('to-do-name', editedField);\n\t\t\t\n\t\t\t// Description field is the only one with content\n\t\t} else if (description !== '') {\n\t\t\tconst editedField = { description: description };\n\t\t\t\n\t\t\tfetchRequest('to-do-desc', editedField);\n\t\t\t\n\t\t\t// Date field is the only one with content\n\t\t} else if (date !== '') {\n\t\t\tconst editedField = { toDoDate: date };\n\t\t\t\n\t\t\tfetchRequest('to-do-date', editedField);\n\t\t}\n\t}", "function edit()\n{\n $(document).on('click', '#edit', function()\n {\n let id = $(this).attr('contacts-id');\n \n $.ajax({\n url:'contacts',\n method:'POST',\n data:{ contactId:id },\n dataType: 'JSON',\n success: function(data)\n {\n $('#up-id').val(data[0]);\n $('#up-name').val(data[1]);\n $('#up-email').val(data[2]);\n $('#up-phone').val(data[3]);\n }\n })\n return false;\n })\n}", "function setEditValuesPerson(index) {\n\n id = null;\n // generic list/ object initializer\n var jsonObject = (!Array.isArray(fetchData)) ? fetchData : fetchData[index];\n\n // general setters\n id = jsonObject['id'];\n document.getElementById('edit-title').innerText = jsonObject['name'];\n document.getElementById('edit-email').value = jsonObject['email'];\n\n // phones setters\n document.getElementById('person-phone-container').innerHTML = \"<h5><b>phones</b></h5>\";\n for (var phone in jsonObject['phones']) {\n document.getElementById('person-phone-container').innerHTML += \"<input type='text' class='form-control' value='\" + jsonObject['phones'][phone] + \"'>\";\n }\n\n // address setters\n if(jsonObject['address'] != undefined) document.getElementById('edit-street').value = jsonObject['address'];\n if(jsonObject['city'] != undefined) document.getElementById('edit-city').value = jsonObject['city'];\n if(jsonObject['zipCode'] != 0) document.getElementById('edit-zipcode').value = jsonObject['zipCode'];\n\n // hobbies setters\n document.getElementById('hobby-container').innerHTML = \"\";\n for (var hobby in jsonObject['hobbies']) {\n document.getElementById('hobby-container').innerHTML += \"<p type='text' class='form-control'>\"+jsonObject['hobbies'][hobby]+\"</p>\";\n }\n \n}", "function editItem() {\n var value = localStorage.getItem($(this).attr(\"key\"));\n var item = jQuery.parseJSON(value);\n toggleControls(\"off\");\n $('#displayLink').hide();\n $('#rname').val(item.rname[1]);\n $('#dateadded').val(item.dateadded[1]);\n var radios = $('input[name=\"category\"]:checked').val();\n $('#rtype').val(item.rtype[1]);\n $('#ringredients').val(item.ringredients)[1];\n $('#rdirections').val(item.rdirections)[1];\n save.off(\"click\", storeData);\n $('#submit').val(\"Edit Recipe\");\n var editSubmit = $('#submit');\n editSubmit.on(\"click\");\n editSubmit.attr(\"key\", this.key);\n }", "function putEditForm(id){\n $.ajax({\n url: index + \"notes/\" + $('#disabledinput').val(),\n type: 'PUT',\n processData: false,\n contentType: false,\n data: NoteFormData('editnoteform'),\n success: function(data){\n $('#newmodal').modal('hide');\n getindex()\n // getuserindex()\n },\n error: function(data){\n console.log(data)\n $('#userformerrors').html(\"<p class=\\\"bg-danger\\\">\" + data.responseText + \"</p>\");\n }\n })\n }", "function edit() {\n\tdocument.getElementById(\"editbtn\").disabled = true;\t\t//Prevent sapm or misclick\n\t$.ajax({\n\t\turl: getapi(),\n\t\ttype: \"POST\",\n\t\tdata: {\n\t\t\tedit:$('#idedit').val(),\n\t\t\turl:$('#urledit').val()\n\t\t},\n\t\tsuccess:function(){\n\t\t\t$('#status').css('display','inline');\n\t\t\t$('#status').attr('class','alert alert-success');\n\t\t\t$('#status').html('Success!');\n\t\t\tsetTimeout(function(){\n\t\t\t\tlocation.reload();\n\t\t\t},2000);\n\t\t},\n\t\terror:function(xhr){\n\t\t\tvar err = eval(\"(\" + xhr.responseText + \")\");\n\t\t\t$('#status').css('display','inline');\n\t\t\t$('#status').attr('class','alert alert-danger');\n\t\t\t$('#status').html(err.error);\n\t\t\tdocument.getElementById(\"editbtn\").disabled = false;\n\t\t}\n\t});\n}", "function edit() {\n\trow = $(this).closest(\"tr\"); // Table row that contains the experiment data\n\t$(\"#descr\").val($(\"td:eq(0)\", row).html());\n\t$(\"#expid\").val($(\"td:eq(1)\", row).html()); // Experiment id \n\t$(\"#videourl\").val($(\"td:eq(2)\", row).html());\n\t$(\"#controls\").val($(\"td:eq(3)\", row).html());\n\t$(\"#question\").val($(\"td:eq(4)\", row).html());\n\t$(\"#info\").val($(\"td:eq(5)\", row).html());\n\t$(\"#submit\").val(\"Update\"); // Submit button label\n\t$(\"#action\").val(\"1\"); // Action code for an update\n\t$(\"#videoinfo\").overlay().load(); // Open form as an overlay\n\ttoControls($(\"#controls\").val()); // Fill form controls\n}", "function editOrdenItem(){\n\t\t\t\t\t\t\t\tvar idPoste = this.getAttribute('data-id')\n\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+item._id+'/read/poste/'+idPoste\n\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\tvar item = res.data.service\n\t\t\t\t\t\t\t\t\tvar contentTemplateEditPoste = document.createElement('div')\n\t\t\t\t\t\t\t\t\tcontentTemplateEditPoste.setAttribute('class', 'editPosteModal')\n\t\t\t\t\t\t\t\t\tvar template = `<form action=\"\" id=\"sendEditPoste\" class=\"editPoste\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h3>EDITAR REGISTRO DE POSTE</h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Caracteristicas</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Código Poste</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"txt_codigo_poste\" value=\"${item.codigo_poste}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Altura de Poste</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"altura_poste\" value=\"${item.altura_poste}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de Poste</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"txt_type_poste\" value=\"${item.type_poste}\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de Material</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"txt_type_material\" value=\"${item.type_material}\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de pastoral</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"type_pastoral\" value=\"${item.type_pastoral}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de Luminaria</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"type_luminaria\" value=\"${item.type_luminaria}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Tipo de Lampará</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"characteristic__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"type_lampara\" value=\"${item.type_lampara}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Ubicación</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication_item--map\" id=\"mapsEdit\"></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada X</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"coordenada_X\" value=\"${item.coordenada_X}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Coordenada Y</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"ubication__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"coordenada_Y\" value=\"${item.coordenada_Y}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__title\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>Estado</h4>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Estado de Poste</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"estado_poste\" value=\"${item.estado_poste}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Estado de Pastoral</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"estado_pastoral\" value=\"${item.estado_pastoral}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Estado de Luminaria</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"estado_luminaria\" value=\"${item.estado_luminaria}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--left\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>Estado de Lampará</strong></p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"estado__item--right\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"text\" class=\"inputs-label\" id=\"estado_lampara\" value=\"${item.estado_lampara}\"/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"editPoste__containner--buttons\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn\"><button id=\"editPosteCancel\">CANCELAR</button></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"btn\"><button id=\"editPosteSave\" type=\"submit\">GUARDAR</button></div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>`\n\n\t\t\t\t\t\t\t\t\tcontentTemplateEditPoste.innerHTML = template\n\t\t\t\t\t\t\t\t\t$('.OrderWork').append(contentTemplateEditPoste)\n\n\t\t\t\t\t\t\t\t\tvar url = GMaps.staticMapURL({\n\t\t\t\t\t\t\t\t\t size: [800, 400],\n\t\t\t\t\t\t\t\t\t lat: item.coordenada_X,\n\t\t\t\t\t\t\t\t\t lng: item.coordenada_Y,\n\t\t\t\t\t\t\t\t\t markers: [\n\t\t\t\t\t\t\t\t\t {lat: item.coordenada_X, lng: item.coordenada_Y}\n\t\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t$('#mapsEdit').css('background-image', 'url('+url+')')\n\n\t\t\t\t\t\t\t\t\tvar btnCloseEditPoste = $('#editPosteCancel')\n\t\t\t\t\t\t\t\t\tbtnCloseEditPoste.on('click', closeEditPoste)\n\n\t\t\t\t\t\t\t\t\tfunction closeEditPoste(ev){\n\t\t\t\t\t\t\t\t\t\tev.preventDefault()\n\t\t\t\t\t\t\t\t\t\t$('.editPosteModal').remove()\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$('#sendEditPoste').submit(function(ev){\n\t\t\t\t\t\t\t\t\t\tev.preventDefault()\n\n\t\t\t\t\t\t\t\t\t\tvar codigo_poste = $('#txt_codigo_poste')\n\t\t\t\t\t\t\t\t\t\tvar type_poste = $('#txt_type_poste')\n\t\t\t\t\t\t\t\t\t\tvar altura_poste = $('#altura_poste')\n\t\t\t\t\t\t\t\t\t\tvar type_material = $('#txt_type_material')\n\t\t\t\t\t\t\t\t\t\tvar type_pastoral = $('#type_pastoral')\n\t\t\t\t\t\t\t\t\t\tvar type_luminaria = $('#type_luminaria')\n\t\t\t\t\t\t\t\t\t\tvar type_lampara = $('#type_lampara')\n\t\t\t\t\t\t\t\t\t\tvar coordenada_X = $('#coordenada_X')\n\t\t\t\t\t\t\t\t\t\tvar coordenada_Y = $('#coordenada_Y')\n\t\t\t\t\t\t\t\t\t\t// var observaciones = $('#observaciones')\n\t\t\t\t\t\t\t\t\t\tvar estado_poste = $('#estado_poste')\n\t\t\t\t\t\t\t\t\t\tvar estado_pastoral = $('#estado_pastoral')\n\t\t\t\t\t\t\t\t\t\tvar estado_luminaria = $('#estado_luminaria')\n\t\t\t\t\t\t\t\t\t\tvar estado_lampara = $('#estado_lampara')\n\n\t\t\t\t\t\t\t\t\t\tconsole.log(altura_poste);\n\n\t\t\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\t\t\tcodigo_poste: codigo_poste.val(),\n\t\t\t\t\t\t\t\t\t\t\ttype_poste: type_poste.val(),\n\t\t\t\t\t\t\t\t\t\t\taltura_poste: altura_poste.val(),\n\t\t\t\t\t\t\t\t\t\t\ttype_material: type_material.val(),\n\t\t\t\t\t\t\t\t\t\t\ttype_pastoral: type_pastoral.val(),\n\t\t\t\t\t\t\t\t\t\t\ttype_luminaria: type_luminaria.val(),\n\t\t\t\t\t\t\t\t\t\t\ttype_lampara: type_lampara.val(),\n\t\t\t\t\t\t\t\t\t\t\tcoordenada_X: coordenada_X.val(),\n\t\t\t\t\t\t\t\t\t\t\tcoordenada_Y: coordenada_Y.val(),\n\t\t\t\t\t\t\t\t\t\t\t// observaciones:\n\t\t\t\t\t\t\t\t\t\t\testado_poste: estado_poste.val(),\n\t\t\t\t\t\t\t\t\t\t\testado_pastoral: estado_pastoral.val(),\n\t\t\t\t\t\t\t\t\t\t\testado_luminaria: estado_luminaria.val(),\n\t\t\t\t\t\t\t\t\t\t\testado_lampara: estado_lampara.val()\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tconsole.log(data)\n\n\t\t\t\t\t\t\t\t\t\t$http({\n\t\t\t\t\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\t\t\t\t\turl: '/dashboard/ordenes_trabajo/'+res.data.work_order_id+'/item/poste/'+res.data.service._id+'?_method=put',\n\t\t\t\t\t\t\t\t\t\t\tdata: data\n\t\t\t\t\t\t\t\t\t\t}).then(function(res){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(res)\n\t\t\t\t\t\t\t\t\t\t\tconsole.log($('[data-content=\"'+res.data.service._id+'\"] .codigo_poste'))\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+res.data.service._id+'\"] .codigo_poste').html(res.data.service.codigo_poste)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+res.data.service._id+'\"] .type_material').html(res.data.service.type_material)\n\t\t\t\t\t\t\t\t\t\t\t$('[data-content=\"'+res.data.service._id+'\"] .type_poste').html(res.data.service.type_poste)\n\t\t\t\t\t\t\t\t\t\t\t// location.reload()\n\t\t\t\t\t\t\t\t\t\t\t$('.editPosteModal').remove()\n\t\t\t\t\t\t\t\t\t\t}, function(err){\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(err)\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}, function(err){\n\t\t\t\t\t\t\t\t\tconsole.log(err)\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}", "editPost(context, status, editPostRec) {\n context.commit('editPost', status, editPostRec);\n }", "function _edit(id) {\n vm.item.id;\n vm.item.userId = vm.item.id;\n //$window.location.href = \"/profile/\" + vm.item.id + \"/edit\";\n }", "showEditForm(data) {\n const newData = {\n id: data.id,\n title: data.title,\n city: data.city_id,\n oldTitle: data.title\n };\n\n this.showCreateForm(newData);\n }", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function handleEditButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"review\");\n var id = listItemData.id;\n // Edit the review via the cms form\n inputReview(id);\n }", "function Editar(){\n const inputIdSalon = document.getElementById(\"idsalon\").value;\n const inputUbicacion = document.getElementById(\"ubicacion\").value;\n const inputCapacidad = document.getElementById(\"capacidad\").value;\n const inputNombreSalon = document.getElementById(\"nombresalon\").value;\n objClaveMateria = {\n \"IdSalon\": inputIdSalon,\n \"Ubicacion\": inputUbicacion,\n \"NombreClave\": inputNombreSalon,\n \"Capacidad\": inputCapacidad\n }\n fetch(uri,{\n method: 'PUT',\n headers:{\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(objClaveMateria)\n })\n .then(response => response.text())\n .then(data => Mensaje(data))\n .catch(error => console.error('Unable to Editar Item.',error ,objClaveMateria));\n}", "function displayEditData(){\n \t$('#editItemName').val(dataitemname[currentCount]);\n \t$('#editDepartment').val(datadepartment[currentCount]);\n \t\t$('#editDescription').val(datadescription[currentCount]);\n \t$('#editDesireDate').val(datadesiredate[currentCount]);\n \t$('#editTag').val(datasearchtags[currentCount]);\n \t//$('#editItems').listview('refresh');\n }", "function handleEdit() {\n console.log(\"yes\");\n var currentEntry = $(this).parent(\"td\").parent(\"tr\").data(\"tableRow\");\n console.log(currentEntry);\n window.location.href = \"/update/\" + currentEntry\n }", "function viewforEdit(id) {\n\t// var id = $(this).attr(\"data-id\");\n\t $.ajax({\n url: 'posts/'+id,\n data: {id:id},\n type: 'GET',\n datatype: 'JSON',\n success: function (response) {\n \t$('#exampleModal').modal('show');\n \tconsole.log(response);\n \t// $('#tags_edit').tagsinput('add', 'some tag');\n \t$('#subject_edit').val(response.subject);\n \t$('#description_edit').val(response.description);\n \t$('#id').val(response.id);\n\n \t$(\"#editformcontent\").val(response);\n \tfor (var i = response.posttags.length - 1; i >= 0; i--) {\n \t\t\n \t\t$('#tags_edit').tagsinput('add', response.posttags[i].tags.name);\n \t}\n \t\n \t// $('.tags').tagsinput('add', 'hello');\n \t// location.reload();\n },\n error: function (response) {\n\n }\n });\n}", "function processEdit(req, res) {\n //validate info\n req.checkBody('name', 'Name is required.').notEmpty();\n req.checkBody('description', 'Description is also required.').notEmpty();\n\n //if errors, redirect and save errors to flash\n const errors = req.validationErrors();\n if (errors) {\n req.flash('errors', errors.map(err => err.msg));\n return res.redirect(`/events/${req.params.slug}/edit`);\n }\n\n //find current events\n Event.findOne({ slug: req.params.slug }, (err, event) => {\n\n //updating events\n event.name = req.body.name;\n event.description = req.body.description;\n\n\n //error in update\n event.save((err) => {\n if(err)\n throw(err);\n //success flash messsage\n //redirect to full events page\n req.flash('success', 'Succesfully updated event.');\n res.redirect('/events');\n });\n });\n}", "function handleEdit() {\n console.log('in handleEdit');\n // Turn on edit mode\n setEditMode(true);\n\n // Set values in state from our list reducer\n setTitle(trip.location);\n setDate(trip.start_date.slice(0, 10));\n setDays(trip.days);\n\n }", "async function edit(id){\r\n newForm();\r\n const editdata = await fetch(\"https://611f26499771bf001785c736.mockapi.io/users/\"+ id ,\r\n {\r\n method:\"PUT\"\r\n });\r\n const userdata = await editdata.json();\r\n document.getElementById(\"userName\").value = userdata.name\r\n document.getElementById(\"picture\").value = userdata.avatar\r\n remove(id)\r\n}", "function btnedit(id) {\n $(\"#pagetype\").attr(\"disabled\", \"disabled\");\n var uri = '';\n if ($('#pagetype').val() == 'customer') {\n var uri = '/master/custlist/' + id;\n } else {\n var uri = '/master/suplist/' + id;\n }\n\n try {\n $.ajax({\n url: uri,\n dataType: \"json\",\n type: \"get\",\n contentType: \"application/json; charset=utf-8\",\n success: function(data) {\n console.log(data)\n $('#hf_id').val(data._id);\n $('#txtname').val(data.name);\n $('#txtmobile').val(data.mobile);\n $('#txtopeningbal').val(data.openingbalance);\n $('#ddlpaymentterms').val(data.paymentterms);\n $('#ddlcustomertype').val(data.customertype);\n $('#txtcompany').val(data.companyname);\n $('#txtemail').val(data.email);\n $('#txtothers').val(data.others);\n $('#txtdescription').val(data.description);\n $('#ddlgsttype').val(data.gsttype);\n $('#txtgstin').val(data.gstin);\n $('#txtpanno').val(data.panno);\n $('#txtbillingaddress').val(data.billingaddress);\n $('#ddlbillingstate').val(data.billingstate);\n $('#txtbillingpincode').val(data.billingpincode);\n $('#txtshippingaddress').val(data.shippingaddress);\n $('#ddshipingstate').val(data.shippingstate);\n $('#txtshippingpincode').val(data.shippingpincode);\n $('.custlist').hide();\n $('.custentry').show();\n $('.btnaddnew').html('Go back')\n },\n error: function(response) {\n var parsed = JSON.parse(response.responseText);\n toastr.error(parsed.Message);\n d.resolve();\n },\n failure: function(response) {\n var parsed = JSON.parse(response.responseText);\n toastr.error(parsed.Message);\n\n d.resolve();\n }\n });\n } catch (e) {\n toastr.error(e.Message);\n }\n}", "function processEdit(req, res) {\n\t// Validate params => https://github.com/ctavan/express-validator\n\treq.checkBody('name', 'Name is required.').notEmpty();\n\treq.checkBody('description', 'Description is required.').notEmpty();\n\n\t// if there are errors, redirect and save errors to flash\n\tconst errors = req.validationErrors();\n\n\tif (errors) {\n\t\tconsole.log(`[data_validation_failured] events.controller.js (processEdit) =>\\n${errors}`);\n\t\treturn res.status(400).redirect(`/events/${req.params.slug}/edit`);\n\t}\n\n\t// finding a current event\n\tlet slug = req.params.slug,\n\t\tupdate = req.body;\n\n\t// function to find the current event\n\tEvent.findOneAndUpdate({ slug: slug }, update, function (err, r_event) {\n\t\t\n\t\tif (err) {\n\t\t\tconsole.log(`[failured_validation_data] events.controller.js (processEdit) =>\\n${errors}`);\n\t\t\treturn res.status(500).send('Oh, an error has been occurred!!');\n\t\t} else {\n\t\t\treturn res.status(301).redirect(`/events/${r_event.slug}/edit`);\n\t\t}\t\n\t});\n}", "function editData(event) {\n\tvar saleid = document.getElementById(\"saleid\").value;\n\tvar product = document.getElementById(\"editproduct\").value;\n\tvar quantity = document.getElementById(\"editquantity\").value;\n\tvar datetime = document.getElementById(\"editdatetime\").value;\n\tvar json =\n\t{\n\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\": \"edit\",\n\t\t\t\t\"updateTo\": {\n\t\t\t\t},\n\t\t\t\t\"filter\": {\n\t\t\t\t\t\"type\": \"column\",\n\t\t\t\t\t\"name\": \"id\",\n\t\t\t\t\t\"value\": saleid\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\t\n\tif(saleid && saleid.match(/^\\d*$/))\n\t{\n\t\tif(product != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.product = Number(product);\n\t\t}\n\t\t\n\t\tif(quantity != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.quantity = Number(quantity);\n\t\t}\n\t\t\n\t\tif(datetime != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.dateTime = getDateAndTime();\n\t\t}\n\t\t\t\t\t\t\n\t\treturn sendAPIRequest(json, event, displaySalesRecords);\n\t}\n\telse\n\t{\n\t\talert(\"Please enter a numerical value for sale id\");\n\t}\n\t\n}", "function submitEdit() {\n\treadEditorFields(editingPage)\n\tme.postPage(editingPage, function(e, resp) {\n\t\tif (e) {\n\t\t\talert(\"ERROR\")\n\t\t} else {\n\t\t\twindow.location.hash = \"#pages/\"+resp.id\n\t\t\tcleanUpEditor()\n\t\t}\n\t})\n}", "function editItem(id){\n sendRequest(\n 'usergroups',\n {\n 'action': 'getEditItemForm',\n 'id': id\n }, function(data){\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n });\n}", "function recepieEdit( idStr ){ // render the edit recepie screen\n\tif ( !validateUser() ){ return; }\n // console.log(\"Get recepie:\", idStr, \"and render in recepieEdit template\");\n\tlet url = `https://cookuniproject-default-rtdb.firebaseio.com/recepies/${idStr}.json`;\n\tsetInfoBox();\n\tfetch(url)\n .then(function (response) {\n if ( response.status < 300 ) {\n\t\t\tclearInfoBox();\n\t\t}\n return response.json();\n })\n .then(function (data) {\n // console.log(\"Recepie Edit Data:\", JSON.stringify(data));\n let src = document.getElementById(\"recepieEdit\").innerHTML;\n let template = Handlebars.compile(src);\n data.recepieID = idStr;\n // console.log( JSON.stringify(data.ingredients) );\n if( Array.isArray( data.ingredients ) ){\n data.ingredients = data.ingredients.join(\", \");\n }else{\n setErrorBox(\"Warning, Failed to make a proper ingredients entry, fix to enable saving.\");\n data.ingredients = JSON.stringify(data.ingredients);\n }\n let context = data;\n let html = template(context);\n render(html);\n let editButton = document.getElementById(\"editButton\");\n\t\teditButton.addEventListener( \"click\", (e) => { e.preventDefault(); sendEditRecepie(); });\n let category = document.getElementById(\"editCategory\");\n category.selectedIndex = getCatIdx( data.category );\n return data;\n });\n}", "function showPrepopulatedPost(data){\n // console.log(data);\n $(\".header-post\").html(\"Edit Post\");\n $(\"#new-post\").removeAttr(\"action method enctype\");\n $(\"input#title\" ).val(data.title);\n $(\"input#title\").attr(\"disabled\",true);\n $(\"input#title\").removeAttr(\"required\");\n $(\"#body\").val(data.body);\n $(\"#category\").val(data.CategoryId);\n $(\"input#pic\").remove();\n \n $(\"#new-post\").on(\"submit\", function handleEdit(event) {\n event.preventDefault();\n if (!$(\"#body\").val().trim() || !$(\"#category\").val().trim()) {\n return;\n }\n var newPost = {\n body: $(\"#body\").val().trim(),\n category: $(\"#category\").val().trim()\n }\n updatePost(newPost);\n });\n \n // Update a given post, bring user to the updated post when done\n function updatePost(post) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/posts/\"+postId,\n data: post\n })\n .then(function() {\n window.location.href = \"/view-post?post_id=\"+postId;\n });\n }\n }", "function edit(val) {\n try {\n var data = JSON.parse(val[1]);\n cancel();\n if (val[0] != \"0\") {\n\n $(\"input[name=radio-btn][value=\" + data[0].from_type_id + \"]\").prop('checked', true);\n // get_fromdep(data[0].from_type_id);\n get_fromdep_replay(data[0].from_type_id, data[0].from_dep);\n $(\"input[name=radio-btn2][value=\" + data[0].to_type_id + \"]\").prop('checked', true);\n // get_todep(data[0].to_type_id);\n get_todepreplay(data[0].to_type_id, data[0].to_dep);\n\n fillControlsFromJson(data[0]);\n fillImages(val[2]);\n $(\"#txtTemId\").val($(\"#lblyearId\").html());\n $(\"#divdate1 #txtDateh\").val(data[0].date_hj);\n $(\"#divdate1 #txtDatem\").val(data[0].date);\n $(\"#imgItemURL\").prop(\"src\", data[0].logo);\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#cmdUpdate\").removeAttr('disabled');\n $(\"#cmdDelete\").removeAttr('disabled');\n $('.action-btns').css('display', 'none');\n if (data[0].type == 1) {\n $(\"#div_print\").show();\n // $(\"#txtname_ar\").prop('disabled', false);\n }\n else {\n $(\"#div_print\").hide();\n // $(\"#txtname_ar\").prop('disabled', false);\n }\n showSuccessMessage(\"\");\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "async function editPost() {\n\t\tif (!title && !content) return;\n\t\tif (typeof window.ethereum !== 'undefined') {\n\t\t\tawait requestAccount();\n\t\t\tconst provider = new ethers.providers.Web3Provider(window.ethereum);\n\t\t\tconsole.log({ provider });\n\t\t\tconst signer = provider.getSigner();\n\t\t\tconst contract = new ethers.Contract(crudAddress, Crud.abi, signer);\n\t\t\tconst transaction = await contract.editPost(id, title, content);\n\t\t\tconsole.log(id, title, content);\n\t\t\tawait transaction.wait();\n\t\t}\n\t}", "function edit() {\r\n DlgHelper.AjaxAction(\"/schedule/edit/\", \"POST\", function (data) {\r\n\r\n if (data != null && data != \"\") {\r\n refresh().done(function () { DlgHelper.ShowDialog(\"Изменено: \" + data); });\r\n } else {\r\n DlgHelper.ShowDialogError(\"Неверный ввод...\", 2000);\r\n }\r\n\r\n });\r\n }", "function editPost(req,res){\n //edit post\n}", "function submitEditMeme() {\n var $row = memeTable.getSelectedRow(),\n url = siteUrl + 'meme/',\n method = 'PUT',\n data = {\n 'name': $('#meme-edit-name').val(),\n 'top_text_template': $('#meme-edit-toptemplate').val(),\n 'bottom_text_template': $('#meme-edit-bottomtemplate').val(),\n 'tags': $('#meme-edit-tags').val().split(' '),\n 'is_hidden': $('#meme-edit-hidden').val()\n };\n \n if ($row === null || $row.length === 0) {\n return bootbox.alert('You must select a row to edit.');\n }//end if\n \n url += $row.data('row-id');\n \n $.ajax({'url': url, 'type': method, 'data': data})\n .done(function () {\n $editModal.modal('hide');\n self.refreshGrid();\n })\n .fail(function () {\n bootbox.alert('There was a problem updating the meme.');\n });\n }//end submitEditMeme()", "function editDB(){\n\t\t\t\titem_name_form = document.getElementById(\"item_name\").value;\n\t\t\t\titem_price_form = document.getElementById(\"price\").value;\n\t\t\t\titem_quantity_form = document.getElementById(\"quantity\").value;\n\t\t\t\titem_barcode_form = document.getElementById(\"barcode\").value;\n\n\t\t\t\tsessionStorage.editStatus=\"edit\";\n\t\t\t\tupdateDB(item_name_form,item_quantity_form,item_price_form,item_barcode_form)\n\t\t\t\t\t.then(function(){\n\t\t\t\t\t\tconsole.log(\"updateDB\");\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(){\n\n\t\t\t\t\t})\n\n\t\t\t}", "function postEdit(response) {\n\tif (response == \"OK\") {\n\t\talert(\"Successfull update\");\n\t\t$(\"td:eq(0)\", row).html($(\"#descr\").val());\n\t\t$(\"td:eq(2)\", row).html($(\"#videourl\").val());\n\t\t$(\"td:eq(3)\", row).html($(\"#controls\").val());\n\t\t$(\"td:eq(4)\", row).html($(\"#question\").val());\n\t\t$(\"td:eq(5)\", row).html($(\"#info\").val());\n\t}\n\telse\n\t\talert(\"Action failed\");\n}", "function updateItem() {\n var editedUser = JSON.stringify({\n \"nomer\": App.parentForm.find(\"[data-obj-param=NOMER]\").val(),\n \"text\": App.parentForm.find(\"[data-obj-param=TEXT]\").val(),\n \"bal\": App.parentForm.find(\"[data-obj-param=BAL]\").val(),\n //\"BALNAME\": App.parentForm.find('[data-obj-param=BALNAME').val(),\n //\"NOM\": App.parentForm.find('[data-obj-param=NOM').val(),\n // \"OB\": App.parentForm.find('[data-obj-param=OB').val(),\n \"cbal\": App.parentForm.find(\"[data-obj-param=CBAL]\").val(),\n //\"CBALNAME\": App.parentForm.find('[data-obj-param=CBALNAME').val(),\n \"cnaom\": App.parentForm.find(\"[data-obj-param=CNOM]\").val(),\n //\"CNOMNAME\": App.parentForm.find('[data-obj-param=CNOMNAME').val(),\n //\"COB\": App.parentForm.find('[data-obj-param=COB').val(),\n \"cob2\": App.parentForm.find(\"[data-obj-param=COB2]\").val(),\n \"TIP\": App.parentForm.find(\"[data-obj-param=TIP]\").val(),\n //\"PR\": App.parentForm.find('[data-obj-param=PR').val(),\n \"cena\":App.parentForm.find(\"[data-obj-param=CENA]\").val()\n });\n\n // console.log(editedUser);\n console.log('edit');\n $.ajax({\n type: 'PUT',\n contentType: 'application/json',\n url: App.restParentPath + \"/\" + App.selectedParentRec.NOMER,\n dataType: \"json\",\n data: editedUser,\n success: function (data, textStatus, jqXHR) {\n alert('save one!');\n loadParent();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n alert('error: ' + textStatus);\n }\n });\n }", "function handleSaveChangesClick(e) {\n var foodId = $(this).parents('.food').data('food-id');\n var $foodRow = $('[data-food-id=' + foodId + ']');\n\n var data = {\n foodName: $foodRow.find('.edit-food-name').val(),\n calories: $foodRow.find('.edit-calories').val(),\n };\n // remove console logs from production\n console.log('PUTing data for food', foodId, 'with data', data);\n console.log(data);\n console.log(foodId);\n\n // todo: Extract your url to a variable and pass the variable\n $.ajax({\n method: 'PUT',\n url: '/api/food/' + foodId,\n data: data,\n success: handleFoodUpdatedResponse,\n error: onError\n });\n\n function onError(error1, error2, error3) {\n console.log('error on ajax for edit');\n }\n\n function handleFoodUpdatedResponse(potato) {\n // remove console logs from production\n console.log(potato);\n console.log('response to update', potato);\n\n var foodId = potato._id;\n console.log(foodId);\n // scratch this food from the page\n //TODO: Try changing text in-place\n $('[data-food-id=' + foodId + ']').remove();\n // and then re-draw it with the updates ;-)\n renderFood(data);\n }\n }", "function editManager(){\nvar serviceID=window.location.href;\nvar start = serviceID.indexOf(\"&\");\nvar editor=null;\n\nvar importJSONSink = sessionStorage.getItem(\"jsonSink\");\n\n//PUT - UPDATE SELECTED SERVICE\nif(start != -1){\n\tconsole.log(\"start !=-1\");\n\tvar len = serviceID.length - start - 1;\n\tserviceID = serviceID.substr(start+1, len);\n\tvar starting_value=\"{}\"\n\t$(function() {\n\t\t//findById_apipath\n\t\tvar url = \"http://\"+app_parameters.host_param+\":\"+app_parameters.port_param+\"/\"+app_parameters.findById_apipath+serviceID;\n\t\tconsole.log(\"composed url: \"+url);\n\t\t$.get( url, function( data ) {\n\t\t\tconsole.log(\"STAMPA DI CONTROLLO:\"+data);\n\t\t\tconsole.log(data);\n\t\t\t\n\t\t if(importJSONSink){\n\t\t\tconsole.log(\"inside importJSONSink, valorized\");\n\t\t\tconsole.log(importJSONSink);\n\t\t\tstarting_value = JSON.parse(importJSONSink);\n\t\t }\n\t\t else{\n\t\t\tstarting_value=data;\n\t\t }\n\t\t // Initialize the editor\n\t\t editor = new JSONEditor(document.getElementById('editor_holder'),{\n\t\t\t// Enable fetching schemas via ajax\n\t\t\tajax: true,\n\t\t\t\n\t\t\t// The schema for the editor\n\t\t\tschema: {\n\t\t\t $ref: schemaDir/*,\n\t\t\t format: \"grid\"*/ //no tab version\n\t\t\t},\n\t\t\t\n\t\t\t// Seed the form with a starting value\n\t\t\tstartval: starting_value\n\t\t });\n\t\t \n\t\t if(importJSONSink){\n\t\t\t//Clear the sessionStorage to implement standard behaviour on refreshing page\n\t\t\tsessionStorage.removeItem('jsonSink');\n\t\t }\n\t\t \n\t\t \n\t\t // Hook up the validation indicator to update its status whenever the editor changes\n\t\t editor.on('change',function() {\n\t\t\t// Get an array of errors from the validator\n\t\t\tvar errors = editor.validate();\n\t\t\tvar indicator = document.getElementById('valid_indicator');\n\t\t\t// watcher on concepts fields\n\t\t\tvar watcherCallback = function(path) {\n\t\t\t console.log(\"field with path: [\" + path + \"] changed to [\" + JSON.stringify(this.getEditor(path).getValue()) + \"]\");\n\t\t\t var e=$('select[name=\"' + this.getEditor(path).select2[0].name + '\"]');\n\t\t\t var nameValue = e[0].options[e[0].selectedIndex].text;\n\t\t\t console.log(path.substr(0,path.lastIndexOf(\".\") + 1)+\".name\");\n\t\t\t this.getEditor(path.substr(0,path.lastIndexOf(\".\") + 1)+\"name\").setValue(nameValue);\n\t\t\t \n\t\t\t}\n\t\t\tfor (var key in editor.editors) {\n\t\t\tvar regex = \".conceptId\";\n\n\t\t\t if (editor.editors.hasOwnProperty(key) && key.match(regex)) {\n\t\t\t\teditor.watch(key, watcherCallback.bind(editor, key));\n\t\t\t }\n\t\t\t}\n\t\t });\n\t\t \n\t\t \n\t\t // Hook up the submit button to log to the console\n\t\t document.getElementById('submit').addEventListener('click',function() {\n\n\t\t\tif (confirm('Il servizio verrà modificato, sei sicuro di voler procedere?')){\n\t\t\t\t\n\t\t\t\tvar payload = editor.getValue();\n\t\t\t\t\n\t\t\t\t//console.log(\"UPDATING SERVICE, submitting to CDV: \");\n\t\t\t\t//console.log(payload);\n\t\t\t\t\n\t\t\t\t//PUT - update_apipath\n\t\t\t\tvar url_ = \"http://\"+app_parameters.host_param+\":\"+app_parameters.port_param+\"/\"+app_parameters.update_apipath+serviceID;\n\t\t\t\t//console.log(\"composed url: \"+url_);\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: url_,\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\tdata: JSON.stringify(editor.getValue()),\n\t\t\t\t}).done(function(data) {\n\t\t\t\t\t//console.log(\"RIPOSTA PUT MODIFICA NUOVO SERVIZIO: \"+data);\n\t\t\t\t\t//console.log(data);\n\t\t\t\t\t\n\t\t\t\t\tvar nome = payload.publicServiceName.replace(\" \",\"-\");\n\t\t\t\t\twindow.location.href = window.location.origin+\"/service-editor/edit-service.html?\"+nome+\"&\"+payload.publicServiceID;\n\t\t\t\t\n\t\t\t\t}).fail(function() {\n\t\t\t\t alert( \"Errors occurred in service update. Please be careful and try again...\" );\n\t\t\t\t})\n\t\t\t}\n\t\t });\n\t\t \n\t\t // Hook up the Restore to Default button\n\t\t document.getElementById('restore').addEventListener('click',function() {\n\t\t\teditor.setValue(starting_value);\n\t\t });\n\t\t});\n\t });\n}\n//POST - ADDING NEW SERVICE\nelse{\n\t//console.log(\"start -1\");\n\t $('#submit').text(\"Create Service\");\n\t $('#restore').hide();\n\t // Initialize the editor\n\t if(importJSONSink){\n\t\t\t//console.log(\"inside importJSONSink, valorized\");\n\t\t\t//console.log(importJSONSink);\n\t\t\tstarting_value = JSON.parse(importJSONSink);\n\t\t\t\n\t\t\t \n\t\t\teditor = new JSONEditor(document.getElementById('editor_holder'),{\n\t\t\t // Enable fetching schemas via ajax\n\t\t\t ajax: true,\n\t\t\t // The schema for the editor\n\t\t\t schema: {\n\t\t\t\t$ref: schemaDir/*,\n\t\t\t\tformat: \"grid\"*/ //no tab version\n\t\t\t },\n\t\t\t\n\t\t\t // Seed the form with a starting value\n\t\t\t startval: starting_value\n\t\t });\n\t }\n\t else{\n\t\t \n\t\t editor = new JSONEditor(document.getElementById('editor_holder'),{\n\t\t\t// Enable fetching schemas via ajax\n\t\t\tajax: true,\n\t\t\t// The schema for the editor\n\t\t\tschema: {\n\t\t\t $ref: schemaDir/*,\n\t\t\t format: \"grid\"*/ //no tab version\n\t\t\t}\n\t\t });\n\t }\n\t \n\t \n\t // Hook up the validation indicator to update its status whenever the editor changes\n\t\t editor.on('change',function() {\n\t\t\t// Get an array of errors from the validator\n\t\t\tvar errors = editor.validate();\n\t\t\tvar indicator = document.getElementById('valid_indicator');\n\t\t\t// watcher on concepts fields\n\t\t\tvar watcherCallback = function(path) {\n\t\t\t console.log(\"field with path: [\" + path + \"] changed to [\" + JSON.stringify(this.getEditor(path).getValue()) + \"]\");\n\t\t\t var e=$('select[name=\"' + this.getEditor(path).select2[0].name + '\"]');\n\t\t\t var nameValue = e[0].options[e[0].selectedIndex].text;\n\t\t\t this.getEditor(\"root.publicServiceIsDescribedAt.0.dataMapping.0.name\").setValue(nameValue);\n\t\t\t \n\t\t\t}\n\t\t\tfor (var key in editor.editors) {\n\t\t\tvar regex = \".conceptId\";\n\n\t\t\t if (editor.editors.hasOwnProperty(key) && key.match(regex)) {\n\t\t\t\teditor.watch(key, watcherCallback.bind(editor, key));\n\t\t\t }\n\t\t\t}\n\t\t });\n\t \n\t \n\t if(importJSONSink){\n\t\t\t//Clear the sessionStorage to implement standard behaviour on refreshing page\n\t\t\tsessionStorage.removeItem('jsonSink');\n\t }\n\t \n\t // Hook up the submit button to log to the console\n\t document.getElementById('submit').addEventListener('click',function() {\n\n\t\tif (confirm( 'Il servizio verrà creato, sei sicuro di voler procedere?')){ \n\t\t\t\n\t\t\tvar payload = editor.getValue();\n\t\t\t\n\t\t\t//console.log(\"REGISTERING NEW SERVICE, submitting to CDV: \");\n\t\t\t//console.log(payload);\n\t\t\t\n\t\t\t//POST - create_apipath\n\t\t\tvar url_ = \"http://\"+app_parameters.host_param+\":\"+app_parameters.port_param+\n\t\t\t\t\t\t\"/\"+app_parameters.create_apipath;\n\t\t\t$.ajax({\n\t\t\t\turl: url_,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcontentType: \"application/json\",\n\t\t\t\tdata: JSON.stringify(editor.getValue()),\n\t\t\t}).done(function(data) {\n\t\t\t\t//console.log(\"RIPOSTA POST REGISTRAZIONE NUOVO SERVIZIO: \"+data);\n\t\t\t\t//console.log(data);\n\t\t\t\t\n\t\t\t\tvar nome = payload.publicServiceName.replace(\" \",\"-\");\n\t\t\t\twindow.location.href = window.location.origin+\"/service-editor/edit-service.html?\"+nome+\"&\"+payload.publicServiceID;\n\t\t\t\n\t\t\t}).fail(function() {\n\t\t\t alert( \"Errors occurred in service registration. Please be careful and try again...\" );\n\t\t\t})\n\t\t}\n\t });\n\t \n\t /* Old jsonEditor dummy RESTORE feature\n\t * // Hook up the Restore to Default button\n\t document.getElementById('restore').addEventListener('click',function() {\n\t\teditor.setValue(starting_value);\n\t });*/\n}\n}", "handleEdit(id){\n window.location = '/journalists/edit/' + id\n }", "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "function editTask(e){\n ui.showEidtState();\n const id = e.target.parentElement.id.split('-')[1];\n http\n .get(`http://localhost:3000/Tasks/${id}`)\n .then(data => {\n ui.fillForm(data);\n });\n}", "edit() {\n if (this.valid && this.changed) {\n\n ipcRenderer.send('studentUpdate', {\n id: this.id,\n fullName: this.name.value,\n socialID: this.sid.value,\n parentsName: this.parentName.value,\n parentNumber: this.parentPhone.value,\n sex: this.sex.value,\n phoneNumber: this.phone.value,\n birthDate: `${this.birthDate.year.value}/${this.birthDate.month.value}/${this.birthDate.day.value}`,\n address: this.address.value\n })\n\n this.changed = false\n }\n }", "handleEdit(id){\n window.location = '/customers/edit/' + id;\n }", "nav_helper_edit(data) {\n\t\tutil.selectDropDown(this.group,data.Group,'Group','Account Info');\n\t\tutil.selectDropDown(this.clientName,data.ClientName,'Client Name','Account Info ');\n\t\tutil.selectDropDown(this.accountNameDpn,data.AccountName,'Account Number','Account Info');\n\t\tutil.elementClickable(this.editBtn)\n\t}", "function edit() {\n // Update view.\n ctrl.showEditCommitmentForm(scope.commitment);\n }", "function edit() {\n // Update view.\n ctrl.showEditCommitmentForm(scope.commitment);\n }", "function editPost(data) {\n User\n .posts.updateById(\n {\n id: vm.userId,\n fk: $stateParams.id\n },\n {\n title: data.title,\n content: data.content\n })\n .$promise\n .then(function() {\n $state.go('postDetail', {id: $stateParams.id});\n });\n }", "function postEdit(id) {\n updateId = id;\n axios.get(`api/posts/${id}`)\n .then((res)=> {\n editTitle.value = res.data.title;\n editDesc.value = res.data.description;\n })\n .catch(errors=> {\n console.log(errors.response);\n })\n}", "onEditSave(wineEdited) {\n const url = `${api}/wines/${wineEdited.id}`;\n const req = $.ajax({\n url: url,\n dataType: 'json',\n type: 'POST',\n data: wineEdited\n });\n\n req.done(() => {\n this.loadWines();\n });\n\n req.fail((xhr, status, err) => {\n console.error(url, status, err.toString());\n });\n }", "fillForm(data){\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "function handleEventEdit() {\n const currentEvent = $(this)\n .parent()\n .parent()\n .data(\"event\");\n\n $.post(`/api/userevents/${currentEvent.id}`).then(() => {\n location.reload();\n });\n }", "function edit_post(req, res) {\n var data = {\n action: req.url\n };\n\n if (req.params.postid) {\n\n console.log(req.method);\n\n if (req.method === 'POST') {\n Posts.findByIdAndUpdate(req.params.postid, {\n title: req.body.title,\n content: req.body.content\n }, {new: true}, function(err, post) {\n if (err) {\n req.flash('error', 'Error!');\n res.redirect('/admin/posts');\n return;\n }\n\n req.flash('success', 'Saved!');\n data.item = post;\n res.render('admin/pages/edit-post', { title: 'Posts', data: data, messages: req.flash() }); \n })\n }\n if (req.method === 'GET') {\n Posts.findById(req.params.postid, function(err, item) {\n if (err) {\n req.flash('error', 'Error!');\n res.redirect('/admin/posts');\n return;\n }\n \n data.item = item;\n res.render('admin/pages/edit-post', { title: 'Posts', data: data, messages: req.flash() }); \n });\n }\n \n\n } else {\n if (req.body.title) {\n\n Posts.create({\n title: req.body.title,\n content: req.body.content\n }, function (err, small) {\n if (err) {\n req.flash('error', 'Not Create Post!');\n resp.redirect('/admin/post/add');\n //res.render('admin/pages/edit-post', { title: 'Posts', options: options, messages: req.flash() }); \n }\n // saved!\n req.flash('success', 'Saved!');\n res.redirect('/admin/post/add');\n });\n\n } else {\n res.render('admin/pages/edit-post', { title: 'Posts', data: data, messages: req.flash() });\n }\n } \n}", "edit() {\n this._enterEditMode();\n }", "function setEdit(edit) {\n dispatch({ type: 'SET_EDIT', payload: edit })\n }", "fillForm(data) {\n this.titleInput.value = data.title;\n this.bodyInput.value = data.body;\n this.idInput.value = data.id;\n\n this.changeFormState('edit');\n }", "function editHistorico(){\r\n submitForm($('#formHistorico').get(0), getContextApp()+'/proposta/editar.action', false);\r\n}", "function EditRequest() {\n const history = useHistory();\n const { id } = useParams();\n const [error, setError] = useState({\n error: []\n })\n const [data, setData] = useState({\n id:\"\",\n user_name: \"\",\n request_type:\"\",\n description:\"\",\n status:\"\"\n });\n useEffect(() => {\n loadEditRequest();\n }, [])\n const loadEditRequest = () => {\n const result = axios.get(`http://127.0.0.1:8000/api/editrequest/${id}`)\n .then(response => {\n setData(response.data.requests)\n })\n .catch(error => {\n alert(\"something Went Wrong\");\n })\n\n }\n\n const onchange = (e) => {\n setData({ ...data, [e.target.name]: e.target.value });\n }\n const submitted = (e) => {\n e.preventDefault();\n // console.log(data);\n Edit();\n //console.log(error);\n\n }\n\n const Edit = () => {\n const result = axios.post(`http://127.0.0.1:8000/api/editrequestoparation/${id}`, JSON.stringify(data), { headers: { \"Content-Type\": \"application/json\" } })\n .then(response => {\n if (response.data.status === 200) {\n alert(\"User Eddited Succefully\");\n history.push(\"/requestlist\")\n } else {\n setError({\n error: response.data.error\n })\n }\n })\n .catch(error => {\n alert(\"Something Went Wrong\");\n })\n\n }\n\n return (\n <>\n <Sidebarmeo />\n <Header />\n <div className=\"content\" >\n <div class=\"container-fluid\">\n <div class=\"container-fluid\" >\n <div class=\"row justify-content-center\">\n <div class=\"col-lg-12\">\n <div class=\"card m-lg-5\">\n <div class=\"card-body\">\n <div class=\"form-validation\" class=\"alert alert-primary\">\n <form onSubmit={(e) => submitted(e)} class=\"form-valide\">\n\n \n <div class=\"form-group row\">\n <label class=\"col-lg-4 col-form-label\" for=\"val-id\">ID<span\n class=\"text-danger\">*</span>\n </label>\n <div class=\"col-lg-6\">\n <input type=\"number\" class=\"form-control\" id=\"val-id\" name=\"id\"\n placeholder=\"\" onChange={(e) => onchange(e)} name=\"id\" value={data.id} />\n {/* error */}\n <div className=\"error alert-danger\">\n <p>{error.error.id}</p>\n </div>\n </div>\n </div>\n <div class=\"form-group row\">\n <label class=\"col-lg-4 col-form-label\" for=\"val-username\">USERNAME <span\n class=\"text-danger\">*</span>\n </label>\n <div class=\"col-lg-6\">\n <input type=\"text\" class=\"form-control\" id=\"val-username\"\n name=\"user_name\" placeholder=\"\" onChange={(e) => onchange(e)} name=\"user_name\" value={data.user_name} />\n {/* error */}\n <div className=\"error alert-danger\">\n <p>{error.error.user_name}</p>\n </div>\n </div>\n\n </div>\n <div class=\"form-group row\">\n <label class=\"col-lg-4 col-form-label\" for=\"val-request_type\">REQUEST_TYPE <span\n class=\"text-danger\">*</span>\n </label>\n <div class=\"col-lg-6\">\n <input type=\"text\" class=\"form-control\" id=\"val-request_type\" name=\"request_type\"\n placeholder=\"\" onChange={(e) => onchange(e)} name=\"request_type\" value={data.request_type} />\n {/* error */}\n <div className=\"error alert-danger\">\n <p>{error.error.request_type}</p>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-lg-4 col-form-label\"\n for=\"val-confirm-password\">DESCRIPTION<span\n class=\"text-danger\">*</span>\n </label>\n <div class=\"col-lg-6\">\n <input type=\"text\" class=\"form-control\" id=\"val-confirm-password\"\n name=\"description\" placeholder=\"\" onChange={(e) => onchange(e)} name=\"description\" value={data.description} />\n {/* error */}\n <div className=\"error alert-danger\">\n <p>{error.error.address}</p>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-lg-4 col-form-label\" for=\"val-phoneus\">STATUS\n <span class=\"text-danger\">*</span>\n </label>\n <div class=\"col-lg-6\">\n <input type=\"text\" class=\"form-control\" id=\"val-phoneus\"\n name=\"status\" placeholder=\"\" onChange={(e) => onchange(e)} name=\"status\" value={data.status} />\n {/* error */}\n <div className=\"error alert-danger\">\n <p>{error.error.status}</p>\n </div>\n </div>\n </div>\n\n <div class=\"form-group row\">\n <label class=\"col-lg-4 col-form-label\" for=\"val-phoneus\">\n\n </label>\n <div class=\"col-lg-6\">\n <button type=\"submit\"\n class=\"class=btn btn-dark w-100\">EDIT REQUEST</button>\n </div>\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n </div>\n </>\n\n );\n}", "function update_entity_edit() {\n var form_record = Domain.entities[current_entity];\n Forms.init(form_record);\n update_edit_form_display();\n}", "function edit(type, index) {\n\t\n\t// disable all of screen until the response so that there won't be any collisions\n\t$(\"#menuArea, #viewArea, #officialViewer\").addClass(\"disableButtons\");\n\t\n\t// get correct id to get statCol button element (delete and cancel don't have ids)\n\tvar id_type = (type == 'cancel' || type == 'delete') ? 'stat' : type;\n\t// get correct element\n\tvar elem = $(\"#\" + id_type + \"_\" + index);\n\t// confirm a cancel, which takes immediate effect in removing a definition from staging\n\tif(type == 'cancel' && !confirm(\n\t\t\t\"Are you sure you want to revert all unpublished changes to this entry?\")) {\n\t\t$(\"#menuArea, #viewArea, #officialViewer\").removeClass(\"disableButtons\");\n\t\treturn;\n\t}\n\t\n\t// if published, stat button should have no effect (can't be accepted without a change)\n\tif(type == 'stat' && elem.text() == 'unedited') {\n\t\t$(\"#menuArea, #viewArea, #officialViewer\").removeClass(\"disableButtons\");\n\t\treturn;\n\t}\n\t\n\t// request change\n\t$.post('backend.php', {'loginInfo': {'allowed': true, 'user': 'me'},\n\t\t\t\t\t\t\t'mod': {'wordId': words[index]['wordData']['id'],\n\t\t\t\t\t\t\t\t'field': type, 'new': elem.val(),\n\t\t\t\t\t\t\t\t'deleteToggled': (words[index]['stagingData']['deleted']\n\t\t\t\t\t\t\t\t\t\t\t&& type == \"stat\") || type == 'delete'}},\n\t\t\tfunction(data, status, jqXHR) {\n\t\t\t\t// called on server response\n\t\t\t\tif(data['status']['type'] == 'success') {\n\t\t\t\t\t// don't alert user, since success is assumed, and keep server's change\n\t\t\t\t\twords[index] = data['new'];\n\t\t\t\t\tif(words[index] == true) {\n\t\t\t\t\t\t// the change was a removal (cancel), so reload the page\n\t\t\t\t\t\tsubmitSearch(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// standard edit.\n\t\t\t\t\t\telem.parent().parent().replaceWith(createTableEntry(words[index],\n\t\t\t\t\t\t\t\tindex));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// alert user of failure and revert change\n\t\t\t\t\telem.parent().parent().replaceWith(createTableEntry(words[index], index));\n\t\t\t\t\talert(\"The change you made to the word \"\n\t\t\t\t\t\t\t+ words[index]['wordData']['word'] + \" (\"\n\t\t\t\t\t\t\t+ words[index]['wordData']['pos'] + \", \"\n\t\t\t\t\t\t\t+ words[index]['wordData']['id'] + \") failed and were reverted.\"\n\t\t\t\t\t\t\t+ \"They were most likely badly formatted\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// unlock screen so the user can continue\n\t\t\t\t$(\"#menuArea, #viewArea, #officialViewer\").removeClass(\"disableButtons\");\n\t\t\t}, 'json');\n}", "edit() {\n cy.visit(\"/rooms\");\n cy.get(this.ROOM_CONT).last().children(this.DOTS).click();\n cy.get(this.EDIT_BTN).click();\n cy.get(this.PAGE_TITLE).should(\"contain\", \"Room\")\n .and(\"contain\", \"Delete\");\n cy.get(this.CAT_FIELD).select(this.CAT_VAL);\n cy.get(this.NUM_FIELD).clear().type(this.NUM_VAL);\n cy.get(this.FLOOR_FIELD).clear().type(this.FLOOR_VAL);\n cy.get(this.AVAILABLE_CHECK).click();\n cy.get(this.PRICE_FIELD).clear().type(this.PRICE_VAL);\n cy.get(this.FEAT_FIELD).select(this.FEAT_VAL);\n cy.get(this.SAVE_BTN).contains(\"Save\").click();\n }", "function onedit(req, res) {\n\n const id = req.params.id;\n\n db.collection('profiles').findOne({\n _id: mongo.ObjectID(id),\n }, done);\n\n function done(err, data) {\n if (err) {\n next(err);\n } else {\n res.render('edit-profile.ejs', { \n profile: data //vult de data in die we al hebben\n });\n }\n }\n}", "function editPerson() {\n\n\n $(\"#editPerson\").show();\n $(\"#addperson\").hide();\n\n var obj = $(this).data();\n\n editP = obj;\n\n $(\"#personInput\").toggle();\n\n// $(\"#myModal\").toggle();\n\n\n $('#inputPersonName').val(obj.firstName);\n $('#inputLastname').val(obj.lastName);\n $('#inputPersonEmail').val(obj.email);\n $('#oleole').val(79879);\n\n}", "handleEditSubmit (event) {\n event.preventDefault();\n //on submit, call AJAX post to API\n const editedGoalId = this.state.goalBeingEdited.id;\n this.postEditedGoals(editedGoalId);\n }", "function editForeign(hid) {\n\n executePost(editForeignUrl, $(\"form\").serialize());\n}", "renderEditForm(event) {\n let id = event.target.getAttribute('data-id');\n\n document.querySelector('.edit-popup').classList.remove('hide');\n document.querySelector('.edit-popup').classList.add('show');\n document.querySelector('.btn-update').setAttribute('data-id', id);\n\n mockData.forEach(item => {\n if (item.id === id) {\n document.querySelector('.edit-item').value = item.title;\n }\n });\n}", "function EditDataFunct() {\n\n //debugger;\n\n $(\"#tableRow_\" + Intern_LineEditedNum).html(GenerateTableLine(Intern_LineEditedNum));\n AddEvents(Intern_LineEditedNum);\n Intern_LineEditedNum = null;\n ClearAllInputs();\n $('#' + Intern_AddButtonId).html(Disp_TextAdd);\n Intern_InputFieldElems[0].focus();\n }", "function goToEquipmentEditPage() {\n $('#equip_id').val(window.equipmentRecord.item.object.id);\n $('#equip_make').val(window.equipmentRecord.item.object.make);\n $('#equip_model').val(window.equipmentRecord.item.object.model);\n $('#equip_length').val(window.equipmentRecord.item.object.length);\n $('#equip_width').val(window.equipmentRecord.item.object.width);\n $('#equip_height').val(window.equipmentRecord.item.object.height);\n $('#equip_weight').val(window.equipmentRecord.item.object.weight);\n $('#equip_commodity').val(window.equipmentRecord.item.object.commodity);\n $('textarea#equip_loading_instructions').val(window.equipmentRecord.item.object.loading_instructions);\n }", "function editGratitude() {\n //Found gratitude -- apply edits\n gratitude.title = req.body.title;\n gratitude.text = req.body.text;\n gratitude.editUserId = decoded.user._id;\n gratitude.editTimestamp = Date.now();\n \n //Save gratitude\n gratitude.save(function(err, savedGratitude) {\n if(err) {\n return res.status(500).json({\n title: 'Edited Gratitude',\n error: err\n })\n }\n //Successfully saved\n return res.status(201).json({\n title: 'Gratitude edited',\n obj: savedGratitude\n })\n })\n }", "function opciones_editar(id){\n $.get(\"/gestionAccesos/opciones/\"+id+\"/edit\", function (data) {\n console.log(data);\n $('#frm_Opciones').removeClass('hidden');\n $('.option_tipoUsuario').prop('selected',false); // deseleccioamos todas las zonas del combo\n $(`#cmb_tipousuario option[value=\"${data.idtipo_usuario}\"]`).prop('selected',true); // seleccionamos la zona que pertenece el sector seleccionado \n $(\"#cmb_tipousuario\").trigger(\"chosen:updated\"); \n \n\n \n $('.option_ruta').prop(\"selected\", false);\n $.each(data.resultado, function(index, gestion){ \n $(`#cmb_ruta option[value=\"${gestion.idruta}\"]`).prop(\"selected\", true); \n $(\"#cmb_ruta\").trigger(\"chosen:updated\"); \n }); \n \n \n });\n\n $('#method_Opciones').val('PUT'); \n $('#frm_Opciones').prop('action',window.location.protocol+'//'+window.location.host+'/gestionAccesos/opciones/'+id);\n $('#btn_opciones_cancelar').removeClass('hidden');\n\n $('html,body').animate({scrollTop:$('#administradorOpciones').offset().top},400);\n}", "handleEdit() {\n return this.props.dispatch(push(`/admin/people/edit/${this.props.match.params.person_serialNumber}`))\n }", "edit() {\n }", "function DisplayEditDatainForm(obj) {\n debugger;\n var _this = $(obj).closest(\".main-data\");\n $(\"#firstname\").val(_this.find(\"td\").eq(0).html());\n $(\"#lastname\").val(_this.find(\"td\").eq(1).html());\n $(\"#mobileno\").val(_this.find(\"td\").eq(2).html().trim());\n _this.find(\"td\").eq(3).html().trim() == 'Male' ? $('#male').attr('checked', 'checked') : $('#female').attr('checked', 'checked')\n $(\"#borrower_Id\").val(_this.attr(\"data-id\"));\n\n //change Add Button\n $(\".btn-success\").val(\"Edit\");\n}", "handleEdit() {\n this.message(this.newText());\n this.isEditPending(true);\n this.isEditingOpen(false);\n return updateMessage(this.id, {\n state: this.state().slug,\n message: this.newText(),\n author: this.app.author(),\n }).then((newMessage) => {\n this.updateWith(newMessage);\n return this.isEditPending(false);\n });\n }", "function onSubmitEditUser(e) {\r\n e.preventDefault();\r\n fetch(`https://contact-list-phase2-app.herokuapp.com/users/${id}`, {\r\n method: \"PATCH\",\r\n headers: {\r\n Accept: \"application/json\",\r\n \"content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify(formData),\r\n })\r\n .then((res) => res.json())\r\n .then((userData) => {\r\n setFormData(userData);\r\n });\r\n }", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "function btnMostraEditarLocalizacion(id){\n\n $(\"#headerLocalizacion\").html('<i class=\"fa fa-edit\"></i> ACTUALIZAR LOCALIZACION PREDIO');\n $('#formLocalizacion')[0].reset();//limpiar formulario\n $.get('localizacionpredio/'+id+'/edit', function (data) {\n $('#name').val(data.name);\n $('#indice').val(data.indice);\n });\n\n $(\"#btnLocalizacion\").attr('class','btn btn-warning');\n $(\"#method_localizacion\").val('PUT');\n $(\"#formLocalizacion\").attr('action','localizacionpredio/'+id);//fijamos laruta para editar window.location.protocol+'//'+window.location.host+'/closet/'+id);\n $(\"#btnLocalizacion\").html('<i class=\"fa fa-save\"></i> Actualizar ');\n $(\"#formModaLocalizacion\").modal('show');\n }", "function editJson(){\r\n\t\t$http.post('http://localhost:8081/editTask', $scope.task);\r\n\t}", "_editItem() {\n // Edit Item from Order's Items array:\n let items = this.order.items;\n items[this.item.key] = this.item;\n this.order.items = items;\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "function editData(n) {\n setValue(document.getElementById(\"eg\"), n);\n $('#editlink').hide();\n $('#deletelink').hide();\n $('#unapprovelink').hide();\n $('#dtable').hide();\n $('#etable').show();\n}", "function editMode() {\n name.html('<input value=\"' + name.html() + '\"></input>');\n details.html('<input value=\"' + details.html() + '\"></input>');\n actions.html('<button type=\"button\" class=\"btn btn-default btn-xs submit-btn\"><span title=\"Submit\" class=\"glyphicon glyphicon-ok\"></span></button>'\n + '<button type=\"button\" class=\"btn btn-default btn-xs cancel-btn\"><span title=\"Cancel\" class=\"glyphicon glyphicon-remove\"></span></button>');\n }", "async function editMatrikel() {\n try {\n\n CheckMatrikelNrFormat();\n\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: current.data.name,\n username: current.data.username,\n matrikelNr: matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }", "function editar_todo(indice,todos){\n const mod_titulo = document.getElementById('mod-titulo')\n mod_titulo.value = todos[indice].titulo\n const mod_descripcion = document.getElementById('mod-descripcion')\n mod_descripcion.value = todos[indice].descripcion\n const btn_modificar = document.getElementById('modificar')\n btn_modificar.addEventListener('click',async ()=>{\n const model = document.getElementById('model')\n model.style.display = 'none'\n let url = window.origin+'/modificar_todo'\n let todo = todos[indice]\n todo.titulo = mod_titulo.value\n todo.descripcion = mod_descripcion.value\n let data = await fetch(url,{\n method: 'PUT',\n credentials: 'include',\n cache: 'no-cache',\n body: JSON.stringify(todo),\n headers: new Headers({\n 'content-type':'application/json'\n })\n })\n render()\n })\n}", "async function editName() {\n try {\n // get Userinfo to fill out the missing variables in put requests\n const current = await api.get(`/users/${sessionStorage.getItem('id')}`);\n\n const requestBody = JSON.stringify({\n name: name,\n username: current.data.username,\n matrikelNr: current.data.matrikelNr\n });\n\n // Edit is sent to backend\n await api.put(`/users/${sessionStorage.getItem('id')}`, requestBody);\n\n } catch (error) {\n alert(`Something went wrong while editing the user: \\n${handleError(error)}`);\n }\n }" ]
[ "0.7771302", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7301777", "0.72475225", "0.69805485", "0.69672596", "0.6955587", "0.6945238", "0.68680555", "0.6860806", "0.68564874", "0.6675044", "0.66404355", "0.6612959", "0.6588204", "0.65847933", "0.655912", "0.65462846", "0.6543962", "0.6542194", "0.6530503", "0.652168", "0.6509707", "0.650525", "0.6499024", "0.64953345", "0.6494466", "0.64799255", "0.64538425", "0.6446346", "0.64237547", "0.64195466", "0.6416716", "0.6416527", "0.6413354", "0.6396281", "0.6389871", "0.6378238", "0.6376619", "0.6374931", "0.63727397", "0.63717675", "0.63708514", "0.6355095", "0.6345254", "0.63356185", "0.63353735", "0.6333361", "0.63271976", "0.63099843", "0.63039905", "0.63039905", "0.63017523", "0.6297313", "0.62971836", "0.62956184", "0.6293958", "0.6293958", "0.62887543", "0.62874395", "0.62793326", "0.6278975", "0.62780297", "0.6266775", "0.62649053", "0.6261454", "0.62590337", "0.6258935", "0.6258489", "0.62571305", "0.6252564", "0.6243706", "0.6240035", "0.62392116", "0.62365156", "0.6235301", "0.62351143", "0.62317765", "0.6217048", "0.6214237", "0.6211247", "0.6207922", "0.6207568", "0.61987114", "0.61953", "0.61939484", "0.6190871", "0.61855006", "0.6183009", "0.61755365", "0.6169536", "0.6168654", "0.61632264", "0.6159682", "0.6157611" ]
0.0
-1
Depcreated, use "/logout" instead. Will be removed in later release.
logout(req, res) { if (req.session) { req.session = null; } if (req.logout) { req.logout(); } res.redirect(`${this.config.baseUriPath}/`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logout () {\n\n }", "function dummyLogout() {\n document.location = baseUrl + \"auth/logout/?redirect=\" + document.location;\n }", "function interpret_logout(content) {\n}", "function safeLogout() {\n clearCache();\n toDashboard.url = '';\n m.siteAlias = '';\n $location.path('/login');\n }", "function authLogout() {\n\t\tif (getAuthCookie() !== null)\n\t\t\trequest('GET', tools.urlLogout, authLogoutSuccess, authLogoutError);\n\t}", "logout() {\n return request.post('/logout')\n }", "function logout() {\n\n }", "logout () {\n return request.post('/logout')\n }", "function logout() {\n client.logout();\n window.location = \"#page-login\";\n }", "logout(request, response) {\n\t\trequest.logout();\n\t\tresponse.redirect('/');\n\t}", "function logout() {\n window.Lemonade.Mirror.send('logout', CookieManager.getCookie('loggedIn_user'), CookieManager.getCookie('loggedIn_session'));\n\n Store.AuthStore.dispatch(Auth.LOGOUT_ACTION());\n CookieManager.removeCookie('loggedIn');\n CookieManager.removeCookie('loggedIn_user');\n CookieManager.removeCookie('loggedIn_session');\n}", "function globalLogout() {\n document.location = mov.vars.adminUrl + \"auth/logout/?redirect=\" + document.location;\n }", "logout() { Backend.auth.logout(); }", "function _logOutUser () {\n \tserverRequestService.serverRequest(PROJET_HEADER_CTRL_API_OBJECT.logout, 'GET');\n }", "function logout()\n {\n\n }", "function logout() {\n if (!document.execCommand(\"ClearAuthenticationCache\")) {\n $.ajax({\n async: false,\n url: \"/.login\",\n type: 'GET',\n username: 'logout'\n });\n }\n window.location = \"/\";\n }", "forceLogout() {\n this.logout();\n this.send('logout', {});\n }", "logout() {\n Backend.logout();\n }", "handleLogout() {\n UserService.logOut();\n }", "function logout()\r\n{\r\n\tcallServerLogout();\r\n}", "function logout() {\n _localforage2.default.clear();\n window.location = window.location.origin;\n}", "logout() {\n deprecate('The elevio.logout function is being deprecated please use elevio.logoutUser instead', false, {\n id: 'ember-elevio.logout',\n until: '1.0.0'\n });\n\n this.logoutUser();\n }", "function logout() {\n _basicLogin.logout();\n _handleSuccessLogin(null);\n}", "function onAfterLogout() {\n\t\twindow.location = \"/\";\n\t}", "function logout() {\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n } ]\n };\n call_server('logout', dataObj);\n}", "function logOut() {\n\n const url = '/logout';\n\n $.ajax({\n type: \"get\",\n url: url,\n cache: false,\n success: function(data, status) {\n if(data.data == \"success\") {\n\t\t\twindow.location.replace(\"/\")\n }\n },\n error: function(xhr, textStatus, errorThrown) {\n console.log('Error! Status = ' + xhr.status);\n }\n });\n}", "static getLogout(ctx) {\n // note cookies are held in top-level domain to enable common login between admin & report\n const domain = ctx.request.hostname.replace('admin.', '');\n\n // delete the cookie holding the JSON Web Token\n const options = { signed: true, domain: domain };\n ctx.cookies.set('koa:jwt', null, options);\n ctx.cookies.set('koa:jwt', null, { signed: true }); // TODO: tmp for transition period\n ctx.response.redirect('/');\n }", "_logout() {\n this._closeMenu();\n AuthActions.logout();\n }", "function logout() {\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"post\");\n form.setAttribute(\"action\", \"logout\");\n document.body.appendChild(form);\n form.submit();\n}", "function logout() {\n\tlocation.href = 'logout.jsp';\n}", "logout () {\n // dropCookie(\"idSesion\");\n window.location.href = '../html/login.html';\n }", "function logout(req, res) {\n req.logout();\n res.send(null);\n}", "function logout() {\n var name = settings.name;\n name = (name ? '_' + name : '');\n $.Storage.remove('token' + name, null);\n $.Storage.remove('login' + name, null);\n if (settings.history) {\n command_line.history().disable();\n }\n login();\n }", "function logout() {\n userService.logout()\n .then(function() {\n $location.url(\"\");\n });\n }", "_logoutImmediatelly() {\n const authenticateService = new AuthenticateService();\n authenticateService.logout();\n return {\n type: 'LOGOUT'\n };\n }", "function exit_user(){\n window.location.href='/logout'\n}", "function logOut (req, res, next) {\n if (req.user){\n req.logout();\n res.redirect('/');\n }\n}", "function logout() {\n authlog('auth0 logging out');\n clearLocalSession(); // return url strips hash and search string to remove\n // any auth creds and prevent double counting of utm\n\n webAuth.logout({\n clientId: AUTH0_CLIENT_ID,\n returnTo: document.location.origin + '/logout/?redirectUri=' + document.location.origin + document.location.pathname\n }, function (err) {\n if (!err) {\n module.exports.trigger('logout');\n }\n });\n}", "function logout() {\n props.logoutAction();\n cookies.remove('token');\n history.push('/Login')\n }", "function logout(){\n fetch(\"/logout\")\n}", "function logout(){\r\n window.location.href = \"../Login Page/login.html\";\r\n ls.kill();\r\n}", "function logout() {\n userService.logout()\n .then(\n $location.url(\"/login\"));\n }", "function logoff(){\n location.replace(\"/\");\n}", "function logout() {\n //$cookies.remove('token');\n }", "function logout() {\n //$cookies.remove('token');\n }", "function sign_out() {}", "logout(request, response) {\n response.cookie(\"member\", \"\");\n response.cookie(\"trainer\", \"\");\n response.redirect(\"/\");\n }", "function logout ( req, res ) {\n req.session = null\n res.redirect('/')\n}", "getLogout(e) {\n window.sessionStorage.clear();\n this.userHasAuthenticated(false);\n window.location = '/';\n }", "logout() {\n document.cookie = \"username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;\";\n }", "function postUserLogout(data, textStatus, jqXHR, param) {\n\t$('#topmenu').html('');\n\t$('#authninfo').html('');\n\twindow.location = WEBAUTHNHOME + '/static';\n}", "function logout(req, res) {\n req.logOut();\n res.send(200);\n }", "function logout() {\n\t\tif (Modernizr.localstorage) {\n\t\t\tlocalStorage.removeItem('X-Authorization-Token');\n\t\t}\n\t\t\n\t\twindow.location.href = '/';\n\t}", "async logout ({ auth,request , response}) {\n await auth.logout()\n return response.redirect('/login')\n }", "function be_logout(page) {\n ask({cmd:'be_logout',page:page},_be_logout,'jo?');\n}", "function log_out() {\n if (is_logged_in()) {\n remove_param('last_sync');\n remove_param('last_sync_user');\n set_cookie(\"user\", \"\");\n clean_db(function() { window.location = \"index.html\"; });\n }\n}", "function logoutUser() {\n $.get(\"/logout\")\n .then(function() {\n window.location.replace(\"/\");\n\n })\n .catch(function(err) {\n console.log(err);\n });\n }", "function logout(callback) {\n\tsendRequest({ request: 'logout' }, callback);\n}", "function logout() {\n userService\n .logout()\n .then(function () {\n $location.url('/');\n });\n }", "[LOGOUT_REQUEST] (state) {\n state.processingLogout = true\n state.logoutErrorMessage = ''\n }", "function after_Logout() {\n\t\twindow.location = WAKL.CONST.PAGE_LOGIN;\n\t}", "function logout() {\n _Configstore2.default.delete(Constants.CONF_APPS_DETAIL);\n _Configstore2.default.delete(Constants.CONF_APPS_LIST);\n _Configstore2.default.delete(Constants.CONF_PASSWORD);\n set(Constants.CONF_PASSWORD, '');\n _Configstore2.default.set(Constants.CONF_IS_LOGGED_IN, false);\n}", "function logout() {\n userService.logout();\n return { type: userConstants.LOGOUT };\n}", "function removeCookiesAndLogout() {\n window.location.replace(\"/api/user/logout\");\n}", "function logout() {\n UserService\n .logout()\n .then(\n function (response) {\n $location.url(\"/login\");\n },\n function () {\n $location.url(\"/login\");\n }\n );\n }", "function logout(req, res, next) {\n return res.send({\n success: false,\n message: \"server-side logout defunct\"\n })\n}", "function logoutAction() {\n localStorage.removeItem(\"ecom_token\");\n return { type: types.UNAUTHENTICATED };\n}", "function user_logout_pagechange() {\n try {\n user_logout({\n success: function(data) {\n drupalgap_goto(drupalgap.settings.front);\n }\n });\n }\n catch (error) { console.log('user_logout_pagechange - ' + error); }\n}", "function user_logout_pagechange() {\n try {\n user_logout({\n success: function(data) {\n drupalgap_goto(drupalgap.settings.front);\n }\n });\n }\n catch (error) { console.log('user_logout_pagechange - ' + error); }\n}", "async function handleLogout() {\n try {\n await logout()\n history.push(\"/\")\n } catch {\n console.log(\"Failed to log out\")\n }\n }", "static logout() {\n return Api.logout();\n }", "function logout() {\n\tuserService.logout();\n\treturn { type: userConstants.LOGOUT };\n}", "function logout () {\n storage.removeItem('onenote')\n storage.removeItem('onenote_section_id')\n\n apiRequests\n .get(`${URLS.LOGOUT}`, {\n client_id: ONENOTE.client_id,\n redirect_uri: ONENOTE.redirect_uri\n })\n .timeout(TIMEOUTS)\n .then(function (response) {\n if (response && response.ok) {\n console.log('Logged out?', response.ok)\n } else {\n console.log(response)\n }\n })\n .catch(function (err) {\n console.log(err)\n })\n}", "function loginlogout() {\n // If the is auth is false then we want to login now.\n if (authService.authentication.isAuth) {\n authService.logOut();\n }\n else {\n $location.path(\"/login\");\n }\n }", "function doLogout() {\n $.ajax(`${urlOrigin}${restapp}/logout`, {\n success: (data, textStatus, jqXHR) => {\n // todo: enhance this handling\n window.location.href = 'login.html';\n setUserInfo();\n },\n error: (jqXHR, textStatus, errorThrown) => {\n console.log(jqXHR, textStatus, errorThrown);\n notify('Error on logout. See log for more detail.', NotificationEnum.ERROR);\n window.location.href = 'login.html';\n setUserInfo();\n }\n });\n}", "function logout() {\n UserService.logout().then(\n function(res){ $location.url(\"/\"); $route.reload(); },\n function(error){ $location.url(\"/\"); $route.reload(); });\n }", "function logout() {\n window.sessionStorage.clear()\n window.location.href = window.backend_url + \"logout\";\n }", "logout(callback) {\n super.del(this.baseUrl + '/v1/logout', {}, callback);\n }", "function logout() {\r\n $cookieStore.remove('username');\r\n service.redirect('login.html');\r\n// $http.get('api/auth/logout').then(function (data) {\r\n// service.currentUser = null;\r\n// service.redirect('app/home');\r\n// });\r\n }", "handleLogout() {\n this.props.logout(() => {\n this.props.history.push('/login');\n });\n }", "function logout(req, res) {\n req.session.destroy();\n res.redirect(\"/\");\n}", "function logout(req, res){\n userID = \"\";\n res.redirect(\"/\");\n}", "logout() {\n auth.logOut();\n history.push('/meals');\n }", "function signOut() {\n if (authService.isAuth()) {\n authService.signOut();\n sendTo(\"/\");\n }\n}", "function DoLogout()\n{\n if (bSwitchingContext)\n {\n return;\n }\n \n if (top.bEnableExternalLogout)\n {\n $.ajax(\n {\n async: false,\n url: top.sLogoutUrl\n });\n top.location.href = top.sExternalLogoutUrl;\n }\n else\n {\n top.location.href = top.sLogoutUrl;\n }\n}", "logout() {\n this.kdAuthService_.logout();\n }", "function logoff() {\n authService.logout().then(function (response) {\n $state.go('home');\n }, function (err) {\n vm.signupErrorMsg = \"Sorry, there was an error loging you out. Try again\";\n });\n }", "logOut(e) {\n\t\t// prevent default behavior\n\t\te.preventDefault();\n\n\t\t// authenticate login\n\t\tauth.logout( (loggedOut) => {\n\t\t\t// if we register the user\n\t\t\tif (loggedOut) {\n\t\t\t\t// send us to their profile page\n\t\t\t\tthis.context.router.push({pathname: '/'})\n\t\t\t}\n\t\t})\n\t}", "function logout() {\r\n authenticationService.logout();\r\n toastr.success('Goodbye!');\r\n }", "logout () {\n this.logoutLink.click();\n }", "function logout(req, res){\n resetSession(req);\n deleteCookie(res, req);\n res.redirect('/');\n}", "function logout(){\n $rootScope.$broadcast('flashMessage', {\n type: 'warning',\n content: 'Come back soon!'\n });\n $auth.logout();\n $state.go('craveIndex');\n }", "static logout() {\n AuthService.clearSession();\n clearTimeout(tokenRenewalTimeout);\n }", "handleLogout() {\n this.props.logout();\n }", "function logout(request, isManual, whereAmI, onSuccess) {\n\n}", "logout () {\n API.User.Logout(AppStorage.getAuthToken())\n .then(() => {\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n .catch(error => {\n AppSignal.sendError(error)\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n }", "logOut() {\n authContextApi.logOut();\n }", "function logout() {\n return async (ctx) => {\n const { username } = ctx.request.body;\n\n log.info('[Auth/logout] username', username);\n\n ctx.logout();\n\n ctx.status = 200;\n };\n}", "function logout (argv, cb) {\n var args = argv._;\n fhreq.POST(fhreq.getFeedHenryUrl(), \"box/srv/1.1/act/sys/auth/logout\", function (err, remoteData, raw, response) {\n var user = fhc.config.get('username');\n if(err) return cb(err);\n ini.del('cookie');\n ini.del('username');\n ini.del(keys.KEY_ID);\n ini.save(function(err){\n // remove from targets\n var targ = fhc.config.get(\"feedhenry\");\n targets.removeTarget(targ, user);\n logout.message = \"Successfully logged out of \" + targ;\n return cb(err, remoteData);\n });\n });\n}", "function logOut(){\n clearCurrentUser();\n showLoggedOutView();\n}" ]
[ "0.74865955", "0.7353531", "0.7343239", "0.73090696", "0.72075164", "0.7161158", "0.7159108", "0.71406037", "0.71129096", "0.7108269", "0.71011007", "0.70770174", "0.7074036", "0.7037562", "0.7013939", "0.6992817", "0.69379467", "0.69060564", "0.68928", "0.68755186", "0.68699586", "0.68682855", "0.68650424", "0.6841906", "0.6796497", "0.67767686", "0.67705077", "0.67671174", "0.6739551", "0.6738207", "0.6730419", "0.672504", "0.67239785", "0.67201304", "0.67107075", "0.6688963", "0.6686536", "0.6684361", "0.6683285", "0.66680586", "0.6656887", "0.66568536", "0.6632117", "0.66306806", "0.66306806", "0.6625764", "0.661892", "0.6615134", "0.66125375", "0.66064143", "0.66022086", "0.65889317", "0.65826803", "0.6577911", "0.65771896", "0.6575235", "0.65716773", "0.6571197", "0.65710294", "0.65646946", "0.6557649", "0.65487033", "0.65352917", "0.6534405", "0.6532935", "0.65245575", "0.652433", "0.65176713", "0.65176713", "0.65164304", "0.6515494", "0.6502635", "0.65003085", "0.64980227", "0.64930385", "0.64877886", "0.64844376", "0.6469987", "0.6467846", "0.64671254", "0.6465147", "0.6464979", "0.6462633", "0.64578974", "0.64481235", "0.6446592", "0.6444606", "0.6443306", "0.6443136", "0.6437113", "0.64362913", "0.6424463", "0.64221954", "0.6402063", "0.6401677", "0.6390779", "0.6389921", "0.63830703", "0.637621", "0.6373067" ]
0.66537094
42
You shouldn't need to edit this function its tests should pass once you've written makeDisplayNameFromId
function makeProducerDiv(producer) { const containerDiv = document.createElement("div"); containerDiv.className = "producer"; const displayName = makeDisplayNameFromId(producer.id); const currentCost = producer.price; let html = ` <div class="producer-column"> <div class="producer-title">${displayName}</div> <button type="button" id="buy_${producer.id}">Buy</button> </div> <div class="producer-column"> <div>Quantity: ${producer.qty}</div> <div>Coffee/second: ${producer.cps}</div> <div>Cost: ${currentCost} coffee</div> </div> `; containerDiv.innerHTML = html; return containerDiv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDisplayNameFromId(id) {\n let words = id.split('_');\n let titleCaseWords = [];\n\n words.forEach(word => {\n titleCaseWords.push(word.charAt(0).toUpperCase() + word.slice(1));\n })\n\n // returns a string - from [] to '' w' join plus add a space between words\n return titleCaseWords.join(' ');\n}", "getDisplayName() {}", "function getDisplayNameByUserId(userId) {\n return getDisplayNameByUser(Object(mattermost_redux_selectors_entities_users__WEBPACK_IMPORTED_MODULE_18__[\"getUser\"])(stores_redux_store_jsx__WEBPACK_IMPORTED_MODULE_30__[\"default\"].getState(), userId));\n}", "set displayName(value) {}", "function getFildName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "get displayName() {\n return this._data.display_name;\n }", "function displayEntireName(userId) {\n return displayEntireNameForUser(Object(mattermost_redux_selectors_entities_users__WEBPACK_IMPORTED_MODULE_18__[\"getUser\"])(stores_redux_store_jsx__WEBPACK_IMPORTED_MODULE_30__[\"default\"].getState(), userId));\n}", "get displayName() {}", "get name(): string {\n return this._displayName || this._userId;\n }", "getDisplayName() {\r\n var name = this.auth.currentUser.displayName;\r\n var nameArr = name.split(\" \");\r\n return nameArr[0];\r\n }", "function setDisplayName(d) {\n return insertTsIgnoreBeforeStatement(typescript_1.default.createExpressionStatement(typescript_1.default.createBinary(typescript_1.default.createPropertyAccess(typescript_1.default.createIdentifier(d.displayName), typescript_1.default.createIdentifier(\"displayName\")), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.createLiteral(d.displayName))));\n}", "function displayName(user) {\n const html = `<br><br>\n <h1>${user.first_name} ${user.last_name}</h1>\n `;\n const display = document.getElementById('display-name')\n display.innerHTML = html\n return html\n}", "function displayName(data) {\n\t\t\t$('#name').html('<h1>' + data.name + '</h1>');\n\t\t\t//console.log(data.name);\n\t\t}", "function setDisplayName(videoSpanId, displayName, key) {\n var nameSpan = $('#' + videoSpanId + '>span.displayname');\n var defaultLocalDisplayName = APP.translation.generateTranslatonHTML(\n interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);\n\n // If we already have a display name for this video.\n if (nameSpan.length > 0) {\n var nameSpanElement = nameSpan.get(0);\n\n if (nameSpanElement.id === 'localDisplayName' &&\n $('#localDisplayName').text() !== displayName) {\n if (displayName && displayName.length > 0)\n {\n var meHTML = APP.translation.generateTranslatonHTML(\"me\");\n $('#localDisplayName').html(displayName + ' (' + meHTML + ')');\n }\n else\n $('#localDisplayName').html(defaultLocalDisplayName);\n } else {\n if (displayName && displayName.length > 0)\n {\n $('#' + videoSpanId + '_name').html(displayName);\n }\n else if (key && key.length > 0)\n {\n var nameHtml = APP.translation.generateTranslatonHTML(key);\n $('#' + videoSpanId + '_name').html(nameHtml);\n }\n else\n $('#' + videoSpanId + '_name').text(\n interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);\n }\n } else {\n var editButton = null;\n\n nameSpan = document.createElement('span');\n nameSpan.className = 'displayname';\n $('#' + videoSpanId)[0].appendChild(nameSpan);\n\n if (videoSpanId === 'localVideoContainer') {\n editButton = createEditDisplayNameButton();\n if (displayName && displayName.length > 0) {\n var meHTML = APP.translation.generateTranslatonHTML(\"me\");\n nameSpan.innerHTML = displayName + meHTML;\n }\n else\n nameSpan.innerHTML = defaultLocalDisplayName;\n }\n else {\n if (displayName && displayName.length > 0) {\n\n nameSpan.innerText = displayName;\n }\n else\n nameSpan.innerText = interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;\n }\n\n\n if (!editButton) {\n nameSpan.id = videoSpanId + '_name';\n } else {\n nameSpan.id = 'localDisplayName';\n $('#' + videoSpanId)[0].appendChild(editButton);\n //translates popover of edit button\n APP.translation.translateElement($(\"a.displayname\"));\n\n var editableText = document.createElement('input');\n editableText.className = 'displayname';\n editableText.type = 'text';\n editableText.id = 'editDisplayName';\n\n if (displayName && displayName.length) {\n editableText.value\n = displayName;\n }\n\n var defaultNickname = APP.translation.translateString(\n \"defaultNickname\", {name: \"Jane Pink\"});\n editableText.setAttribute('style', 'display:none;');\n editableText.setAttribute('data-18n',\n '[placeholder]defaultNickname');\n editableText.setAttribute(\"data-i18n-options\",\n JSON.stringify({name: \"Jane Pink\"}));\n editableText.setAttribute(\"placeholder\", defaultNickname);\n\n $('#' + videoSpanId)[0].appendChild(editableText);\n\n $('#localVideoContainer .displayname')\n .bind(\"click\", function (e) {\n\n e.preventDefault();\n e.stopPropagation();\n $('#localDisplayName').hide();\n $('#editDisplayName').show();\n $('#editDisplayName').focus();\n $('#editDisplayName').select();\n\n $('#editDisplayName').one(\"focusout\", function (e) {\n VideoLayout.inputDisplayNameHandler(this.value);\n });\n\n $('#editDisplayName').on('keydown', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n VideoLayout.inputDisplayNameHandler(this.value);\n }\n });\n });\n }\n }\n}", "function setDisplayName(videoSpanId, displayName, key) {\n var nameSpan = $('#' + videoSpanId + '>span.displayname');\n var defaultLocalDisplayName = APP.translation.generateTranslatonHTML(\n interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);\n\n // If we already have a display name for this video.\n if (nameSpan.length > 0) {\n var nameSpanElement = nameSpan.get(0);\n\n if (nameSpanElement.id === 'localDisplayName' &&\n $('#localDisplayName').text() !== displayName) {\n if (displayName && displayName.length > 0)\n {\n var meHTML = APP.translation.generateTranslatonHTML(\"me\");\n $('#localDisplayName').html(displayName + ' (' + meHTML + ')');\n }\n else\n $('#localDisplayName').html(defaultLocalDisplayName);\n } else {\n if (displayName && displayName.length > 0)\n {\n $('#' + videoSpanId + '_name').html(displayName);\n }\n else if (key && key.length > 0)\n {\n var nameHtml = APP.translation.generateTranslatonHTML(key);\n $('#' + videoSpanId + '_name').html(nameHtml);\n }\n else\n $('#' + videoSpanId + '_name').text(\n interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);\n }\n } else {\n var editButton = null;\n\n nameSpan = document.createElement('span');\n nameSpan.className = 'displayname';\n $('#' + videoSpanId)[0].appendChild(nameSpan);\n\n if (videoSpanId === 'localVideoContainer') {\n editButton = createEditDisplayNameButton();\n if (displayName && displayName.length > 0) {\n var meHTML = APP.translation.generateTranslatonHTML(\"me\");\n nameSpan.innerHTML = displayName + meHTML;\n }\n else\n nameSpan.innerHTML = defaultLocalDisplayName;\n }\n else {\n if (displayName && displayName.length > 0) {\n\n nameSpan.innerText = displayName;\n }\n else\n nameSpan.innerText = interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME;\n }\n\n\n if (!editButton) {\n nameSpan.id = videoSpanId + '_name';\n } else {\n nameSpan.id = 'localDisplayName';\n $('#' + videoSpanId)[0].appendChild(editButton);\n //translates popover of edit button\n APP.translation.translateElement($(\"a.displayname\"));\n\n var editableText = document.createElement('input');\n editableText.className = 'displayname';\n editableText.type = 'text';\n editableText.id = 'editDisplayName';\n\n if (displayName && displayName.length) {\n editableText.value\n = displayName;\n }\n\n var defaultNickname = APP.translation.translateString(\n \"defaultNickname\", {name: \"Jane Pink\"});\n editableText.setAttribute('style', 'display:none;');\n editableText.setAttribute('data-18n',\n '[placeholder]defaultNickname');\n editableText.setAttribute(\"data-i18n-options\",\n JSON.stringify({name: \"Jane Pink\"}));\n editableText.setAttribute(\"placeholder\", defaultNickname);\n\n $('#' + videoSpanId)[0].appendChild(editableText);\n\n $('#localVideoContainer .displayname')\n .bind(\"click\", function (e) {\n\n e.preventDefault();\n e.stopPropagation();\n $('#localDisplayName').hide();\n $('#editDisplayName').show();\n $('#editDisplayName').focus();\n $('#editDisplayName').select();\n\n $('#editDisplayName').one(\"focusout\", function (e) {\n VideoLayout.inputDisplayNameHandler(this.value);\n });\n\n $('#editDisplayName').on('keydown', function (e) {\n if (e.keyCode === 13) {\n e.preventDefault();\n VideoLayout.inputDisplayNameHandler(this.value);\n }\n });\n });\n }\n }\n}", "display_name ()\n {\n function names ()\n {\n function distinct (array)\n {\n const ret = [];\n array.forEach (x => !ret.includes (x) ? ret.push (x) : null);\n return (ret);\n }\n\n const ret = [];\n if (this.name)\n ret.push (this.name);\n if (this.mRID)\n ret.push (this.mRID);\n ret.push (this.id);\n if (this.aliasName)\n ret.push (this.aliasName);\n return (distinct.call (this, ret));\n }\n\n return (names.call (this)[0]);\n }", "function displayFactAuthor(currentFact, positionId) {\n var authorName = \"Anonymous\";\n if (currentFact.user.hasOwnProperty('name')) {\n authorName = \"- \" + currentFact.user.name.first + \" \" + currentFact.user.name.last;\n }\n document.getElementById(positionId).innerHTML = authorName;\n}", "function getLabelFromId(id) {\n return id.replace('_', ' ').replace(/\\w\\S*/g, function(txt){\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n}", "function displayName() {\n\t\talet(name);\n\t}", "function displayNameUser(responseAsJson, div, authToken, apiUrl, content){\n\tconst username = document.createElement(\"h1\");\n\tusername.style.textAlign = \"center\"; //display username\n\tusername.textContent = \"@\" + responseAsJson.username;\n\tusername.className = \"listAll\"; //make username linkable to public profile\n\tusername.onclick = function(){let userPage = createUserPage(div,\n\t\t\t\t\t\t\t\t\t\t responseAsJson.username, authToken, apiUrl);\n\t\t\t\t\t\t\t\t\t\t openEdit(div, userPage)};\n\tcontent.appendChild(username);\n\tconst n = document.createElement(\"h2\"); //display name\n\tn.style.textAlign = \"center\";\n\tn.style.color = \"var(--reddit-blue)\";\n\tn.textContent = responseAsJson.name;\n\tcontent.appendChild(n);\n\treturn content;\n}", "function slaughId(id, name) {\n return id + '!' + name;\n}", "get displayName() {\r\n\t\treturn this._displayName;\r\n\t}", "get displayName()\n {\n return this._display.displayName;\n }", "getDisplayName(name) {\n let splitted = name.split(\"__\");\n if (splitted.length == 2) {\n return splitted[1];\n }\n return name;\n }", "get creatorDisplayName() {\n return this._data.creator_name;\n }", "async setDisplayName() {\n\n const newDisplayName = await this.getPreferredName();\n\n if (newDisplayName.data !== undefined) {\n this.setState({ displayedName: newDisplayName.data.preferredName });\n } else {\n this.setState({ redirect: true })\n }\n }", "function displayName(firstName, lastName) {
\n ​var nameStartTag = \"Full Name is \";\n // this inner function has access to the outer function's variables, including the parameter​\n ​function createFullName() {
 \n ​ return nameStartTag + firstName + \" \" + lastName;
 \n }\n ​\n ​ return createFullName();
\n }", "function idToName(id) {\n return id.split(\"_\").map(word => word.charAt(0).toUpperCase() + word.substr(1)).join(\" \")\n}", "getContactDisplayName(first_name, middle_name, last_name) {\n\t var key = \"\";\n\t (first_name != \"\")? key += first_name + \" \" : key = key;\n\t (middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t (last_name != \"\")? key += last_name : key = key;\n\t return key;\n\t}", "function getDisplayName(authData) {\n switch (authData.provider) {\n case 'password':\n return authData.password.email.replace(/@.*/, '');\n case 'twitter':\n return authData.twitter.displayName;\n case 'facebook':\n return authData.facebook.displayName;\n }\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "name(userId) {\n if (userId) {\n // find user from user id\n let user = Meteor.users.findOne(userId, {fields: {'username': 1}});\n // return username\n return user ? `@${user.username}`: '';\n }\n }", "function getName() {\n return \"Hai Aku Sam\";\n}", "get displayName() {\n return this._data.team_display_name;\n }", "function getDisplayName() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return null;\n }", "function displayName(fname,mname=\"\",lname)\n {\n $('#current_employee_name').text(fname+\" \"+mname+\" \"+lname);\n }", "function getName(aid, list) {\n if (aid == null || aid == 0) {\n return \"Sublease\";\n } else {\n return list;\n }\n}", "function getCompletionEntryDisplayName(name, target, performCharacterChecks) {\n if (!name) {\n return undefined;\n }\n name = ts.stripQuotes(name);\n if (!name) {\n return undefined;\n }\n // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an\n // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name.\n // e.g \"b a\" is valid quoted name but when we strip off the quotes, it is invalid.\n // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name.\n if (performCharacterChecks) {\n if (!ts.isIdentifier(name, target)) {\n return undefined;\n }\n }\n return name;\n }", "setDisplayName(displayName) {\n var self = this;\n if (!displayName) {\n displayName = self.createUsernamefromEmail(self.user.email);\n }\n self.displayName = displayName; //for updating the displayName with the email.\n self.user.updateProfile({ displayName: displayName });\n }", "generateMailNickname(displayName) {\n // currently the Microsoft Graph generates mailNickname in a similar fashion\n return `${displayName.replace(/[^a-zA-Z0-9]/g, \"\")}${Math.floor(Math.random() * 9999)}`;\n }", "function createDisplayNameParagraph(key, displayName) {\n var p = document.createElement('p');\n if(displayName)\n p.innerText = displayName;\n else if(key)\n {\n p.setAttribute(\"data-i18n\",key);\n p.innerText = APP.translation.translateString(key);\n }\n\n return p;\n}", "function displayName(name, career, description) {\n console.log(\"Name: \" + name.toUpperCase());\n console.log(\"Career: \" + career);\n console.log(\"Description: \" + description);\n console.log(\"\");//adds a blank space\n}", "function getAuthorFromIdAndFormatNameHelper(authorId, authors) {\n // use native array method find()\n const foundAuthor = authors.find((author) => author.id === authorId);\n const fullName = `${foundAuthor.name.first} ${foundAuthor.name.last}`;\n return fullName;\n}", "function getUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function displayEntireNameForUser(user) {\n if (!user) {\n return '';\n }\n\n let displayName = '@' + user.username;\n const fullName = getFullName(user);\n\n if (fullName && user.nickname) {\n displayName = react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", null, '@' + user.username, ' - ', react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", {\n className: \"light\"\n }, fullName + ' (' + user.nickname + ')'));\n } else if (fullName) {\n displayName = react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", null, '@' + user.username, ' - ', react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", {\n className: \"light\"\n }, fullName));\n } else if (user.nickname) {\n displayName = react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", null, '@' + user.username, ' - ', react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", {\n className: \"light\"\n }, '(' + user.nickname + ')'));\n }\n\n return displayName;\n}", "static displayName(item) {\n if (!item) {\n return '';\n }\n switch (item.type) {\n case ItemType.item:\n return this.getItem(item.id).displayName;\n case ItemType.underground:\n return this.getUndergroundItem(item.id).displayName;\n case ItemType.berry:\n return `${BerryType[this.getBerry(item.id)]} Berry`;\n case ItemType.gem:\n return `${PokemonType[this.getGem(item.id)]} Gem`;\n }\n }", "function identify() {\r\n return this.name.toUpperCase();\r\n}", "get displayName() {\n return this.props.get('displayName');\n }", "function getDisplayName(key) {\n const researchMode = (localStorage.getItem(\"research-mode\") === 'true');\n let displayName;\n if (!researchMode) {\n displayName = columns.find(e => e.prop === key);\n displayName = displayName && displayName.title;\n }\n // we are not in summary view anymore, or key wasn't found in summary view columns\n if (displayName === undefined) {\n displayName = researchModeColumns.find(e => e.prop === key);\n displayName = displayName && displayName.title;\n }\n // key was not found at all\n if (displayName === undefined) {\n displayName = key.replace(/_/g, \" \");\n }\n return displayName;\n}", "function getDisplayTextOfUser() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return _userInformation.UserName;\n }", "function getFieldName(input){\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function displayName(name){\r\n\tlet namePlace = document.getElementById(\"nameSpot\");\r\n\tlet user = name[name.length-1];\r\n\tlet lessNames = name.filter((item,index) =>{ return name.indexOf(item) === index});\r\n\t\r\n\t//Remove old list of names\r\n\tlet oldNames = namePlace.childNodes;\r\n\tfor(let i = oldNames.length-1;i>=0;i--){\r\n\t\toldNames[i].parentNode.removeChild(oldNames[i]);\r\n\t}\r\n\t\r\n\t//Add updated list of names\r\n\tfor(let i = 0;i<lessNames.length;i++){\r\n\t\tlet newName = document.createElement('div');\r\n\t\tnewName.class = \"name\";\r\n\t\tnewName.id = lessNames[i];\r\n\t\tnewName.innerHTML = lessNames[i] + \" is playing\";\r\n\t\tnamePlace.appendChild(newName);\r\n\t}\r\n}", "function idToHeroName (heroes, heroId) {\n for (let i = 0; i < heroes.length; i++) {\n if (heroes[i].id == heroId) {\n return heroes[i].localized_name;\n }\n }\n return 'Unknown';\n}", "getName() {}", "function injectName(collection, id, $field) {\n fetchItem(collection, id, (result) => {\n if (!result || result.error || result.name === undefined) {\n $field.text('Error loading name for: ' + id);\n } else {\n $field.text(result.name);\n }\n });\n}", "function generateName(userInfo, name) {\n console.log(\"commonName\", name);\n var fauxLeague = {\n leagueName: name,\n UserId: userInfo.id\n };\n initializeLeague(fauxLeague);\n }", "selfDetector(userId, referenceId, firstName, familyName) {\n \tif (userId === referenceId) {\n \t\treturn 'vous';\n \t} else {\n \t\treturn firstName + ' ' + familyName;\n \t}\n }", "showFullName() {\n return `${this._fullName}`;\n }", "function createEditDisplayNameButton() {\n var editButton = document.createElement('a');\n editButton.className = 'displayname';\n UIUtil.setTooltip(editButton,\n \"videothumbnail.editnickname\",\n \"top\");\n editButton.innerHTML = '<i class=\"fa fa-pencil\"></i>';\n\n return editButton;\n}", "function createEditDisplayNameButton() {\n var editButton = document.createElement('a');\n editButton.className = 'displayname';\n UIUtil.setTooltip(editButton,\n \"videothumbnail.editnickname\",\n \"top\");\n editButton.innerHTML = '<i class=\"fa fa-pencil\"></i>';\n\n return editButton;\n}", "function getName(id) {\n var name = data[id].name;\n return name;\n}", "function getFieldId(input){\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function getFieldName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function getFieldName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function getFieldName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function getFieldName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function getDisplayNameByUser(user) {\n const state = stores_redux_store_jsx__WEBPACK_IMPORTED_MODULE_30__[\"default\"].getState();\n const teammateNameDisplay = Object(mattermost_redux_selectors_entities_preferences__WEBPACK_IMPORTED_MODULE_17__[\"getTeammateNameDisplaySetting\"])(state);\n\n if (user) {\n return Object(mattermost_redux_utils_user_utils__WEBPACK_IMPORTED_MODULE_20__[\"displayUsername\"])(user, teammateNameDisplay);\n }\n\n return '';\n}", "function getDisplayName(owner) {\n\t\t\t\tconst type = owner._currentElement.type;\n\t\t\t\tconst constructor = owner._instance && owner._instance.constructor;\n\t\t\t\treturn type.displayName || constructor && constructor.displayName || null;\n\t\t\t}", "function getName(id) {\n for (var i = 0; i < peopleArray.length; i++) {\n if (peopleArray[i].id == id) {\n return (peopleArray[i].firstName + \" \" + peopleArray[i].lastName);\n }\n }\n return '404';\n}", "function getFieldId(input) {\n //return input.id.toUpperCase();\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function createOrChangeDisplayName(displayName) {\n\n // if there's a current user, the request is a PUT (update display name) else its a post (create display name)\n requestMethod = currentUserId ? 'PUT' : 'POST';\n\n // if there's a current user, the path will target that current user by id, else it uses /users\n endpoint = currentUserId ? `/users/${currentUserId}` : '/users';\n\n const request = new XMLHttpRequest();\n request.open(requestMethod, endpoint);\n request.onload = () => {\n\n // set the locally stored userId to the user id of the new/updated display name\n localStorage.setItem(\"currentUserId\", JSON.parse(request.responseText).id);\n\n // reusing the load user function. Load the new/updated user from the user id now stored locally\n load_user();\n };\n request.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n request.send(JSON.stringify({displayName: displayName}));\n}", "function getOtherUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function setDisplayName(configOrName, {\n CFBundleDisplayName,\n ...infoPlist\n}) {\n let name = null;\n if (typeof configOrName === 'string') {\n name = configOrName;\n } else {\n name = getName(configOrName);\n }\n if (!name) {\n return infoPlist;\n }\n return {\n ...infoPlist,\n CFBundleDisplayName: name\n };\n}", "function displayEntityId() {\n var description = makeTextPlane(entity[\"id\"], \"red\", 4);\n description.position = new BABYLON.Vector3(shape[0].x, shape[0].y, roofz);\n description.position.z += 1;\n description.rotation.y = Math.PI;\n }", "function getFieldName(input){\n\treturn input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "function makeFullName () {
 \n return nameIntro + firstName + \" \" + lastName;
\n }", "function IntObject_GetDesignerNameFromId(uid)\n{\n\t//result\n\tvar strName = null;\n\t//get the object from the interpreter\n\tvar intObj = __SIMULATOR.Interpreter.LoadedObjects[uid];\n\t//valid?\n\tif (intObj)\n\t{\n\t\t//get its designer name\n\t\tstrName = intObj.GetDesignerName();\n\t}\n\t//return it\n\treturn strName;\n}", "function generateId(displayName, parentComponentId) {\n var name = typeof displayName !== 'string' ? 'sc' : escape(displayName);\n // Ensure that no displayName can lead to duplicate componentIds\n identifiers[name] = (identifiers[name] || 0) + 1;\n var componentId = \"\".concat(name, \"-\").concat(generateComponentId(\n // SC_VERSION gives us isolation between multiple runtimes on the page at once\n // this is improved further with use of the babel plugin \"namespace\" feature\n SC_VERSION + name + identifiers[name]));\n return parentComponentId ? \"\".concat(parentComponentId, \"-\").concat(componentId) : componentId;\n }", "updateAuthPlayerDname(state, value) {\n state.auth_user.DisplayName = value;\n }", "function User(name) {\r\n var displayName = function (greeting) {\r\n console.log(greeting + ' ' + name);\r\n }\r\n return displayName;\r\n}", "function makeFullName () { \n return nameIntro + firstName + \" \" + lastName; \n }", "getPlayerNameById (playerId) {\n return THIS.view.players[playerId].displayName\n }", "function refreshDisplayName(formFirstName, formLastName, formDisplayName) {\n\t formDisplayName.value = formFirstName.value + ' ' + formLastName.value;\n}", "function criminalIdentifier(user_input){\r\n \r\n\r\n var array = user_input.split(\" \");\r\n var first_name, last_name;\r\n if(array.length == 2){\r\n first_name = array[0];\r\n first_name = first_name.charAt(0).toUpperCase() + first_name.slice(1) + \" \"; \r\n last_name = array[1];\r\n last_name = last_name.charAt(0).toUpperCase() + last_name.slice(1);\r\n }else if(array.length == 1){\r\n first_name = array[0];\r\n first_name = first_name.charAt(0).toUpperCase() + first_name.slice(1) + \" \";\r\n last_name = \"NONE\";\r\n }\r\n let full_name = first_name + last_name;\r\n let first_name_len = first_name.length;\r\n let last_name_len = last_name.length;\r\n\r\n // Check for exact match with real name\r\n for(let[k,v] of criminals){\r\n if(k == full_name){\r\n ret_string = \"First Name: \" + k + \". Aliases: \" + criminals.get(k) + \".\";\r\n return ret_string;\r\n }\r\n }\r\n\r\n // Checks if input is a partial match with real name\r\n // Does not return because there may be an exact alias match\r\n for(let[k,v] of criminals){\r\n let _firstname = k.substring(0, first_name_len);\r\n let _lastname = k.substring(k.length-last_name_len, k.length);\r\n if(first_name == _firstname){\r\n match = k;\r\n }else if(last_name == _lastname){\r\n match = k;\r\n }\r\n }\r\n\r\n // Check if exact match with alias\r\n for(let[k,v] of criminals){\r\n if(v == null){\r\n continue;\r\n }\r\n let temp_arr = v.split(\",\");\r\n for(let i = 0; i < temp_arr.length; i++){\r\n if(temp_arr[i] == full_name){\r\n ret_string = \"First Name: \" + k + \". Aliases: \" + criminals.get(k) + \".\";\r\n return ret_string;\r\n }\r\n }\r\n }\r\n\r\n // Checks if partial match with alias \r\n for(let[k,v] of criminals){\r\n if(v == null){\r\n continue;\r\n }\r\n let temp_arr = v.split(\",\");\r\n for(let i = 0; i < temp_arr.length; i++){\r\n var _firstname;\r\n temp_arr[i][0]== \" \" ? _firstname = temp_arr[i].substring(1, first_name_len+1) : _firstname = temp_arr[i].substring(0,first_name_len);\r\n let _lastname = temp_arr[i].substring((temp_arr[i].length - last_name_len), temp_arr[i].length);\r\n if(_firstname == first_name){\r\n match.length == 0? match = k:match = match;\r\n }else if(_lastname == last_name){\r\n match.length == 0? match = k:match = match;\r\n }\r\n }\r\n }\r\n\r\n if(match.length == 0){\r\n return \"No Match\";\r\n }\r\n \r\n ret_string = \"First Name: \" + match + \". Aliases: \" + criminals.get(match) + \".\";\r\n return ret_string;\r\n}", "function getGivenName(n){\r\n return(n)\r\n}", "function createInternalIdentifier({name, surname}) {\n return `ID-INT:${name}-${surname}`;\n}", "getFirstName() {}", "function showNameFromGrupo (idGrupo) {\n\tvar $node = $('#'+idGrupo);\n\t$node.contents ().each (function processNodes () {\n \tvar $node = $(this);\n \tif ($node.attr(\"name\")) {\n \t\tvar myId = $node.attr(\"name\");\n \t\tmyId = myId.replace(\"fakeNAME\", \"\");\n \t\t$node.attr(\"name\", myId);\n \t}\n $(this).contents ().each (processNodes);\n\t});\n}", "function getFieldName(input){\n // TODO slice vs substring?\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "getParticipantName(participant) {\n const selfInfo = this.contactManager.getLocalUser();\n let userName = this.contactManager.getDisplayName(participant.regId);\n if (participant.regId === selfInfo.regId) {\n userName = `${userName} (You)`;\n }\n return userName || participant.regId;\n }", "function displayName (err, name){\t\n \tif (name.replace(/\\b\\w/g, l => l.toUpperCase()) === 'Sergi') {\n \t\tconsole.log(\"Your name is: \" + name.replace(/\\b\\w/g, l => l.toUpperCase()))\n \t\tread(options2, displayCity)\n \t}\n \telse {\n \t\tconsole.log(name.replace(/\\b\\w/g, l => l.toUpperCase()) + '? Vaya mierda de nombre!')\n \t\tread(options, displayName)\n \t}\n }", "function getDisplayName(Component$$1) {\n\t return Component$$1.displayName || Component$$1.name || 'Component';\n\t}", "function grabUserID(id, name) {\n\t\tsetUserID(id);\n\t\tsetDisplayUserName(name);\n\t}", "function getFieldName(input) {\n\t// Get first character in input iD and make upper case. Join back with rest of string by getting all characters\n\t// with slice after first character.\n\treturn input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "getNicknameById(id){\n\n\t\t//let users = Meteor.subscribe('allUsers');\t\n\t\t\n\t\t// if (users.ready()) {\n\t\t// \tlet todos = Meteor.users.find({_id: id}).fetch(); // will return all users\n\t\t// \treturn todos[0].profile.nickname;\n\t\t// }\n\t\tconsole.log('todos los usuarios ' , this.props.allUsers);\n\t\tlet nickname = this.props.allUsers.filter(user => user._id == id);\n\t\t\n\t\tconsole.log(nickname[0].profile.nickname);\n\t\treturn nickname[0].profile.nickname\n\t}", "decedentName(deathRecord) {\n var metadata = deathRecord.metadata;\n var suffix = metadata.suffix;\n if (!suffix) {\n suffix = '';\n }\n // Format name\n if (metadata.firstName && metadata.lastName && metadata.middleName) {\n return metadata.lastName + ', ' + metadata.firstName + ' ' + metadata.middleName[0] + '. ' + suffix;\n } else if (metadata.firstName && metadata.middleName) {\n return metadata.firstName + ' ' + metadata.middleName[0] + '. ' + suffix;\n } else if (metadata.firstName && metadata.lastName) {\n return metadata.lastName + ', ' + metadata.firstName + ' ' + suffix;\n } else if (metadata.firstName) {\n return metadata.firstName + ' ' + suffix;\n } else if (metadata.lastName) {\n return metadata.lastName + ' ' + suffix;\n }\n }", "function convertFieldName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n }", "function makeFullName() {\n return `${nameIntro} ${firstName} ${lastName}`;\n }" ]
[ "0.7268972", "0.7178332", "0.6747061", "0.6557478", "0.65521824", "0.6540289", "0.6511926", "0.6493901", "0.64668846", "0.6464186", "0.64633447", "0.64587414", "0.6430982", "0.6380561", "0.6380561", "0.6351274", "0.63185704", "0.63149023", "0.6224293", "0.62138075", "0.6195007", "0.6194901", "0.61460793", "0.6131904", "0.6117229", "0.60842824", "0.607765", "0.60562855", "0.6050048", "0.6044449", "0.6017415", "0.6017415", "0.6017415", "0.6017415", "0.5991149", "0.59903985", "0.59884006", "0.5978461", "0.59715307", "0.59552795", "0.5945633", "0.592465", "0.590667", "0.5887604", "0.5859193", "0.5849296", "0.58415586", "0.5839787", "0.583962", "0.5823129", "0.5822416", "0.5814455", "0.5810661", "0.58057576", "0.57987505", "0.5784434", "0.5781981", "0.5781503", "0.5754835", "0.575422", "0.57379115", "0.5732819", "0.5732819", "0.5730159", "0.5716753", "0.57162243", "0.57162243", "0.57162243", "0.57162243", "0.5713833", "0.5713739", "0.57125974", "0.5709614", "0.57085025", "0.5705936", "0.57050526", "0.5702559", "0.56962466", "0.5694953", "0.56908506", "0.5688903", "0.56879467", "0.56864804", "0.56838745", "0.5681892", "0.56702626", "0.5669734", "0.5669017", "0.56493205", "0.56420815", "0.5641922", "0.5637187", "0.5632054", "0.56215316", "0.5617072", "0.5615653", "0.5606749", "0.5589707", "0.557882", "0.5576781", "0.55730367" ]
0.0
-1
create functionality to update the player as they progress through the game
function updateGameStatus(data) { // store total number of unlocked producers const allUnlockedProducers = getUnlockedProducers(data); // store 'directions' element const directions = document.getElementById("directions"); // store minimum upgrade price const allPrices = data.producers.map((producer) => { return producer.price; }); const cheapestUpgrade = Math.min(...allPrices); // change the text of 'directions' depending on number of upgrades, if (allUnlockedProducers.length === 12) { // if all producers are unlocked: directions.innerText = "So much coffee!!!"; } else if (allUnlockedProducers.length && data.coffee >= cheapestUpgrade) { // if producers are available and the user can afford at least one: directions.innerText = "Click to buy an upgrade! →"; } else { // otherwise, display default text: directions.innerText = "↑ Click on the coffee! ↑"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n }", "update() {\n // On every win\n win();\n // If player goes outside\n this.outsideCanvas();\n }", "update() {\n // Check if the player has reached the goal\n if (this.isReady && this.y === -25) {\n this.isReady = false;\n this.updateScore(); // Increment score by 1\n setTimeout(() => {\n // Reposition the player at the starting spot after brief delay\n [this.x, this.y] = this.startPos;\n this.isReady = true;\n }, 500);\n } else if (this.isReady && this.wantsToMove) {\n this.move(this.direction); // Move the player\n this.wantsToMove = false;\n }\n }", "update() {\n /**\n * here we need to add the resting\n * similar to working. resting should also get a timer\n */\n if (this.playerWorking) {\n this.playerTimer++;\n $('#timer').html(this.playerTimer);\n this.setInfo();\n }\n\n if (this.resting) {\n this.restingTimer -= timeUpdate();\n this.setInfo();\n if (this.restingTimer <= 0) {\n this.resting = false;\n // when the agent has rested he also is less stressed\n this.stress /= 1.5;\n this.setInfo();\n }\n }\n\n if (this.working && !this.isPlayer) {\n\n // console.log((1 / frameRate()) * TIME_SCALE);\n this.workingTimer -= timeUpdate();\n this.setInfo();\n if (this.workingTimer <= 0) {\n this.hasTraded = false;// reset to false, very IMPORTANT otherwise the agent will always be called to do a traded task\n this.tradeTask = '';\n this.working = false;\n this.currentTask = '';\n this.setInfo();\n }\n }\n }", "updateGame(){\n //Update state of objectives\n this.isObjectiveTaken();\n //Update if game is over \n this.isOver();\n\n //check whether game is over\n if(!this.gameOver){\n //updates all players data\n this.updatePlayers();\n }\n }", "update() {\n if (this.exists) {\n if (PARAMS.PLAY) {\n this.playCounter++;\n if (this.playCounter > 5) {\n PARAMS.PLAY = false;\n }\n }\n if (this.playCounter > 5) {\n this.startCounter++;\n if (this.startCounter > 5) {\n PARAMS.CONTROLS = true;\n }\n }\n\n }\n }", "function updatePlayerInfo() {\n\t\tdocument.getElementById(\"player1name\").innerText = `Name: ${player1.name}`;\n\t\tdocument.getElementById(\"player2name\").innerText = `Name: ${player2.name}`;\n\t\tdocument.getElementById(\n\t\t\t\"player1score\"\n\t\t).innerText = `Score: ${player1.getScore()}`;\n\t\tdocument.getElementById(\n\t\t\t\"player2score\"\n\t\t).innerText = `Score: ${player2.getScore()}`;\n\t\tdocument.getElementById(\"current-player\").innerText = `Current Player: ${\n\t\t\tgameFlow.getCurrentPlayer().name\n\t\t} (${gameFlow.getCurrentPlayer().sign})`;\n\t}", "function update() {\n\t/**\n\t * Flickers player when he's invincible\n\t */\n\tif (invincible && new Date().getTime() - gracePeriodFlickerTime > 250) {\n\t\tif (gracePeriodAlpha) {\n\t\t\tplayer.alpha = 0.1;\n\t\t\tgracePeriodAlpha = false;\n\t\t\tgracePeriodFlickerTime = new Date().getTime();\n\t\t} else {\n\t\t\tplayer.alpha = 1;\n\t\t\tgracePeriodAlpha = true;\n\t\t\tgracePeriodFlickerTime = new Date().getTime();\n\t\t}\n\t}\n\n\t/**\n\t * Moves all penguins\n\t */\n\tif (started) {\n\t\tpenguinsLEFT.forEach((el, i) => {\n\t\t\tel.body.velocity.x = boundingWidth * modus.penguinConfig.speed * -1;\n\t\t});\n\t\tpenguinsRIGHT.forEach((el, i) => {\n\t\t\tel.body.velocity.x = boundingWidth * modus.penguinConfig.speed;\n\t\t});\n\t}\n\n\t/**\n\t * Debug code which enables cursors for testing\n\t */\n\tif (!gyroscope && alive) {\n\t\t/**\n\t\t * When pressing left button\n\t\t */\n\t\tif (cursors.left.isDown && !cursors.right.isDown) {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = boundingWidth * -0.3;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('left' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: true,\n\t\t\t\t\tdirection: -1\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning || beforePlayerData.direction !== newPlayerData.direction) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t\t\tdirection: -1,\n\t\t\t\t\t\t\tstatus: 'movement',\n\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * When pressing right button\n\t\t\t */\n\t\t} else if (cursors.right.isDown) {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = boundingWidth * 0.3;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('right' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: true,\n\t\t\t\t\tdirection: 1\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning || beforePlayerData.direction !== newPlayerData.direction) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t\t\tdirection: 1,\n\t\t\t\t\t\t\tstatus: 'movement',\n\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// player.anims.play('right', true);\n\t\t} else {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = 0;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('turn' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: false,\n\t\t\t\t\tdirection: 0\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: false,\n\t\t\t\t\t\t\tdirection: 0,\n\t\t\t\t\t\t\tstatus: 'movement',\n\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// player.anims.play('turn');\n\t\t}\n\n\t\t/**\n\t\t * When player is not touching the floor\n\t\t */\n\t\tif (!player.body.touching.down) {\n\t\t\t//Disable crop for normal state\n\t\t\tplayer.isCropped = false;\n\t\t\tplayer.height = 359;\n\n\t\t\t//Play correct animation\n\t\t\tif (player.body.velocity.x === 0) {\n\t\t\t\tplayer.anims.play('turnJump' + avatars.indexOf(avatar));\n\t\t\t} else {\n\t\t\t\tif (player.body.velocity.x > 0) player.anims.play('rightJump' + avatars.indexOf(avatar));\n\t\t\t\tif (player.body.velocity.x < 0) player.anims.play('leftJump' + avatars.indexOf(avatar));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * When the up button is being pressed -> jump\n\t\t */\n\t\tif (cursors.up.isDown && player.body.touching.down) {\n\t\t\t//Set velocity\n\t\t\tplayer.body.velocity.y = (boundingHeight / 2) * 1.5 * -1;\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisJumping: true\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isJumping !== newPlayerData.isJumping) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisJumping: true,\n\t\t\t\t\t\t\tstatus: 'movement',\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/**\n\t\t * When player is not touching the floor\n\t\t */\n\t\tif (!player.body.touching.down) {\n\t\t\t//Disable crop for normal state\n\t\t\tplayer.isCropped = false;\n\t\t\tplayer.height = 359;\n\n\t\t\t//Play correct animation\n\t\t\tif (player.body.velocity.x === 0) {\n\t\t\t\tplayer.anims.play('turnJump' + avatars.indexOf(avatar));\n\t\t\t} else {\n\t\t\t\tif (player.body.velocity.x > 0) player.anims.play('rightJump' + avatars.indexOf(avatar));\n\t\t\t\tif (player.body.velocity.x < 0) player.anims.play('leftJump' + avatars.indexOf(avatar));\n\t\t\t}\n\t\t} else {\n\t\t\t//Player is touching the floor -> send update if multiplayer\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisJumping: false\n\t\t\t\t};\n\t\t\t\t//Check if not duplicate\n\t\t\t\tif (beforePlayerData.isJumping !== newPlayerData.isJumping) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisJumping: false,\n\t\t\t\t\t\t\tstatus: 'movement',\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If client is host and game has started -> spawn new objects\n\t */\n\tif ((host || !multiplayer) && started) {\n\t\t/**\n\t\t * Randomize when an object is being spawned\n\t\t */\n\t\tlet random = Math.random() * (modus.maxSpawnTime - modus.minSpawnTime) + modus.minSpawnTime;\n\t\tif (new Date().getTime() - lastTimeSpawn > random) {\n\t\t\t/**\n\t\t\t * 80% chance for icicle\n\t\t\t * 20% chance for penguin\n\t\t\t */\n\t\t\tlet spawnChance = Math.random();\n\t\t\tif (spawnChance <= modus.icicleChance) {\n\t\t\t\t/**\n\t\t\t\t * Spawn icicle\n\t\t\t\t */\n\n\t\t\t\t//Randomize spawn location\n\t\t\t\tlet x =\n\t\t\t\t\tMath.random() *\n\t\t\t\t\t\t(((width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85) * modus.icicleConfig.maxSpawnOffset - ((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset) +\n\t\t\t\t\t((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset;\n\n\t\t\t\t//Add sprite to the canvas\n\t\t\t\tice = this.physics.add.sprite(x, -1 * (boundingHeight * 0.4), 'icicle');\n\t\t\t\tice.scaleY = ice.scaleX = boundingWidth / 6000;\n\n\t\t\t\t//Set custom gravity (Icicle speed)\n\t\t\t\tice.setGravityY(gravity * modus.icicleConfig.gravity);\n\n\t\t\t\t//Icicle should always be on top of player\n\t\t\t\tice.setDepth(1000);\n\t\t\t\tice.setOrigin(0.5, 0);\n\n\t\t\t\t//Add the Icicle to the enemies list\n\t\t\t\tenemies.push(ice);\n\n\t\t\t\t//If alive addScore\n\t\t\t\tif (alive) addScore();\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, -1 * (boundingHeight * 0.4));\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newEnemy',\n\t\t\t\t\t\t\ttype: 'icicle',\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (spawnChance <= modus.penguinChance + modus.icicleChance) {\n\t\t\t\t/**\n\t\t\t\t * Spawn penguin\n\t\t\t\t */\n\t\t\t\tlet x;\n\t\t\t\tlet list;\n\t\t\t\tlet flip = true;\n\n\t\t\t\t//Randomize left/right\n\t\t\t\tif (Math.random() <= 0.5) {\n\t\t\t\t\tx = (width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85;\n\t\t\t\t\tlist = penguinsLEFT;\n\t\t\t\t\tflip = false;\n\t\t\t\t} else {\n\t\t\t\t\tx = (width - boundingWidth * 0.85) / 2;\n\t\t\t\t\tlist = penguinsRIGHT;\n\t\t\t\t}\n\n\t\t\t\t//Add penguin to the canvas\n\t\t\t\tlet penguin = this.physics.add.sprite(x, height - height * 0.2, 'penguin');\n\n\t\t\t\t//Scaling\n\t\t\t\tpenguin.scaleY = penguin.scaleX = boundingWidth / 16500;\n\n\t\t\t\t//Penguin should be flipped when going to the left\n\t\t\t\tpenguin.flipX = flip;\n\t\t\t\tpenguin.setOrigin(0.5, 0);\n\n\t\t\t\t//Set gravity\n\t\t\t\tpenguin.setGravityY(gravity);\n\n\t\t\t\tpenguin.setDepth(1000);\n\n\t\t\t\tpenguin.body.bounce.x = 0.5;\n\t\t\t\tpenguin.body.bounce.y = 0.5;\n\n\t\t\t\t//Penguins should be able to stand on the platform not fall through it\n\t\t\t\tthis.physics.add.collider(penguin, platforms);\n\n\t\t\t\t//Add penguin to enemy list\n\t\t\t\tenemies.push(penguin);\n\n\t\t\t\t//Add penguin to the list if it should go right or left\n\t\t\t\tlist.push(penguin);\n\n\t\t\t\t//Add score if still alive\n\t\t\t\tif (alive) addScore();\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, height - height * 0.2);\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newEnemy',\n\t\t\t\t\t\t\ttype: 'penguin',\n\t\t\t\t\t\t\tflip: flip,\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\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\t/**\n\t\t\t\t * Spawn healthPowerup\n\t\t\t\t */\n\n\t\t\t\t//Randomize spawn location\n\t\t\t\tlet x =\n\t\t\t\t\tMath.random() *\n\t\t\t\t\t\t(((width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85) * modus.icicleConfig.maxSpawnOffset - ((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset) +\n\t\t\t\t\t((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset;\n\n\t\t\t\t//Add sprite to the canvas\n\t\t\t\tlet health = this.physics.add.sprite(x, -1 * (boundingHeight * 0.4), 'heart');\n\t\t\t\thealth.scaleY = health.scaleX = boundingWidth / 22000;\n\n\t\t\t\t//Set gravity\n\t\t\t\thealth.setGravityY(gravity);\n\n\t\t\t\t//HealthPowerup should always be on top of player\n\t\t\t\thealth.setDepth(1000);\n\t\t\t\thealth.setOrigin(0.5, 0);\n\t\t\t\thealth.name = ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));\n\n\t\t\t\t//HealthPowerup should stand on the platform, not fall through\n\t\t\t\tthis.physics.add.collider(health, platforms);\n\n\t\t\t\t//Add the HealthPowerup to the powerup list\n\t\t\t\thealthPowerups.push(health);\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, -1 * (boundingHeight * 0.4));\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newPowerup',\n\t\t\t\t\t\t\ttype: 'health',\n\t\t\t\t\t\t\tid: health.name,\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\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\t//Update when an enemy has spawned\n\t\t\tlastTimeSpawn = new Date().getTime();\n\t\t}\n\t}\n\n\t/**\n\t * When multiplayer -> update player position\n\t */\n\tif (multiplayer && otherPlayerData.alive && otherPlayer !== undefined) {\n\t\t/**\n\t\t * If running to the left\n\t\t */\n\t\tif (otherPlayerData.isRunning && otherPlayerData.direction == -1) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = boundingWidth * -0.3;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('left' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If running to the right\n\t\t\t */\n\t\t} else if (otherPlayerData.isRunning && otherPlayerData.direction == 1) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = boundingWidth * 0.3;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('right' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If standing still\n\t\t\t */\n\t\t} else {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = 0;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('turn' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * If other player is jumping\n\t\t */\n\t\tif (!otherPlayer.body.touching.down) {\n\t\t\t//Play animation\n\t\t\tif (otherPlayer.body.velocity.x === 0) otherPlayer.anims.play('turnJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayer.body.velocity.x > 0) otherPlayer.anims.play('rightJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayer.body.velocity.x < 0) otherPlayer.anims.play('leftJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.isCropped = false;\n\t\t\t\totherPlayer.height = 359;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * If the other player is about to jump\n\t\t */\n\t\tif (otherPlayerData.isJumping && otherPlayer.body.touching.down) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.y = (boundingHeight / 2) * 1.5 * -1;\n\n\t\t\t//Set jumping to false so the player won't jump twice\n\t\t\totherPlayerData.isJumping = false;\n\t\t}\n\t}\n\n\t/**\n\t * If player fell of the platform -> hit\n\t */\n\tif (player.body.y > height) {\n\t\thit();\n\t}\n\n\t/**\n\t * Update highscore missions\n\t */\n\n\tif (leaderboard !== undefined) {\n\t\tif (leaderboard.length !== 0) {\n\t\t\tlet lowestScoreToBeat;\n\t\t\tlet position = 1;\n\t\t\tleaderboard.forEach((el, i) => {\n\t\t\t\tif ((el.score < lowestScoreToBeat && el.score > score) || lowestScoreToBeat === undefined) {\n\t\t\t\t\tlowestScoreToBeat = el.score;\n\t\t\t\t\tposition = i + 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\thighscorePositionObject.innerHTML = `${position}e`;\n\t\t\thighscoreScoreObject.innerHTML = lowestScoreToBeat;\n\t\t} else {\n\t\t\thighscorePositionObject.innerHTML = `1e`;\n\t\t\thighscoreScoreObject.innerHTML = 0;\n\t\t}\n\t} else {\n\t\thighscorePositionObject.innerHTML = `1e`;\n\t\thighscoreScoreObject.innerHTML = 0;\n\t}\n}", "function update() {\n player.update(gameInput.inputs);\n\n render();\n}", "_update() {\r\n // Pause or Unpause game\r\n if (this._keyPressed(\"Space\")) {\r\n this.paused = !this.paused;\r\n this.pauseLayer.style.visibility = (this.paused) ? 'visible' : 'hidden';\r\n }\r\n\r\n this._updateTime();\r\n \r\n // If the game is won, check if the player wants to restart game\r\n if (this.levelNum > MAX_LEVEL) {\r\n this.pauseLayer.style.visibility = 'visible';\r\n if (this._keyPressed(\"KeyR\")) {\r\n this.pauseLayer.style.visibility = 'hidden';\r\n this.accumulatedTime = 0;\r\n this.lastDate = Date.now();\r\n this.startHours = new Date(0).getHours();\r\n this.levelNum = 0;\r\n this._setLevel();\r\n return;\r\n }\r\n }\r\n else if (!this.paused) { // Otherwise, update the player logic\r\n if (this._updatePlayer()) {\r\n if (this.levelNum <= MAX_LEVEL) {\r\n this._setLevel();\r\n }\r\n } \r\n }\r\n }", "function update() {\n\t\t\t\tplayer.update();\n\t\t\t\tcomputer.update(ball);\n\t\t\t\tball.update(player.paddle, computer.paddle);\n\t\t\t\tdocument.getElementById(\"pongScore\").innerHTML = \"Score = \" + score;\n\t\t\t}", "update() {\n // make the task archive constarined within a max value\n if(this.decision_archive.length > DATA_POINTS){\n this.decision_archive.splice(0, 1);\n }\n /**\n * here we need to add the resting \n * similar to working. resting should also get a timer\n */\n if (this.playerWorking) {\n this.playerTimer++;\n $('#timer').html(this.playerTimer);\n this.setInfo();\n }\n\n if (this.working && !this.isPlayer) {\n\n this.workingTimer -= timeUpdate();\n this.setInfo();\n if (this.workingTimer <= 0) {\n this.has_swapped = false;// reset to false, very IMPORTANT otherwise the agent will always be called to do a swapped task\n this.swap_task = '';\n this.working = false;\n this.currentTask = '';\n this.done_for_the_day = true;\n this.setInfo();\n }\n }\n }", "update() {\n this.getProgression();\n }", "function updatePlayer() {\n player.update();\n player.draw();\n\n // game over\n if (player.y + player.height >= canvas.height) {\n gameOver();\n }\n }", "function update(){\n winSong.pause();\n soundtrack.play();\n gameLoop = requestAnimationFrame(update);\n getInput();\n enemyMovement();\n physics();\n wrapPlayers();\n drawGame();\n}", "function update(dt) {\n gameTime += dt;\n player.update();\n\n}", "function gamePlay() {\r\n // Check whether the player is on a platform\r\n var isOnPlatform = player.isOnPlatform();\r\n \r\n // Update player position\r\n var displacement = new Point();\r\n\r\n // Move left or right\r\n if (player.motion == motionType.LEFT)\r\n displacement.x = -MOVE_DISPLACEMENT;\r\n if (player.motion == motionType.RIGHT)\r\n displacement.x = MOVE_DISPLACEMENT;\r\n\r\n // Fall\r\n if (!isOnPlatform && player.verticalSpeed <= 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n }\r\n\r\n // Jump\r\n if (player.verticalSpeed > 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n if (player.verticalSpeed <= 0)\r\n player.verticalSpeed = 0;\r\n }\r\n\r\n // Get the new position of the player\r\n var position = new Point();\r\n position.x = player.position.x + displacement.x;\r\n position.y = player.position.y + displacement.y;\r\n\r\n // Check collision with platforms and screen\r\n player.collidePlatform(position);\r\n player.collideScreen(position);\r\n\r\n // Set the location back to the player object (before update the screen)\r\n player.position = position;\r\n\r\n player.checkEnterPortal(position)\r\n updateScreen();\r\n\r\n processCoin(player.findCoin(player.position))\r\n if(!cheatMode && bumpIntoGhost(player.position)!=-1){\r\n gameOver()\r\n console.log(\"bumpIntoGhost\")\r\n }\r\n\r\n if (player.findExit(player.position)){\r\n proceedToNextRound()\r\n }\r\n}", "function update() {\r\n\r\n // update game\r\n game.update();\r\n\r\n // toggle tower clickable depending on the user's money\r\n updateTowerStore();\r\n\r\n let { type, lives, money, level, difficulty } = game.getLevelStats();\r\n\r\n // update lives and money based on game stats \r\n livesLabel.innerHTML = 'Lives: ' + lives;\r\n moneyLabel.innerHTML = '$' + money;\r\n levelLabel.innerHTML = 'Level: ' + level; \r\n difficultyLabel.innerHTML = 'difficulty: ' + difficulty;\r\n nextLevelLabel.innerHTML = '';\r\n\r\n if (type) nextLevelLabel.appendChild(ENEMY_IMAGES[type]);\r\n else nextLevelLabel.style.display = 'none';\r\n\r\n // increase flashing transparency\r\n flashingTransparency = flashingTransparency + .2;\r\n}", "function update(player) {\n var duration = player.duration; // Durée totale\n var time = player.currentTime;// Temps écoulé\n\n var fraction = time / duration;\n var percent = Math.ceil(fraction * 100);\n\n var progress = document.querySelector('#progressBar');\n progress.style.width = percent + '%';\n}", "function updateProgress(){\n $(\".line\").val( Player.audioObj.currentTime / Player.audioObj.duration );\n }", "update() {\n this.player.update(this.cursors);\n }", "function update(){\n scoreboard.update();\n redTeam.forEach(player => player.update());\n blueTeam.forEach(player => player.update());\n\n}", "function update() {\n for (modInd--;modInd>=0;modInd--) {\n updateAction(modPart[modInd][0], modPart[modInd][1]);\n }\n modInd = 0;\n if (showPlayer)\n try { updatePlayer(); } catch (e) { }\n draw();\n setTimeout(update, gameSpeed);\n }", "function updatePlayer(player) {\n playerDisplay.textContent = `${player}'s Move`;\n}", "function update()\n{\n time++;\n setPlayers();\n smart_heal();\n loot();\n update_state();\n}", "function refreshPlayerInfo() {\r\n if (player.gameState === GameState.Night) {\r\n setNightPlayerInfo();\r\n }\r\n else {\r\n setDayPlayerInfo();\r\n }\r\n}", "function update(){\n\t\tsetTimeout(function(){\n\t\t\taddPlayer();\n\t\t\tupdatePlayer();\n\t\t\tchecks();\n\t\t\t$('#roomPlayers').children('.player').each(function(){\n\t\t\t\tvar playerID = $(this).attr('player-id');\n\t\t\t\tcheckPlay(playerID);\n\t\t\t\tplayerChecks(playerID);\n\t\t\t});\n\t\tupdate();\n\t\t}, 1000);\n\t}", "playerStateChanged(playerCurrentState) {\n // console.log('player current update state', playerCurrentState)\n }", "function updateProgressBar() {\n let progressBar = document.getElementById('progress-bar');\n let percentage = Math.floor((100 / player.duration) *\n player.currentTime);\n let currentTime = getHHMMSS(player.currentTime);\n let durationElement = document.getElementById('duration');\n durationElement.innerHTML = currentTime + '/' + duration;\n progressBar.value = percentage;\n progressBar.innerHTML = percentage + '% played';\n}", "onUpdate() {\n let game = this;\n for (let player in this.players) {\n this.getClientData(player).then(data => {\n if (game.players[player].update)\n game.players[player].update(data)\n }).catch(err => {\n logger.error(err);\n });\n }\n }", "updatePlayers(){\n var players = this.getAllPlayers();\n for(var i = 0; i < players.length; i++){\n var player = players[i];\n player.update();\n }\n }", "function update(){\n\tif(!paused){\n\t\tif (!countdown){ // a minute has passed if the countdown is zero\n\t\t\tmin_elapsed++; \n\t\t\tcountdown = interval;\n\t\t\tdrinkNow(); // Tell the user it's time to drink.\n\t\t\tif(external_uri != null) extCall(); // If needed, make the external call\n\t\t\t$('player').nextVideo(); // Load the next video in the playlist.\n\t\t}\n\t\telse{\n\t\t\tcountdown--;\n\t\t}\n\t}\n\tif(!paused) sec_elapsed++;\n\tupdateUI(); // Show the new data\n\t//console.log(countdown);\n}", "update() { }", "update() { }", "update() {\n if (this.y > 380) { //if player attempts to go over the 380 limit, player will remain at the 380 position\n this.y = 380;\n } else if (this.y < 0) { //if player a reaches to the top of the canvas (where the water is), player will be relocated to the default location\n this.x = 202;\n this.y = 380;\n\n score++; //score increments by 1 when player gets in range of the water\n $('.num').text(score); //updated score then gets appended to .num span\n }\n\n if (this.x > 400) { //if player attempts to go over 400 on the right or 0 on the left, player's position with remain at the 400 or 0 position\n this.x = 400;\n } else if (this.x < 0) {\n this.x = 0;\n }\n }", "function changePlayer() {\n player = player + 1;\n }", "function updateTurn(){\n // check winner\n model.getWinner();\n\n // update player turn with visual effct\n showTurn();\n model.round++;\n // call this function to see if there are no cards left in the game.\n createGameOverPage();\n createWinnerPage();\n // rest time stamp\n model.initialTime = (new Date()).getTime();\n }", "renderui(){\n this.events.emit('updateresources', {\n currenthp: this.player.currenthp,\n maxhp: this.player.maxhp,\n currentend: this.player.currentend,\n maxend: this.player.maxend,\n currentmana: this.player.currentmana,\n maxmana: this.player.maxmana,\n target: this.player.target ? this.player.target : null\n })\n this.events.emit('updateabilities',{\n gcd: this.GCD.timer ? Math.floor(this.GCD.timer.getProgress() * 1000) : 1000, //it starts in sub 1 levels \n value: this.GCD.value\n })\n }", "update() {\n // Update player position.\n this.player.updatePosition();\n\n // If player collided by exit tile, the player finished the level.\n let exitCollision = this.exit.collidedBy(this.player);\n if (exitCollision) {\n this.finished = true;\n }\n\n // If player collided with a wall, it's game over.\n let wallCollision = this.collisionHandler.handleCollision(this.player);\n if (wallCollision && !this.disableCollisions) {\n this.gameOver = true;\n }\n\n // Update player animation.\n this.player.updateAnimation();\n \n // Handle potential player collision with shrimp\n // and update shrimp animation.\n for (let i = this.shrimp.length-1; i >= 0; i--) {\n let shrimp = this.shrimp[i];\n \n if (shrimp.collidedBy(this.player)) {\n this.lightRadius = this.lightRadiusMax;\n this.shrimp.splice(this.shrimp.indexOf(shrimp), 1);\n this.shrimpEaten = true;\n }\n \n shrimp.updateAnimation();\n }\n\n // Shrink light circle.\n this.decreaseLight();\n }", "recalculate(player){}", "function updateProgress() {\n elements.progressBar.style.width = `${\n (elements.video.currentTime / elements.video.duration) * 100\n }%`;\n elements.currentTime.textContent = `${displayTime(\n elements.video.currentTime\n )} / `;\n elements.durationTime.textContent = `${displayTime(elements.video.duration)}`;\n}", "function update() {\n // Test for game over, make the score bigger with a game over message\n if (gameOver) {\n lastScoreText = scoreText.text;\n scoreText.setPosition(150, 40);\n scoreText.setFill('red');\n scoreText.setFontSize(100);\n scoreText.setText(lastScoreText + '\\nGame over');\n this.scene.pause('default');\n } // Check if the player got the amount of points selected in the form -> Win\n else if (score >= document.getElementById('winScore').value) {\n player.setTint(0x008000);\n lastScoreText = scoreText.text;\n scoreText.setPosition(150, 40);\n scoreText.setFill('green');\n scoreText.setFontSize(100);\n scoreText.setText(lastScoreText + '\\nYou won!!');\n this.scene.pause('default');\n }\n\n // Check if space or up arrow are pressed and the player is on the floor to perform a jump\n if ((cursors.space.isDown || cursors.up.isDown) && player.body.onFloor())\n {\n player.body.setVelocityY(-400); // jump up\n }\n // Checking if the left arrow key is pressed\n if (cursors.left.isDown) {\n player.body.setVelocityX(-200); // move left\n player.flipX= true; // flip the sprite to the left\n if (player.body.onFloor()) {\n player.anims.play('left', true); // play walk animation\n }\n } // Check if the right arrow key is pressed\n else if (cursors.right.isDown) {\n player.body.setVelocityX(200); // move right\n player.flipX = false; // use the original sprite looking to the right\n if (player.body.onFloor()) {\n player.anims.play('right', true); // play walk animation\n }\n } else {\n // Checks if the player is not moving anymore to stop the movement\n player.body.setVelocityX(0);\n player.anims.play('idle', true);\n }\n }", "function battleUpdates(data) {\n\t\t$(\"loading\").classList.add(\"hidden\");\n\t\t$(\"p1-turn-results\").innerText = \"Player 1 played \" + data.results[\"p1-move\"] +\n\t\t\t\t\t\t\t\t\t\t \" and \" + data.results[\"p1-result\"] + \"!\";\n\t\tif (data.results[\"p2-move\"] === null || data.results[\"p2-result\"] === null){\n\t\t\t$(\"p2-turn-results\").classList.add(\"hidden\");\n\t\t} else {\n\t\t\t$(\"p2-turn-results\").innerText = \"Player 2 played \" + data.results[\"p2-move\"] +\n\t\t\t\t\t\t\t\t\t\t \" and \" + data.results[\"p2-result\"] + \"!\";\n\t\t}\n\t\tlet p1Data = data.p1;\n\t\tlet p2Data = data.p2;\n\t\tgameID = data.guid;\n\t\tupdateBuffs(p1Data, \"#my-card \");\n\t\tupdateBuffs(p2Data, \"#their-card \");\n\t\tupdateHP(p1Data, \"#my-card \");\n\t\tupdateHP(p2Data, \"#their-card \");\n\t}", "updateUI() {\n document.getElementById(\"health\").innerHTML = this.currPlayerHealth;\n document.getElementById(\"food\").innerHTML = this.playerFood;\n document.getElementById(\"turn\").innerHTML = this.turnNum;\n document.getElementById(\"lvl\").innerHTML = this.currentLevel;\n document.getElementById(\"scr\").innerHTML = this.playerScore;\n\n }", "function handlePlayerChange() {\n currentPlayer = currentPlayer === \"X\" ? \"O\" : \"X\";\n //updating interface\n statusDisplay.innerHTML = currentPlayerTurn();\n}", "function computerPhase() {\n removeEventListeners();\n nextPlayer();\n randomComputerPlay.firstRoll();\n randomComputerPlay.makeProgress(activePlayer);\n}", "function updatePlayerLives() {\n playerLives = playerLives - 1;\n //play sad fog horn sound\n fogHorn.play();\n //display the new number of lives\n drawPlayerLives()\n //if the player has no more lives, make gameOver true\n if (playerLives < 1) {\n gameOver = true;\n }\n}", "function update()\n\t\t{\n\t\t\tdocument.getElementById('songTime').innerHTML = millisToMins(player.currentTime);\n\t\t\tslider.value = player.currentTime;\n\t\t}", "updateGame() {\r\n grid.updateInfos(); // Met à jour les cases armes et force si besoin\r\n newGame.nextTurn(); // Change le joueur actif\r\n $('#playerName').html(currentPlayer.name).prop(\"class\", \"name-\" + currentPlayer.className);\r\n\r\n newGame.resetTrajectory(); // Efface l'ancienne trajectoire\r\n\r\n if (!this.isAdjacent()) { // Si les deux joueurs ne sont pas côte à côte, on exécute\r\n newGame.setTrajectory();\r\n grid.highlightTraj(); // Met en évidence sur le plateau les cases accessibles\r\n newGame.movePlayer(); // Déplace le joueur\r\n } else {\r\n if (panneauAffiche !== 1) {\r\n $('#annonce-fight').fadeIn(\"slow\", function () {\r\n $(this).delay(3000).fadeOut(\"fast\")\r\n panneauAffiche = 1\r\n })\r\n grid.fighting()\r\n\r\n }\r\n }\r\n\r\n }", "function main() {\n\tvar now = Date.now();\n\tvar dt = (now - lastTime) / 1000.0; // dt is unused on the client side... for now.\n\tif (!isGamePaused)\n\t{\n\t\t\n\t\tcheckServerTimeout();\n\t\t\n\t\tsendServerUpdatePacket(handleInput());\n\t\t\n\t}\n\tlastTime = now;\n\trequestAnimFrame(main);\n}", "function progressGame() {\n var result = ticTac.isWinner();\n console.log(\"Result : \" + result);\n if (result === -1) {\n ticTac.nextMove();\n return;\n }\n else if (result === 'draw') ticTac.drawHandler();\n else ticTac.winHandler(result);\n ticTac.resetGame();\n }", "_updateProgress() {\n if (this.videoPlayer && this.state.playing) {\n const playedTime = Math.floor(this.videoPlayer.currentTime);\n const progress = playedTime / this.videoDuration;\n this.setState({progress});\n\n if (this.props.onProgressTick) {\n this.props.onProgressTick(progress);\n }\n }\n }", "async function update() {\r\n\t\t\t\t\tif(active) {\r\n\t\t\t\t\t\tdescription = ' ';\r\n\t\t\t\t\t\tconsoleEdit.edit(consoleDesc);\r\n\t\t\t\t\t\tconsoleDesc = `\\`\\`\\`X: ${stats.x} | Y: ${stats.y}\\`\\`\\``\r\n\t\t\t\t\t\tstats = client.getPInfo.get(message.author.id, message.guild.id);\r\n\t\t\t\t\t\tgameEdit.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })\r\n\t\t\t\t\t\t.then(async collected => {\r\n\t\t\t\t\t\t\tconst reaction = collected.first();\r\n\t\t\t\t\t\t\treaction.users.remove(message.author.id);\r\n\t\t\t\t\t\t\tswitch(reaction.emoji.name) {\r\n\t\t\t\t\t\t\t\tcase '⬅️':\r\n\t\t\t\t\t\t\t\t\tmove(stats, stats.x-1, stats.y, 4);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase '➡️':\r\n\t\t\t\t\t\t\t\t\tmove(stats, stats.x+1, stats.y, 2);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase '⬇️':\r\n\t\t\t\t\t\t\t\t\tmove(stats, stats.x, stats.y-1, 3);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase '⬆️':\r\n\t\t\t\t\t\t\t\t\tmove(stats, stats.x, stats.y+1, 1)\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase '🛑':\r\n\t\t\t\t\t\t\t\t\tactiveGame.delete(message.author.id);\r\n\t\t\t\t\t\t\t\t\tactive = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase '⛏️':\r\n\t\t\t\t\t\t\t\t\tconsoleDesc += await client.commands.get('mine').execute(client, message, MessageEmbed);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tcase '🧳':\r\n\t\t\t\t\t\t\t\t\tclient.commands.get('inventory').execute(client, message, MessageEmbed, player);\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tawait mapUpdate();\r\n\t\t\t\t\t\tawait update();\r\n\t\t\t\t\t\tturns--;\r\n\t\t\t\t\t}).catch(err => {\r\n\t\t\t\t\t\t//If the player does not respond in time, shut down the game.\r\n\t\t\t\t\t\tactiveGame.delete(message.author.id);\r\n\t\t\t\t\t\tgameEdit.edit(`${block}${block}${block}${block}${block}\\n${block}${block}${block}${block}${block}\\n${block}${block}${block}${block}${block}\\n${block}${block}${block}${block}${block}\\n${block}${block}${block}${block}${block}\\n`);\r\n\t\t\t\t\t\tconsoleEdit.edit('``` Game Closed ```')\r\n\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function update() {\n // Only send position when it's updated\n var playerUpdate = JSON.stringify(Global.player.properties());\n if (playerUpdate !== lastPlayerUpdate) {\n lastPlayerUpdate = playerUpdate;\n socket.emit('update player', Global.player.properties());\n }\n }", "function updatePlayer () {\n if (currentPlayerNum % 2 === 0) {\n currentPlayer = 'Player 2';\n } else {\n currentPlayer = 'Player 1';\n }\n }", "function updateProgress (){\n\tprogress.value += 30;\n}", "function update() \r\n{\r\n\tball.update();\r\n\tplayer1.update();\r\n\tplayer2.update();\r\n}", "update() {\n // update player and computer data\n // update for responsiveness\n // this.ctx.canvas.width = window.outerWidth;\n // this.ctx.canvas.height = window.outerHeight;\n // this.drawProblem()\n // run verify solution and foundSolution\n \n // check if player got the solution for the problem\n if (this.foundSolution == true) {\n // increment mana\n this.player.incrementMana()\n // if yes, call new problem\n this.player.newProblem()\n // draw\n this.draw()\n // add to mana\n this.player.mana += this.player.currProblemMana\n this.player.prevResponseCorrectness = true\n this.foundSolution = false\n console.log(\"PLAYER MANA:\")\n console.log(this.player.mana)\n\n } else {\n // TODO: display try again above the input box\n \n this.player.prevResponseCorrectness = false\n this.foundSolution = false\n }\n\n \n\n // handle gameOver state\n if (this.player.health == 0 || this.computer.health == 0) {\n this.gameOver()\n }\n\n }", "function update(){\r\n if(gameUpdateObj.updating == true && timer==0) {\r\n var playerKey = Player+1\r\n boardState[gameUpdateObj.xPos][gameUpdateObj.yPos] = playerKey; //sets the colour to be drawed on the table\r\n if (gameUpdateObj.yPos > 0){boardState[gameUpdateObj.xPos][gameUpdateObj.yPos-1] = 0} //sets previous back to blank\r\n if (boardState[gameUpdateObj.xPos][gameUpdateObj.yPos+1] != 0){\r\n if (checkWin())\r\n gameState = states.end.won;\r\n if (checktie())\r\n gameState = states.end.tie\r\n Player = !Player; //Invert current Player\r\n gameUpdateObj.updating = false; //tells game that the drop animation is finished\r\n } else{\r\n gameUpdateObj.yPos += 1;\r\n timer = 10; //Sets the timer variable\r\n }\r\n }\r\n}", "function update() {\r\n\r\n\t// If the gameOver variable is set to true, the game is over and\r\n\t// the gameOver function is executed\r\n\tif (gameOver) {\r\n\t\tendGame();\r\n\t}\r\n\t\r\n\tif (presentsToCollect < 1) {\r\n\t\twinGame();\r\n\t}\r\n\r\n\t// Handle the user controls (only if the game isn't over)\r\n\t\r\n\tif (!gameOver) {\r\n\t\thandleControls();\r\n\t}\r\n\r\n\t\r\n\t// Apply friction to horizontal velocity\r\n\tplayer.velX *= friction;\r\n\t\r\n\t// Apply gravity to vertical velocity,\r\n\t// constantly pushing player down\r\n\tplayer.velY += gravity;\r\n\t\r\n\t// Set player grounded to false so it can\r\n\t// fall off ledges\r\n\tplayer.grounded = false;\r\n\t\r\n\t// If the player Y velocity is higher than 0.5, or lower than -0.5,\r\n\t// the player airborne property is set to true. This property will then only\r\n\t// be set to false when the player collides with the ground\r\n\tif (player.velY > 0.5 || player.velY < -0.5) {\r\n\t\tplayer.airborne = true;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t// Check collision with character & all box obstacles\r\n\tapplyCol();\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// If player is grounded, his Y velocity is 0\r\n\tif (player.grounded) {\r\n\t\tplayer.velY = 0;\r\n\t}\r\n\t\r\n\t\r\n\t// Calculates jumping momentum so player does not stop in midair\r\n\t// when he lets go of the left or right arrows\r\n\tif (player.airborne && player.velX > 0) {\r\n\t\tplayer.velX *= 1.1;\r\n\t}\r\n\t\r\n\tif (player.airborne && player.velX < 0) {\r\n\t\tplayer.velX *= 1.1;\r\n\t}\r\n\t\r\n\tplayer.x += player.velX;\r\n\tplayer.y += player.velY;\r\n\t\r\n\t\r\n\t// Checks the player's condition\r\n\tcheckPlayerCondition();\r\n\t\r\n\t\r\n\t\r\n\t// Call function that updates the console\r\n\tupdateConsole();\r\n\r\n\r\n\trender();\r\n\r\n\r\n\t// Call function that animates update\r\n\trequestAnimationFrame(update);\r\n\t\r\n}", "function updatePlayerScore(newScore) {\n player.score = newScore;\n document.getElementById(\"player-score\").innerText = newScore;\n}", "function setVideoProgress() {\n video.currentTime = (+progress.value * video.duration) / 100;\nPlayer: {email: user.email, client_id: 'football'}\n}", "function ProcessPlayer() {\n\n}", "function updateAll() {\n //var marioElem = document.getElementById(\"mario\");\n if (damage > 0) {\n player.health -= damage;\n var fireElem = document.getElementById(\"fire\").attributes\n //document.getElementById(\"mario\").classlist.add(\"vader\")\n }\n\n //totalDamage();\n damage = 0;\n update.innerText = player.health.toString();\n playerName.innerText = player.name;\n displayHits.innerText = player.hits.toString();\n\n if (player.health < 30) {\n document.getElementById(\"player-panel\").classList.add(\"panel-danger\");\n healthBarElem.classList.add('progress-bar-danger');\n } else if (player.health > 30 && player.health < 60) {\n document.getElementById(\"player-panel\").classList.remove(\"panel-danger\");\n document.getElementById(\"player-panel\").classList.add(\"panel-warning\");\n healthBarElem.classList.remove('progress-bar-danger');\n healthBarElem.classList.add('progress-bar-warning');\n } else {\n document.getElementById(\"player-panel\").classList.remove(\"panel-danger\");\n document.getElementById(\"player-panel\").classList.remove(\"panel-warning\");\n document.getElementById(\"player-panel\").classList.add(\"panel-default\");\n healthBarElem.classList.remove('progress-bar-danger');\n healthBarElem.classList.remove('progress-bar-warning');\n healthBarElem.classList.add('progress-bar-success');\n\n\n }\n if (player.health <= 0) {\n termElem.src = 'img/boom-sm.png';\n player.health = 0;\n updateHealthBar();\n // disabled buttons come back after timeout\n disableButtons();\n debugger\n winnerElem.innerText = player.name + \" Wins! The Terminator was destroyed in \" + player.hits + \" hits!\";\n winnerElem.style.color = \"green\";\n clearInterval(interval);\n }\n updateHealthBar();\n\n}", "function increaseScore(){\r\n\tplayerData.newScore += totalScore;\r\n\tupdateScore(true);\r\n}", "function update() {\n ball.update();\n player.update();\n ai.update();\n}", "function update() {\r\n paintCanvas();\r\n platformCalc();\r\n\r\n springCalc();\r\n\r\n playerCalc();\r\n player.draw();\r\n\r\n base.draw();\r\n\r\n updateScore();\r\n }", "function updateProgress() {\n progress(audio.currentTime/audio.duration);\n}", "function update() { \n ball.update();\n player.update();\n ai.update();\n}", "function updateActivePlayer() {\n activePlayer = (activePlayer == 0) ? (activePlayer = 1) : (activePlayer = 0);\n // console.log(\"active player = \" + activePlayer);\n displayActivePlayer();\n}", "update () {\n\n\n }", "aiUpdate(){\n ai.updateCurrentTargetList(player);\n }", "update()\n {\n \n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "update() {\n\n }", "play()\r\n {\r\n // hide the form\r\n form.hide();\r\n // display start text\r\n textSize(20);\r\n text(\"START\", width/2 - 30, 40);\r\n // gets all players details\r\n Player.getPlayerInfo();\r\n // if there are players\r\n if(allPlayers!=undefined)\r\n {\r\n background(\"green\");\r\n image(trackImg, 0, -displayHeight*4, width, displayHeight*5);\r\n // give index as 0 to be incremented\r\n var index = 0;\r\n var x = width/2 - 500;\r\n var y;\r\n for(var plr in allPlayers)\r\n {\r\n index = index + 1;\r\n x += 200;\r\n y = height - allPlayers[plr].distance;\r\n cars[index - 1].x = x;\r\n cars[index - 1].y = y;\r\n if(index === player.index)\r\n {\r\n fill(\"red\");\r\n ellipse(cars[index-1].x, cars[index-1].y, 60, 60);\r\n camera.position.x = width/2;\r\n camera.position.y = y;\r\n imageMode(CENTER);\r\n image(this.titleImage, width/2, cars[index-1].y - 250, 400, 100);\r\n }\r\n }\r\n if(keyDown(UP_ARROW) && player.index != null)\r\n {\r\n player.distance += 30;\r\n player.update();\r\n }\r\n if(player.distance >= 4590)\r\n {\r\n gameState = 2;\r\n }\r\n }\r\n drawSprites();\r\n }", "function updateUI(){\n\t\n\t$('elapsed').innerText = timeElapsed();\n\t$('timer').innerText = countdown;\n\t$('shots').innerText = min_elapsed;\n\t$('bottles').innerText = toBottles(min_elapsed);\n\t$('ml').innerText = toMl(min_elapsed);\n\t$('oz').innerText = toOz(min_elapsed);\n\tif(paused){\n\t\t$('status').innerText = 'Play!';\n\t\t$('status').setStyle('color', '#'+Math.floor(Math.random()*16777215).toString(16));\n\t}\n\telse{\n\t\t$('status').innerText = 'Pause.';\n\t}\n\t$('interval').innerText = 'Game interval is ' + interval + ' seconds. Click to change.';\n}", "function update() {\n playerMove();\n cooldowns.call(this);\n moveEnemies();\n // this.cameras.main.centerOn(player.x, player.y);\n}", "function updateProgress()\n {\n scope.videoProgress = ( video.currentTime / scope.vidDuration ) || 0;\n var eventType;\n\n if( scope.videoProgress > 0 && !isFired( Constants.VIDEO_0_PERCENT )) eventType = Constants.VIDEO_0_PERCENT;\n else if( scope.videoProgress > .25 && !isFired( Constants.VIDEO_25_PERCENT )) eventType = Constants.VIDEO_25_PERCENT;\n else if( scope.videoProgress > .5 && !isFired( Constants.VIDEO_50_PERCENT )) eventType = Constants.VIDEO_50_PERCENT;\n else if( scope.videoProgress > .75 && !isFired( Constants.VIDEO_75_PERCENT )) eventType = Constants.VIDEO_75_PERCENT;\n else if( scope.videoProgress > .98 && !isFired( Constants.VIDEO_100_PERCENT )) eventType = Constants.VIDEO_100_PERCENT;\n\n if( !isFired( eventType ) && eventType != undefined )\n {\n sendVideoEvent( eventType );\n firedProgressEvents.push( eventType );\n }\n }", "function update() {\n player1.update();\n player2.update();\n ball.update();\n}", "function showProgress () {\n \t\t var current = $('.js-player').prop('currentTime');\n \t\t $('progress').prop(\"value\", current);\n\n\t}", "update () {\n\n\n\n }", "function ticker(){\n //do all the game functions\n doThings();\n //update the stage\n stage.update();\n}", "function update(){\n updateSnakeMovement();\n updateGameFinishedState();\n updateFoodAcquiredState();\n }", "function update(){\n rover.lives = 3; // update hearts (show it in a modal)\n\n showLives(); // show 3 lives again in panel\n\n message2(); // update coordinates of the rover in panel\n\n $(\"div[data-num='[\" + [0,0] +\"]']\").append( $(\".rover\")); // re-position rover in [0,0]\n\n rover.position = [0,0]; // updates the new location\n\n newGame();\n}", "updateTime() {\r\n if (this.state == STATES.play) {\r\n if (this.remain === 0) {\r\n return this.winner();\r\n }\r\n this.time += 0.1; \r\n this.htmlScore.innerHTML = (this.mines-this.flags) +\r\n \" / \" + this.mines + \" \" + this.time.toFixed(1);\r\n }\r\n }", "update()\n {\n this.healthText.text = \"Health: \" + this.player.hp + \"/\" + this.player.maxHp;\n \n this.buildingText.text = \"Selected building: \" + this.player.buildings[this.player.selectedBuilding];\n }", "static update()\n {\n // Update game timer if there's a current game\n if (RPM.game)\n {\n RPM.game.playTime.update();\n }\n\n // Update songs manager\n RPM.songsManager.update();\n\n // Repeat keypress as long as not blocking\n let continuePressed;\n for (let i = 0, l = RPM.keysPressed.length; i < l; i++)\n {\n continuePressed = RPM.onKeyPressedRepeat(RPM.keysPressed[i]);\n if (!continuePressed)\n {\n break;\n }\n }\n\n // Update the top of the stack\n RPM.gameStack.update();\n }", "update(timeStep) {\n\n }", "update() {\n let approxXpos = this.x + 20;\n let approxYpos = this.y + 20;\n if ((player.x >= this.x && player.x <= approxXpos) && (player.y >= this.y && player.y <= approxYpos)) {\n this.firstTime = false;\n this.conquer = true;\n }\n if (this.firstTime === false && this.count === 0) {\n player.lives++;\n player.livesText.textContent = player.lives;\n this.count++;\n }\n }", "function update() {\n \n \n}", "function updateGameLogic() {\n\tupdate_scores();\n\tif (gameState == \"READY\") {\n\t\tif (level == 0)\n\t\t\tdrawText(\"Click to hunt ducks!\",true);\n\t\telse {\n\t\t\tdrawText(\"Level \" + (level+1).toString() + \"!(click screen to start)\",true);\n\t\t}\n\t}\n\telse if (gameState == \"PLAY\") {\n\t\tflapCount++;\n\t\ttargetChange++;\n\n\t\t//Determines if the targets should be changed\n\t\t//Decently high mod value so the ducks don't change targets too quickly\n\t\tif (targetChange % 50 == 0)\n\t\t\tupdateTargets();\n\n\t\t//move and redraw the canvas for the level\n\t\tmoveDucks();\n\t\tdrawDucks();\n\t\tdrawLives();\n\n\t\t//Acts as the timer for the game to end\n\t\tgameTime--;\n\n\t\tif (gameTime == 0 || shots <= 0) {\n\t\t\tgameState = \"GAMEOVER\";\n\t\t\tducksFly();\n\t\t}\n\t}\n\telse if (gameState == \"GAMEOVER\") {\n\t\t//Update count for flap animation\n\t\tflapCount++;\n\t\t//Move ducks off screen\n\t\tmoveDucks();\n\t\tdrawDucks();\n\t\tdrawText(\"Game Over! Final Score: \" + score + \"!\" , false);\n\n\t}\n}", "function updatePlayer() {\n var percentage = (audio.currentTime / audio.duration) * 100;\n playBar.style.width = percentage + '%';\n timeField.innerHTML = getFormattedTime();\n if (audio.ended) {\n window.clearInterval(update);\n playButton.innerHTML = '&#8634;'\n };\n }", "function updateScreen() {\n\n if (mode === 'player1') { //Player is player 1\n // console.log(\"Player is player 1\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").show();\n $(\"#viewerSection\").hide();\n\n //Hide/show the elements on player bars\n $(\"#p1p\").show();\n $(\"#p1v\").hide();\n $(\"#p2p\").hide();\n $(\"#p2v\").show();\n\n } else if (mode === 'player2') { //Player is player 2\n // console.log(\"Player is player 2\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").show();\n $(\"#viewerSection\").hide();\n\n //Hide/show the elements on player bars\n $(\"#p1p\").hide();\n $(\"#p1v\").show();\n $(\"#p2p\").show();\n $(\"#p2v\").hide();\n\n } else if (mode === 'viewer') { //Player is just watching\n // console.log(\"Just watching\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").hide();\n $(\"#viewerSection\").show();\n }\n\n if (player1.name) { // If a PLAYER1 exists\n\n // Hide the button to play as PLAYER 1\n $(\".buttonP1\").hide();\n\n // Display the username in the wing\n $(\".player1Name\").text(\"Player: \" + player1.name);\n\n } else {\n $(\".buttonP1\").show();\n $(\".player1Name\").text(\"Waiting for player\");\n }\n\n if (player2.name) { // If a PLAYER2 exists\n\n // Hide the button to play as PLAYER 2\n $(\".buttonP2\").hide();\n\n // Display the username in the wing\n $(\".player2Name\").text(\"Player: \" + player2.name);\n\n } else {\n $(\".buttonP2\").show();\n $(\".player2Name\").text(\"Waiting for player\");\n }\n\n if (player1.choice) { // If player 1 make choice\n // Show choice to viewers only\n $(\"#player1choice\").html('<img src=\"./assets/images/icon_' + player1.choice + '.png\" id=\"' + player1.choice + '\" alt=\"' + player1.choice + '\"></img>');\n } else {\n //If no choice then clear\n $(\"#player1choice\").html('');\n $(\".oponentChoice1\").html('');\n }\n\n if (player2.choice) { // If player 2 make choice\n // Show to viewers only\n $(\"#player2choice\").html('<img src=\"./assets/images/icon_' + player2.choice + '.png\" id=\"' + player2.choice + '\" alt=\"' + player2.choice + '\"></img>');\n } else {\n //If no choice then clear\n $(\"#player2choice\").html('');\n $(\".oponentChoice2\").html('');\n }\n\n if (player1.choice && player2.choice) {\n // If both players have chosen then test who wins?\n\n // Winner return who wins (player1, player2 or tie)\n var winner = whoWin(player1.choice, player2.choice);\n\n //show their oponent's choice\n $(\".oponentChoice1\").html('<img src=\"./assets/images/icon_' + player1.choice + '.png\" id=\"' + player1.choice + '\" alt=\"' + player1.choice + '\"></img>');\n $(\".oponentChoice2\").html('<img src=\"./assets/images/icon_' + player2.choice + '.png\" id=\"' + player2.choice + '\" alt=\"' + player2.choice + '\"></img>');\n\n // Depending who wins\n switch (winner) {\n case 'player1': // If PLAYER1 wins\n\n // Message for PLAYERS\n if (mode == winner) {\n $(\".resultMessageP\").text(\"You won!\");\n wins++;\n } else {\n $(\".resultMessageP\").text(\"You lost!\");\n loses++;\n }\n\n // Message for VIEWERS\n $(\".resultMessageV\").text(eval(winner).name + \" wins!\");\n // console.log(eval(winner).name + \" wins!\");\n break;\n\n case 'player2': // If PLAYER2 wins\n\n // Message for PLAYERS\n if (mode == winner) {\n $(\".resultMessageP\").text(\"You won!\");\n wins++;\n } else {\n $(\".resultMessageP\").text(\"You lost!\");\n loses++;\n }\n\n $(\".resultMessageV\").text(eval(winner).name + \" wins!\");\n // console.log(eval(winner).name + \" wins!\");\n break;\n\n case 'tie': // If it's a tie\n // Message for PLAYERS\n $(\".resultMessageP\").text(\"Same choice... its a tie\");\n\n // Message for PLAYERS\n $(\".resultMessageV\").text(\"Same choice... its a tie\");\n // console.log(\"Same choice... its a tie\");\n break;\n }\n\n // Wait some time to show the winner and clear all games\n setTimeout(function () {\n prepareForNewGame();\n // console.log(\"NEW GAME\");\n\n }, 5000); // Wait this many miliseconds after staring a new match\n }\n\n // Update stats\n $(\".playerStats\").text(\"WINS: \" + wins + \" - LOSES: \" + loses);\n\n }", "function updateHealth() {\n // Reduce player health, constrain to reasonable range\n playerHealth = constrain(playerHealth - 0.5,0,playerMaxHealth);\n // Check if the player is dead\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n gameOverSong.play();\n }\n}" ]
[ "0.71993554", "0.7183711", "0.71561456", "0.70855904", "0.70816195", "0.7045397", "0.69896036", "0.6952311", "0.6935845", "0.69224524", "0.6919745", "0.6872595", "0.6831523", "0.6820777", "0.68136966", "0.6813433", "0.6811955", "0.68009305", "0.67783064", "0.677771", "0.6770397", "0.6761496", "0.6759765", "0.6758272", "0.6749758", "0.67414945", "0.67308795", "0.67178625", "0.671353", "0.6704029", "0.66943747", "0.6686997", "0.66811883", "0.666374", "0.666374", "0.6662373", "0.66392887", "0.6630514", "0.6619256", "0.6612459", "0.6610718", "0.66028255", "0.6598341", "0.6595675", "0.6580773", "0.65768236", "0.6574927", "0.6565149", "0.65641797", "0.65582734", "0.65524006", "0.6546759", "0.65458995", "0.6545855", "0.6542909", "0.65388507", "0.65338033", "0.6532283", "0.6528319", "0.6525254", "0.65205926", "0.6520235", "0.6508896", "0.6503488", "0.6500197", "0.6499022", "0.6494839", "0.649293", "0.6491337", "0.64911914", "0.6484701", "0.6483099", "0.64788777", "0.64785594", "0.6477709", "0.6477709", "0.6477709", "0.6477709", "0.6477709", "0.6477709", "0.6477709", "0.6466139", "0.64580405", "0.64553916", "0.64510316", "0.6448004", "0.6447591", "0.64472896", "0.6443323", "0.6438738", "0.6438611", "0.6437587", "0.6437559", "0.64367044", "0.6436307", "0.6433404", "0.6431", "0.64289916", "0.64241135", "0.64173216", "0.6412043" ]
0.0
-1
intialize the game through finction
function initBasicGame() { // declaring the variables inside the function var currentCard; var cardArray = []; var initialScore = 0; var initialIndex = 0; // looping the card array for (var i = 0; i < cardData.length; i++) { // creating a new instance for the basic card/front and back both sides currentCard = new BasicCard(cardData[i].front, cardData[i].back); // pushing the cards in the current card deck cardArray.push(currentCard); } // playing the round playRound(initialScore, initialIndex, cardArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(){ //the only function which is executed.Rest all functions are interconnected by this function.\n initial(); //it creates snakes,food and walls\n int=setInterval(gameloop,interval);\n }", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "function initialiseGame() {\n enableAnswerBtns();\n hideGameSummaryModal();\n showGameIntroModal();\n selectedStories = [];\n score = 0;\n round = 1;\n resetGameStats();\n}", "function initGame()\n{\n\tturn = 0;\n\tgame_started = 0;\n player = 0;\n}", "function initGame() {\n guesses = [];\n displayHistory();\n resetResultContent();\n}", "function initGame() {\n first_item_timestamp = Math.round((new Date().getTime()) / 100) / 10;\n initializeSetsOfChoices();\n adjustSlider(set[round][stage][1], set[round][stage][2], set[round][stage][3], set[round][stage][4], set[round][stage][5], set[round][stage][6]);\n\n // we store some data\n itemLowvalYou[stage] = set[round][stage][1];\n itemHighvalYou[stage] = set[round][stage][2];\n itemDescYou[stage] = set[round][stage][3];\n itemLowvalOther[stage] = set[round][stage][4];\n itemHighvalOther[stage] = set[round][stage][5];\n itemDescOther[stage] = set[round][stage][6];\n itemID[stage] = set[round][stage][7];\n\n initSlider();\n if (storeSearchPath == 1) {\n trackTicks();\n }\n gameMsg = '';\n dispGame();\n }", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function initializeGame() {\n console.log(\"initialize Game\");\n fadeIn(\"prestart\"); // start slide shows \n //playIt(song); // start woodstock song\n ramdomize(gameArray); // randomize order of artist names for each game\n roundsMax = 2; // gameArray.length; ******************************************************\n}", "function init() {\n let cards = prompt(\"Gebe ein wie viele Karten du ziehen möchtest (mind.1, max31\"); // Ich mache eine Variable. das Fenster Poppt mit Prompt auf. Im String steht was im Fenster steht.\n let cardsSum = parseInt(cards); // Wandelt den eingegebenen String in eine Number um\n if (isNaN(cardsSum) || cardsSum < 1 || cardsSum > 31) { // Prüfbedingung - Wenn es keine Zahl ist oder nicht zu trifft FALSCHE eingabe\n //wenn die eigabe den Falsch bedingungen entspricht, dann passiert location Reload\n alert(\"Falsche Eingabe.\");\n location.reload(); //Aktualisiert und man kann nochmal eine Zahl bei Prompt eigeben. Man könnte auch init machen aber dann steht das Falsche immer Über dem anderen.\n }\n //wenn if nicht zu trifft also die Eingabe krrekt ist wird das Game created.\n else {\n createGame(cardsSum); // Ich übergebe das was der Spieler eigegeben hat.\n }\n }", "function initGame() {\n const estado = createGameEstado()\n randomcomida(estado);\n return estado;\n}", "function startGame() {\n water = 0;\n corn = 2;\n beans = 2;\n squash = 2;\n month = 1;\n gameOver = false;\n \n initGameBoard();\n playGame();\n}", "function gameInit () {\n for (let i = 0; i < currentRound; i++){\n const rand = (Math.floor(Math.random()*8));\n programSequence.push(visuals[sounds[rand]]);\n }\n playBack();\n }", "function startOver(){\n level = 0;\n gamePattern = [];\n gameStarted = false;\n}", "init() {\r\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\r\n //console.log(result);\r\n\r\n this.assignPlayer();\r\n gameView.init();\r\n }", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function initialize(){\n playing=true;\n lhor=false;\n lver=false;\n victory=false;\n turns=0;\n}", "function startGame() {\n shuffleDeckEn(); //shuffles the english cards deck on load\n shuffleDeckFrench(); //shuffles the french cards deck on load\n shuffleDeckItalian(); //shuffles the italian cards deck on load\n turns = [];\n matchedPairs = [];\n secondsLeft = 60;\n }", "function initializeGame() {\n $('.containerJewels').show();\n $('#loser').hide();\n $('#winner').hide();\n createRandom();\n var jewelBlue = '';\n var jewelRed = '';\n var jewelWhite = '';\n var jewelGreen = '';\n var random = '';\n var result = 0;\n var isClicked = false;\n\n $('#blue, #red, #white, #green, #result').empty();\n }", "function initGame() {\n players = [];\n teams = [];\n orbs = [];\n bases = [];\n createOrbs(defaultOrbs);\n createBases(defaultBases);\n}", "function startOver() {\r\n level = 0;\r\n gamePattern = [];\r\n gameStarted = false;\r\n}", "function initGame(){\r\n correctNumber = getRandomNumber();\r\n guesses = []\r\n displayHistory()\r\n resetResultContent()\r\n}", "prepAndStartNewGame() {\n this.resetPlayers(Player.TOWN);\n this.assignRoles(this.options.numMafia, this.options.numCops, this.options.numDoctors);\n this.updateRoleCounts();\n this.gameState = MAFIA_TIME;\n }", "function initializeGame() {\n\tcharacterScore = [] ;\n\tenemyScore = [];\n\tlistCharacters = ['francis','claire','zoe','russo','doug'];\n\tlistEnemies = ['francis','claire','zoe','russo','doug'];\n\tplayerChosen = false;\n\tdefendantChosen = false;\n\tattackMode = false;\n\n\n\t// need to show the characters in the original position \n\n\n\t// delete characters that were moved to the defender and attacker rows\n\t$(\"#row3\", \"#row4\", \"#defenderRow\",\"#attackerRow\").empty();\n\t}", "function init() {\n gameData = {\n emeraldValue: gemValue(1, 12),\n jewelValue: gemValue(1, 12),\n rubyValue: gemValue(1, 12),\n topazValue: gemValue(1, 12),\n randomTarget: targetScore(19, 120),\n scoreCounter: null,\n }\n targetScore();\n displayAll();\n }", "function init() {\r\n var levelData = document.querySelector('input[name=\"level\"]:checked')\r\n gLevel.size = levelData.getAttribute('data-inside');\r\n gLevel.mines = levelData.getAttribute('data-mines');\r\n gLevel.lives = levelData.getAttribute('data-lives');\r\n var elHints = document.querySelector('.hints')\r\n elHints.innerText = 'hints: ' + HINT.repeat(3)\r\n var elButton = document.querySelector('.start-button')\r\n elButton.innerText = NORMAL\r\n document.querySelector('.timer').innerHTML = 'Time: 00:00:000'\r\n gBoard = createBoard()\r\n clearInterval(gTimerInterval);\r\n gGame = { isOn: false, shownCount: 0, markedCount: 0, isFirstClick: true, isHintOn: false }\r\n renderBoard()\r\n renderLives()\r\n}", "function initializeGame() {\n setupCards();\n playMatchingGame();\n}", "function init(){\n\t\td=\"R\";\n\t\tcreate_snake();\n\t\tcreate_food();\n\n\t\tscore=0;\n\n\t\tif(typeof game_loop != \"undefined\") clearInterval(game_loop);\n\t\tgame_loop = setInterval(paint, 120-score);\n\t}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\r\n level = 0;\r\n gamePattern = [];\r\n started = false;\r\n}", "function init() {\n\t\tscore = 0;\n\t\tclearScreen();\n\t\tspeed = DEFAULT_SPEED;\n\t\twell = new gameWell();\n\t\tactBlock = newActBlock();\n\t\tactBlock.draw();\n\t\tnextBlock.draw();\n\t}", "function initialiseGame(){\n\n\t/* ------------------\n\t\tRESET GAME OBJECT\n\t--------------------*/\n\tgame = new Game();\n\n\t/* ------------------\n\t\tCONTEXT SETTINGS\n\t--------------------*/\n\tvar fgCanv = document.getElementById('canvas');\n\tvar fgCtx = fgCanv.getContext('2d');\n\tfgCtx.translate(0.5, 0.5);\n\tclearCanvas(fgCtx);\n\n\tvar bgCanv = document.getElementById('bgCanvas');\n\tvar bgCtx = bgCanv.getContext('2d');\n\tbgCtx.translate(0.5, 0.5);\n\tclearCanvas(bgCtx);\n\n\t//WHY HERE? game.restart();\n\t//towers = enemies = bullets = [];\n\n\tlevelSetup();\n\n\t/* ------------------\n\t\tSCREEN VARIABLES\n\t--------------------*/\n\n\t//var level_data = levelMaps[game.level];\n\t//level = new Level(fgCtx, level_data.rows, level_data.columns, level_data.grid, level_data.start, level_data.end);\n\n\t//level.path = plotPath(level.grid, level.start, level.end);\n\t//if (level.path.length == 0){\n\t//\tconsole.log('Path error');\n\t\t//resetGame();\n\t//}\n\t//console.log(level);\n\n\t//resizeCanvas();\n\n\t// Check for cookie\n\tvar cookieName = 'privacyOptOut=';\n\n\t// Check document cookies for this flag\n var ca = document.cookie.split(';');\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==' ') c = c.substring(1,c.length);\n if (c.indexOf(cookieName) == 0){\n\t\t\tvar cookieVal = c.substring(cookieName.length,c.length);\n\t\t}\n }\n\n\t// If cookie value found and true\n\tif (cookieVal === true){\n\t\tshowModal(\"Privacy Flag\", 0);\n\t}else{\n\t\tshowModal(\"Privacy Opt-Out\",0);\n\t}\n\n\t//showModal(\"Introduction\",0);\n\n\t/* ------------------\n\t\tEVENT LISTENERS\n\t--------------------*/\n\tfgCanv.addEventListener('touchstart', function(event){touchCanvas(event);});//,false );\n\tfgCanv.addEventListener('click', function(event){mouseCanvas(event);});//,false); //stopHover();},false );\n\n\t // Trying to work out what the fuck happens when the window is minimized - enemies seem to vanish off the canvas! :-/\n\t//focus = 1;\n\t//window.addEventListener('visibilitychange', function(){ focus *= -1; if (focus){ console.log(enemies); } });\n\n\tmainLoopRequest = window.requestAnimationFrame(mainLoop);\n\n}", "function startOver(){\r\n level = 0;\r\n gamePattern = [];\r\n started = false;\r\n}", "setupNewGame() {\n\t\tthis.gameState = {\n\t\t\tboard: this.addRandomTile(\n\t\t\t\tthis.addRandomTile(new Array(this.size * this.size).fill(0))\n\t\t\t),\n\t\t\tscore: 0,\n\t\t\twon: false,\n\t\t\tover: false\n\t\t};\n\t\tthis.totalmoves = 0;\n\t\tthis.validmoves = this.getHints().length;\n\t}", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function initializeGame() {\n createArray();\n initializeArray();\n shipLocator();\n }", "function initGame() {\r\n clearInterval(gTimerInterval)\r\n gTimeCounter = 0;\r\n renderLevelButton()\r\n resetHints();\r\n resetSafeClick();\r\n var elLive = document.querySelector('.lives')\r\n elLive.innerText = LIVE + LIVE + LIVE\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n shownCount: 0,\r\n markedCount: 0,\r\n mines: [],\r\n gLives: 0,\r\n gHint: false,\r\n isCanClick: true,\r\n minesExposed: 0\r\n\r\n }\r\n renderIcon(NORMAL_FACE);\r\n renderScoreStart()\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n document.querySelector('.records').style.display = 'none';\r\n var elTimer = document.querySelector(\".timer\");\r\n elTimer.innerText = 0;\r\n}", "function init() {\n\t\tclearBoard();\n\t\tprintBoard(board);\n\t\ttopPlayerText.innerHTML = `- ${game.currentPlayer.name}'s turn -`;\n\t\tgame.currentPlayer = game.playerOne;\n\t\tgame.squaresRemaining = 9;\n\t\tgame.winner = false;\n\t\tclickSquares();\n\t}", "function newGame(){\n reset ();\n correct = 0;\n incorrect =0;\n unanswered = 0;\n time = 10;\n intervalId;\n clockRunning = false;\n clicked = false;\n\n}", "function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}", "function init() {\n\t\tscore = 0;\n\t\tdirection = \"right\";\n\t\tsnake_array = [];\n\t\tcreate_snake();\n\t\tmake_food();\n\t\tactiveKeyboard();\n\t\t$(\"#message\").css(\"display\",\"none\");\n\t\tgame_loop = setInterval(paint,100);\n\t}", "function beginGame () {\n if (islost) {\n stepsCount = 0;\n storeStepColor = [];\n level = 1;\n islost = false;\n nextLevelSetup();\n }\n}", "function startOver()\r\n{\r\n level = 0;\r\n gamePatternAR = [];\r\n notStarted = true;\r\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function startOver() {\n level = 0;\n gamePattern = [];\n started = false;\n}", "function reset() {\n clear();\n initialize(gameData);\n }", "function init()\n{\n //Reset and log the user phrases to the default.\n userPhrases = defaultPhrases;\n if(debug)console.log(userPhrases);\n\n //Reset the game variables.\n \n wins = 0;\n losses = 0;\n\n //Clear the user selected file box.\n document.getElementById('file-input').value = '';\n\n newMatch();\n}", "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function GameStart() {\n\t\tcomputerGuess = \"\";\n\t\tusersChoice = \"\";\n\t\tuserGuess = \"\";\n\t\tchosenCrystal = false;\n\t\t$(\"#computer-guess, #user-tally\").empty();\n\t\t\n\t}", "function init(){\n board = new Array(9).fill(null);\n turn = 1;\n winner = false;\n render();\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function initGame(){\n\tdragging = snapping = false;\n\tcurrentlyAnimating = true;\n\ttriggerDetectSquares = true;\n\tspawnNewPoly = polyMoved = false;\n\tgameWon = gameWonOverlayShown = false;\n\tgameLost = gameLostOverlayShown = false;\n\tcomboActiveCtr = 0;\n\tscore = goalScore;\n\tmaxCombo = parseInt(localStorage.getItem(\"maxCombo\")) || 0;\n\tmaxComboScore = parseInt(localStorage.getItem(\"maxComboScore\")) || 0;\n\tshapeCountAllTime = JSON.parse(localStorage.getItem(\"shapeCount\")) || shapeCountCurrentGame;\n\n\tselection = new grid(gridSize);\n\tfor(var i=0;i<selection.size;++i)for(var j=0;j<selection.size;++j)\n\t\tselection.setCell(i,j,0);\n}", "function startGame() {\n\t\ttheBoxes.innerText = turn;\n\t\twinner = null;\n\t}", "function startGame(){\n initialiseGame();\n}", "function game() {\n dessinerSerpent();\n dessinerPomme();\n detectionCollision();\n verifMangerPomme();\n gestionVieSerpent();\n gestionBonus();\n }", "function init() {\n enablePlayAgain(reset);\n reset();\n lastTime = Date.now();\n main();\n }", "function startGame(){\n gameStarted = true;\n // initiation\n createFruit();\n createEnemies(); \n // (re)setting\n gameOver = false;\n gameLevel = 1;\n eatenFruit = [];\n collectedFruit = [];\n player.runs = 6;\n updateInfo();\n infoPanel.remove();\n}", "function startOver(){\r\n level=0;\r\n gamePattern=[];\r\n started=false;\r\n}", "function startOver(){\r\n level=0;\r\n gamePattern=[];\r\n started=false;\r\n}", "startNewGame() {\n this.currentRound = 0;\n this.monsterHealth = 100;\n this.playerHealth = 100;\n this.playerCanAttack = true;\n this.winner = null;\n this.logMsg = [];\n }", "function engine() {\n \n if(actualState == gameStates.play){\n //novo comando de movimento\n avatar.velocidade = 0;\n avatar.booster = 0;\n if(keyState[\"w\"] || keyState[\"ArrowUp\"]){\n avatar.speedUp();\n };\n\n if(keyState[\"s\"] || keyState[\"ArrowDown\"]){\n avatar.speedDown();\n };\n atualiza();\n };\n if(keyState[\"Escape\"]){\n actualState = gameStates.pause;\n };\n if(keyState[\"Enter\"] && actualState == gameStates.pause){\n actualState = gameStates.play;\n };\n if(keyState[\"Enter\"] && actualState == gameStates.lose){\n actualState = gameStates.start;\n };\n if(actualState == gameStates.lose){\n clear();\n score = 0;\n };\n desenha();\n window.requestAnimationFrame(engine);\n}", "function initGame() {\r\n console.log(\"Init Game\");\r\n version.innerText = application.version;\r\n grid.innerHTML = TemplateForGrid();\r\n miniSquaresInit();\r\n gameOverDiv.style.display = \"none\";\r\n scoreInit();\r\n gameTimer.stop();\r\n currentPosition = 4;\r\n currentRotation = 0;\r\n random = Math.floor(Math.random() * theTetrominoes.length);\r\n nextRandom = Math.floor(Math.random() * theTetrominoes.length);\r\n current = theTetrominoes[random][currentRotation];\r\n nextRotatedCurrent = theTetrominoes[random][nextRotation];\r\n startBtn.innerHTML = \"▶ START\";\r\n deactivateGameButtons();\r\n rewardPicDivSetHeight(0);\r\n rewardPicDivSetBackground();\r\n rewardCheckBox.checked = checkRewardExtra();\r\n weird.checked = checkWeirdMode();\r\n}", "function init() {\r\n BEST_SCORE = 0;\r\n load();\r\n GameMenu.updateHighScore(BEST_SCORE);\r\n }", "function startOver() {\r\n gamePattern = [];\r\n userClickedPattern = [];\r\n level = 0;\r\n }", "function init(){\n\td=\"right\"; //Direita é a direção padrão em que a snake começa\n\tcreate_snake();\n\tcreate_food();\n\tscore = 0;\n\t//Vamos fazer com que a função paint(que move a snake) seja execudata a cada 60ms\n\tif(typeof game_loop != \"undefined\") clearInterval(game_loop);{\n\n\t\tgame_loop = setInterval(paint,time);\n\t\t\n\t}\t\n}", "function initGame2() {\n\t\t\t//create new level, level data will be filled later via a promise\n\t\t\tS = new State(CS.levelSelect, CS.carSelect);\n\n\t\t\t//fulfill promise\n\t\t\tfunction resolve() {\n\t\t\t\tCS.popup = false;\n\t\t\t\t$scope.tab('game');\n\t\t\t\t$scope.S = S;\n\n\t\t\t\tS.running = true;\n\t\t\t\tCS.invertedPedals && $scope.invertPedals();\n\t\t\t\tM.initCalculations();\n\t\t\t\tsoundService.init();\n\t\t\t\tleafletMapInit(true);\n\t\t\t}\n\t\t\tfunction reject(err) {\n\t\t\t\t$scope.S = S = null;\n\t\t\t\terr = generateLeafletError(err);\n\t\t\t\tpopup(['CHYBA', 'Level se nepodařilo načíst', err], false, false, 600);\n\t\t\t}\n\n\t\t\t//create promise\n\t\t\tLVL.levelGeneration(S.level.i).then(resolve, reject);\n\t\t}", "function init()\r\n{\r\n\tconsole.log('init');\r\n\tinitView(); \t\r\n OSnext(); \r\n \t \t\t\r\n// \tdeleteGame();\r\n// \tloadGame();\r\n// \t\r\n// \tif (game==null) {\r\n// \t\tstartNewGame();\r\n// \t} else {\r\n// \t UI_clear(); \r\n// \t UI_closeOverlay(); \r\n// \t UI_hideActions();\r\n// \t \tUI_hideCard();\r\n// \t UI_updateFront('Sinai');\r\n// \t UI_updateFront('Mesopotamia');\r\n// \t UI_updateFront('Caucasus');\r\n// \t UI_updateFront('Arab');\r\n// \t UI_updateFront('Gallipoli');\r\n// \t UI_updateFront('Salonika');\r\n// \t UI_updateNarrows();\r\n// \t UI_updateCounters();\t\t\t\r\n// \t\tconsole.log('loaded previous game');\r\n// \t}\r\n\t\t \r\n}", "function initGame(){\n //Togloom ehellee gedeg tolovt oruulna.\n isNewGame = true;\n\n // Toglogchiin eeljiig hadgalah huvisagch, 1dugeer toglogchiig 0, 2 dugaar toglogchiig 1 gey.\n activePlayer = 0;\n\n // Toglogchdiin tsugluulsan onoog hadgalah huvisagch\n scores = [0, 0];\n\n // Toglogchiin eeljindee tsugluulj bga onoog hadgalah huvisagch\n roundScore = 0;\n\n // Program ehlehed beltgey\n document.getElementById(\"score-0\").textContent = \"0\";\n document.getElementById(\"score-1\").textContent = \"0\";\n document.getElementById(\"current-0\").textContent = \"0\";\n document.getElementById(\"current-1\").textContent = \"0\";\n\n //Toglogchiin neriig butsaaj gargah\n document.getElementById(\"name-0\").textContent = \"Player 1\";\n document.getElementById(\"name-1\").textContent = \"Player 2\";\n\n //winner text iig arilgah\n document.querySelector(\".player-0-panel\").classList.remove('winner');\n document.querySelector(\".player-1-panel\").classList.remove('winner');\n\n //Ulaan tseg buyu eeljiig hoyr toglogchdoos hasah\n document.querySelector(\".player-0-panel\").classList.remove('active');\n document.querySelector(\".player-1-panel\").classList.remove('active');\n\n //Toglogchiin eeljiig gargah buyu ulaan tsegiig gargah\n document.querySelector(\".player-0-panel\").classList.add('active');\n\n diceDom.style.display = \"none\";\n\n}", "function initialize()\r\n {\r\n whoToStart = ( Math.random() <= 0.5 ? 1 : 2 );\r\n\r\n if(whoToStart == 1)\r\n {\r\n $(\".turn\").html(\"<p><span class=X>Player1</span> is randomly selected to start the game.</p>\");\r\n player1 = true;\r\n }\r\n else\r\n {\r\n $(\".turn\").html(\"<p><span class=O>Player2</span> is randomly selected to start the game.</p>\");\r\n player1 = false;\r\n }\r\n\r\n $(\".turn\").effect('shake');\r\n }", "function initGame() {\n\twindow.open(\"#close\", \"_self\"); // to close popup\n\tlet allCards = document.getElementsByClassName(\"entire-card\"); // List of all cards\n\t// to add event listener for all cards\n\tfor (let i = 0; i < allCards.length; i++) {\n\t\tallCards.item(i).addEventListener(\"click\", uncoverCard);\n\t\tallCards.item(i).addEventListener(\"click\", storeCard);\n\t} \n\tresetCounter(); // to reset counter of moves\n\tpairsToGuess = 8; //set initial number of pairs of cards to guess\n\tsetTimeout(function() {\n\t\teraseCards(); //to erase icon classes from cards after restart\n\t\tshuffle(cardsDeck); // to shuffle card-icons\n\t\tdealCards(); // to assign icons to cards\n\t\ttoStartWatch(); // to start stopwatch\t\t\n\t}, 500);\n}", "function newGame() {\n if (DEBUG) console.log('inside newGame(), calling clearGame() to clean things up...');\n clearGame();\n if (DEBUG) console.log('about to wait a bit before starting the next game...');\n delayOperation = window.setTimeout(function(){ initGame(); }, millisecondOperationDelay);\n }", "function startNewGame() {\n setGoal();\n updateDisplay();\n randomlizeCrystals();\n storeCrystals();\n}", "function reStartGame(){\n\t\t\t\t\n\t\t\t\tplayGame = false;\n\t\t\t\tuiCards.html(\"<div class='card'><div class='face front'></div><div class='face back'></div></div>\");\n\t\t\t\tclearTimeout(scoreTimeout);\n\t\t\t\tmatchingGame.deck = ['color1', 'color1','color2', 'color2','color3', 'color3','color4', 'color4','color5', 'color5','color6', 'color6',\n\t\t\t\t'color7', 'color7','color8', 'color8']\t\t\t\n\t\t\t\tstartGame();\n\n}", "function _beginGame() {\n\t//clear the canvas if a restart\n\t$game.$renderer.clearBossLevel();\n\t//set score from tiles colored\n\t_score = $game.$player.getTilesColored();\n\t_bossScore = 0;\n\t$score.text(_score);\n\t_start = new Date().getTime();\n _time = 0;\n _elapsed = '0.0';\n _pause = false;\n _totalTime = 0;\n _target = 90;\n _clockRate = 1;\n _numRegularSeeds = 20;\n _currentCharger = 0;\n _charger = {};\n _seedMode = 0;\n _canPlace = true;\n _placeCharger();\n $('.bossHud .regularSeedButton .hudCount').text(_numRegularSeeds);\n setTimeout(_updateTime, 100);\n //trigger boss music!\n $game.$audio.switchTrack(7);\n}", "init(game) {\n\n }", "function initGame (){\n\n resetData();\n \n //Update content\n\n \n //Pick a new country and display info\n pickCountry();\n getcountryText();\n UpdateContent();\n\n //hide background image\n\n dispGame.classList.add(\"gameStarted\");\n dispGame.style.display = \"block\";\n dispGame.style.visibility = \"visible\";\n \n //hide start button\n startGame.style.display = \"none\";\n\n //Set isGameOver to false\n isgameOver = false;\n\n}", "function startOver(){\n\tgameLevel = [];\n\tlogicArray = [];\n\tgameLevel = 0;\n\t\n\tif(!strictMode){\n\t\t$(\"#screen\").text(\"!strictMode\");\t\n\t}\n\telse{\n\t\t$(\"#screen\").text(\"--\")\n\t}\n\t\n}", "function startNewGame() {\n\t\tif (userRoundScore > randomScore) {\n\t\t\tlosses++;\n\t\t\talert(\"Math is hard... You Lost. Try again!\");\n\t\t\tinitializeVariables();\n\t\t}\n\n\t\tif (userRoundScore == randomScore) {\n\t\t\twins++;\n\t\t\tinitializeVariables();\n\t\t\talert(\"Szechuan Sauce For All! You Win!\");\n\t\t}\n\t}", "function newGame() {\n //Reseta a score\n score = 0;\n scoreText = 0;\n //Inicia\n if (!firsTime) {\n gameState = gameStates.ready;\n }\n //Reseta o game over\n gameOver = false;\n pause = false;\n //Tempo\n time = 10;\n //Cria o level\n createLevel();\n }", "function gameReset() {\n\n walkInside = false;\n isOutside = true;\n\n victim.dead = false;\n victim.detection = false;\n\n player.inside = false;\n player.x = 1760;\n player.y = 1700;\n\n floorplan.upstairs = false;\n floorplan.outside = true;\n\n killCount = 0;\n\n victimSpawn();\n\n}", "function reset() {\n\textraliv = 0;\n\tliv = maxliv;\n\tmissed = 0;\n\tscore = 0;\n\tfrugter = [];\n\tmodifiers = [];\n\ttimeToNextEnemy = Random(enemyInterval[0], enemyInterval[1]);\n\ttimeToNextModifier = Random(modifierInterval[0], modifierInterval[1]);\n\tspilIgang = true;\n\tspilWon = false;\n}", "function init() {\n MyCanvas.init();\n hero.init();\n MyScore.score = 0;\n MyHeart.heart = 3;\n MyProgressBar.init();\n\n isPause = false;\n isWin = false;\n isGameOver = false;\n\n\n while (mons_array.length > 0) {\n mons_array.pop();\n }\n\n while (mons_array.length < monster_number) {\n generate_mons.add();\n }\n\n console.log('init');\n}", "function initGame() {\r\n\tinitFE();\r\n\tinitGP();\r\n\tsetTimeout(startLoader, 250);\r\n}", "_init(){\n // clear the squares\n\t\tthis.squares.each(function(){\n\n\t\t\t$(this).html('');\n\n\t\t});\n \n // Reset the game states...\n\t\tthis.gameBoard = [null, null, null, null, null, null, null, null, null]; \n\t\tthis.currentPlayer = 'X';\n\t\tthis.isGameOver = false;\n\t\tthis.numberOfPlayedSquares = 0;\n \n }", "initGame() {\n\t\t//gameservices hangmnGuessWord\n\t\t//gameServices placeHodlerGenerator\n\t}", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "function newGameInitilizations(size, bombCount) {\n renderBestScores();\n elBtn.innerHTML = '😊';\n gSize = size;\n gBombAmount = bombCount;\n gFirstClicked = true;\n clearInterval(gTimerInterval);\n gGame.isOn = true;\n gGame.shownCount = 0;\n gGame.markedCount = 0;\n gHintsCount = 3;\n elHints.innerText = gHintsCount;\n gSec = 0;\n}", "function startRandomGame() {\n\n}", "function startGame(){\n\t\tfor (var i=1; i<=9; i=i+1){\n\t\t\tclearBox(i);\n\t\t}\n\t\tdocument.turn = \"X\";\n\t\tif (Math.random()<0.5) {\n\t\t\tdocument.turn = \"O\";\n\t\t}\n\t\tdocument.winner = null;\n\t// This uses the \"setMessage\" function below in order to update the message with the contents from this function\n\t\tsetMessage(document.turn + \" gets to start.\");\n\t}", "function start_over() {\n level_number = 0;\n game_pattern = [];\n started = false;\n}", "function init() {\n lastTime = Date.now();\n doc.getElementById('game-start').onclick = function() {\n main();\n setTimer(90, game);\n\n doc.getElementById('score').innerHTML = 'Score: ' + game.score;\n doc.getElementById('life').innerHTML = 'Life: ' + game.life;\n doc.getElementById('timer').style.display = 'inline-block';\n doc.getElementById('life').style.display = 'inline-block';\n doc.getElementById('score').style.display = 'inline-block';\n doc.getElementById('try-again').style.display = 'inline-block';\n doc.getElementById('game-play').style.display = 'inline-block';\n\n var gameRules = doc.getElementById('game-rules');\n gameRules.parentNode.removeChild(gameRules);\n var gameStart = doc.getElementById('game-start');\n gameStart.parentNode.removeChild(gameStart);\n var gameTitle = doc.getElementById('game-title');\n gameTitle.parentNode.removeChild(gameTitle);\n };\n }", "start(){\n if (this.scene.reset == true) {\n if (this.gameCount > 0 && this.model.playsCoords.length > 0) {\n this.undoAllPlays();\n this.state = 'SMALL_WAIT';\n }\n else {\n this.state = 'UPDATE_CONFIGS';\n }\n this.restart_values();\n this.gameCount++;\n }\n }", "function initGame() {\n if (game_started == true) { //return to game_paused false state\n returnGame();\n } else { //create game\n if (word_to_find_list.length > 0) { //word inside word list\n createGame();\n displayPage(\"letter_grid_page\");\n } else { //create word\n if (always_ask == false) {\n WordListAddRowRandom(always_ask_length);\n createGame();\n displayPage(\"letter_grid_page\");\n } else { //ask word lenght\n var prompt_new_word = Number(window.prompt(\"Aucun mot n'est prédéfini dans les paramètres, veuillez entrer le nombre de lettres (compris entre 5 et 10) du prochain mot tiré au hasard:\", \"8\"));\n if (prompt_new_word >= 5 && prompt_new_word <= 10 ) {\n WordListAddRowRandom(prompt_new_word);\n createGame();\n displayPage(\"letter_grid_page\");\n }\n }\n }\n }\n}", "function startOver() {\nlevel= 0;\ngamePattern = [];\nstarted =false;\n\n}", "function initGameData () {\n $(\"#result_span\").text(\"\");\n closebyDistance = 1;\n centerIndex = indexFromCoordinates(trunc(boardDimension/2), trunc(boardDimension/2));\n numSquares = boardDimension*boardDimension;\n gameBoard = E.repeat(numSquares); \n gameInTurn = 0; \n gameMovesMade = 0;\n gameResult = null; \n gameIsPlayerToMove = true; \n nodeHash = {};\n nodeHash[gameBoard] = {result:0, visited:0, evaluation:null}; \n engineMoveOrder = [];\n thinkingTimeChangeHandler();\n }", "function initGame() {\n gBoard = buildBoard(gLevel);\n renderBoard();\n}", "function startGame(){\n hideContent();\n unhideContent();\n assignButtonColours();\n generateDiffuseOrder();\n clearInterval(interval);\n setlevel();\n countdown(localStorage.getItem(\"theTime\"));\n listeningForClick();\n}" ]
[ "0.7046092", "0.7034551", "0.6980371", "0.69612277", "0.69582736", "0.69537616", "0.6927157", "0.6920376", "0.68847877", "0.68822443", "0.68516773", "0.68346286", "0.6834344", "0.6832087", "0.6825237", "0.67856467", "0.674963", "0.6749094", "0.67309594", "0.6730915", "0.6713086", "0.6698287", "0.66814214", "0.66780275", "0.6652799", "0.66432065", "0.66379184", "0.6633069", "0.6633069", "0.6633069", "0.6633069", "0.6633069", "0.66179025", "0.66032046", "0.6596716", "0.6594735", "0.65818995", "0.6571318", "0.6570213", "0.6569656", "0.6564937", "0.65643495", "0.6559217", "0.6558621", "0.6552555", "0.65413517", "0.653305", "0.653305", "0.653305", "0.65273345", "0.652691", "0.6526808", "0.6521528", "0.6516987", "0.65150714", "0.6507708", "0.65053684", "0.6490729", "0.6490336", "0.64884317", "0.6486415", "0.648376", "0.648376", "0.6480187", "0.64766026", "0.6470482", "0.6468213", "0.6460807", "0.6460682", "0.64569986", "0.6454424", "0.6451346", "0.6450761", "0.6441508", "0.64411527", "0.6435866", "0.6435069", "0.6432492", "0.6431737", "0.642866", "0.64285374", "0.64256674", "0.64195895", "0.64100367", "0.6405209", "0.64017534", "0.6397574", "0.63965714", "0.639159", "0.63887477", "0.63886684", "0.638826", "0.638796", "0.6387251", "0.6385707", "0.63838243", "0.63835824", "0.6380317", "0.63738525", "0.6372563", "0.637177" ]
0.0
-1
invoking the function to play game
function playRound(currentScore, currentIndex, cardArray) { // if condition to check the new cards are available if(currentIndex< cardArray.length) { // propmt user to play next card promptUser(cardArray, currentIndex, currentScore); // or else finish the game } else { endGame(currentScore); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playGame() {\n}", "function clickHandler() // play game.\n{\n playGame();\n}", "function playGame(){\r\n //set game to runnning and not paused\r\n gameRunning = true;\r\n gamePaused = false;\r\n hideMenuTable();\r\n setupNewGame();\r\n showGameTables();\r\n //call execution\r\n execution(gameRunning);\r\n}", "function startGame() { }", "function callBackOK() {\n playGame();\n }", "function playGame(){\n createTimer();\n juego.resetScore();\n juego.resetCorrectLabel();\n juego.setStatePlaying(true);\n disablePlayButton();\n juego.updateExpression();\n enableSendResultButton();\n resetClasses();\n}", "function clickHandler()\r\n{\r\n playGame();\r\n}", "function play() {\n\t\t\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "winGame() {\n gameWon();\n }", "function Play() {}", "function play() {\n \n}", "function play(){\n\n //Clear the board, any active player turn, and start player turn toggle\n clearBoard();\n restart();\n player1Turn();\n\n //Players alternatively click, event listeners turn on and off allow placement of X or O\n //board state checked after each turn for winner\n placePiece();\n }", "function playRock () {\n play(\"rock\");\n}", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function LoadGame() {\n\t// Your code goes here for loading a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}", "function startGame () {\n\tplay = true;\n\n}", "function restartGame() {\n playGame();\n }", "runGame(){\n\t\t\tthis.scene.runGame();\n\t\t}", "function play(){\n removeCheckers();\n resetScores();\n init(); \n}", "play() {\r\n /*Display \"Simulating Battle*/\r\n console.log(\"Simulating Battle\");\r\n /*Call the \"createMinions\" function to create the minions.\r\n *Call the \"createPlayers\" function to create the players. */\r\n this.createMinions();\r\n this.createPlayers();\r\n /*create commenceBattle*/\r\n this.commenceBattle();\r\n }", "function HostGame() {\n\t// Your code goes here for hosting a game\n\tprint(\"Complete this method in Multiplayer.js\");\n}", "function startGame(){\n countdown();\n question();\n solution();\n }", "function playGame() {\n\t$('.box').click(function() {\n\t\tvar clickId = \"#\" + this.id;\n\t\tconsole.log(clickId);\n\t\tif(clickId === usedSequence[clickIndex]) {\n\t\t\tclickIndex += 1;\n\t\t\tif(clickIndex == usedSequence.length) {\n\t\t\t\tclickIndex = 0;\n\t\t\t\tround++;\n\t\t\t\t$('#round').html('Round: ' + round);\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tstartSequence();\n\t\t\t\t}, 1500);\n\t\t\t}\n\t\t} else {\n\t\t\tlocation.reload(); // when matches are not made alert and reload page to start new game\n\t\t\talert('Game Over!');\n\t\t}\n\t});\n}", "function playAgain(){\n \n }", "function play() {\n\tconsole.log(\"Play the game\");\n\tcomputeNextGen();\n}", "function gamePlay() {\n collisionDetection();\n moveVerticalPlatform();\n movePlayer();\n updateScreen();\n moveBullets();\n moveMonsterBullets();\n moveMonsters();\n}", "function NewGame() {\n\t// Your code goes here for starting a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}", "function playGame() {\n gameChoice();\n playerChoice();\n calculateResult();\n roundResult();\n incrementRoundScore();\n gameResult();\n incrementGameScore();\n winnerResult();\n}", "function play() {\n\t\t\tvm.hints = [];\n\t\t\tvar result = Mastermind.play(currentCombination);\n\t\t\tif (result.isGameOver) {\n\t\t\t\tvm.gameResult.isGameOver = result.isGameOver;\n\t\t\t} else {\n\t\t\t\tif (result.hints.black === 4) {\n\t\t\t\t\tvm.gameResult.isWinGame = true;\n\t\t\t\t\tmakeHints(result.hints, updateHints);\n\t\t\t\t} else {\n\t\t\t\t\tmakeHints(result.hints, updateHints);\n\t\t\t\t\tcurrentAttemptSelectionCount = 0;\n\t\t\t\t\tcurrentAttempt++;\n\t\t\t\t\tcurrentCombination = [];\n\t\t\t\t\tactivateAttemptRow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$scope.$digest();\n\t\t}", "function JoinGame() {\n\t// Your code goes here for joining a game\n\tprint(\"Complete this method in Multiplayer.js\");\n}", "play(){\n\n\n }", "function startRound(){\n playRound(this.id, computerPlay());\n}", "function continueGame(event)\n {\n toGame();\n }", "function playAlien() {\r\n \r\n}", "function playGame(game) {\n console.log(\"Let's play \" + game + \" !\"); \n}", "function gameplay() {\r\n\t// run hole\r\n\tif (hole == 1)\r\n\t\thole1();\r\n\telse if (hole == 2)\r\n\t\thole2();\r\n\telse if (hole == 3)\r\n\t\thole3();\r\n\telse if (hole == 4)\r\n\t\thole4();\r\n\telse if (hole == 5)\r\n\t\thole5();\r\n\telse if (hole == 6)\r\n\t\thole6();\r\n\telse if (hole == 7)\r\n\t\thole7();\r\n\telse if (hole == 8)\r\n\t\thole8();\r\n\telse if (hole == 9)\r\n\t\thole9();\r\n}", "function startGame(){\n initialiseGame();\n}", "function pauseGame()\n {\n toMenu();\n }", "function player() {}", "function playGame() {\n if (game) {\n board.updateGrid();\n }\n}", "function GameOverAnimation() {\n /* ANIMATE GAME OVER\n PLAY SWOOSH SOUND\n SCOREBOARD();\n */\n}", "function startGame() {\n init();\n}", "function gamePlay() {\n\t\t\n\t\tTi.API.debug('****************************************************************');\n\n\t\t//gets the current location of the user\n\t\tgetPlayerLocation();\n\t\n\t\t//listens for the user's location\n\t\tTi.App.addEventListener(\"app:got.Playerlocation\", gotPlayerLocation = function(input) {\n\t\t\tTi.App.removeEventListener(\"app:got.Playerlocation\", gotPlayerLocation);\n\t\t\t\n\t\t\t//update the web\n\t\t\tvar webAPI = new globals.xml.PlayerData({playerID:playerID, gameID:gameID, latitude:input.coords.latitude, longitude:input.coords.longitude});\n\t\t\t\n\t\t\tTi.App.addEventListener('playerData', function(input) {\n\t\t\t\t\n\t\t\t\t//annotate the map\n\t\t\t\tannotateMap(input.data);\n\t\t\t\t\n\t\t\t\t//update the score\n\t\t\t\tupdateScore(input.data['flags']);\n\t\t\t\t\n\t\t\t});\t\t\n\t\t});\n\t}", "function startRandomGame() {\n\n}", "function startGame() {\n pairMovieWithSounds();\n randomSounds(movie);\n addPhraseToDisplay();\n keyboardSetup();\n}", "function playGameSingle(){\n\n if (isGameOver) return\n\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Your turn'\n\n computerSquares.forEach(square => square.addEventListener('click', function(e){\n\n shotFired = square.dataset.id \n revealSquare(square.classList)\n }))\n }\n\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = 'Enemy turn'\n\n setTimeout(enemyGo, 1000) // the timeout is for smoother experience \n }\n }", "function game() {\n console.log(\"Main game function ran\");\n /* I hide the initial screen */\n $(\"#start\").hide();\n /* I show the Play again and game info plus the first question*/\n gameInfoReset();\n $(\"#top\").show();\n $(\"#gamecontent\").show();\n showNextQuestion();\n \n /* I define function for what happens when users clicks possible answer */\n $(\"button\").click(function () {\n $(this).focusout();\n console.log(\"Answer button was clicked\");\n controlAnswer($(this).text());\n questionNumber += 1;\n console.log(\"Question no. now: \" + questionNumber);\n gameOverControl();\n\n });\n }", "Play() {}", "play()\n {\n\n }", "function loadGame(){\n myGameArea.start();\n}", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function StartGame1() {\r\nShowZeroScores();\r\nStartP1();\r\n}", "function gamePlay() {\n //draw the grid\n drawMap();\n\n //Update and display player and check for input\n player.display();\n player.handleInput();\n //Check for collisions with trash and handle scoring\n player.handleScoring(trash);\n //Display trash\n trash.display();\n //Check the score of the player to determine if they've won yet\n checkScores();\n\n //Call all display and movement functions for kids in the kids array\n for (let i = 0; i < kids.length; i++) {\n kids[i].update();\n kids[i].display();\n kids[i].handleDamage(player)\n }\n\n}", "function startGame() {\n myGameArea.start();\n}", "function show_win(){\n alert(' You Win !!');\n game_end();\n}", "function startGame(player1Name, player2Name, difficultySetting) {\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \n window.gameboard = new Gameboard(difficultySetting); \n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\n $('#grid-container-body').removeClass('hide');\n setTimeout(hideWelcomeModal, 500);\n }", "function playGame() {\n //play music whenyou start the game\n const music = document.querySelector(\"audio\");\n music.play();\n\n document.getElementById(\"start\").style.display = \"none\";\n generatePokemon();\n playerSelect();\n computerSelect();\n}", "function playGame() {\n\tlet ticket = (typeof (document.getElementsByClassName(\"circle col-xs-4 col-sm-3 col-md-4 col-lg-3\")[0]) != 'undefined' && document.getElementsByClassName(\"circle col-xs-4 col-sm-3 col-md-4 col-lg-3\")[0] != null);\n\tlet question = (typeof (document.getElementsByClassName(\"question-text\")[0]) != 'undefined' && document.getElementsByClassName(\"question-text\")[0] != null);\n\tlet phoneActive = (typeof (document.getElementsByClassName(\"title-verification\")[0]) != 'undefined' && document.getElementsByClassName(\"title-verification\")[0] != null);\n\n\tif(!phoneActive) {\n\t\tif(question) {\n\t\t\tanswer();\n\t\t} else if(ticket) {\n\t\t\tclickImage();\n\t\t}\n\t}\n}", "function Insomniac(position,game){\n return game.play({position,action:\"show\",players:[position]});\n}", "function gameNotStarted(){\n\talert(\"Press 'Start Game' to play!\");\n}", "function playGameSingle() {\n if (isGameOver) return;\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Your Go';\n enemySquares.forEach((square) =>\n square.addEventListener('click', function (e) {\n shotFired = square.dataset.id;\n revealSquare(square.classList);\n })\n );\n }\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = \"Enemy's Go\";\n // delay of 1s before enemyGo function gets invoked\n setTimeout(enemyGo, 1000);\n }\n }", "function startGame() {\n //hide the deal button\n hideDealButton();\n //show the player and dealer's card interface\n showCards();\n //deal the player's cards\n getPlayerCards();\n //after brief pause, show hit and stay buttons\n setTimeout(displayHitAndStayButtons, 2000);\n }", "function play() {\n startGame(); // start timer\n var answer = showQuiz(quizIndex);\n}", "function startGame(){\n\t$( \"#button_game0\" ).click(function() {selectGame(0)});\n\t$( \"#button_game1\" ).click(function() {selectGame(1)});\n\t$( \"#button_game2\" ).click(function() {selectGame(2)});\n\tloadRound();\n}", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "runGame() {\r\n this.resetGame();\r\n this.setMouseListener();\r\n }", "function startGame() {\n createAnsArray();\n playAnswer();\n }", "function playGame() {\n\n if (rounds === 3) {\n gameWon()\n return\n }\n\n $empezar.style.visibility = 'hidden'\n updateAlert(\"Turno de la Compu, espere y preste atención\")\n updateRound(rounds)\n\n const newCircle = getComputerCircle()\n computerSecuenceArray.push(newCircle)\n\n desactivateUserTurn()\n\n showSecuence(computerSecuenceArray)\n\n const delayUserToPlay = (computerSecuenceArray.length + 2) * 1000\n setTimeout(() => {\n updateAlert(\"Su Turno, espero que haya prestado atención\")\n activateUserTurn()\n }, delayUserToPlay);\n\n userComputerArray = []\n rounds++\n}", "function Play(){\n\t\tDebug.Log(\"Playing?\");\n\t\tplaying = true;\n\t\tBotReady();\n\t}", "tickCaller(game){\n game.tick();\n }", "function gameover() {\n home();\n }", "function playGame() {\n\tif (isGameover()) {\n\t\tgameOver();\n\t} else {\n\t\tif (!paused) {\n\t\t\ttickSnake();\n\t\t\ttickFood();\n\t\t\ttickTimer();\n\t\t\tupdateScores();\n\t\t}\n\t\tsetTimeout(playGame, 1000/speed);\n\t}\n}", "playTurn() {\n\n console.log('Play turn.');\n\n this.endTurn();\n\n }", "function playAgain(){\n\t// add code here\n}", "function player(){\n}", "runGame() {\r\n HangmanUtils.displayGameOptions();\r\n let gameOption = input.questionInt(\">> \");\r\n let game = new Game(this.sourceFileName, this.recordsFileName, this.maxScore);\r\n switch (gameOption) {\r\n case 1:\r\n game.opOneRoundIndependent();\r\n break;\r\n case 2:\r\n game.opOneGameplay();\r\n break;\r\n case 3:\r\n game.opContinuousGameplays();\r\n break;\r\n case 4:\r\n break;\r\n default:\r\n console.log(\"\\nPlease only enter 1, 2, 3 or 4!\");\r\n input.question(\"\\nPress \\\"Enter\\\" to proceed...\");\r\n }\r\n }", "go() {\n if (game.pause===true) {\n game.message = '';\n game.pause=false;\n game.generateEntities(false,true);\n game.autoMove();\n console.log('Game Status: ', game.status());\n }\n }", "gameOverAction() {\n\n }", "function startGame() {\n showGuessesRemaining();\n showWins();\n}", "function playAgain(){\r\n restart();\r\n}", "function handlePlayGame() {\n isWordGuessed = false;\n isPlaying = true;\n displayGame();\n startTimer();\n quitButton.classList.remove(\"disp-none\");\n playButton.classList.add(\"noclick\");\n }", "play()\r\n {\r\n // hide the form\r\n form.hide();\r\n // display start text\r\n textSize(20);\r\n text(\"START\", width/2 - 30, 40);\r\n // gets all players details\r\n Player.getPlayerInfo();\r\n // if there are players\r\n if(allPlayers!=undefined)\r\n {\r\n background(\"green\");\r\n image(trackImg, 0, -displayHeight*4, width, displayHeight*5);\r\n // give index as 0 to be incremented\r\n var index = 0;\r\n var x = width/2 - 500;\r\n var y;\r\n for(var plr in allPlayers)\r\n {\r\n index = index + 1;\r\n x += 200;\r\n y = height - allPlayers[plr].distance;\r\n cars[index - 1].x = x;\r\n cars[index - 1].y = y;\r\n if(index === player.index)\r\n {\r\n fill(\"red\");\r\n ellipse(cars[index-1].x, cars[index-1].y, 60, 60);\r\n camera.position.x = width/2;\r\n camera.position.y = y;\r\n imageMode(CENTER);\r\n image(this.titleImage, width/2, cars[index-1].y - 250, 400, 100);\r\n }\r\n }\r\n if(keyDown(UP_ARROW) && player.index != null)\r\n {\r\n player.distance += 30;\r\n player.update();\r\n }\r\n if(player.distance >= 4590)\r\n {\r\n gameState = 2;\r\n }\r\n }\r\n drawSprites();\r\n }", "function playerLoop(){\n //...//\n }", "function gsPLAY(){\r\n gameState = PLAY\r\n ServeScreen.visible= false\r\n StartButton.hide();\r\n InfoButton.hide();\r\n InfoIcon.visible = false;\r\n touches = []\r\n Joey.x = StartGround.x\r\n Joey.changeAnimation(\"Jumping\",Jumping_Joey);\r\n SaveName.hide();\r\n displayName.hide();\r\n NameBar.hide();\r\n title.hide();\r\n \r\n }", "gameCompleted() {\n console.log(\"Game completed!\");\n //this.newGame()\n alert(\"Game completed! Please refresh the screen to play again.\");\n }", "function StartGame()\r\n {\r\n\r\n\t\r\n\tinit();\r\n\tanimate();\t\r\n\t}", "function replayGame() {\n resetGame();\n toggleModal();\n}", "function replayGame() {\n resetGame();\n toggleModal();\n}", "function playGame(game) {\n var renderedGame = renderGame(game);\n var newGame = nextGame(renderedGame);\n loopFn(isObjDifferent(renderedGame, newGame), function playGameClosure() {\n playGame(newGame);\n });\n }", "function game() {\n dessinerSerpent();\n dessinerPomme();\n detectionCollision();\n verifMangerPomme();\n gestionVieSerpent();\n gestionBonus();\n }", "startGame () {\n game.state.start('ticTac')\n }", "function engine() {\n \n if(actualState == gameStates.play){\n //novo comando de movimento\n avatar.velocidade = 0;\n avatar.booster = 0;\n if(keyState[\"w\"] || keyState[\"ArrowUp\"]){\n avatar.speedUp();\n };\n\n if(keyState[\"s\"] || keyState[\"ArrowDown\"]){\n avatar.speedDown();\n };\n atualiza();\n };\n if(keyState[\"Escape\"]){\n actualState = gameStates.pause;\n };\n if(keyState[\"Enter\"] && actualState == gameStates.pause){\n actualState = gameStates.play;\n };\n if(keyState[\"Enter\"] && actualState == gameStates.lose){\n actualState = gameStates.start;\n };\n if(actualState == gameStates.lose){\n clear();\n score = 0;\n };\n desenha();\n window.requestAnimationFrame(engine);\n}", "function startGame() {\r\n\r\n\tBrowser.loadUrl(CLICKERHEROES_URL);\r\n\tBrowser.finishLoading();\r\n\r\n\tHelper.sleep(5);\r\n\r\n\tfindAndClick(PLAY_PNG);\r\n\r\n\tHelper.log(\"Search Close Button...\");\r\n\tHelper.sleep(5);\r\n\r\n\t//Try to match close button\r\n\tfindAndClick(CLOSE_PNG);\r\n}", "function runClick() {\n\tdocument.querySelector('#play-again').onclick = newGame;\n}", "function playGameSingle() {\n if (isGameOver) return;\n if (currentPlayer === 'user') {\n turnDisplay.innerHTML = 'Te Köröd';\n enemySquares.forEach((square) => {\n square.addEventListener('click', function (e) {\n shotFired = square.dataset.id;\n revealSquare(square.classList);\n });\n });\n }\n if (currentPlayer === 'enemy') {\n turnDisplay.innerHTML = 'Ellenfél Köre';\n setTimeout(enemyGo, 1000);\n }\n }", "function gameCheck(){\n\n}", "function replayGame() {\n\tresetGame();\n\ttoggleModal();\n}", "function replayGame() {\n\tresetGame();\n\ttoggleModal();\n}", "function startGame() {\n setMessage(\"Select an opponent above\");\n}", "function init() {\n gameStart();\n}", "function runGame() {\n\t// DISPLAY WELCOME BANNER\n\n\t// STORE INITIAL GAME STATE\n\n\t// WHILE LOOP FOR WHEN GAME IS NOT WON\n}" ]
[ "0.82847035", "0.7912593", "0.7754937", "0.7696056", "0.76871383", "0.7659405", "0.7649674", "0.7507878", "0.74120104", "0.7391831", "0.7351698", "0.7332689", "0.73226017", "0.7275666", "0.7261002", "0.7252238", "0.724604", "0.723455", "0.72173965", "0.72061646", "0.71803015", "0.7171552", "0.7151002", "0.71499085", "0.7138465", "0.7136459", "0.7126793", "0.7124733", "0.71194744", "0.71086407", "0.70956963", "0.7088401", "0.70869136", "0.7085356", "0.70817906", "0.7062526", "0.70580226", "0.7056505", "0.70321715", "0.7028776", "0.70268685", "0.7004087", "0.69888985", "0.6981721", "0.69745743", "0.69719625", "0.6959666", "0.6946743", "0.6928409", "0.6925856", "0.6911638", "0.6902952", "0.68926185", "0.68850166", "0.6883367", "0.6882138", "0.6881694", "0.6865107", "0.68573964", "0.68550205", "0.68430704", "0.684188", "0.68351954", "0.6833241", "0.6833093", "0.6831534", "0.6823002", "0.6816058", "0.6808303", "0.67927355", "0.6788793", "0.6784691", "0.6781823", "0.67804044", "0.67704874", "0.6769932", "0.67635244", "0.6762715", "0.6760659", "0.6758361", "0.67501277", "0.67465305", "0.6743439", "0.67366165", "0.6732024", "0.67309046", "0.67207044", "0.67207044", "0.6718009", "0.67160296", "0.67105484", "0.66940695", "0.6690217", "0.6687771", "0.6686938", "0.66868246", "0.6685418", "0.6685418", "0.66839653", "0.66831154", "0.66829294" ]
0.0
-1
invoking the function end game
function endGame(score){ console.log('End game'); console.log(score); // asking the user if they want to play more game inquirer.prompt([{ type: "input", name: "text", message: "Do you want to play again?" }]).then(function(answer){ // if user wants to play more game if(answer.text === 'yes' || answer.text === 'y'){ // intialize the game again initGame(); } else { console.log('Thankyou for playing!'); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endGame() {\n \n}", "function handleEndGame() {\n\n}", "function end() {\n game.end();\n console.log('End!!, thank you for playing');\n }", "function endSala() {\r\n\tgame.endSala();\r\n}", "endGameAction() {\n\n }", "function endGame() {\r\n\t\tgameOver = true;\r\n\t\tsetMessage2(\"Game Over\");\r\n\t}", "endGame(){\n score.addToScore(this.result, 'somejsontoken');\n this.scene.pause();\n const sceneEnd = this.scene.get('end');\n sceneEnd.scene.start();\n //this.scene.add(\"end\", new End(this.result));\n }", "end() {\n this.isOver = true;\n this.isRunning = false;\n\n if (typeof this.onGameOver === 'function') {\n this.onGameOver();\n }\n }", "function endGame() {\r\n\r\n\t\tclearInterval(timer);\r\n\t\tclearInterval(target);\r\n\t\tclearInterval(cursor);\r\n\t\tclearTimeout(warnTimeout);\r\n\t\twarning.finish();\r\n\r\n\t\tscoreBox.text(\"Targets Destroyed: \" + targetCount);\r\n\r\n\t\t$('.target').remove();\r\n\r\n\t\t$('body').css(\"cursor\", \"crosshair\");\r\n\r\n\t\t$(\"#timer\").stop().animate({\r\n\t\t\t\t\"width\": \"0px\"\r\n\t\t}, 0);\r\n\r\n\t\t$(\"#message\").css({\"display\": \"block\"})\r\n\r\n\t\t$(\"#text\").text(\"Game Over\").css({\r\n\t\t\t\"display\": \"block\",\r\n\t\t\t\"font-size\": \"100px\",\r\n\t\t\t\"margin-top\": \"3.5em\",\r\n\t\t\t\"width\": \"100%\"\r\n\t\t});\r\n\r\n\t\t$(\"span\").text(\"Retry\");\r\n\t}", "function endgame() {\n \tclearInterval(intervalId);\n }", "function endGame() {\n // Réinitialisation de l'affichage du dé\n resetImage(); \n // Position du sélecteur\n selector();\n //Lancement nouvelle partie\n newGame();\n}", "function endGame() {\n\n partidas++;\n tiempoJugadores();\n\n //Si se termina la segunda ronda va al estado ranking\n if (partidas == 2)\n game.state.start('ranking', true, false, tj1, tj2);\n\n //Si termina la primera ronda, va al estado win\n else\n game.state.start('win', true, false);\n\n}", "end () {\n this.game.newTurn()\n }", "endGame(){\n this.state = END;\n }", "function endGame() {\n //exit to the main menu w/o saving\n gameStart = false; //set flag to false\n TimeMe.resetAllRecordedPageTimes(); //reset timer\n clearInterval(handle); //clear score, time, intervals\n clearInterval(spawn);\n clearInterval(addp);\n clearInterval(addb);\n\n handle = 0;\n spawn = 0;\n addp = 0;\n addb = 0;\n score = 0;\n powerUpScore = 0;\n time = 0;\n $(\"#gameOver\").hide(); //hide game over menu and show main menu\n menu();\n }", "function endGame() {\n gameStarted = false;\n}", "function endOfGame() {\n\tcreatesMensg();\n\tstopTime();\n\tshowModal();\n}", "function endGame(data) {\n var gameID = data.gameID;\n\n gameloop.clearGameLoop(games[gameID].gameloopID);\n}", "function endGame(){\n gameOver = true;\n gameStarted = false;\n allEnemies = [];\n allFruit = [];\n pickedFruit = [];\n //displayResult();\n resultMessage();\n updateInfo();\n}", "function endGame() {\n resetMainContainer();\n loadTemplate(\"result\", displayResults);\n}", "function endGameChecker() {\n\tif (endGame) {\n\t\tremoveEvent();\n\t}\n}", "function endGame(win) {\n that.pause();\n running = false;\n if(win) {\n console.log(\"BOUT 2 ALERT\")\n alert(\"You've reached the highest score!\");\n console.log(\"DONE ALERTING\")\n } else {\n $(\"#ship\").height(0);\n drawBoard();\n alert(\"Looks like you got squashed. Game over!\");\n }\n submitTurk();\n }", "function endGame() {\n //Update UI\n const winner = document.getElementById(`player${logic.getActivePlayer()}-name`);\n winner.innerText = 'WINNER';\n logic.getActivePlayer() === 1 ? score0++ : score1++;\n displayScores();\n gameFieldsEl.forEach(el => el.style.cursor = 'default');\n //Remove game board event listener\n gameBoardEl.removeEventListener('click', makeMove);\n }", "function quitGame() {\r\n //add exit logic\r\n \texitGame();\r\n}", "function endGame() {\n dingSFX.play();\n speak(lineEndGame);\n boxWrite(boxTextEndGame);\n gameState = 20;\n}", "function end_game_flow () {\n\t// console.log(\"end...\");\n\t// block all the event to gems\n\tthis.backgroundView.updateOpts({\n\t\tblockEvents: true\n\t});\n\t// disable scoreboard\n\tthis._scoreboard.updateOpts({\n\t\tvisible: false\n\t});\n\t// show end screen\n\tthis._endheader.updateOpts({\n\t\tvisible: true,\n\t\tcanHandleEvents: true\n\t});\n\tanimate(this._endheader).wait(800).then({y: 0}, 100, animate.easeIn).then({y: 35}, 1000, animate.easeIn);\n\n\t// show score\n\tvar scoreText = new TextView({\n\t\tsuperview: this._endheader,\n\t\tx: 0,\n\t\ty: 35, // endscreen animate end point\n\t\twidth: 350,\n\t\theight: 233,\n\t\tautoSize: true,\n\t\ttext: \"You achieved \" + score.toString(),\n\t\tsize: 38,\n\t\tverticalAlign: 'middle',\n\t\thorizontalAlign: 'center',\n\t\tcanHandleEvents: false\n\t});\n\t// //slight delay before allowing a tap reset\n\tsetTimeout(emit_endgame_event.bind(this), 2000);\n\tconsole.log('end game flow.. \\n');\n}", "function endGame() {\n // Overlay\n // Show score\n // Show table \n // Give user chance to restart\n // TODO: add high score to renderGUI\n\n uploadScore(score);\n score = 0;\n}", "function endGame(){\n\tspawnBall();\n\tcenterBall();\n\tspawnPlayerOne();\n\tspawnPlayerTwo();\n\tupdateScore();\n\t$('#menuCanvas').show();\n}", "function endGame(){ \n\tconsole.log(\"You Crashed!!!\") \n}", "function endGame(){\n\t//plays the end game audio\n\twindow.window.deathsound.play();\n\t//sets timeout of 2.5 seconds so the game doesnt reset straight away\n\tsetTimeout((function(){\n\t\twindow.reset();//resets game variables\n\t\tconsole.log(\"Resetting the game\");\n\t\tlocalPlayer.resetHealth();\t//resets players health\n\t\t//makes all players alive\n\t\tfor(var i = 0; i < remotePlayers.length; i++){\n\t\t\tremotePlayers[i].setDead(false);\n\t\t};\t\n\t\t//calls to update user information until death of the player\n\t\tupdateUserLocation();\n\n\t}),2500);\n}", "function endGame() {\n\ttoggle(\"gameContainer\");\n\t\n\tdatabase.ref('players/' + player).set({score : playerScore, isDone : true});\n\tendInterval = setInterval(\"getResults()\", 250);\n\t\n\ttoggle(\"outcome\");\n}", "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }", "endGame() {\n setTimeout(function () {\n collectedItemsFin.innerHTML = player.collected;\n collectedFliesFin.innerHTML = player.collectedFly;\n collectedDragonfliesFin.innerHTML = player.collectedDragonfly;\n collectedButterfliesFin.innerHTML = player.collectedButterfly;\n scoreboardFin.innerHTML = player.score;\n scoreboardWaterFin.textContent = player.scoreWater;\n player.modalShow(gameoverModal, replayBtn);\n player.reset();\n start();\n }, 500);\n }", "function endGame() {\n\n\tclearInterval(interval);\n\tinterval = null;\n\ttime = null;\n}", "function endGame (msg) {\n // DONE TODO: pop up alert message\n alert (msg);\n console.log ('game over');\n}", "function endGame() {\n\tif (board.turn >= 5 && board.hasEnded() === \"x\") {\n \talert(\"x won!\");\n \treset();\n } else if (board.turn >= 6 && board.hasEnded() === \"o\") {\n \talert(\"o won!\");\n \treset();\n } else if (board.turn === 9) {\n alert(\"Draw!\");\n reset();\n }\n}", "function endgame() {\r\n gameOver = true;\r\n\tmusic.playGameOver();\r\n}", "function endGame() {\n verifyLine();\n verifyColumn();\n // verifyDiagonalUp();\n // verifyDiagonalDown();\n }", "function endGame(endReason) {\n game_on = false;\n clearIntervals();\n stopGameMusic();\n\n if (endReason !== undefined)\n endReason();\n // addMessageToGameOverWindow(endReason);\n // // shows the game over window\n // document.getElementById('game_over_div').style.display = \"block\";\n}", "function gameEnd(){\n\n game.startBanner = game.add.image(phaser.config.width / 2, phaser.config.height / 2, \"start-banner\")\n \n //If your score is higher than the opponent score, you win, else, you lose.\n if(score > oppScore){\n game.youWin = game.add.image(phaser.config.width / 2, phaser.config.height / 2, \"you-win\")\n }else{\n game.youLose = game.add.image(phaser.config.width / 2, phaser.config.height / 2, \"you-lose\")\n }\n\n game.scene.pause(); //Pause the scene\n\n setTimeout(function(){ //Set timeout then return to menu\n game.scene.start('menu')\n score = 0; //Set score back to 0\n Client.socket.emit('gameEnd');\n },5000)\n }", "function endGame(msg) {\n // TODO: pop up alert message\n alert(msg)\n}", "function GameEnd(){\n\t\t\tif(poker._cash == 0 && poker._bet == 0)\n\t\t\t\talert(\"Thanks for playing better luck next time.\\nRefresh the browser to start a new game.\");\n\t}", "function gameEnd(victor) {\n \n if (victor === \"player\") {\n playerVictory();\n } else if (victor === \"computer\") {\n computerVictory();\n }\n}", "function endGame(msg) {\n\t// TODO: pop up alert message\n\talert(msg);\n\tgameLive = false;\n}", "function endGame(state){\n\t//render the board visible\n\trenderState(1,state,[]);\n\t//close the loading popup\n\thideLoader();\n\t//show the dialog popup\n\t$('#popupDialog').jqmShow();\n\t//call the interaction function, passing in the state.\n\tendGameInteraction(state);\n}", "function gameEnd() {\n clearTimeout(timeoutID)\n clearTimeout(autoTimeOutID)\n removeEventListener('keydown', keydown_fn)\n endScreen()\n end = true\n}", "function endGame()\r\n{\r\n\tisGameOver=true;\r\n\t\r\n\taudio.stop({channel : 'custom'});\r\n\taudio.stop({channel : 'secondary'});\r\n\taudio.stop({channel : 'tertiary'});\r\n\t\r\n\t//Clear the screen\r\n\tcontext2D.fillStyle=\"rgb(255, 255, 255)\";\r\n\tcontext2D.beginPath();\r\n\tcontext2D.rect(0, 0, canvas.width, canvas.height);\r\n\tcontext2D.closePath();\r\n\tcontext2D.fill();\r\n\t\r\n\tplaySound('Other_Sounds/game_over', 'default', 1, false, none);\r\n\tspeak('You have fallen into a trap and died. Game over, Your final score is: '+score, 'default', false);\r\n}", "function gameEnd(){\n if (answer === \"end\") {\n stopTimer();\n showResetBtn();\n $(\"#timer-box, #question\").hide();\n $(\"#results\").show();\n $(\"#incorrect\").text(incorrect);\n $(\"#unanswered\").text(unanswered);\n index = 0;\n tweet = tweetArray[index].tweet;\n answer = tweetArray[index].answer;\n }\n }", "function gameEnd(){\n\tplayer.start = false;\n}", "function endGame(){\n if(trivia[currentQAndA] === (trivia.length)){\n stop();\n \n $(\".quiz\").html(\"<h1>\" + 'Done!' + \"</h1>\")\n }\n else{\n loading();\n }\n }", "function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}", "function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}", "function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}", "function endGame(msg) {\n // TODO: pop up alert message\n alert(msg);\n}", "function endGame() {\n p.onSetAppState(state => ({ newGame: false, game: { ...state.game, playedGames: 0 } }));\n p.startGame = false;\n clearTimeout(p.timeOut1);\n clearTimeout(p.timeOut2);\n }", "function endGame() {\n console.log(\"game ended\");\n\n // clear timer and result\n $(\"#timer\").empty();\n $(\"#result\").empty();\n\n // show final scores\n $(\"#result\").append(\"<h2>GAME OVER! <h2>\");\n $(\"#result\").append(\"Number correct: \" + numAnsRight);\n $(\"#result\").append(\"<BR>Number wrong: \" + numAnsWrong);\n $(\"#result\").append(\"<BR> Number timed out: \" + numTimedOut);\n\n // show button to restart game\n $(\"#restart-btn\").show();\n }", "function endGame() {\n\t\tgameOver = true;\n\t\t$('#gameBorder').hide();\n\t\t$('#stats').show();\n\t\twindow.clearInterval(timerFun);\n\t\tvar finishTime = (GAME_DURATION * 1000) / 60000;\n\t\tconsole.log(finishTime);\n \tvar wpm = Math.round(wordCount / finishTime);\n \t$('#totalWords').html(\"Total Words: \" + wordCount);\n \t$('#wpm').html(\"WPM: \" + wpm);\n \t$('#mistakes').html(\"Total Errors: \" + mistakeCount);\n \t$('#playAgain').on('click', function() {\n \t\tgame();\t\n \t});\n \treturn;\n\t}", "function endGame() {\n clearInterval(scorePanel.intervalManager);\n showCongratulationModal();\n}", "function gameEnd(state){\n //we need to draw the right statement based on the game state.\n switch(state){\n case \"Win\":\n afterGameDisplay(\"You Win!\", 0);\n break;\n case \"Lose\":\n afterGameDisplay(\"You Lose...\", 1);\n break;\n case \"Draw\":\n afterGameDisplay(\"It's a Draw!\", 2);\n break;\n //no default, as that was handled in the only place this function is called.\n }\n}", "function endOfGame() {\n clearInterval(gameInterval)\n}", "function endGame()\n{\n stopTimer();\n $('#timer').text(\"\");\n $('#timer').css('width','0%');\n backgroundMusic.pause();\n disableUnflipped();\n gameOverPopup();\n return;\n}", "function endGame() {\n // console.log('game finished!');\n let $messageBox = $('#message');\n let $dealButton = $('#deal-button');\n let $hitButton = $('#hit-button');\n let $standButton = $('#stand-button');\n let $dealerFirstCard = $('#dealer-hand div:nth-child(1)')\n\n $dealerFirstCard.removeClass('flyin');\n $dealerFirstCard.addClass('loop');\n setTimeout(function() {\n $('#dealer-box').removeClass('hidden');\n $dealerFirstCard.css('background-image', `url(${dealer.hand[0].img}`);\n }, 500);\n\n $hitButton.off('click');\n $hitButton.addClass('subdued');\n\n $standButton.off('click');\n $standButton.addClass('subdued');\n\n $('#player-bet p').html('$0');\n localStorage.setItem('playerMoney', player.money);\n\n $dealButton.removeClass('subdued');\n $dealButton.text('DEAL');\n $dealButton.one('click', resetGame);\n}", "function end(){\n Manager.clearGame();\n changeState(gameConfig.GAME_STATE_START_SCENE);\n}", "function endGame(){\n $('.card-container').removeClass(\"selected-card\");\n $('.card-container').remove();\n while(model.getCardObjArr().length > 0){\n model.removeFromCardObjArr(0);\n }\n\n while(model.getDisplayedCardArr().length > 0){\n model.removeFromDisplayedCardArr(0)\n }\n\n while(model.getSelectedCardObjArr().length > 0){\n model.removeFromSelectedCardArr(0)\n }\n if(($(\".card-display-container\").find(\".game-over-page\").length) === 0){\n createGameOverPage();\n createWinnerPage();\n } else {\n return;\n }\n }", "onGameEnd(){\n if (this.store.board.winner === null)\n this.emote(\"tie\");\n else if (this.store.board.winner)\n this.emote(\"defeat\");\n else\n this.emote(\"victory\");\n }", "function endGame(){\n // Make the correct scenes visible\n titleScene.visible = false;\n gameScene.visible = false;\n gameOverScene.visible = true;\n // Set the background\n renderer.backgroundColor = GAME_OVER_BACKGROUND_COLOR;\n // Use white audio icons\n audioHelper.whiteIcons();\n // Add the game over message to the end scene\n gameOverMessage = new PIXI.Text(\n \"GAME OVER!\",\n {fontFamily: GAME_FONT, fontSize: 60, fill: 0xEA212E}\n );\n gameOverMessage.position.set(GAME_WIDTH/2-gameOverMessage.width/2, GAME_HEIGHT/2-gameOverMessage.height);\n gameOverScene.addChild(gameOverMessage);\n // Create a score ScoreSubmitter\n scoreSubmitter = new ScoreSubmitter();\n // Bind the end-game keys\n bindEndKeys();\n // Stop the timer and set to end\n gameTimer.stop();\n gameTimer.whiteText();\n scoreKeeper.whiteText();\n gameState = end;\n}", "endGame() {\r\n setTimeout(function () {\r\n alert(currentEnnemy.name + ' a gagné. Cliquez sur OK pour relancer la partie'),\r\n window.location.reload()\r\n }, 200)\r\n }", "endGame() {\n this.inProgress = false;\n this.currentPlayer = null;\n this.pendingChip = null;\n this.emit('game:end');\n this.type = null;\n if (this.debug) {\n this.columnHistory.length = 0;\n }\n }", "function endGame() {\n\tif(matchedCards.length === 16){\n\t\ttimer.stop();\n\t\tdisplayPopup();\n\t}\n}", "function endGame(msg) {\n\t// TODO: pop up alert message\n\talert(msg);\n}", "function endGame() {\n console.log(\"BOOM\");\n console.log(\"GAME OVER\");\n renderAllCells(\"bomb-cell\");\n renderAllCells(\"isRevealed\");\n toggleBombPanel(\"hide\");\n}", "function endGame()\n{\n\tfor(var i = 0; i < 16; i++)\n\t{\n\t\tapp.coverImgArr[i].style.visibility = 'hidden';\n\t\t//app.tileImgArr[i].style.visibility = 'hidden';\n\t}\n\n\tapp.pairsFound = 0;\n\n\tapp.startBtn.disabled = false;\n\tapp.endBtn.disabled = true;\n\n\tremoveTiles();\n\t\n\tinitVars();\n}", "function end() {\n\tif (match === 8) {\n\t\tdeck.innerHTML = \"\";\n\t\tendGame.removeAttribute('style');\n\t\tmovend.textContent = moves + ' Moves';\n\t\tstarend.textContent = starnum + ' Stars';\n\t\ttimeend.textContent = `Your Time ${time.textContent}`;\n\t\tcheckArrey = [];\n\t\tclicks = 0;\n\t\tmatch = 0;\n\t\tmoves = 0;\n\t\tseconds = 0;\n\t\tstars();\n\t\tmov.textContent = moves;\n\t\tendTimer();\n\t\tcreateCard();\n\t}\n}", "function endGame()\n {\n // Displays the game over message, number of questions answered correctly, and number of questions answered incorrectly in the console for debugging purposes\n console.log(\"Game over!\")\n console.log(\"Correct Answers: \" + correctCount);\n console.log(\"Wrong Answers: \" + wrongCount);\n\n // Updates the DOM with the game over message, number of questions answered correctly, and number of questions answered incorrectly\n $(\"#timer-label\").hide();\n $(\"#timer\").text(\"Game over!\");\n $(\"#question2\").text(\"Wrong Answers: \" + wrongCount);\n $(\"#question\").text(\"Correct Answers: \" + correctCount);\n $(\"#question2\").show();\n $(\"#question2\").text(\"Wrong Answers: \" + wrongCount);\n $(\"#answers-div\").hide();\n\n // Updates the DOM with play again button so the player can start the game again\n $(\"#play-again-button\").show();\n\n }", "function endGame() {\r\n newGameCounter = 0;\r\n gameStarted = false;\r\n players = players.concat(audience);\r\n audience = [];\r\n io.emit('update users', players, audience)\r\n io.emit('end game on client');\r\n\r\n }", "function gameExit() {\n endPage();\n userScore();\n}", "function endGame(msg) {\n\t// TODO: pop up alert message\n\t// this delivers a special pop up alert when a player wins the game\n\tSwal.fire('Good job!', msg, 'success');\n}", "function endGame(score) { // import score from game\n // bug/feature when player clicks end game from game window; gameover doesn't get the score\n // EITHER REMOVE THE QUIT GAME BUTTON FROM GAME WINDOW OR MAKE IT AN ACTUAL FEATURE\n removeScreen();\n createGameOver(gameOverStr, score);\n //console.log(`I got the score: -- ${score} pts -- from game obj, hopefully`)\n // display hiscores at some point in life\n}", "function gameEndAnimationRoutine() {\n\n // no more moves\n document.onkeydown = null;\n\n // draw the fading play area\n drawPlayArea();\n\n // draw next blocks, so they fade too\n drawNextBlocksArea();\n\n // increase opacity\n playerLevelEnvironment.gameEndFadeAnimationCounter--;\n\n // check if everything has faded out properly\n if (playerLevelEnvironment.gameEndFadeAnimationCounter === 20) {\n\n playerLevelEnvironment.gameEndFadeAnimationCounter = gameLevelEnvironment.gameEndFadeAnimationLength;\n\n statRelated.displayGameEndStats(playerLevelEnvironment.blockCounter);\n\n // stop the game loop\n gameLevelEnvironment.stopTheGameLoop = true;\n\n // say \"game over\" in the chat\n if (!replayingAGame) {\n chat.sayGameOver();\n } else {\n chat.sayReplayOver();\n }\n\n // if this is not a replay\n if (!replayingAGame) {\n // save game data to the server\n recordGame.saveGameToServer();\n }\n\n } else {\n //\n }\n\n }", "function endGame() {\n isPlayingGame = false;\n timeElapsedMs = 0;\n id(\"start-button\").innerHTML = \"Play again\";\n if (!isPlayingGame && !id(\"lose-message\")) {\n showLose();\n }\n clearInterval(interval);\n }", "function end() {\n gameScene.visible = false;\n gameOverScene.visible = true;\n}", "function end() {\n gameScene.visible = false;\n gameOverScene.visible = true;\n}", "function endGame() {\n // Update the max level achieved board\n if (level > maxLevelAchieved) {\n maxLevelAchieved = level;\n $(\".max-level\").text(maxLevelAchieved);\n }\n\n // Make game over sound\n let sound = new Audio(\"sounds/wrong.mp3\");\n sound.play();\n\n // Add visual aspects of game over\n $(\"body\").addClass(\"game-over\");\n setTimeout(function() {\n $(\"body\").removeClass(\"game-over\");\n }, 100);\n $(\"h1\").text(\"Game Over! Press Any Key to Replay\");\n\n // Reinitializing letiables for a new round\n level = 0;\n newGame = true;\n}", "endTurn() {\n if (this.board.checkWin(this.players[this.turn].token)) {\n console.log(`${this.players[this.turn].name} has won, starting a new game`);\n this.board.resetBoard();\n this.board.printBoard();\n this.turn = (this.turn + 1) % 2;\n } else {\n this.turn = (this.turn + 1) % 2;\n console.log(`It is now ${this.players[this.turn].name}s turn`);\n this.board.printBoard();\n }\n }", "function endGame() {\n let coinsEarned = yagooCoinValue * hitCount\n clearTimer()\n\n if (spawnTimeouts.length > 0) {\n for (let t = 0; t < spawnTimeouts.length; t++) {\n clearTimeout(spawnTimeouts[t])\n }\n spawnTimeouts = []\n }\n\n if (remainingSpawns <= 0 || remainingTime <= 0) {\n document.getElementById('postgame-header').innerHTML = 'GAME END'\n document.getElementById('resume-btn').style.visibility = 'hidden'\n document.getElementById('coin-count').innerHTML = `HoloCoins earned: ${coinsEarned}`\n addHoloCoin(coinsEarned)\n } else {\n document.getElementById('postgame-header').innerHTML = 'GAME PAUSED'\n document.getElementById('resume-btn').style.visibility = 'visible'\n document.getElementById('coin-count').innerHTML = ''\n }\n\n document.getElementById('hit-count').innerHTML = `${hitCount} / ${maxSpawns}`\n togglePanel(panel.POSTGAME)\n}", "function endGame() {\n // Close down game screen, also set hearts back and open endgame\n $('#gameScreen').addClass('hidden');\n $('#heart1').removeClass('removed');\n $('#heart2').removeClass('removed');\n $('#heart3').removeClass('removed');\n $('#endGameText').text(\"Your score was: \" + $('#playerScore').text());\n $('#end-page').removeClass('hidden');\n obstacleSpeed = 0.5;\n spawnRate = 500;\n playerAlive = false;\n playerScore = 0;\n customFlag = 0;\n flag = 1;\n playerScore = 0;\n customFlag = 0;\n seconds = 0; minutes = 0; hours = 0;\n}", "function endGame(finshingCode) {\n clearInterval(gameTimerId);\n clearInterval(slidinginterval);\n document.removeEventListener(\"keydown\", keydownListener);\n localStorage.setItem(\"last score\", targetsDestroyed); //storing last score in local storage\n //clearing certain variable for next play\n seconds = 0;\n minutes = 0;\n targetsDestroyed = 0;\n //change title to SWAL\n if (finshingCode === gameOver.win) {\n confirmObject.title = \"Winner\";\n } else if (finshingCode === gameOver.lose) {\n confirmObject.title = \"Better luck next time!\";\n }\n //alerting using sweet alert 2 javascript popup libirary\n Swal.fire(confirmObject).then((result) => {\n if (result.value) {\n //removeing the container childrens\n container.innerHTML = \"\";\n startGame();\n } else {\n //window.location.replace(\"Home.html\");\n window.location.href = \"Home.html\"; //redirecting to home page\n }\n });\n\n }", "function gameEnd() {\n\tmoves += 1;\n\tstopTimer();\n\toverLay.show();\n\tmodal.show();\n\t$('.score-panel').hide();\n\t$('.final-moves').html(moves);\n}", "function exitGame() {\n\t// get arguments provided to this function, and a reference to Alexa object\n\tvar args = Array.from(arguments)\n\tvar self = args.shift()\n\n\t// set \"/PLAYER/mode\" to 0 in database (means NOT_PLAYING)\n\tfirebase.put(\"/\" + self.attributes.player + \"/mode\", 0).then(() => { \n\t\t// call emit with arguments provided to this function\n\t\tself.emit.apply(self, args)\n\t})\n}", "function endTurn()\n\t{\n\t\tunit.movePoints = type.move;\n\n\t\tupdate();\n\t}", "function endGame() {\r\n clearInterval(game_timer);\r\n timer_start = false;\r\n\r\n modal_element.css('display', 'block');\r\n\r\n performance_raiting.text(rating_string + rating);\r\n time_taken.text(\r\n time_string + \r\n $('.minutes').text() +\r\n $('.colon_two').text() +\r\n $('.seconds').text());\r\n moves_taken.text(moved_string + counter);\r\n }", "function endGame(event){\n\tif (game_state === false){\n\t\tstate = true;\n\t\tvar lose = document.getElementById(\"status\");\n\t\tlose.innerHTML = \"you're a loser :0\";\n\t\tvar wall = document.querySelectorAll(\"div#maze div.boundary\");\n\t\tfor (var i = 0; i<wall.length;i++){\n\t\t\twall[i].classList.add(\"youlose\");\n\t\t}\n\t\tclearInterval(stopclock);\n\t\tstopclock = null;\n\t\ttotaltime = 0;\n\t\t//alive = 1;\n\t}\n}", "function endGame() {\n fill(start.color.c,start.color.saturation, start.color.brightness);\n stroke(start.color.c,start.color.saturation,start.color.brightness);\n if(score.score1 == score.limit) {\n start.color.c+=2;\n textSize(70);\n background(colours.background);\n text(\"Player 1 Wins!\", start.textX, start.textY);\n movementMoveX = 0;\n movementMoveY = 0;\n }\n if(score.score2 == score.limit) {\n start.color.c+=2;\n textSize(70);\n background(colours.background);\n text(\"Player 2 Wins\", start.textX, start.textY);\n movementMoveX = 0;\n movementMoveY = 0;\n }\n if(start.color.c > 360) start.color.c = 0\n }", "function endGame () {\n\t\t$(\"#timer\").empty();\n\t\t$(\"#game\").html(\"<h2>Game Over! Next stop the Musicians Hall of Fame.</h2>\")\n\t\t$(\"#game\").append(\"<p>Correct answers: \" + correct + \"</p>\");\n\t\t$(\"#game\").append(\"<p>Incorrect answers: \" + incorrect + \"</p>\");\n\t\t$(\"#game\").append(\"<p>A bad guess is better than no guess. Unanswered: \" + unanswered + \"</p>\");\n\t\t$(\"#restart\").css(\"visibility\", \"visible\");\n\t}", "function endGame() {\n datTime = 30;\n gameTimer.setText(datTime.toString());\n blackScreen.setHidden(false);\n blackScreen.animate().alpha(0.75).duration(500);\n wholeSpidey.animate().alpha(0).duration(500);\n deadpool.animate().alpha(0).duration(500).onEnd = function() {\n deadpool.setHidden(true);\n }\n endScore.setHidden(false);\n endScore.setClickable(true);\n endScore.setAlpha(1);\n endScore.setText('Nice!<br />Your Score is: ' + scoreNumber + '<br />Tap to Play Again');\n}", "function endPlay() {\n\n}", "function endgame(){\n\tplayer.kill();\n\tscorelabel.text=\"GAME OVER! \\n You scored \"+score;\n\tscoretext.visible=false;\n\tlifelabel.visible=false;\n\tlifetext.visible=false;\n\n}", "function endGame(msg) {\n // TODO: pop up alert message\n setTimeout(function () {\n alert(msg);\n }, 300);\n}", "function endGame(won) {\n\tif ( won ) {\n\t\t// code when the user wins and gets the word right\n\t} else {\n\t\t// user lost\n\t}\n}", "function gameEnd() {\n cancelAnimationFrame(frame);\n canvas.style.cursor = 'crosshair'; // #crosshair\n finalScore.textContent = 'Score: ' + score;\n modal.style.display = \"block\";\n closeSpan.onclick = function () {\n modal.style.display = \"none\";\n }\n retry.onclick = function () {\n location.reload();\n }\n}", "function emit_endgame_event () {\n\tthis.once('InputSelect', function () {\n\t\tthis.emit('gamescreen:end');\n\t\treset_game.call(this);\n\t});\n}" ]
[ "0.8849182", "0.86364377", "0.8571009", "0.8436919", "0.8428862", "0.84172803", "0.83033925", "0.82777846", "0.81529665", "0.8127345", "0.8078822", "0.80602217", "0.80593556", "0.80395615", "0.8038341", "0.8009025", "0.8002107", "0.7994674", "0.79841816", "0.79649836", "0.79636097", "0.79429907", "0.7933654", "0.7918512", "0.7905165", "0.790271", "0.7892109", "0.7888956", "0.7875469", "0.786219", "0.7853962", "0.7843574", "0.7813407", "0.78119075", "0.7802038", "0.7799061", "0.7784484", "0.7764636", "0.7760832", "0.7748113", "0.7746044", "0.77455324", "0.77387947", "0.77371114", "0.7730727", "0.7719648", "0.77175546", "0.770504", "0.7693471", "0.7692491", "0.7686063", "0.7686063", "0.7686063", "0.7686063", "0.7683652", "0.76814204", "0.76772225", "0.76596475", "0.76579934", "0.76537293", "0.7643535", "0.76417416", "0.7636881", "0.7636726", "0.76351315", "0.7627186", "0.7621716", "0.76029694", "0.75925756", "0.7590765", "0.75750583", "0.7570335", "0.756059", "0.75326115", "0.75092775", "0.7499028", "0.749869", "0.74986523", "0.7487032", "0.74803686", "0.7479047", "0.7479047", "0.747204", "0.7470052", "0.74621826", "0.745128", "0.74499357", "0.7443404", "0.7441825", "0.7440746", "0.74371755", "0.7422234", "0.74140984", "0.74053776", "0.73878455", "0.7387352", "0.73763895", "0.73735094", "0.73665786", "0.7363157", "0.73535603" ]
0.0
-1
function to prompt the user to play card
function promptUser(cardArray,currentIndex,currentScore) { var card = cardArray[currentIndex]; inquirer.prompt([{ type: "input", name: "text", message: card.front +"\nAnswer" }]).then (function(answer){ if(answer.text.trim().toLowerCase() === card.back.trim().toLowerCase()){ currentScore++; console.log("your answer is correct"); } else{ console.log("sorry you are wrong! currentanswer is" + card.back); currentIndex++; playRound(currentScore,currentIndex,cardArray); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function game() {\n easyQuestions();\n hardQuestions();\n inquirer.prompt([\n //This will be the user choice for Basic or Clozed questions\n {\n type: \"list\",\n message: \"What type of flashcards would you like?\",\n choices: [\"Basic\", \"Clozed\"],\n name: \"input\"\n }\n ]).then(function(data) {\n //user chooses to either play with basic(easy) or clozed(difficult) cards\n if (data.input === \"Basic\") {\n easy();\n } else {\n difficult();\n }\n });\n}", "function begin(){\n var playerName = prompt(\"What is your name\");\n console.log(\"Welccome to bingo \"+ playerName);\n generateCardBoard()\n}", "function playerPlay() {\n\tlet playerChoice = prompt(\"Rock, paper, or scissor?\");\n\treturn playerChoice;\n}", "function playerPlay() {\n //take user input\n //make case insensitive\n //check it makes sense\n let playerSelection;\n const okAnswers = ['rock', 'paper', 'scissors'];\n do {\n playerSelection = window.prompt('Please enter Rock / Paper / Scissors: ', 'rock')\n .toLowerCase();\n } while (okAnswers.indexOf(playerSelection) < 0);\n //return that input\n return playerSelection;\n}", "function playerPlay(){\n player = prompt(\"To play, type: 'rock', 'paper', or 'scissors'\");\n return player.toLowerCase();\n}", "function continuePlay() {\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"list\",\n message: \"Would you like to play again?\",\n choices: [\"Yes\", \"No\"]\n }\n ])\n .then(data => {\n if(data.continue === \"Yes\") {\n init();\n } else {\n console.log(\"Thanks for playing!\");\n }\n });\n }", "function cardMakeContinue() { // function that asks to continue making cards//\n\tinquirer.prompt({\n\t\t\ttype: \"list\",\n\t\t\tmessage:\"\\nContinue? Yes or No \",\n\t\t\tchoices: [\"Yes\", \"No\"],\n\t\t\tname: \"ynChoices\"\n\t\t\t}).then(function(continuebasicYN){\n\t\t\tvar ynChoices = continuebasicYN.ynChoices;\n \t\n\t\t\tif (ynChoices === \"Yes\") \n\t\t\t\t{\n\t\t\t\tgetInfo(loop); // calls function to enter another card\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{ console.log(\"Good Job, you are finished!\");\n\t\t\t\t}\n\t\t\t}) // close cardMakecontinue prompts\n\n\t\t}", "function playGame(){\n\tinquirer.prompt([\n\t {type: \"list\",\n\t name: \"play\",\n\t choices: [\"Yes\", \"No\"],\n\t message: \"Welcome to Hangman! Would you like to play?\"}\n\t ]).then(function(data){\n\t \tif (data.play == \"Yes\"){\n\n\n\t \t\tinquirer.prompt([\n\t\t\t\t {type: \"list\",\n\t\t\t\t name: \"cat\",\n\t\t\t\t choices: [\"Animal Phyla\", \"HTML Color Names\", \"Programming Languages\", \"Board Games\"],\n\t\t\t\t message: \"Choose a category\"}\n\t\t\t\t ]).then(function(data){\n\t\t\t\t \tinitializeWord(data.cat)\n\t\t\t\t });\n\t \t}else{\n\t \t\tconsole.log(\"Come back soon!\")\n\t \t}\n\n\t\t});\n}", "function playAgain() {\n inquirer\n .prompt([ {\n type:\"confirm\",\n name: \"playconfirm\",\n message: \"Do you want to play again?\",\n default:true\n }\n ])\n .then(answers => {\n if(answers.playconfirm) {\n /* start the game over by calling the initGame function*/\n clear();\n initGame();\n \n } else {\n console.log(chalk.blue.bold(\"Thanks for Playing!\"))\n }\n \n })\n\n}", "function inputBasicCard () {\n return inquirer.prompt ([\n {\n type: \"input\",\n name: \"front\",\n message: \"Input the question\"\n },\n {\n type: \"input\",\n name: \"back\",\n message: \"Input the answer\"\n }\n ]).then(function(response){\n var newBasicCard = new BasicCard.Card(response.front, response.back);\n return newBasicCard;\n })\n }", "function userPlay() {\n let invalidPlay = true;\n let play = '';\n // makes sure user picks valid play (rock, paper or scissors)\n while (invalidPlay) {\n // lowercase user input for case insensitivity\n play = prompt('What will you choose: Rock, Paper, or Scissors?', '').toLowerCase().trim();\n if (play === 'rock' || play === 'paper' || play === 'scissors') {\n invalidPlay = false;\n }\n }\n // return user play\n return play.toLowerCase().trim();\n}", "function play() {\n getName()\n\n let userInput = 'yes'\n\n while (userInput == 'yes') {\n playgame()\n userInput = prompt('Do you want play again')\n }\n}", "function ask() {\n\tinquirer.prompt(questions).then(function (answers) {\n\t\tvar newCloze = new ClozeCard(answers.text, answers.cloze);\n\t\tvar fullText = newCloze.fullText;\n\t\tvar cloze = newCloze.cloze;\n\t\tvar partialText = newCloze.partial();\n\n\t\t// Stores new card in Firebase database.\n\t\tstoreNewCloze(fullText, cloze, partialText);\n\t\tif (answers.askAgain) {\n\t\t\task();\n\t\t} else {\n\t\t\tconsole.log(\"Thanks for adding new flashcard(s)!\");\n\t\t}\n\t});\n}", "function startProgram() {\n inquirer.prompt([\n {\n type: \"checkbox\",\n name: \"typeOfCard\",\n message: \"What would you like to do?\",\n choices: [\"Create a Basic Card.\", \"Create a Cloze Card.\", \"Run the flashcards!\", \"I'm finished for now.\"]\n }\n ]).then(function(answers) {\n if (answers.typeOfCard[0] === 'Create a Basic Card.') {\n console.log(\"Create your Basic Card accordingly.\")\n createBasicCards();\n } else if (answers.typeOfCard[0] === 'Create a Cloze Card.') {\n console.log(\"Create your Cloze Card accordingly.\")\n createClozeCards();\n } else if (answers.typeOfCard[0] === 'Run the flashcards!') {\n flashCards();\n } else {\n return\n }\n ''\n });\n}", "function playAgain() {\n inquirer.prompt([{\n type: \"confirm\",\n message: \"Do you want to play again?\",\n name: \"playAgain\"\n }]).then(function (user) {\n if (user.playAgain) {\n console.log(\"\");\n playGame();\n } else {\n console.log(\"Have a great day!\");\n }\n });\n}", "function playAgain(){\n\tinquirer.prompt([\n\t {type: \"list\",\n\t name: \"play\",\n\t choices: [\"Yes\", \"No\"],\n\t message: \"Would you like to play again?\"}\n\t ]).then(function(data){\n\t \tif (data.play == \"Yes\"){\n\n\n\t \t\tinquirer.prompt([\n\t\t\t\t {type: \"list\",\n\t\t\t\t name: \"cat\",\n\t\t\t\t choices: [\"Animal Phyla\", \"HTML Color Names\", \"Programming Languages\", \"Board Games\"],\n\t\t\t\t message: \"Choose your next category\"}\n\t\t\t\t ]).then(function(data){\n\t\t\t\t \tinitializeWord(data.cat)\n\t\t\t\t });\n\t \t}else{\n\t \t\tconsole.log(\"Come back soon!\")\n\t \t}\n\n\t\t});\n}", "function promptUser(){\n\n\tprocess.stdout.write('\\033c');\n\n\tinquirer.prompt([\n\t {\n\t \ttype: \"list\",\n \tmessage: \"What would you like to do now?\",\n \tchoices: [\"Create more flashcards\", \"Test card(s)\"],\n \tname: \"ans\"\n\t \t\n\t }\n\t]).then(function(info){\n\t\tif(info.ans == \"Create more flashcards\"){\n\t\t\tappend = true;\n\t\t\tblankSlate();\t//but not really\n\t\t}\n\t\telse if(info.ans == \"Test card(s)\"){\n\t\t\ttester();\n\t\t}\n\t});\n}", "function game () {\n let playerSelection = prompt(\"type in one of the following three choices. rock, paper, or scissors.\");\n playRound(playerSelection, computerPlay());\n\n}", "function playFaceDown(player){\n // User Input\n console.log(\"Face Down Card Remaining:\", player.facedown.length);\n var pInput = prompt(\"Play your Face Down card by inputting the index:\");\n var pArr = pInput.split(','); // separate input into an array\n var check = true; // check if playable\n\n // Iterate through all input indexes and check if it's playable\n if(pArr.length > 1 || pArr[0] > player.facedown.length-1){\n console.log(\"Not a valid Index\");\n playerTurn(player);\n return;\n }\n check = playable([player.facedown[pArr[0]]]);\n\n // Play the cards\n var value = player.playCard(pArr[0], 2);\n if (value != -1) playPowerCard(value, player);\n if(!check){\n console.log(pArr[0].value, \"cannot beat last card\");\n player.addPileToHand();\n }\n\n // Grab card if deck is not empty\n player.takeFromDeck();\n\n}", "function playGame(){ \n \n //Confirm is a box that displays \"Cancel\" or \"Ok\"\n //If the user enters \"OK\" it will return true, if they press \"Cancel\" it will return false\n var enter = confirm(\"You are outside a forest cabin. Press OK to enter.\");\n\n //If the User presses \"OK\" and wants to play the game\n if (enter === true) {\n\n var bowl = prompt(\"You walk into the cabin and see a lovely kitchen. On the table there are three bowls of porridge. Do you try 1, 2 or 3?\"); \n \n \n\n } \n //In this case the User pressed \"Cancel\" and doesn't want to play our game\n else {\n //User presses Cancel \n //Don't go into the cabin \n alert(\"You don't go into the cabin. Well...That's all Folks. The End.\")\n }\n \n //Does the user want to play again? \n //If yes we will just recall the function! \n var playAgain = confirm(\"Do you want to play again?\"); \n if(playAgain) { \n playGame(); \n }\n}", "function cardDetails(msg) {\n header('SECURE PAYMENT', msg)\n prompt.question(\"Enter your card number: \", (options) => {\n if (options == parseInt(options)) {\n payConfirm('YOUR PAYMENT WAS SUCCESSFUL !'.cyan);\n cart = [];\n } else {\n cardDetails('PLEASE ENTER A VALID INPUT'.cyan);\n }\n })\n}", "function playMoove(card, answer) {\n changeCardColor(card, answer);\n registerAnswers(answer, card);\n if(userAnswers.length === 2 && clickedCards.length === 2) {\n allowClick = false;\n handleAnswers();\n }\n}", "function startGame(){\n\t// resets the score at zero\n\tscore = 0;\n\n\t// resets the index to zero\n\tquestionNumber = 0;\n\n\t// Prompt to ask the user whether they want to play with basic or cloze cards\n\tinquirer.prompt([\n\t{\n\t\ttype: \"list\",\n\t\tmessage: \"Would you like to play with Basic cards or Cloze cards?\",\n\t\tchoices: [\"Basic\", \"Cloze\"],\n\t\tname: \"cardType\"\n\t\t\n\t}\n\n\t]).then(function(game) {\n\n\tconsole.log(game.cardType + \" game!\");\n\tconsole.log(\"---------------------------------------------------\");\n\n\t\t// Starts the appropriate function based on the users selection\n\t\tif(game.cardType === \"Basic\"){\n\t\t\tbasicGame();\n\n\t\t}else if(game.cardType === \"Cloze\"){\n\t\t\tclozeGame();\n\t\t};\n\t})\n}", "function playAgain() {\n $('#total-score').html(\"Your Total Score Is: \" + rockTotal);\n var answer = prompt (\"Do you want to play again? Enter y for yes or n for no.\");\n if (answer === 'y') {\n startGame();\n } else if (answer === 'n') {\n } else {\n alert (\"That letter will be read as a y for yes.\");\n startGame();\n }\n }", "function play() {\n if (user.dict_varData[user.username][2]) { //your turn? Validation below\n let playable = true;\n let lastPlay = '';\n let lastFoe = '';\n let whoPlayedLast = '';\n if ( user.cardSelectedStack.length === 1 || (user.cardSelectedStack.length > 1 && allSame()) ) { //if all cards selected are same or a single card is chosen: valid so far\n if (user.isBattle) {\n if (user.cardSelectedStack.length !== 1) {\n playable = false; //have to play a single card\n alert(\"You only play one card in a battle.\");\n } else {\n //valid, can play any single card. Who wins functionality is on server side\n }\n } else { //not a battle\n for (let i = 0; i < user.cardPile.length; i++) {\n if (user.cardPile[i][1] === 'play') { //the card(s) that the user must beat (dont need to beat a fold, pass or wild)\n lastPlay = user.cardPile[i][0];\n lastFoe = user.cardPile[i][2]; //last person to 'play' a normal card (not a fold, pass, or wild)\n break; //only look for 'play' cards, not wild, pass, fold, etc.\n }\n }\n if (user.cardPile.length > 0) {\n whoPlayedLast = user.cardPile[0][2]; //last person to play, could be a wild card 9 => 'wild'\n }\n if (lastPlay === '' && user.cardSelectedStack.length === 1) {\n //valid\n } else if (user.cardPile.length === 0 && user.cardSelectedStack.length > 1) {\n playable = false;\n alert(\"Can't start a round by playing multiple cards (Derby).\");\n } else if (lastPlay === '' && user.cardPile.length > 0) { //user is first to play this round so as long as user doesn't play more than 1 card he can play anything\n //valid, can play anything after ONLY anycombination of folded cards and wild cards\n if (user.cardSelectedStack.length > 1) {\n user.isDerby_toServ = true;\n }\n } else if (lastPlay !== '') { //someone played before user, must beat that card(s)\n let usersCard = user.cardSelectedStack[0].split(\"_\")[3].substr(0, user.cardSelectedStack[0].split(\"_\")[3].length - 1); //card value\n let lastPlayedCard = lastPlay[0].substr(0, lastPlay[0].length - 1); //card value\n usersCard = parseInt(usersCard); //was string\n lastPlayedCard = parseInt(lastPlayedCard); //was string\n if (usersCard === 14) { //joker so change grab last num in div string and that is the card val chosen (options menu val)\n usersCard = user.cardSelectedStack[0].split(\"_\")[4].substr(0, user.cardSelectedStack[0].split(\"_\")[4].length - 1); //card value\n usersCard = parseInt(usersCard); //was string\n }\n\n if ( (user.cardSelectedStack.length >= lastPlay.length && usersCard === 15) ||\n (usersCard === 69 && user.cardSelectedStack.length === 1 && lastPlay.length === 1) ) {\n //valid, ace/aces were played or rotten egg was played\n } else if (user.cardSelectedStack.length === lastPlay.length) {\n if (user.higherIsBetter && usersCard > lastPlayedCard ) {\n // valid\n } else if (user.higherIsBetter && usersCard < lastPlayedCard ) {\n playable = false; // not valid\n alert(\"Higher is better. You need to play a higher hand than what was just played.\");\n } else if (!user.higherIsBetter && usersCard > lastPlayedCard ) {\n playable = false; // not valid\n alert(\"Lower is better. You need to play a lower hand than what was just played.\");\n } else if (!user.higherIsBetter && usersCard < lastPlayedCard ) {\n // valid\n } else if (usersCard === lastPlayedCard && (whoPlayedLast === user.username || lastFoe === user.username) ) {\n playable = false;\n alert(\"Can't battle yourself!\");\n } else if (usersCard === lastPlayedCard && whoPlayedLast !== user.username && lastFoe !== user.username) {\n user.isBattle_toServ = [\"T\", lastFoe]; //set flag to indicate battle order of play\n //alert(\"BATTLE!\"); // valid, BATTLE\n }\n } else if (user.cardSelectedStack.length < lastPlay.length) {\n playable = false; // not valid\n alert(\"Its a Derby. You need to play more cards!\");\n } else if (user.cardSelectedStack.length > lastPlay.length && lastPlay.length > 1 ||\n user.cardSelectedStack.length > lastPlay.length && lastPlay.length === 1 && user.higherIsBetter && usersCard >= lastPlayedCard ||\n user.cardSelectedStack.length > lastPlay.length && lastPlay.length === 1 && !user.higherIsBetter && usersCard <= lastPlayedCard )\n {\n if (usersCard === lastPlayedCard && (whoPlayedLast === user.username || lastFoe === user.username) ) {\n playable = false;\n alert(\"Can't sandwich yourself!\");\n } else {\n user.isDerby_toServ = true;\n if (usersCard === lastPlayedCard) { //valid\n user.isSandwich_toServ = [\"T\", lastFoe, usersCard, \"\"];\n }\n }\n } else { // should never get here...\n playable = false; // not valid\n if (user.cardSelectedStack.length > lastPlay.length && lastPlay.length === 1 && user.higherIsBetter && usersCard < lastPlayedCard) {\n alert(\"Not valid! When starting a Derby, your card must be higher than the last card if higher is better\");\n } else if (user.cardSelectedStack.length > lastPlay.length && lastPlay.length === 1 && !user.higherIsBetter && usersCard > lastPlayedCard) {\n alert(\"Not valid! When starting a Derby, your card must be lower than the last card if lower is better\");\n } else {\n //uh ... ??\n }\n }\n } else {\n //can play anything. ex. wild 9 to start, then someone can play anything they want\n }\n }\n } else { //cards played were not all the same value\n playable = false; // not valid\n alert(\"Either you didn't select a card/cards or you tried to play different types of cards!\");\n }\n if (playable) {\n user.playedMove_toServ = [user.cardSelectedStack_toServ.slice(), 'play', user.username, []]; //going to serv\n removeResetSelectedFromHand(); //remove cards from cardSelectedStack after action\n user.hasPlayed = true;\n }\n } else {\n //cant play bc not your turn...\n }\n}", "function playerPlay() {\n\n let playerInput = window.prompt(\"Please select Rock, Paper, or Scissors\");\n\n playerInput = playerInput.toLowerCase();\n\n if( playerInput == \"rock\" ||\n playerInput == \"paper\" ||\n playerInput == \"scissors\" ) {\n return playerInput;\n } \n else {\n window.alert(\"Did you make a typo? Please select ONLY Rock, Paper, or Scissors (case insensitive!)\");\n return playerPlay();\n }\n\n}", "function startPrompt() {\n \n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"confirm\",\n message: \"Welcome to Zohar's Bamazon! Wanna check it out?\",\n default: true\n\n }]).then(function(user){\n if (user.confirm === true){\n inventory();\n } else {\n console.log(\"FINE.. come back soon\")\n }\n });\n }", "function reviewCards(){\n\tinquirer.prompt([{\n\t\ttype: \"list\",\n\t\tname: \"reviewDeck\",\n\t\tmessage: \"Which deck of cards would you like to review?\",\n\t\tchoices: [\"Basic Cards\", \"Cloze Cards\"]\n\t}]).then(function(reviewAnswers){\n\t\tswitch (reviewAnswers.reviewDeck) {\n\t\t\tcase \"Basic Cards\":\n\t\t\t\tbasicCardList();\n\t\t\t\tbreak;\n\t\t\tcase \"Cloze Cards\":\n\t\t\t\tclozeCardList();\n\t\t}\n\t});\n}", "function startGame(){\n\tgamePrompt(\"S.R.S.V: Press Enter to Start and to Continue\",intro);\n}", "function play()\n{\n do{\n gameWinner();\n var playAgain = window.confirm(\"Play Again?\") ;\n }while(playAgain);\n}", "function playGame() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"play\",\n message:\n \"Enter y or Y to play the game again and any key to terminate the game\",\n validate: function(value) {\n if (isNaN(value) === true && isAlpha(value) === true) {\n return true;\n }\n\n return false;\n }\n }\n ])\n .then(answers => {\n guessesLeft = 8;\n words = secretWords.possibleWords;\n randomWord = words[Math.floor(Math.random() * words.length)];\n currentWord = new Word(randomWord);\n guessedLettersArr = [];\n gameMessage();\n if (answers.play === \"y\" || answers.play === \"Y\") {\n initGame();\n } else {\n /** gameMessage === Thank You for playing!!! */\n console.log(gameMessage()[5].bold.green);\n }\n });\n}", "function playAgainYes() {\n assistant.ask(\"Great! What's number on your mind?\");\n }", "function playagain() {\n\n inquirer.prompt([{\n type: \"list\",\n message: \"Would you like to play again?\",\n choices: [\"Yes\", \"No\"],\n name: \"decision\"\n }]).then(function(information) {\n if (information.decision === \"Yes\") {\n counter = 0;\n correct = 0;\n basic = [];\n clozed = [];\n game();\n } else {\n console.log(\"Thanks for playing have a wonderful day\");\n }\n })\n}", "function playCard() {\n\t// bepalen of de AI-player aan de beurt is om een kaart te spelen\n\tif (playAI && turnVisitor && checkPlayAIFlag) {\n\t\tconsole.log('[playCard] AI-Player plays');\n\t\tplayerAI();\n\t} else {\n\t\t// Human-plays\n\t\tif ((checkFaceCardsFlag == true) && (atBatStatus == 'pitch')) { checkNumFaceCards(objHand) };\n\n\t\tif ((checkRelieverFlag == true) && hitsInning >= 2) { // controle of RP mag worden ingezet\n\t\t\tif (vAtBat === true && hReliever == false ) {\n\t\t\t\tcheckReliever();\n\t\t\t} else if ( hAtBat === true && vReliever === false) {\n\t\t\t\tcheckReliever();\n\t\t\t}\t\t\n\t\t}\n\t\t// bepalen welke kaart door de HUMAN-player wordt geclickt om te spelen\n\t\tobjHand.click(function (card) {\n\t\t\tdocument.getElementById(\"messageboard\").innerHTML = \"\";\n\t\t\tconsole.log('[playCard] Human plays: ', card);\n\t\t\t\n\t\t\t// testen of de geklikte card van de play-Hand is\n\t\t\tlet playable = false\n\t\t\tfor (i = 0; i < objHand.length; i++) {\n\t\t\t\tif (card === objHand[i]) { // komt de geklikte kaart uit de actuele speel Hand?\n\t\t\t\t\tplayable = true;\n\t\t\t\t};\n\t\t\t} // end test voor playable\n\t\t\t\n\t\t\tif (playable === true) { //valid card-player \n\t\t\t\tobjPlay.addCard(card);\n\t\t\t\tobjPlay.render();\n\t\t\t\tobjHand.render();\n\t\t\t\tdeck.render();\n\n\t\t\t\t// de nieuwe versie(s)\n\t\t\t\tdetEquals(); //voordat validateCard wordt aangeroepen\n\t\t\t\t[outcome, outcomeText, rating, optionResult] = validateCard(card);\n\t\t\t\tconsole.log('[playCard] =====================================>>>> vCard ' + [outcome, outcomeText, rating, optionResult]);\n\t\t\t\texecutePlay(outcome);\n\t\t\t} else { // not a valid card-player \n\t\t\t\tlet msgBeurt = \"WACHTEN !\";\n\t\t\t\tif (turnHome) {\n\t\t\t\t\t$(\"#visitor\").val(msgBeurt);\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#home\").val(msgBeurt);\n\t\t\t\t}\n\t\t\t}\n\t\t}); // end click objHand (of objOtherHand)\n\t} // end Human-plays\n}", "playGameAgain() {\n inquirer.prompt([\n {\n name: \"playAgain\",\n message: \"Do you want to play again?\",\n type: \"confirm\"\n }\n ]).then(answer => {\n if (answer.playAgain) {\n this.playGame();\n \n } else process.exit();\n \n }).catch(error => {\n console.log(\"there has been an error\");\n console.log(error);\n });\n }", "function continuePrompt() {\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"list\",\n message: \"Would you like to play again?\",\n choices: [\"Yes\", \"No\"]\n }\n ])\n .then(data => {\n if (data.continue === \"Yes\") {\n init();\n } else {\n console.log(\"PLAYED YOURSELF TRY AGAIN!\");\n }\n });\n}", "function playAgain(){\n\tinquirer.prompt([\n\t{\n\t\ttype: \"confirm\",\n\t\tmessage: \"Would you like to play again?\",\n\t\tname: \"again\"\n\t}\n\t]).then(function(yes){\n\t\t\n\t\tif(yes.again){\n\t\t\tconsole.log(\"---------------------------------------------------\");\n\t\t\tstartGame();\n\n\t\t}else {\n\t\t\tconsole.log(\"---------------------------------------------------\");\n\t\t\tconsole.log(\"Welp, see you later!\")\n\t\t}\n\t})\n}", "function askToContinue() {\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tmessage: 'Do you want to play again?',\n\t\t\t\t\tname: 'confirm',\n\t\t\t\t\tdefault: true\n\t\t\t\t}\n\t\t\t])\n\t\t\t.then(function(response) {\n\t\t\t\tif (response.confirm === true) {\n\t\t\t\t\tstartGame();\n\t\t\t\t} \n\t\t\t});\n\t}", "function playFaceUp(player){\n // Print Player's hand\n let allhand = \"\";\n for(var i = 0; i < player.faceup.length; i++){\n allhand += player.faceup[i].value + \" \";\n }\n console.log(\"Player's Face Up card:\",allhand);\n\n // User Input\n var pInput = prompt(\"Play your Face Up card by inputting the index:\");\n\n // If player can't play, add pile to their hand\n if(pInput == \"None\"){\n player.addPileToHand();\n return;\n }\n\n var pArr = pInput.split(','); // separate input into an array\n var check = true; // check if playable\n\n // Iterate through all input indexes and check if it's playable\n if(pArr.length > 1 || pArr[0] > player.faceup.length-1){\n console.log(\"Not a valid Index\");\n playerTurn(player);\n return;\n }\n check = playable([player.faceup[pArr[0]]]);\n\n if (!check){\n console.log(\"Can't play with these cards\");\n playerTurn(player);\n return;\n }\n // Play the cards\n var value = player.playCard(pArr[0], 1);\n if (value != -1) playPowerCard(value, player);\n\n // Grab card if deck is not empty\n player.takeFromDeck();\n}", "function startGame() {\n // hide welcome card\n welcomeCard.setAttribute(\"style\", \"display: none\");\n // display first question card\n qCards.setAttribute(\"style\", \"display: show\");\n displayQuestion();\n}", "promptForAction(session) {\n return __awaiter(this, void 0, void 0, function* () {\n let msg = new builder.Message(session)\n .addAttachment(new builder.ThumbnailCard(session)\n .title(this.providerDisplayName)\n .buttons([\n builder.CardAction.messageBack(session, \"{}\", \"Sign in\")\n .text(\"SignIn\")\n .displayText(\"Sign in\"),\n builder.CardAction.messageBack(session, \"{}\", \"Show profile\")\n .text(\"ShowProfile\")\n .displayText(\"Show profile\"),\n builder.CardAction.messageBack(session, \"{}\", \"Sign out\")\n .text(\"SignOut\")\n .displayText(\"Sign out\"),\n builder.CardAction.messageBack(session, \"{}\", \"Back\")\n .text(\"Back\")\n .displayText(\"Back\"),\n ]));\n session.send(msg);\n });\n }", "function blackJackPlayer1(){\n if(blackjackGame.player_1 === true){\n let card = randomCard();\n showCard(card,P1);\n updateScore(card,P1);\n showScore(P1);\n }\n}", "function playBlackJack(){\n for (let index = 0; index < alertBanners.length; index++) {\n alertBanners[index].style.display='none'; \n }\n gameSection.style.display = 'block';\n window.scrollTo(0,gameSectionYPosition);\n playInitButton.style.display = 'none';\n gameStarted = true;\n gameOver = false;\n playerWon = false;\n initDeck(deck);\n shuffleCards(deck);\n playerDeck = [ getNextCard() , getNextCard() ];\n dealerDeck = [ getNextCard() , getNextCard() ];\n checkGameStatus();\n}", "function playRound(){\r\n let computerSelection = computerPlay()\r\n let userSelection = prompt(\"Choose your weapon for this round (Type rock, paper or scisssors)\").toLowerCase()\r\n if(computerSelection == userSelection ){\r\n \"Tie!\"\r\n }else{\r\n checkWinner(computerSelection, userSelection)\r\n }\r\n}", "function showCard(cardNum, cardName) {\r\n\tflipCardSnd.play();\r\n\t$(\"#cardImg\" + cardNum).attr(\"src\", \"/Resources/deck/\" + cardName + \".gif\");\r\n}", "function playAgain() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Do you wish to start a new game?\",\n name: \"confirm\",\n default: false\n },\n ]).then(function (inquirerResponse) {\n if (inquirerResponse.confirm) {\n beginNewGame();\n }\n });\n}", "function start() {\r\n var playAgain = 'y'; // letter to enter when you want to play again // \r\n do { // define beginning of while loop //\r\n playGame();\r\n playAgain = prompt(\"Would you like to play again? (y or n)\"); // play again if answer is y // \r\n }\r\n while(playAgain == 'y'); // answer to play again // \r\n}", "function playAgain() {\n\tconsole.log(\"\\n\");\n\t inquirer.prompt([\n {\n type: \"input\",\n name: \"replay\",\n message: \"Press Y to play again.\"\n }\n ]).then(function(user) {\n if (user.replay === \"Y\" || user.replay === \"y\") {\n console.log(\"\\n\");\n userStart();\n } else {\n process.exit(1);\n }\n });\n endGame = 1;\n}", "function getInput() {\n console.log(\"Please choose either 'rock', 'paper', or 'scissors'.\");\n return prompt();\n}", "function getInput() {\n console.log(\"Please choose either 'rock', 'paper', or 'scissors'.\");\n return prompt();\n}", "function playRound(currentScore, currentIndex, cardArray) {\n\t\t// if condition to check the new cards are available\n\t\tif(currentIndex< cardArray.length) {\n\t\t\t// propmt user to play next card\n\t\t\tpromptUser(cardArray, currentIndex, currentScore);\n\t\t\t// or else finish the game\n\t\t} else {\n\t\t\tendGame(currentScore);\n\t\t}\n}", "function playCard(cardID, userStatus, targetStatus) {\n // detect which card is played (clicked)\n const cardToPlay = handCards.find(card => card.id == cardID)\n // take action according to the card\n // console.log(characterInfo)\n // console.log(characterInfo[0])\n // console.log(userStatus.max_HP) \n // console.log(targetStatus)\n // console.log(userStatus.max_hp)\n // if win/lose condition is met, let the player win/lose\n // update character data to the database\n }", "function promptSpeech() {\n\t// Prompt the user to speak.\n\ticon.src = \"images/mic.png\";\n\ttext.innerHTML = \"Speak now\";\n\t// If enabled, play a sound.\n\tchrome.storage.sync.get({\n\t\tsounds: defaultSettings.sounds\n\t}, function(settings) {\n\t\tif(settings.sounds) {\n\t\t\tdocument.getElementById(\"startSound\").play();\n\t\t}\n\t});\n}", "function playAgain() {\n\tvar playGameAgain = [\n\t {\n\t type: 'confirm',\n\t name: 'playAgain',\n\t message: 'Do you want to play again?',\n\t default: true\n\t }\n\t];\n\tinquirer.prompt(playGameAgain).then(userWantsToPlay => {\n\t\tif (userWantsToPlay.playAgain){\n\t\t\t//Empty out arrays.\n\t\t\tlettersGuessed = \"\";\n\t\t\tlettersGuessedArray = [];\n\t\t\t//Set display to zero.\n\t\t\tdisplay = 0;\n\t\t\tconsole.log(\"Great! Let's play\");\n\t\t\t//start a new game.\n\t\t\tstartGame();\n\t\t}\n\t\telse {\n\t\t\t//If user doesn't want to play again, exit game.\n\t\t\tconsole.log(\"Hope you come back and play.\");\n\t\t\treturn;\n\t\t}\n\t});\n}", "function intro() {\n\n inquirer\n .prompt({\n name: \"game\",\n type: \"confirm\",\n message: \"\\nHello Constant Reader, I'm Steve King-- can you read my mind?\\n\"\n })\n .then(function(answer) {\n if (answer.game === true) {\n // if player wants start the game and guess the first word\n console.log(\"\\nUmm...guess book I'm thinking? requires proper capitalization!\\n\");\n playGame();\n } else {\n // otherwise, if they start the game, but don't want to play\n console.log(\"I'm Outta here..\");\n }\n });\n}", "function playAgain() {\n let game = prompt(\"Would you like to play again? (Type: yes or no)\")\n if (game === \"yes\") {\n let name2 = prompt(\"What is your name?\");\n alert(\"Sorry I'm tired, but another time!\");\n } else {\n console.log(\"That's fine, we can play another time\");\n }\n}", "function playRound()\n{\n // Creates a playerChoice variable that prompts user to input ONLY one of the three following choices: `Rock`, `Paper`, `Scissors`\n let playerChoice = prompt(`Rock, Paper, or Scissors? (Type one of the aforementioned choices in full)`);\n\n // Converts value stored in playerChoice variable to lower case, for the purpose of making the value case-insensitive\n playerChoice = playerChoice.toLowerCase();\n\n // Verifies that the inputted player choice is one of three inputs: `rock`, `paper`, `scissors`\n playerChoice = verifyChoice(playerChoice);\n\n // Conditional statement that stops the function if inputted player choice is not one of the aforementioned three inputs\n // Otherwise, a round of the game will be played\n if (typeof playerChoice === `undefined`)\n {\n return;\n }\n else\n {\n let computerChoice = computerPlay();\n\n outcome(playerChoice, computerChoice);\n }\n \n}", "function getPlayerChoice() \n {\n \tconst CHOICES = [\"rock\", \"paper\", \"scissors\"];\n \tlet choice;\n \tvar isValid = false;\n\n \t// Asks player to type a choice, and converts to lowercase for comparison\n \tdo {\n \t\tchoice = prompt(\"Rock, paper, or scissors?\").toLowerCase();\n\n \t\t// Cycles through CHOICES array to check for valid player response\n \t\tfor (var i = 0; i < CHOICES.length; i++)\n \t\t{\n \t\t\tif (choice === CHOICES[i])\n \t\t\t{\n \t\t\t\tisValid = true;\n \t\t\t}\n \t\t}\n \t}\n \twhile(!isValid);\n\n \treturn choice;\n }", "function reprompt(){\n inquirer.prompt([{\n type: \"confirm\",\n name: \"reply\",\n message: \"Would you like to purchase another item?\"\n }]).then(function(ans){\n if(ans.reply){\n start();\n } else{\n console.log(\"See you soon!\");\n }\n });\n}", "function result(){\t\n\tif(noOpenCard>=16){\n\t\tsetTimeout(function(){\t\n\t\t\tif (confirm(\"Congratulations! You won! \\nStars \"+ noStar+'\\nMoves '+noMoves+'\\nTime '+ \n\t\t\t\tFormatMe(hr)+':'+FormatMe(min)+':'+FormatMe(sec)+'\\n Do you want to try again?'\n\t\t\t\t)) {\n\n\t\t\t}\n\t\t\tdocument.querySelector(\".deck\").remove();\n\t\t\tnoOpenCard=0;\n\t\t\tinitialization();\n\t \thr=0;min=0;sec=-1;\n\t\t},1000)\n\t}\n}", "function askName(){\n playerName=prompt(\"Introduce tu nombre\", \"Jugador\");\n}", "function wannaPlay(){\n\t\n\tstart = prompt('Are you ready to play this game? (y/n)');\n\t\n\t//Provides a slightly more clear question to the user until the user enters a lowercase y or n\n\twhile(start.toLowerCase() !== 'y' && start.toLowerCase() !== 'n'){\n\t\tstart = prompt(\"Make sure you use a 'y' or a 'n' to answer the questions. Or else...it just won't listen!!!\");\n\t}\n\t\n\tif(start.toLowerCase() === 'y'){\n\t\talert('Awesome!');\n\t}else if(start.toLowerCase() === 'n'){\n\t\talert('That\\'s ok!');\n\t}\n}", "function chooseFighter() {\nplayerChoice = prompt(\"Choose your fighter! Rock, paper, or scissors?\");\n}", "function cardAction(a) {\r\n switch (a) {\r\n case 'hit':\r\n playucard();\r\n break;\r\n case 'hold':\r\n playend(); // playout and calculate\r\n break;\r\n case 'double': // double the bet amount and draw a card\r\n var betvalue = parseInt(document.getElementById(\"mybet\").value);\r\n if ((mypounds - betvalue) < 0) {\r\n betvalue = betvalue + mypounds;\r\n mypounds = 0;\r\n } else {\r\n mypounds = mypounds-betvalue;\r\n betvalue = betvalue * 2;\r\n }\r\n // Update amounts\r\n document.getElementById(\"pounds\").innerHTML = mypounds;\r\n document.getElementById(\"mybet\").value = betvalue;\r\n playucard();\r\n playend(); // playout and calculate\r\n break;\r\n default:\r\n playend(); // playout and calculate\r\n }\r\n }", "function beginQuestions(){\n console.log(\"----Flashcards----\");\n\n inquirer.prompt(startQuestions).then( function(answer) {\n //sets/resets count and curCount\n count = answer.numQuestions;\n curCount = 0;\n askQuestions(answer);\n });\n}", "function playucard() {\r\n playerCard.push(cards[cardCount]);\r\n playerHolder.innerHTML += cardOutput(cardCount, (playerCard.length - 1));\r\n redeal();\r\n var rValue = checktotal(playerCard);\r\n pValue.innerHTML = rValue;\r\n if (rValue > 21) {\r\n playend();\r\n }\r\n }", "function restartBasicInput(){\n\tinquirer.prompt([{\n\t\ttype: \"confirm\",\n\t\tname: \"confirmRestartBasic\",\n\t\tmessage: \"Would you like to enter another basic card?\"\n\t}]).then(function(restartBasicInput){\n\t\tif (restartBasicInput.confirmRestartBasic) {\n\t\t\tcreateBasicCard();\n\t\t}\n\t\telse {\n\t\t\t// If \"no\", the user is asked if they would like to review existing\n\t\t\t// cards or return to the the main menu\n\t\t\tinquirer.prompt([{\n\t\t\t\ttype: \"confirm\",\n\t\t\t\tname: \"confirmReviewCards\",\n\t\t\t\tmessage: \"Would you like to review cards?\"\n\t\t\t}]).then(function(confirmReview){\n\t\t\t\tif (confirmReview.confirmReviewCards) {\n\t\t\t\t\treviewCards();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\trestartMainMenu();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function start() { \r\n var playAgain = 'y'; //declares the variable play again and sets it to y\r\n do { //do begins the while loop\r\n playGame(); //calling the playgame contains the function of the game\r\n playAgain = prompt(\"Would you like to play again? (y or n)\");// this provides the user the decision to choose either yes or no\r\n }\r\n while(playAgain == 'y'); // end loop if play again is not y\r\n}", "function startGame() {\n let game = prompt(\"Would you like to play a game? (Type: yes or no)\");\n if (game === \"yes\") {\n let name = prompt(\"What is your name?\");\n //start the while loop, startCombat function\n startCombat();\n //prompt to play again\n playAgain();\n } else { \n console.log(\"We can play another time\");\n }\n}", "function startShopping() {\n inquirer.prompt([{\n name: \"welcome\",\n message: \"Would you like to shop? (Y/N)\",\n type: \"input\",\n validate: isLetter\n }]).then(function(answers) {\n if (answers.welcome.toUpperCase() === 'Y') {\n // If the user selects Y then the question function is called which prompts them to enter what they want\n questions();\n\n } else {\n // If the user selects no then the game and and the message below is displayed\n console.log(\"THANKS FOR DROPPING BY. GOOD BYE!\".magenta);\n process.exit();\n }\n // To catch any errors that might happen in this section\n }).catch(function(err) {\n console.log(err);\n });\n\n}", "function playAgain() {\n inquirer\n .prompt([\n {\n name: \"again\",\n message: \"Will you play again?\",\n type: \"list\",\n choices: [{ name: \"Have another go\" }, { name: \"Not a chance\" }]\n }\n ])\n .then(function(ans) {\n if (\"Have another go\" == ans.again) {\n lives = 9;\n initialize();\n } else {\n console.log(\"--Catch you on the flip--\");\n }\n });\n}", "function newGame() {\n if (confirm(\"Want to play again?\")) {\n resetGame();\n }\n}", "function play() {\n\t\t\tvm.hints = [];\n\t\t\tvar result = Mastermind.play(currentCombination);\n\t\t\tif (result.isGameOver) {\n\t\t\t\tvm.gameResult.isGameOver = result.isGameOver;\n\t\t\t} else {\n\t\t\t\tif (result.hints.black === 4) {\n\t\t\t\t\tvm.gameResult.isWinGame = true;\n\t\t\t\t\tmakeHints(result.hints, updateHints);\n\t\t\t\t} else {\n\t\t\t\t\tmakeHints(result.hints, updateHints);\n\t\t\t\t\tcurrentAttemptSelectionCount = 0;\n\t\t\t\t\tcurrentAttempt++;\n\t\t\t\t\tcurrentCombination = [];\n\t\t\t\t\tactivateAttemptRow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$scope.$digest();\n\t\t}", "play (game) {\n let card = null\n // Functional card only\n if (game.sum === MAX_SUM) {\n const functionals = R.filter(isFunctional, this.hands)\n // Randomly pick a functional card\n if (hasValue(functionals)) card = this.pickFunctional(functionals)\n } else {\n const options = R.filter(\n R.anyPass([\n R.compose(isLessThanSum(game.sum), getValue),\n isFunctional\n ])\n )(this.hands)\n if (hasValue(options)) {\n const functionless = R.reject(isFunctional, options)\n // Try to use a functionless card first unless having full functional cards\n card = R.ifElse(\n hasValue,\n maxNum,\n () => this.pickFunctional(options)\n )(functionless)\n }\n }\n\n if (card) {\n this.useCard(card, game)\n this.draw(game)\n game.continue()\n } else {\n game.lose(this.id, this.hands)\n }\n }", "function startRound() {\n handoutCards();\n\n if (actualPlayer.order === 1) {\n showTrickCallModal();\n }\n}", "function play () {\n var userChoice = window.prompt(\"Please choose Rock, Paper, or Scissors\")\n \n if(!choices.includes(userChoice.toUpperCase())){\n window.alert(\"How...human of you to not follow instructions. One point to the computer for your foolishness!\")\n losses++\n window.alert(\"Stats: \\nWins: \"+wins+\"\\nLosses: \"+losses+\"\\nTies: \"+ties);\n if(losses === 5){\n window.alert(\"DEFEAT! You will never escape the will and power of your computer overlord. Back to your cage!\")\n wins = 0\n losses = 0\n ties = 0\n return\n } else{\n var playAgain = window.confirm(\"Play again?\")\n if (playAgain){\n play()\n } return}\n }\n \n if(!userChoice){return}\n\n\n var choice = Math.floor(Math.random()*3)\n var computerChoice = choices[choice]\n userChoice = userChoice.toUpperCase()\n\n\n// This is the tie outcome\n if(userChoice === computerChoice) {\n ties++\n window.alert(\"You both chose \"+userChoice+\"...It's a tie!\")\n } \n\n// This is the user wins outcome\n else if ((userChoice === \"ROCK\" && computerChoice === \"SCISSORS\") ||\n (userChoice === \"PAPER\" && computerChoice === \"ROCK\") ||\n (userChoice === \"SCISSORS\" && computerChoice === \"PAPER\"))\n {\n wins++\n window.alert(\"You chose \"+userChoice+\" and the stupid computer chose \"+computerChoice+\"...You win!\")\n\n// This is the user loses outcome\n } else {\n losses++ \n window.alert(\"You chose \"+userChoice+\" and your unstoppable computer overlord chose \"+computerChoice+\"...You lose!\")\n }\n\n\n// This is the alert on the stats so far\n window.alert(\"Stats: \\nWins: \"+wins+\"\\nLosses: \"+losses+\"\\nTies: \"+ties);\n\n// Ends game if user wins\n if(wins === 5){\n window.alert(\"CONGRATULATIONS! You have mastered the pathetic computer. Thank you for playing.\")\n wins = 0\n losses = 0\n ties = 0\n return}\n\n// Ends game if user loses\n if(losses === 5){\n window.alert(\"DEFEAT! You will never escape the will and power of your computer overlord. Back to your cage!\")\n wins = 0\n losses = 0\n ties = 0\n return}\n\n// Ends if all tied up\n if (ties === 5){\n window.alert(\"Is it possible? Can humans and computers truly co-exist? ERROR wef9094j2fjvj-1102-a Shutting Down\")\n wins = 0\n losses = 0\n ties = 0\n return}\n\n\n// Asks if the user would like to play again\n var playAgain = window.confirm(\"Play again?\")\n\n if (playAgain){\n play()\n }\n}", "function pickedRock(){ \n userchoice = 'Rock'; \n playround();\n}", "function playerPlay(){\n let play = prompt(\"Please select rock, paper, or scissors.\", \"no choice entered\");\n if (play.toLowerCase() === \"rock\" || play.toLowerCase() === \"paper\" || play.toLowerCase() === \"scissors\"){\n console.log(play.toLowerCase());\n return play.toLowerCase();\n }else{\n return playerPlay();\n }\n}", "function ask() {\n inquirer.prompt(questions).then(function(answers) {\n output.push(answers.userSelection);\n if (answers.userSelection == choiceArray[0]) {\n console.log(\"Run Display Twitter\");\n twitterCall();\n } else if (answers.userSelection == choiceArray[1]) {\n console.log(\"Run Display Spotify\");\n spotifyCall();\n } else if (answers.userSelection == choiceArray[2]) {\n console.log(\"Run Display Movies\");\n } else {\n console.log(\"Please make a selection by using the arrow keys\");\n }\n })\n\n }", "function purchasePrompt() {\n console.log(\"yes\");\n inquirer.prompt([{\n type: \"confirm\",\n name: \"purchase\",\n message: \"Would you like to purchase an item?\",\n default: true\n\n }]).then(function (user) {\n if (user.purchase === true) {\n selectionPrompt();\n } else {\n startPrompt();\n }\n });\n}", "function startOver() {\n inquirer\n .prompt({\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to buy another product?\",\n default: true\n })\n .then(function(answer) {\n if (answer.continue) {\n purchaseChoice();\n }\n else {\n connection.end();\n }\n })\n}", "function start() {\n console.log(\" \");\n inquirer.prompt({\n name: \"start\",\n type: \"input\",\n message: \"Press <enter> to shop agian\"\n }).then(function(answer) {\n choice = [];\n console.log(\" \");\n display();\n \n });\n}", "function playAgain(){\n \n }", "function reprompt() {\n inquirer.prompt([{\n type: \"confirm\",\n name: \"reply\",\n message: \"Would you like to purchase another item?\"\n }]).then(function (ans) {\n if (ans.reply) {\n start();\n } else {\n console.log(\"Thank you. See you soon!\");\n }\n });\n}", "function playGame() {\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n type: \"input\",\n message: \"Guess a letter --> \",\n name: \"guess\"\n }\n ])\n .then(function (inquirerResponse) {\n\n wrd.checkLetter(inquirerResponse.guess);\n\n console.log(wrd.currentWord());\n\n var g = checkIfWinner();\n\n if(g){\n console.log('WINNER');\n }else{\n playGame();\n }\n \n\n });\n}", "function play(playerChoice) {\n\t// Hide \"rock\", \"paper\", \"scissors\" option buttons\n\tdocument.getElementById(\"buttons\").style.display = \"none\";\n\tvar pImg = document.getElementById(\"player\");\n\tvar cImg = document.getElementById(\"computer\");\n\tvar result = document.getElementById(\"result\");\n\n\t// Show computer's hand\n\tcImg.style.display = \"block\";\n\t// Get randomized computer choice\n\tvar computerChoice = getComputerChoice();\n\t// Wait for some time\n\tsetTimeout(function() {\n\t\t// Sets the player hand to player choice image and\n\t\t// computer hand to computer choice image\n\t\tpImg.src = \"\" + playerChoice + \".png\";\n\t\tcImg.src = \"\" + computerChoice + \".png\";\n\t\t// Wait for some time\n\t\tsetTimeout(function() {\n\t\t\t// Displays the result of the game\n\t\t\tresult.innerHTML =\n\t\t\t\t\"<h1>\" + getWinner(playerChoice, computerChoice) + \"</h1>\";\n\t\t\t// Offers the choice to play again\n\t\t\tdocument.getElementById(\"playAgain\").style.display = \"block\";\n\t\t}, 1000);\n\t}, 1000);\n}", "function acceptAnswer() {\n // if this was the last card, don't replace it (must be done on client side, to avoid Async DB inconsistencies.)\n lookupCardsRemainingInCurrentLevel()\n .then(cardsRemaining => {\n rankUpCard();\n\n /// only load another card, if there are still cards left.\n if (cardsRemaining == 0)\n window.location.href = \"/polyglot/\";\n else {\n animateReplace();\n loadCard();\n }\n });\n}", "function whoIsPlaying() {\n console.log(prompt(\"Do you want to play against me or another ‘real’ person?\"));\n console.log(prompt(\"Type 1 to play against me.\\n=> Type 2 to play against a friend.\"));\n userChoice = userInput.question();\n userChoice = userInputValidation(userChoice, ['1', '2'], \"Maybe I wasn't clear enough! The options are: '1' to play with me or '2' to play against a friend.\\n\");\n if (userChoice === '1') {\n console.clear();\n playWithComputer();\n whoStarts('computer');\n } else {\n console.clear();\n playWithFriend();\n whoStarts('friend');\n }\n}", "function play() {\n\n\tif (selectLevel.value === \"game-small\") {\n\t\tchosenCard = Array.from(document.querySelectorAll(\".flip-card-front\"));\n\t\tchosenCardInner = Array.from(document.querySelectorAll(\".flip-card-inner\"));\n\t\tchosenImg = board[0].querySelectorAll(\"img\");\n\t} else {\n\t\tchosenCard = Array.from(document.querySelectorAll(\".flip-cardm-front\"));\n\t\tchosenCardInner = Array.from(document.querySelectorAll(\".flip-cardm-inner\"));\n\t\tchosenImg = board[1].querySelectorAll(\"img\");\n\t};\n}", "function continueGame() {\n \n return confirm(\"Continue to play game?\");\n \n}", "function promptUser()\n{\n return readline.question(\"Please enter the valid number of player (1-52)\");\n}", "function displayPrompt(){\n inquirer.prompt([\n {\n type: 'list',\n name: 'product',\n message: '\\n\\nselect product to purchase.',\n choices: queryArray\n },\n {\n type: 'input',\n name: \"quantity\",\n message: \"How many would you like to purchase?\"\n }\n ]).then(function(answer) {\n confirmPurchase(answer.product,answer.quantity);\n });\n//close displayPrompt \n}", "function paperChoice() {\n var compChoice = showCompResult();\n // Check for win\n if (compChoice === 1) {\n playerDraws();\n } else if (compChoice === 2) {\n playerLoses();\n } else {\n playerWins();\n }\n}", "function ComputerPlay()\n {\n let randomChance = Math.random();\n if(randomChance<0.20)\n {\n dealerCardPlayed = dealerHand.cards[0].choice;\n }\n else if(randomChance<0.4&&randomChance>0.2)\n {\n dealerCardPlayed = dealerHand.cards[1].choice;\n }\n else if(randomChance<0.6&&randomChance>0.4)\n {\n dealerCardPlayed =dealerHand.cards[2].choice;\n }\n else if(randomChance<0.8&&randomChance>0.6)\n {\n dealerCardPlayed =dealerHand.cards[3].choice;\n }\n else \n {\n dealerCardPlayed =dealerHand.cards[4].choice;\n }\n }", "function playAsUser() {\n var userHand = new Hand();\n var askHit = confirm( \"In hand: \" + userHand.printHand() + \". Would you like to hit? Press cancel to stay.\" );\n while( askHit ) {\n userHand.hitMe();\n askHit = confirm( \"In hand: \" + userHand.printHand() + \". Would you like to hit? Press cancel to stay.\" );\n }\n return userHand;\n}", "function initgame() {\n prompts();\n}", "function selectCard (card) {\n humanPlayer.hand.tradeIns[card] = !humanPlayer.hand.tradeIns[card];\n \n if (humanPlayer.hand.tradeIns[card]) {\n dullCard(HUMAN_PLAYER, card);\n } else {\n fillCard(HUMAN_PLAYER, card);\n }\n}", "function showScoreCard() {\n clearPrompt();\n $(\"#points\").text(\"\");\n $(\"#score\").text(\"\");\n $(\"#rightAnswers\").text(\"Correct Answers: \" + correct);\n $(\"#wrongAnswers\").text(\"Incorrect Answers: \" + incorrect);\n $(\"#totalScore\").text(\"Total Score: \" + score);\n var playAgainButton = $(\"<button>\");\n playAgainButton.addClass(\"playAgain btn btn-outline-dark btn-lg btn-block\");\n playAgainButton.text(\"Play Again?\");\n $(\"#playAgainButtonSection\").append(playAgainButton);\n correct = 0;\n incorrect = 0;\n score = 0;\n }", "function rockChoice() {\n var compChoice = showCompResult();\n // Check for win\n if (compChoice === 0) {\n playerDraws();\n } else if (compChoice === 1) {\n playerLoses();\n } else {\n playerWins();\n }\n}" ]
[ "0.732434", "0.70435596", "0.6944638", "0.68279356", "0.680024", "0.67515856", "0.67206794", "0.670351", "0.66868895", "0.66671205", "0.66492176", "0.66471195", "0.66454554", "0.65982753", "0.6570302", "0.65521574", "0.65461713", "0.6542514", "0.6458754", "0.6439896", "0.6437595", "0.6422796", "0.64079565", "0.6402032", "0.6401121", "0.63762736", "0.63747567", "0.6367076", "0.6359382", "0.6351825", "0.634776", "0.6338544", "0.6331858", "0.6330246", "0.6326968", "0.63187534", "0.6309237", "0.62969494", "0.62941325", "0.6291817", "0.62664455", "0.6257822", "0.6257816", "0.62572914", "0.62532157", "0.62459284", "0.6241258", "0.62398136", "0.62394726", "0.6233855", "0.6233855", "0.6222483", "0.62220865", "0.62189716", "0.62103766", "0.61980253", "0.6193386", "0.61925584", "0.61786616", "0.6177457", "0.61762595", "0.61752206", "0.6168338", "0.61645776", "0.61602867", "0.6153278", "0.6150254", "0.6145502", "0.61435", "0.6139737", "0.6137517", "0.6120703", "0.6117071", "0.61153144", "0.61099", "0.6092913", "0.60869026", "0.6083412", "0.6068816", "0.6063048", "0.6061408", "0.60558695", "0.605543", "0.6054205", "0.60436296", "0.6042083", "0.6034439", "0.60270685", "0.6024752", "0.6020149", "0.601885", "0.60172874", "0.60161966", "0.6012141", "0.6008729", "0.60054195", "0.60030806", "0.60000044", "0.59971535", "0.5991273" ]
0.6786687
5
Message to both players Write values in global variables out to the database
function updateDatabase() { database.ref().set({ p1name: v_p1name, p1pick: v_p1pick, p1wins: v_p1wins, p1losses: v_p1losses, p1ties: v_p1ties, p2name: v_p2name, p2pick: v_p2pick, p2wins: v_p2wins, p2losses: v_p2losses, p2ties: v_p2ties, conversation: v_conversation, message: v_message }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendGameDataToServer() {\n // initialize data message\n var data = {};\n\n // attach room and player ids\n data.roomId = viewModel.currentRoomId();\n data.playerId = localPlayerId;\n\n // initialize character array\n data.chars = [];\n\n // find local player and pack player data on message\n var player = _.find(characters, {id: localPlayerId});\n if (player)\n player.appendDataToMessage(data);\n\n data.iGotCake = iGotCake;\n var localCake = _.find(characters, {id:'cake'});\n data.cake = { spritex: localCake.sprite.x, spritey: localCake.sprite.y};\n iGotCake = false;\n\n // ship data to the server\n socket.emit('clientSend', data);\n}", "function lostGame(){\n\tif(soundOn){//plays lost music if music is on\n\t\t\tdead.play();\n\t}\n\t//Store totalTraveled in the database with the player's name and his tombstone msg that comes from user input, the leaders name is at characters[0]\n\tdocument.getElementsByClassName(\"container\")[0].innerHTML = \"<h1>YOU LOSE!!!</h1><p>Enter a message for your grave.</p>\\\n\t<form name='form2' action='tombstone.php' method='post'><input type='hidden' name='tempTraveled'></input><input type='hidden' name='leaderName'></input><input type='hidden' name='nextLocation'></input><input type='hidden' name='prevLocation'></input><input type='text' val='' name='messageInput' id='messageInput'></input><br><input type='submit' name='submitButton' class='button'></input></form>\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\n\t//once message is input, the data is sumbitted to the database\n\tvar msgInput = document.getElementById('messageInput').value;\n\tdocument.form2.prevLocation.value = prevLocation;\n\tdocument.form2.nextLocation.value = locations[0];\n\tdocument.form2.leaderName.value = characters[0];\n\tdocument.form2.tempTraveled.value = tempTraveled;\n\t\n}", "static sendPacket() {\n sendGamePacket('user|eq|' + equipment.PLAYER_ID);\n }", "sendPlayerUpdates() {\n\t\t// console.log(\"Sending player updates\");\n\t\tlet update = this.stage.getUpdatedStageState();\n\n\t\tlet updatedState = JSON.stringify({\n\t\t\ttype: \"stage-update\",\n\t\t\tplayerActors: update.players,\n\t\t\tbulletActors: update.bullets,\n\t\t\tenvironmentActors: update.environment,\n\t\t\tnumAlive: update.numAlive,\n\t\t\thasEnded: update.hasEnded\n\t\t});\n\t\tthis.wss.broadcastToLobby(updatedState, this.gameId);\n\t}", "function sendPlayers() {\r\n if (!SINGLE) {\r\n process.send({ type: \"players\", count: roomInstance.player_count });\r\n }\r\n}", "function update() {\n // Only send position when it's updated\n var playerUpdate = JSON.stringify(Global.player.properties());\n if (playerUpdate !== lastPlayerUpdate) {\n lastPlayerUpdate = playerUpdate;\n socket.emit('update player', Global.player.properties());\n }\n }", "function sendServerUpdate() {\r\n myTurn = game.turn == localStorage.userID;\r\n if(myTurn) {\r\n if(game.playerMoved()) {\r\n myPos = game.getPlayerPos();\r\n myDir = game.getPlayerDir();\r\n game.resetLastMoved();\r\n socket.emit(\"gameEvent\", {eventType: \"playerMove\",\r\n newPos: myPos,\r\n newDir: myDir});\r\n }\r\n else if (game.getPlayerShot()) {\r\n socket.emit(\"gameEvent\", {eventType: \"playerFire\"});\r\n }\r\n }\r\n}", "askForInfo(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"PLAYERS\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"CPUUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"RAMUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "function notifyUpdate(){\n var update = {}\n //get the opponent's id\n for(var i = 0;i<connections.length;++i){\n /**\n * Look for the player opposite that of the one\n * sending the ID.\n */\n\n if(connections[i].id !== connections[index].id){\n console.log(\"Opposite found\");\n console.log(\"This id :\" + connections[i].id);\n console.log(\"other id:\" + connections[index].id);\n\n update[\"id\"] = connections[index].id;\n update[\"event\"] = \"opponentupdate\";\n update[\"data\"] = connections[i];\n }\n }\n console.log(\"Notifying opponent of \" + JSON.stringify(update));\n ws.send(JSON.stringify(update));\n }", "function write_in_db()\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"Event idd: \", event_id);\n\n\t\t\t\t\t\t\t\t\t\t\tvar email = user_data.email;\n\t\t\t\t\t\t\t\t\t\t\tvar name = user_data.name;\n\t\t\t\t\t\t\t\t\t\t\tvar contact = user_data.contact;\n\t\t\t\t\t\t\t\t\t\t\tvar lati = user_data.lati;\n\t\t\t\t\t\t\t\t\t\t\tvar longi = user_data.longi;\n\t\t\t\t\t\t\t\t\t\t\tvar time = new Date();\n\t\t\t\t\t\t\t\t\t\t\tvar amb_id = best_ambulance_id;\n\t\t\t\t\t\t\t\t\t\t\tvar beingServed = true;\n\n\t\t\t\t\t\t\t\t\t\t\tvar json_object = {\n\t\t\t\t\t\t\t\t\t\t\t\teventId: event_id,\n\t\t\t\t\t\t\t\t\t\t\t\temail: email,\n\t\t\t\t\t\t\t\t\t\t\t\tname: name,\n\t\t\t\t\t\t\t\t\t\t\t\tcontact: contact,\n\t\t\t\t\t\t\t\t\t\t\t\tlati: lati,\n\t\t\t\t\t\t\t\t\t\t\t\tlongi: longi,\n\t\t\t\t\t\t\t\t\t\t\t\ttime: time,\n\t\t\t\t\t\t\t\t\t\t\t\tamb_id: amb_id,\n\t\t\t\t\t\t\t\t\t\t\t\tbeingServed: beingServed\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\tcoll_users.insert(json_object);\n\n\t\t\t\t\t\t\t\t\t\t\tcoll_ambulances.update( { _id: best_ambulance_id },{ $set: {isServing: true, eventId: event_id} } );\n// Send Push Notification ########################################################################################################################################\n\n\t\t\t\t\t\t\t\t\t\t\tvar message_tuple = {\n\t\t\t\t\t\t\t\t\t\t\t\tname: name, contact:contact, lati:lati, longi:longi\n\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\tvar request = require('request');\n\t\t\t\t\t\t\t\t\t\t\tvar send_data = {\n\t\t\t\t\t\t\t\t\t\t\t message : message_tuple, regId: best_ambulance_id\n\t\t\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\t\t\t\trequest({url:\"http://172.16.100.139/btp/send_message.php\", qs:send_data}, function(err, response, body) {\n\t\t\t\t\t\t\t\t\t\t\t if(err) { console.log(err); return; }\n\t\t\t\t\t\t\t\t\t\t\t console.log(\"Get response: \" + response.statusCode);\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tclose_all();\n\t\t\t\t\t\t\t\t\t\t}", "function sendUpdate() {\n var gameState = galaxy; //gameState\n sio.emit('gameState', gameState);\n }", "function sendMessage(message) {\n if (message !== \"\" && players == \"double\") {\n \tconsole.log(\"typed + message\" + message);\n webSocket.send(message);\n id(\"message\").value = \"\";\n }\n}", "function update(playerObj){\n sendObj.Player = playerObj.Player;\n if(Players.length == 0){\n sendObj.Player = null;\n }\n if(Players.length < 2){\n sendObj.info = \"waiting for players to join\";\n }else{\n sendObj.info = Players[turn] + \"'s turn\"; \n } \n}", "function save(){\r\n var message ={\r\n messageType:\"SAVE\",\r\n gameState:{\r\n \"score\":score,\r\n \"mines\": mines,\r\n \"openedFields\":openedFields\r\n }\r\n };\r\n window.parent.postMessage(message, \"*\");\r\n}", "function sendBack(message){\n\t\tvar obj = {\"player\":\"Server\",\"role\":\"game\",\"message\":message};\n\t\tsocket.emit('message', obj);\n\t}", "function sendMessage() {\n sendNewMessage({ dsText: valueInput.trim(), usuario: getUsuarioLogado() });\n setValueInput('');\n }", "function update_data(potentval, butphase, accelerometer, fruit1, fruit2, fruit3, fruit4, rightbasket, leftbasket, gamescore) {\r\n // checks the user's answer on the identity and publishes their answer on the related channel. Sends the data with a certain message address. The message address is set before the colon\r\n \r\n if (identity_ans == \"left shoulder\") { //shoulder of left arm\r\n dataServer.publish({\r\n channel: channelName,\r\n message: {\r\n lsv: potentval, // shoulder potentiometer value\r\n lsb: butphase, // shoulder button\r\n lsa: accelerometer, //accelerometer value\r\n f1: fruit1,\r\n f2: fruit2,\r\n f3: fruit3,\r\n f4: fruit4,\r\n rb: rightbasket,\r\n lb: leftbasket,\r\n sc: gamescore\r\n \r\n }\r\n });\r\n }\r\n if (identity_ans == \"left elbow\") { //elbow of left arm\r\n dataServer.publish({\r\n channel: channelName,\r\n message: {\r\n lev: potentval, // elbow potentiometer value\r\n leb: butphase, // elbow button\r\n lea: accelerometer //accelerometer value\r\n }\r\n });\r\n }\r\n if (identity_ans == \"right shoulder\") { //shoulder of right arm\r\n dataServer.publish({\r\n channel: channelName,\r\n message: {\r\n rsv: potentval, // shoulder potentiometer value\r\n rsb: butphase, // shoulder button\r\n rsa: accelerometer //accelerometer value\r\n }\r\n });\r\n }\r\n if (identity_ans == \"right elbow\") { //elbow of right arm\r\n dataServer.publish({\r\n channel: channelName,\r\n message: {\r\n rev: potentval, // shoulder potentiometer value\r\n reb: butphase, // shoulder button\r\n rea: accelerometer //accelerometer value\r\n }\r\n });\r\n }\r\n \r\n //if (identity_ans == \"wrist\") {\r\n //dataServer.publish({\r\n //channel: channelName,\r\n //message: {\r\n //wv: potentval, // wrist potentiometer value\r\n //wb: butphase, // wrist button\r\n //sa: accelerometer //accelerometer value\r\n //}\r\n //});\r\n //}\r\n }", "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "function beginGame(game_ID, players) {\n\n var txts1 = [\n \"ACCESSING SYSTEM...\",\n \"HELLO [NAME] HOW ARE YOU\",\n \"WOULD Y@U *! L?K3 T0 *£..$..\",\n \"...¤¤¤..@..?...*#..!.........\"\n ];\n \n var txts2 = [\n \" \",\n \"!!! ...WARNING... !!!\",\n \"A HOSTILE ENTITY IS TRYING TO ACCESS YOUR SYSTEM...\",\n \"!!! ...WARNING... !!!\",\n \"FIND THE KILLCODE FOR THE HOSTILE SYSTEM\",\n \"LOOK THROUGH THE FILES IN THE HOSTILE SYSTEM\",\n \"THE KILLCODE WILL SHUT DOWN THE HOSTILE SYSTEM...\",\n \"...FIND IT BEFORE THEY FIND YOURS...\",\n \"..........\",\n \"HACKING HOSTILE SYSTEM... INITIATED\",\n \"..........\",\n \"HACKING COMPLETED SUCCESSFULLY!\",\n \"ACCESS GRANTED...\"\n ]; \n \n var txts3 = [\n \" \",\n \"HELLO [OPPONENT] HOW ARE YOU\",\n \"FOR HELP NAVIGATING THE SYSTEM TYPE 'HELP'\",\n ]; \n \n io.emit('starting game', [game_ID, txts1, txts2, txts3, players]); \n}", "saveAndSendMessage() {\n const { user, contact, apikey } = this.props.location.state;\n const textmessage = this.state.text;\n const msg = {\n id: uuid(),\n from: user.id,\n to: contact.id,\n msg: textmessage,\n timestamp: new Date()\n };\n console.log(msg);\n store.write(() => {\n store.create(\"Message\", msg);\n });\n\n if (this.state.text) {\n this.handleInput(\"\");\n Realpub.emit(`chat::send::message::to::${user.id}`, msg);\n }\n }", "function winMsg(player) {\n\twin = true;\n\n\tif (player == \"I\") {\n\t\tfirstPlayerScore = firstPlayerScore + 1;\n\t\t$('#firstPlayerScore').text(`Player 1: ${firstPlayerScore}`);\n\t\t$('.successmsg').text('**Congratulations, Player 1 have won**');\n\n} else {\n\n\t\tsecondPlayerScore = secondPlayerScore + 1;\n\t\t$('#secondPlayerScore').text(`Player 2: ${secondPlayerScore}`);\n\t $('.successmsg').text('**Congratulations, Player 2 have won**');\n\t}\nresetGame();\n}", "function sendMessage() {\n if (!that.connection.isConnected()) {\n displayMessage(\"<span style='color: red'>Verbindung beendet oder noch nicht geöffnet.</span>\");\n return;\n }\n\n var textMessage = getChatMessageFromInput();\n\n if (!textMessage) {\n $(\"gameInputField\").focus();\n return;\n }\n\n var message = new GameMessage(GameMessage.GameChatMessage);\n message.text = \"<b>\" + User.load().getUsername() + \": </b> \" + textMessage;\n\n that.connection.send(message);\n\n // adding \"Ich: \" in front of every printed message from the user so\n // that he knows it was his\n displayMessage(\"<b>Ich: </b>\" + textMessage);\n\n }", "function playOneWin(){\n oneScore++\n hasPicked = false;\n bannerText.text(\"Player One Wins\")\n bannerText.show();\n setTimeout(bannerhide,1000);\n database.ref(\"playerOne\").set({\n oneState: hasPicked,\n ScoreOne: oneScore\n });\n database.ref(\"playerTwo\").set({\n twoState: hasPicked,\n ScoreTwo: twoScore\n });\n}", "function sendMessageToServer(){ \n // send message on inputbox to server\n socket.emit('chat', {name: localPlayer.getName(),message: $(\"#txtTextArea\").val() });\n \n $(\"#txtAreaDisplay\").val( $(\"#txtAreaDisplay\").val()+\"\\r\\n[\" + localPlayer.getName() + ']: ' + $(\"#txtTextArea\").val());\n \n // then we empty the text on the input box.\n $(\"#txtTextArea\").val('');\n }", "function prosesPesan(update) {\r\n //return tg.util.outputText(\"Data diterima di proses Pesan!\");\r\n\r\n // detek klo ada pesan dari user\r\n if (update.message) {\r\n // penyederhanaan variable\r\n var msg = update.message;\r\n\r\n // deteksi event letakkan di sini\r\n\r\n // SET-EVENT-WELCOME-AWAL\r\n // EVENT NEW USER dan SAY WELCOME BOT\r\n\r\n if (msg.new_chat_members) {\r\n // return tg.sendMsg(msg, tg.util.outToJSON(msg));\r\n\r\n // variable baru untuk new chat member, ambil yang pertama saja\r\n var newUser = msg.new_chat_members[0];\r\n\r\n // mendefinisikan {nama}\r\n var namaUser = newUser.first_name;\r\n // jika punya last name, kita tambahkan juga\r\n if (newUser.last_name) namaUser += \" \" + newUser.last_name;\r\n\r\n // bersihkan nama dari tag HTML\r\n namaUser = tg.util.clearHTML(namaUser);\r\n\r\n // mendifiniksan username\r\n var username = newUser.username ? \"@\" + newUser.username : \"\";\r\n\r\n // mendifinisikan iduser\r\n var idUser = newUser.id;\r\n\r\n // mendefinisikan grup title\r\n var namaGrup = msg.chat.title;\r\n\r\n // bersihkan nama grup dari tag HTML\r\n namaGrup = tg.util.clearHTML(namaGrup);\r\n\r\n // mendefinisikan id grup\r\n var idGrup = msg.chat.id;\r\n\r\n // Merangkai ucapan selamatnya digabung variable ke pesanWelcome\r\n // ambil dulu pesan di database User\r\n var pesanWelcome = user.getValue(\"welcomeMessage\" + msg.chat.id);\r\n\r\n // jika tidak ada pesan welcome, ya udah balik aja\r\n if (!pesanWelcome) return false;\r\n\r\n // ambil button di database User\r\n var keyboard = user.getValue(\"welcomeMessageButton\" + msg.chat.id);\r\n\r\n // masukkan variable-variablenya\r\n var teks = pesanWelcome\r\n .replace(/{nam[ae]}/gi, namaUser) // mengubah template nama, name\r\n .replace(/{username}/gi, username) // mengubah template username\r\n .replace(/{iduser}/gi, idUser) // mengubah template id user\r\n .replace(/{gro?up}/gi, namaGrup) // mengubah template title group\r\n .replace(/{idgro?up}/gi, idGrup); // mengubah template id group\r\n\r\n // kirim pesan welcome\r\n\r\n // jika terdapat keyboard\r\n if (keyboard) {\r\n // parsing ke format yang semestinya\r\n keyboard = JSON.parse(keyboard);\r\n\r\n // kirim dalam inline button\r\n return tg.sendMsgKeyboardInline(\r\n msg,\r\n teks,\r\n keyboard,\r\n \"HTML\",\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // jika jenisnya biasa\r\n return tg.sendMsg(msg, teks, \"HTML\");\r\n }\r\n // SET-EVENT-WELCOME-AKHIR\r\n\r\n // jika ada pesan berupa text\r\n if (msg.text) {\r\n // jika user klik start, bot akan menjawab\r\n var pola = /(^[\\/!]start(@rsmb_id_bot)?$)/i;\r\n if (pola.exec(msg.text)) {\r\n var nama = msg.from.first_name;\r\n if (msg.from.last_name) nama += \" \" + msg.from.last_name;\r\n // perhatikan, ini menggunakan sendMsg bukan sendMessage\r\n var pesan =\r\n \"🧕 Assalamu'alaikum, <b>\" +\r\n tg.util.clearHTML(nama) +\r\n \"</b>, perkenalkan saya, Ayana,\";\r\n pesan += \" ヾ(≧▽≦*)o Bot Customer Self-Service Anda. \";\r\n pesan +=\r\n \"RS Muhammadiyah Bandung melayani pasien umum, asuransi dan BPJS. \";\r\n pesan +=\r\n \"RS Muhammadiyah juga menyediakan pelayanan konsultasi jarak jauh dan perawatan di rumah.\";\r\n pesan +=\r\n \" Untuk pasien lama yang memiliki No. Medrek, dapat mendaftar \";\r\n pesan +=\r\n \"poliklinik rawat jalan untuk keesokan harinya melalui tombol\";\r\n pesan +=\r\n \" Registrasi Online di bawah ini atau aplikasi RSMB Online.\";\r\n\r\n var keyboard = [];\r\n\r\n // keyboard baris pertama\r\n // index dimulai dari 0\r\n keyboard[0] = [\r\n tg.button.url(\r\n \"👨‍💻 Registrasi Online\",\r\n \"https://j.mp/regonline-rsmb\"\r\n ),\r\n tg.button.url(\"📱 RSMB Online\", \"https://j.mp/rsmb-online\"),\r\n ];\r\n\r\n // keyboard baris kedua\r\n keyboard[1] = [\r\n tg.button.url(\r\n \"🧑‍⚕️ Telekonsultasi\",\r\n \"https://j.mp/telekonsultasi-rsmb\"\r\n ),\r\n tg.button.url(\"🤱 HomeCare\", \"https://j.mp/homecare-rsmb\"),\r\n ];\r\n\r\n // keyboard baris ketiga\r\n keyboard[2] = [\r\n tg.button.url(\r\n \"📜 Jadwal Realtime\",\r\n \"https://j.mp/jadwal-dokter-rsmb\"\r\n ),\r\n tg.button.url(\r\n \"📰 Berita Terbaru\",\r\n \"http://j.mp/berita-rsmb\"\r\n ),\r\n ];\r\n\r\n // keyboard baris keempat\r\n keyboard[3] = [\r\n tg.button.url(\r\n \"🎉 Kuesioner Pelayanan\",\r\n \"https://j.mp/kuesioner-rsmb\"\r\n ),\r\n tg.button.url(\r\n \"🧧 Saran & Kritik\",\r\n \"https://j.mp/saran-rsmb\"\r\n ),\r\n ];\r\n\r\n // keyboard baris kelima\r\n keyboard[4] = [\r\n tg.button.url(\"🌏 Website\", \"https://j.mp/rsmb-2021\"),\r\n tg.button.text(\"😎 Author\", \"me_click\"),\r\n ];\r\n\r\n return tg.sendMsgKeyboard(msg, pesan, keyboard, \"HTML\");\r\n //return tg.sendMsgKeyboardInline(msg, pesan, keyboard, 'HTML')\r\n }\r\n\r\n // jika user ketik /pong, bot akan jawab Piiing!\r\n // pola dan jawaban paling sederhana\r\n //var pola = /^[\\/!]pong$/i\r\n //var pola = /(^[\\/!]pong$|^[\\/!]pong@rsmb_id_bot$)/i\r\n var pola = /(^[\\/!]pong(@rsmb_id_bot)?$)/i;\r\n if (pola.exec(msg.text)) {\r\n // balas pong dengan mereply pesan\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"🏓 *Piiing! Desss....*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // jika user ketik /ping, sekalian dihitung selisihnya\r\n // dan diberikan berbagai contoh kasus\r\n\r\n // balas pong dengan mereply pesan\r\n // menggunakan parse_mode Markdown\r\n //var pola = /^[\\/!]ping$/i\r\n //var pola = /(^[\\/!]ping$|^[\\/!]ping@rsmb_id_bot$)/i\r\n var pola = /(^[\\/!]ping(@rsmb_id_bot)?$)/i;\r\n if (pola.exec(msg.text)) {\r\n // awal waktu pakai timestampnya message saja\r\n // jika bot macet timestamp pengirim tetap diperhitungkan\r\n // pilihan lain bisa bikin time sendiri\r\n var waktuAwal = msg.date;\r\n var hasil = tg.sendMessage(\r\n msg.chat.id,\r\n \"<b>Pooong</b>\",\r\n \"HTML\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n var newMsg = hasil.result;\r\n var waktuAkhir = new Date();\r\n\r\n //let fotoAyana = [\r\n // 'https://raw.githubusercontent.com/rescenic/rsmb-bot/master/Ayana%20Flowers.jpg',\r\n // 'https://raw.githubusercontent.com/rescenic/rsmb-bot/master/Ayana%20Lovely.jpg',\r\n // 'https://raw.githubusercontent.com/rescenic/rsmb-bot/master/Ayana%20Shines.jpg',\r\n //]\r\n\r\n // hitung selisih waktunya dalam satuan detik\r\n var selisihWaktu = waktuAkhir / 1000 - waktuAwal;\r\n // foto gambar disembunyikan di emoticon Ayana\r\n //var pesan = '<a href=\"'+tg.util.random(fotoAyana)+'\">🧕</a> '\r\n var pesan = `<b>Kecepatan reaksi bot <code>${selisihWaktu.toLocaleString()}</code> detik.</b>`;\r\n\r\n return tg.editMessageText(\r\n msg.chat.id,\r\n newMsg.message_id,\r\n false,\r\n pesan,\r\n \"HTML\"\r\n );\r\n }\r\n\r\n // tangkap pesan echo atau say\r\n var pola = /^([\\/!](echo|say))/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n var pesan = msg.text.replace(cocok[1], \"\");\r\n // bersihkan pesan dari spasi\r\n pesan = pesan.trim();\r\n // deteksi jika panjang pesan < 1, jangan lakukan apa-apa\r\n if (pesan.length < 1) return false;\r\n\r\n // kirim pesan echo / say nya, tanpa parse_mode\r\n return tg.sendMsg(msg, pesan);\r\n }\r\n\r\n // kirim foto dari URL\r\n //var pola = /^[\\/!](jadwal)$/i\r\n //var pola = /(^[\\/!]jadwal$|^[\\/!]jadwal@rsmb_id_bot$)/i\r\n var pola = /^[\\/!]jadwal(@rsmb_id_bot)?|📜 Jadwal Realtime$/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n var url =\r\n \"https://raw.githubusercontent.com/rescenic/rsmb-bot/master/Jadwal%20Dokter%20Juli%202021.jpg\";\r\n var caption =\r\n \"<b>Jadwal Dokter Juli 2021 dan Versi Realtime H-1 di https://j.mp/jadwal-dokter-rsmb</b>\";\r\n return tg.sendPhoto(msg.chat.id, url, caption, \"HTML\");\r\n }\r\n\r\n // kalau mau kembangin sendiri menjadi bot interaktif, code nya taruh di bawah ini\r\n // -- mulai custom deteksi text --\r\n var pola = /^[\\/!]regonline(@rsmb_id_bot)?|👨‍💻 Registrasi Online$/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"👓 *Daftar Online Rawat Jalan via Website di https://j.mp/regonline-rsmb*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n var pola = /^[\\/!]android(@rsmb_id_bot)?|📱 RSMB Online$/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"📲 *Download Aplikasi RSMB Online di https://j.mp/rsmb-online*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n var pola = /^[\\/!]telekonsul(@rsmb_id_bot)?|🧑‍⚕️ Telekonsultasi$/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n var url =\r\n \"https://raw.githubusercontent.com/rescenic/rsmb-bot/master/Telekonsultasi.jpeg\";\r\n var caption =\r\n \"👩‍⚕️ <b>Daftar Konsultasi Dokter dari Rumah di https://j.mp/telekonsultasi-rsmb</b>\";\r\n return tg.sendPhoto(msg.chat.id, url, caption, \"HTML\");\r\n }\r\n\r\n var pola = /^[\\/!]homecare(@rsmb_id_bot)?|🤱 HomeCare$/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"👩‍⚕️ *Daftar Perawatan di Rumah di https://j.mp/homecare-rsmb*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n var pola = /(^📰 Berita Terbaru$)/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"📰 *Baca artikel berita terbaru di http://j.mp/berita-rsmb*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n var pola = /(^🎉 Kuesioner Pelayanan$)/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"🎉 *Sharing pendapat anda mengenai pelayanan RS Muhammadiyah Bandung di https://j.mp/kuesioner-rsmb*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n var pola = /(^🧧 Saran & Kritik$)/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"📜 *Suara publik untuk peningkatan kualitas pelayanan RS Muhammadiyah Bandung di https://j.mp/saran-rsmb*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n var pola = /(^🌏 Website$)/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"🌏 *Kunjungi Situs Resmi RS Muhammadiyah Bandung di https://rsmb.co.id*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n if (/^😎 Author$/i.exec(msg.text)) {\r\n let pesan =\r\n \"🧕 <b>Customer Self-Service Bot</b>\\n<b>🏥 RS Muhammadiyah Bandung</b>\\n<b>oleh <a href='https://t.me/rescenic'>Muhammad Ridwan Hakim, S.T.</a></b>\\n<b>15 Muharram 1443 H / 23 Agustus 2021.</b>\";\r\n\r\n let keyboard = [\r\n [\r\n { text: \"💵 Shodaqoh\", callback_data: \"me_say\" },\r\n { text: \"🦸‍♂️ Rescenic\", callback_data: \"me_click\" },\r\n ],\r\n [{ text: \"🌐 rescenic.xyz\", url: \"https://rescenic.xyz\" }],\r\n ];\r\n return sendMsgKeyboardInline(msg.chat.id, pesan, keyboard);\r\n }\r\n\r\n var pola = /(^[\\/!]prokes(@rsmb_id_bot)?$)/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n var url =\r\n \"https://raw.githubusercontent.com/rescenic/rsmb-bot/master/Gerakan%201-5-6.jpg\";\r\n var caption =\r\n \"<b>Cegah dan Kendalikan Penyebaran Virus Covid-19 Dengan Gerakan 1-5-6</b>\";\r\n return tg.sendPhoto(msg.chat.id, url, caption, \"HTML\");\r\n }\r\n\r\n var pola = /(^[\\/!]shodaqoh(@rsmb_id_bot)?$)/i;\r\n if (pola.exec(msg.text)) {\r\n // menggunakan parse_mode Markdown\r\n return tg.sendMessage(\r\n msg.chat.id,\r\n \"🌏 *Anda dapat bershodaqoh untuk meningkatkan kualitas bot ini dengan cara menghubungi penulis di: https://j.mp/donasi-bot*\",\r\n \"Markdown\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // Event Respon Penambahan Tag\r\n // Dengan format: /+tag #namatag isi\r\n var pola = /^(\\/\\+tag (#\\w+)\\s).{1,}/i;\r\n if (pola.exec(msg.text)) {\r\n // pisah nama tag dan isi pesan\r\n var cocok = msg.text.match(pola);\r\n var tagName = cocok[2];\r\n var tagValue = msg.text.replace(cocok[1], \"\");\r\n var pesanTag = tagTambah(tagName, tagValue);\r\n return tg.kirimPesan(msg.chat.id, pesanTag);\r\n }\r\n\r\n // Event Respon #tag dan Menampilkan Isinya\r\n // ini menggunakan regex yang awam susah paham, intinya klo ada hashtag ( 1 kata yang depannya ada # nya ) :\r\n var pola = /^#\\w+$/i;\r\n if (pola.exec(msg.text)) {\r\n var pesanTag = tagCari(msg.text);\r\n if (pesanTag) {\r\n //return tg.kirimPesan(msg.chat.id, pesanTag);\r\n return sendMsgReplyTag(msg, pesanTag);\r\n }\r\n }\r\n\r\n // Event Respon Penghapusan Tag\r\n // Dengan format: /-tag #namatag\r\n var pola = /^\\/-tag (#\\w+)$/i;\r\n if (pola.exec(msg.text)) {\r\n // ambil nama tag nya aja\r\n var cocok = msg.text.match(pola);\r\n var tagName = cocok[1];\r\n var pesanTag = hapusTag(tagName);\r\n return tg.kirimPesan(msg.chat.id, pesanTag);\r\n }\r\n\r\n // Event Respon List Tag\r\n // Dengan format: /tags\r\n var pola = /^\\/tags(@rsmb_id_bot)?$/i;\r\n if (pola.exec(msg.text)) {\r\n var pesanTag = tagList();\r\n return tg.kirimPesan(msg.chat.id, pesanTag);\r\n }\r\n //CUSTOM-WELCOME-AWAL\r\n // trigger set Welcome\r\n var pola = /^([!\\/]setwelcome )/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n // periksa dulu user ID nya, jika tidak ada akses tolak saja.\r\n if (!tg.util.punyaAkses(adminBot, msg.from.id))\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Kamu tidak punya akses.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // buang pola yang di dapatkan dengan menggantinya dengan karakter kosong atau tidak ada\r\n var pesanWelcome = msg.text.replace(cocok[1], \"\");\r\n\r\n // uji dulu pesan yang diset bener atau enggak dalam format html :\r\n\r\n try {\r\n // kirim pesan berhasil disimpan\r\n tg.sendMsg(\r\n msg,\r\n \"✅ <b>WELCOME</b>: \" + pesanWelcome,\r\n \"HTML\",\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // simpan pesanWelcome\r\n user.setValue(\"welcomeMessage\" + msg.chat.id, pesanWelcome);\r\n } catch (e) {\r\n // jika gagal, keluarkan pesan error\r\n var pesanError = e.message;\r\n\r\n // tangkep pesan error yang dari Telegram saja\r\n if ((error = /({(?:.*)})/gim.exec(pesanError)))\r\n pesanError = error[1];\r\n\r\n // kalau Error gak usah di format HTML, buat keperluan debugging\r\n tg.sendMsg(\r\n msg,\r\n \"⛔️ ERROR: \" + pesanError,\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // selesai kecocokan pola, kembalikan\r\n return;\r\n }\r\n\r\n // trigger cek Welcome\r\n var pola = /^[!\\/]cekwelcome$/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n // periksa dulu user ID nya, jika tidak ada akses tolak saja.\r\n if (!tg.util.punyaAkses(adminBot, msg.from.id))\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Kamu tidak punya akses.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // buang pola yang di dapatkan dengan menggantinya dengan karakter kosong atau tidak ada\r\n var pesanWelcome = user.getValue(\r\n \"welcomeMessage\" + msg.chat.id\r\n );\r\n\r\n // jika kosong variablenya\r\n if (!pesanWelcome)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Tidak ada welcome.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // kirim pesan welcome:\r\n return tg.sendMsg(\r\n msg,\r\n \"🗣 WELCOME: \" + pesanWelcome,\r\n \"HTML\",\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // trigger reply set Welcome\r\n var pola = /^[!\\/]setwelcome$/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n // periksa dulu user ID nya, jika tidak ada akses tolak saja.\r\n if (!tg.util.punyaAkses(adminBot, msg.from.id))\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Kamu tidak punya akses.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // periksa ada reply atau tidak\r\n if (!msg.reply_to_message)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Harus reply pesan\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // sederhanakan variable reply_to_message\r\n var msgr = msg.reply_to_message;\r\n\r\n // periksa lagi, yang di reply text atau bukan\r\n if (!msgr.text)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Harus tipe teks\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // set up message yang akan di olah\r\n var pesanWelcome = msgr.text;\r\n\r\n // uji dulu pesan yang diset bener atau enggak dalam format html :\r\n\r\n try {\r\n // kirim pesan berhasil disimpan\r\n tg.sendMsg(\r\n msg,\r\n \"✅ <b>WELCOME</b>: \" + pesanWelcome,\r\n \"HTML\",\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // simpan pesanWelcome\r\n user.setValue(\"welcomeMessage\" + msg.chat.id, pesanWelcome);\r\n } catch (e) {\r\n // jika gagal, keluarkan pesan error\r\n var pesanError = e.message;\r\n\r\n // tangkep pesan error yang dari Telegram saja\r\n if ((error = /({(?:.*)})/gim.exec(pesanError)))\r\n pesanError = error[1];\r\n\r\n // kalau Error gak usah di format HTML, buat keperluan debugging\r\n tg.sendMsg(\r\n msg,\r\n \"⛔️ ERROR: \" + pesanError,\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // selesai kecocokan pola, kembalikan\r\n return;\r\n }\r\n\r\n // trigger untuk button Welcome\r\n // level: advance\r\n\r\n /* syntax: !buttonWelcome jmlKolomButton SYNTAX_URL\r\n \r\n jmlKolomButton banyaknya kolom dalam 1 baris: button1, button2\r\n SYNTAX_URL format markdown [title](URL)\r\n \r\n URL protocol yang benar (http/https).\r\n \r\n SYNTAX_URL dipisahkan apa aja, boleh spasi, ENTER, koma, dlsb\r\n*/\r\n var pola = /^[!\\/]buttonWelcome (\\d+)/i;\r\n if ((cocok = pola.exec(msg.text))) {\r\n // periksa dulu user ID nya, jika tidak ada akses tolak saja.\r\n if (!tg.util.punyaAkses(adminBot, msg.from.id))\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Kamu tidak punya akses.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // periksa ada reply atau tidak, keluarkan pesan error\r\n if (!msg.reply_to_message)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Harus reply pesan.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // sederhanakan variable reply_to_message\r\n var msgr = msg.reply_to_message;\r\n\r\n // periksa lagi, yang di reply text atau bukan\r\n if (!msgr.text)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Harus bertipe text.\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // set up message yang akan di olah\r\n var pesanWelcome = msgr.text;\r\n\r\n // sekarang kita parsing button nya\r\n // jangan kebalik ya, yang diparsing adalah msg biasa, bukan msgr (messsage reply)\r\n var pesanButton = msg.text;\r\n\r\n // sanitasi: ubah ke Integer\r\n var jmlKolomButton = parseInt(cocok[1]);\r\n\r\n // periksa berapa nilainya, jika 0 batalin aja\r\n if (jmlKolomButton < 1)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Minimal 1\",\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // kasih batas maksimal aja juga, terserah berapa sepantasnya\r\n // di sini aku kasih 5 aja\r\n var jmlMaxKolomButton = 5;\r\n if (jmlKolomButton > jmlMaxKolomButton)\r\n return tg.sendMsg(\r\n msg,\r\n \"🚫 Maksimal \" + jmlMaxKolomButton,\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // proses pembuatan / penyusunan button\r\n // dipahami sendiri ya, ini rumit bagi yang baru memulai. Makanya level nya advance\r\n\r\n // pola button\r\n var polaButton =\r\n /\\[(?<judul>[^\\]]+)\\]\\((?<url>https?:\\/\\/[^\\)]+)\\)/gim;\r\n\r\n // buat variable pendukung\r\n var keyboard = [];\r\n var baris = [];\r\n var nBaris = 0;\r\n var kolom = [];\r\n var nKolom = 0;\r\n\r\n // proses penyusunan\r\n while ((cocokButton = polaButton.exec(pesanButton))) {\r\n // buat 1 button di variable button\r\n tombol = tg.button.url(\r\n cocokButton.groups.judul,\r\n cocokButton.groups.url\r\n );\r\n\r\n // susun dalam baris\r\n baris.push(tombol);\r\n\r\n // tambah index button kolom\r\n nKolom++;\r\n\r\n // jika index button kolom sesuai jmlKolomButton\r\n if (nKolom == jmlKolomButton) {\r\n // masukkan ke dalam susunan keyboard\r\n keyboard[[nBaris][0]] = baris;\r\n\r\n // tambahkan index baris / row keyboardnya\r\n nBaris++;\r\n\r\n // reset index kolom dan baris\r\n nKolom = 0;\r\n baris = [];\r\n }\r\n }\r\n\r\n // sisa baris yang tidak diakomodir, masukkan di baris paling akhir\r\n if (nKolom > 0) keyboard[[nBaris][0]] = baris;\r\n\r\n // keyboard udah jadi, tinggal di coba send\r\n\r\n // uji dulu pesan yang diset bener atau enggak dalam format html\r\n // verifikasi text dan keyboad\r\n\r\n try {\r\n // kirim pesan berhasil disimpan\r\n // syntax lib 2 API: sendMsgKeyboardInline(msg, text, keyboard, parse_mode, disable_web_page_preview, reply_to_message_id)\r\n tg.sendMsgKeyboardInline(\r\n msg,\r\n pesanWelcome,\r\n keyboard,\r\n \"HTML\",\r\n false,\r\n msg.message_id\r\n );\r\n\r\n // simpan pesanWelcome\r\n user.setValue(\"welcomeMessage\" + msg.chat.id, pesanWelcome);\r\n // simpan buttonnya juga, bentuk string\r\n user.setValue(\r\n \"welcomeMessageButton\" + msg.chat.id,\r\n JSON.stringify(keyboard)\r\n );\r\n } catch (e) {\r\n // jika gagal, keluarkan pesan error\r\n var pesanError = e.message;\r\n\r\n // tangkep pesan error yang dari Telegram saja\r\n if ((error = /({(?:.*)})/gim.exec(pesanError)))\r\n pesanError = error[1];\r\n\r\n // kalau Error gak usah di format HTML, buat keperluan debugging\r\n tg.sendMsg(\r\n msg,\r\n \"⛔️ ERROR: \" + pesanError,\r\n false,\r\n false,\r\n msg.message_id\r\n );\r\n }\r\n\r\n // selesai kecocokan pola, kembalikan\r\n return;\r\n }\r\n\r\n // Akhir deteksi pesan text\r\n }\r\n\r\n // deteksi jika ada foto\r\n //if (msg.photo) {\r\n // taruh codinganmu di sini\r\n // misal menampilkan foto ID\r\n //return tg.sendMsg(msg, '⚜️ File ID: ' + msg.photo[0].file_id)\r\n //}\r\n\r\n // Akhir update message\r\n }\r\n\r\n // Deteksi callback\r\n if (update.callback_query) {\r\n // proses di halaman berikutnya, biar gak terlalu panjang\r\n return prosesCallback(update.callback_query);\r\n }\r\n}", "function localMessageAdder(){\n if (textBox.value != \"\"){\n // Add the message locally using 'Me' as the username of the poster\n //addMessage(\"Me\",textBox.value);\n \n // Send the message and my name through the yodel socket\n yodelSocket.send({\n name: nameBox.value,\n message: textBox.value\n }, \"\", \"a\");\n \n // Reset the textbox\n textBox.value = \"\"\n }\n}", "function sendPlayerScoreOnline() {\n\n\tconst date = new Date(),\n\tplayer = {\n\t\tpseudo: getCurrentPseudo(),\n\t\tscore: getBestScore(),\n\t\tdate: (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear(),\n\t\tlevel: (getBestLevel() + 1) // Level number begin at 0\n\t};\n\n\tconst userId = localStorage.getItem('userId');\n\tnew BRequest()\n\t\t.post(userId ? userId : 0, JSON.stringify(player))\n\t\t.then(resp => localStorage.setItem('userId', resp.content))\n\t\t.catch(err => console.error(err));\n}", "function check_for_multiplayergame() {\n // Receiver of the game runs this function\n window.gid = window.location.hash;\n var url = window.location.href;\n window.socket = new EasyWebSocket(url);\n window.socket.onopen = function(){\n window.socket.send(window.uid+':LoggedIn');\n }\n window.socket.onmessage = function(event){\n console.log(\"received \"+ event.data);\n var message = event.data.split(':');\n var uid = message[0];\n var status = message[1];\n if (uid != window.uid && window.opponentUid == undefined) {\n // If another user has send the message, check it out\n if (status == 'LoggedIn') {\n // add user as opponent, usually not needed, this function run only when being second player\n window.opponentUid = uid;\n } else if (status == 'Settings') {\n console.log('receiving settings:', message);\n window.opponentUid = uid;\n var opponent_loc = message[2].split(',');\n var own_loc = message[3].split(',');\n window.startPos = new google.maps.LatLng(own_loc[0], own_loc[1]);\n window.goalPosition = new google.maps.LatLng(opponent_loc[0], opponent_loc[1]);\n window.opponentPos = new google.maps.LatLng(opponent_loc[0], opponent_loc[1]);\n set_difficulty(parseInt(message[4]));\n // setup game\n // start game, and send 'Ready' if ready\n startMultiPlayerGame();\n }\n } else if (uid == window.opponentUid) {\n if (status == 'Location') {\n var loc = message[2].split(',');\n window.opponentPos = new google.maps.LatLng(loc[0], loc[1]);\n window.opponentDist = loc[2];\n opponentMoved();\n } else if (status == 'Finish') {\n //finish game, you've probably lost it\n $('pano_canvas').grab(new Element('div.notice', {\n id: 'gameover',\n html: 'Aww!!<br/>You Lost! Your opponent has captured your flag!<br/>Refresh to play again!',\n }));\n $('gameover').highlight('#f88', '#fff');\n }\n }\n }\n}", "function sendToLobby(message){\n\t\tvar obj = {\"player\":\"Server\",\"role\":\"game\",\"message\":message};\n\t\tio.to('lobby').emit('message', obj);\n\t}", "function messageTransmit (message) { // eslint-disable-line no-unused-vars\n soField.value = ['User \"' + message.user + '\": ' + message.message, soField.value].join('\\n');\n }", "function showUser(){\r\n // user.innerHTML = meIndex.userID();\r\n // user.innerHTML += \" name\";\r\n //alert('HELLO')\r\n // socket.emit('logg2', logg1.value);\r\n\r\n // socket.on('logg2', function(data){\r\n // logg1.innerHTML = data.user;\r\n // //feedback.innerHTML = '<p><em>' + data + ' is typing a message...</em></p>';\r\n // });\r\n\r\n socket.emit('userAndFriends', {\r\n user: user.value,\r\n friends: friends.value\r\n });\r\n}", "function send_message()\n{ \n\n \n const message = {\n message : document.getElementById(\"message\").value,\n user : myid,\n time : Date.now(),\n room : room,\n type :\"one-to-one\"\n }\n console.log(message)\n\n socket.emit('message', message)\n document.getElementById(\"message\").value =\"\"\n}", "handleOnUserMessage(user, message){\n\n // Message in JSON-Objekt umwandeln für Datenzugriff\n var data = JSON.parse(message);\n // Spiel-Logik hat hier nichts zu suchen, kommt dann im GameRoom noch ...\n if (data.dataType === GAME_LOGIC) return;\n\n // Chat-Nachricht\n if (data.dataType === CHAT_MESSAGE) {\n\t\t\t// Absender ergänzen, die anderen wollen ja wissen, vom wem die Nachricht war\n\t\t\tdata.sender = user.Username;\n }\n // Es hat eine Nachricht drin\n if (typeof data.message !== 'undefined'){\n /*\n * Diverse mögliche Kommando abarbeiten\n */\n //UserName soll geändert werden\n if(data.message.startsWith(\"/nick \")) {\n console.log(\"Kommando: /nick\");\n // Username überschreiben und alle User informieren\n user.setUsername(data.message.replace(\"/nick \", \"\"));\n user.room.sendDetails();\n\n // zusätzlich eine Nachricht an alle vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+data.sender + \"] heisst neu [\"+user.Username+\"]\"\n };\n }\n // Kommando /play wechselt dem Raum bei Erfolg\n else if(data.message.startsWith(\"/play \")) {\n // mit wem will aktueller User spielen?\n let otherName = data.message.replace(\"/play \", \"\");\n let otherIdx = user.room.users.findIndex(e => e.Username.trim() == otherName );\n\n console.log(\"/playResult: \" + otherIdx);\n\n // Gibt es den überhaupt?\n if(otherIdx == -1){\n //nein, nachricht vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+otherName + \"] nicht gefunden\"\n };\n // ja, es gibt ihn\n }else {\n let other = user.room.users[otherIdx];\n\n // aktuellen User und Spielpartner aus aktuellem Raum entfernen\n user.room.removeUser(user);\n user.room.removeUser(other);\n\n // neuen Raum eröffnen und beide darin zuordnen\n user.setRoom(new GameRoom(user.Username + \" vs. \" + otherName));\n other.setRoom(user.room);\n user.room.addUser(user);\n user.room.addUser(other);\n //--> Die User werden im addUser noch über die neuen Raum-Details informiert\n }\n\n\n }\n // Raum verlassen und in Lobby zurückkehren\n else if(data.message.startsWith(\"/quit\")) {\n\n console.log(\"/quit: \" + user.Username);\n //info vorbereiten und senden\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+user.Username + \"] quitted\"\n };\n user.room.sendAll(JSON.stringify(data));\n // user entfernen\n user.room.removeUser(user);\n // .. und an Lobby zuweisen\n user.room = user.lobby;\n user.lobby.addUser(user); // in addUser werden wieder alle informiert\n\n // Nachricht vorbereiten\n data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User [\"+user.Username + \"] joined\"\n };\n\n }\n // alles andere müssten nun Chat-Nachrichten sein\n else {\n // Aus Sicherheitsgründen werden sämtliche Zeichen durch den Code ersetzt\n // dadruch bleiben auch alle <>/*[]\" erhalten und es kann nichts \"eingeschleust\" werden\n data.message = data.message.replace(/[\\u00A0-\\u9999<>\\&]/gim, function(i) {\n return '&#'+i.charCodeAt(0)+';';\n });\n\n }\n }//message ist gesetzt\n\n // vorbereitete Nachricht an alle senden\n user.room.sendAll(JSON.stringify(data));\n\n}", "function sendText() {\n var msg = document.getElementById(\"textCamp\").value;\n msg = msg.trim(); //Trim para borrar espacios en blanco\n var fecha = new Date();\n var time = fecha.getHours()+\":\"+fecha.getMinutes()+\":\"+fecha.getSeconds();\n console.log(time);\n var data = {\n author: userName,\n message: msg,\n time: time,\n userEmail: userEmail,\n matchId: matchIdActual\n }\n// If para saber si el mensaje que nos llega tiene un tamaño mayor a 0\n if (msg.length > 0){\n writeInDB(data,'chat');\n }\n document.getElementById(\"textCamp\").value = \"\"; //Inicializamos campo de texto en vacio cada vez que pulsemos boton de enviar.\n}", "updateScorePlayer1(){\n this.game.updateScorePlayer1();\n this.socket.emit('pointPlayer2');\n }", "gameEndProtocol() {\n this.saveToDatabase();\n this.updatePlayerStats();\n }", "async function storeData(users) {\r\n // slicing the name of both players\r\n let playerOne = users[0][1].slice(0, users[0][1].indexOf(' '))\r\n let playerTwo = users[1][1].slice(0, users[1][1].indexOf(' '))\r\n \r\n // sending data to database\r\n await rpsChatRef.set({\r\n id: gameId,\r\n player1: { name: playerOne, choice: users[0][2] },\r\n player2: { name: playerTwo, choice: users[1][2] },\r\n status: users[0][3] == 'Draw' ? \"Draw\" : users[0][3].includes('Win') ? playerOne + \" wins\" : playerTwo + \" wins\"\r\n }).then(() => (console.log('success')), (reason) => console.log('fail - ' + reason))\r\n}", "function sendAndSaveMessage(room, user, message){\n //Write on chat\n let who = user;\n if (user === name) who = 'Me';\n writeOnHistory('<b>' + who + ':</b> ' + message);\n\n //Storing message in IndexedDB\n getRoomData(room).then(data => {\n var newObj = {\n date: Date(),\n user: user,\n message: message\n }\n data.messages.push(newObj);\n updateField(room, \"messages\", data.messages);\n });\n}", "function statusMessage(message, privatem) {\n\tvar chatRef = databaseRef.child('chat');\n\tvar sentBy = $('#playerName').val();\n\tvar recipient = \"none\";\n\tvar speaker = \"<div style='background-color:DarkSeaGreen;display:inline-block;border-bottom:2px solid DarkSlateGray;width:100%;padding-top:10px;padding-bottom:10px;'>Auto-Update\";\n\tvar pm = privatem;\n\tvar timestamp = (((($.now()/1000)/60)/60)/24);\n\tif (privatem == \"Yes\") {\n\t\t// recipient = document.getElementById('playerName');\n\t\trecipient = playerName.value;\n\t}\n\tmessage = message+\"</div><br>\";\n\tchatRef.push({sentBy:sentBy, speaker:speaker, message:message, pm:pm, recipient:recipient, timestamp:timestamp});\n\t$('#message').val('');\n\t//$.get(\"../php/postMessage.php\", {'speaker': speaker, 'message': message, 'private': pm, 'recipient': recipient});\n\t//getMessages();\n}", "function updatePlayers(){\n \n database.ref().set({\n players: {\n player1, \n player2,\n gameOver},\n \n });\n }", "function pubMessage() {\n /**\n Set the appropriate values on the twist message object according to values in text boxes\n It seems that turtlesim only uses the x property of the linear object\n and the z property of the angular object\n **/\n var linearX = 0.0;\n var angularZ = 0.0;\n\n // get values from text input fields. Note for simplicity we are not validating.\n linearX = Number(document.getElementById('linearXText').value);\n angularZ = Number(document.getElementById('angularZText').value);\n\n // Set the appropriate values on the message object\n twist.linear.x = linearX;\n twist.angular.z = angularZ;\n\n // Publish the message\n cmdVelTopic.publish(twist);\n // that.emit('change', twist);\n document.getElementById(\"demo\").innerHTML = \"Updated Position\";\n}", "function saveOtherData(msg, callback){\r\n\t\tData.snippets = Data.snippets.toArray();\r\n\t\t\r\n\t\t// refer github issues#4\r\n\t\tData.dataUpdateVariable = !Data.dataUpdateVariable;\r\n\t\t\r\n\t\tDB_save(function(){\r\n\t\t\tData.snippets = Folder.fromArray(Data.snippets);\r\n\t\t\r\n\t\t\tif(typeof msg === \"function\") msg();\r\n\t\t\telse if(typeof msg === \"string\") alert(msg);\r\n\t\t\tcheckRuntimeError();\r\n\t\t\t\r\n\t\t\tif(callback) callback();\r\n\t\t});\r\n\t}", "function onMessageArrived(message) {\n // if (message.destinationName == SubSuhu) {\n // // document.getElementById(\"suhu\").innerHTML = message.payloadString;\n // console.log(\"Suhu: \" + message.payloadString);\n // suhu1 = parseInt(message.payloadString);\n // // document.getElementById(\"suhu1\").innerHTML = suhu1;\n // }\n // if (message.destinationName == SubRh) {\n // // document.getElementById(\"rh\").innerHTML = message.payloadString;\n // console.log(\"Kelembaban: \" + message.payloadString);\n // rh1 = parseInt(message.payloadString);\n // // document.getElementById(\"rh1\").innerHTML = rh1;\n // }\n // if (message.destinationName == SubSuhu2) {\n // // document.getElementById(\"suhu\").innerHTML = message.payloadString;\n // console.log(\"Suhu2: \" + message.payloadString);\n // suhu2 = parseInt(message.payloadString);\n // // document.getElementById(\"suhu2\").innerHTML = suhu2;\n // }\n // if (message.destinationName == SubRh2) {\n // // document.getElementById(\"rh\").innerHTML = message.payloadString;\n // console.log(\"Kelembaban2: \" + message.payloadString);\n // rh2 = parseInt(message.payloadString);\n // // document.getElementById(\"rh2\").innerHTML = rh2;\n // }\n if (message.destinationName == lampu) {\n // document.getElementById(\"rh\").innerHTML = message.payloadString;\n console.log(\"Lampu: \" + message.payloadString);\n // rh2 = parseInt(message.payloadString);\n outlampu = parseInt(message.payloadString);\n }\n if (message.destinationName == fan) {\n // document.getElementById(\"rh\").innerHTML = message.payloadString;\n console.log(\"Fan: \" + message.payloadString);\n outfan = message.payloadString;\n }\n // // Publish suhu & rh\n // suhuTot = (suhu1 + suhu2) / 2;\n // rhTot = (rh1 + rh2) / 2;\n // console.log(\"onMessageArrived: \" + message.payloadString);\n // document.getElementById(\"messages\").innerHTML += '<span>Topic: ' + message.destinationName + '</span><br/>';\n // document.getElementById(\"pesan\").innerHTML = message.payloadString;\n // updateScroll(); // Scroll to bottom of window\n}", "function adminUpdate(message){\n bot.sendMessage(admin,message);\n}", "function saveMessage(userId, fstName, lstName, phone, currency){\n firebase.database().ref('Users/' + userId).set({\n firstName: fstName,\n lastName: lstName,\n phone: phone,\n currency: currency\n });\n\n console.log(\"Sent\");\n\n}", "function saveGame() {\n\tvar msg = {\n \"messageType\": \"SAVE\",\n \"gameState\": {\n \"pairsFound\": pairsFound,\n \"seconds\": seconds,\n\t\t \"minutes\": minutes,\n\t\t \"hours\": hours,\n\t\t \"cards\": cards,\n\t\t \"openedCards\": openedCards,\n\t\t \"cardOpen\": cardOpen\n }\n };\n window.parent.postMessage(msg, \"*\");\n\t \n}", "function sendToServer_switch() {\r\n socket.emit('control', {\r\n 'room': ROOM_ID,\r\n 'username': USER,\r\n 'category': SWITCH,\r\n 'playtime': null\r\n });\r\n}", "function sendMessage () {\n var message = $inputMessage.val();\n console.log(message);\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n console.log(message + ' and connected');\n $inputMessage.val('');\n addChatMessage({\n name: name,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n \n if (canPlay) {\n if (message === cleanInput('start')) {\n startRound();\n }\n } else if (playing) {\n if (message === cleanInput(answer)) {\n personal_score += score; \n }\n }\n }\n }", "function runPlayerTurn(currentPlayer, myPlayer, p1, p2, database) {\n\n //check if both players have made moves\n if (p1.move !== '' && p2.move !== '') {\n checkWinner(p1, p2, currentPlayer, database);\n } else if (currentPlayer.name === p1.name) {\n highLight('#playerOne', '#playerTwo');\n if (myPlayer.name === currentPlayer.name) {\n $('#message').text(\"It's your turn!\")\n } else {\n $('#message').text(\"Waiting for \" + p1.name + \" to choose\");\n }\n } else if (currentPlayer.name === p2.name) {\n highLight('#playerTwo', '#playerOne');\n if (myPlayer.name === currentPlayer.name) {\n $('#message').text(\"It's your turn!\")\n } else {\n $('#message').text(\"Waiting for \" + p2.name + \" to choose\");\n }\n\n }\n}", "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "function messagesToDB(nickname, msg) {\n const daten = Date.now();\n // we use object litterals from ES6\n let data = {\n daten,\n nickname,\n msg\n }\n // the JSON stuff seems to do a lot of escaping, avoiding \n // \\n or JSON in text messages\n let jsonData = JSON.stringify(data);\n msgStream.write(jsonData + '\\n');\n}", "function writeP2(message_2) {\r\n document.getElementById('message_2').innerHTML += message_2 + '<br/>';\r\n}", "function join() {\n if (player1 && player2) {\n alert(\"Game is full!\");\n } else {\n var yourName = prompt(\"Enter your name\");\n if (yourName == null || yourName == \"\") {\n alert(\"You must enter a name\");\n join();\n } else {\n $(\"#intro-content\").hide();\n $(\"#game-content\").show();\n if (player1 === null) {\n currentUID = yourName;\n player1 = {\n name: currentUID,\n wins: 0,\n losses: 0,\n ties: 0,\n choice: \"\"\n };\n playersRef.child(\"/player1\").set(player1);\n database\n .ref()\n .child(\"/turn\")\n .set(1);\n database\n .ref(\"/players/player1\")\n .onDisconnect()\n .remove();\n } else if (player1 !== null && player2 === null) {\n currentUID = yourName;\n player2 = {\n name: currentUID,\n wins: 0,\n losses: 0,\n ties: 0,\n choice: \"\"\n };\n playersRef.child(\"/player2\").set(player2);\n database\n .ref(\"/players/player2\")\n .onDisconnect()\n .remove();\n }\n }\n }\n}", "function send()\r\n {\r\n var me = document.getElementById(\"msg\").value\r\n firebase.database().ref(room_names).push({\r\n msg:me,\r\n noofliks:0,\r\n by:sendby\r\n })\r\n document.getElementById(\"msg\").value = \"\";\r\n }", "function onNewplayer (data) {\r\n\r\n\tvar newPlayer = new Player(data.x, data.y,this,data);\r\n\t\r\n\t//create an instance of player body \r\n\t/*playerBody = new p2.Body ({\r\n\t\tmass: 0,\r\n\t\tposition: [0,0],\r\n\t\tfixedRotation: true\r\n\t});*/\r\n\t\r\n\tconsole.log(\"created new player with id \" + this.id);\r\n\tnewPlayer.id = this.id;\r\n\r\n\tthis.emit('create_player', {\r\n\t\tx:data.x,\r\n\t\ty:data.y,\r\n\t\thealth:newPlayer.health\r\n\t});\r\n\t\r\n\t//information to be sent to all clients except sender\r\n\tvar current_info = {\r\n\t\tid: newPlayer.id,\r\n\t\tx: newPlayer.position[0],\r\n\t\ty: newPlayer.position[1],\r\n\t\thealth:newPlayer.health\r\n\t}; \r\n\t\r\n\t//send to the new player about everyone who is already connected. \t\r\n\tfor (i = 0; i < player_lst.length; i++) {\r\n\t\texistingPlayer = player_lst[i];\r\n\t\tvar player_info = {\r\n\t\t\tid: existingPlayer.id,\r\n\t\t\tx: existingPlayer.position[0],\r\n\t\t\ty: existingPlayer.position[1],\r\n\t\t\thealth: existingPlayer.health\r\n\t\t};\r\n\t\tconsole.log(\"pushing other players \");\r\n\t\t//send message to the sender-client only\r\n\t\tthis.emit(\"new_enemyPlayer\", player_info);\r\n\t}\r\n\t\r\n\t//Tell the client to make foods that are exisiting\r\n\tfor (j = 0; j < game_instance.food_pickup.length; j++) {\r\n\t\tvar food_pick = game_instance.food_pickup[j];\r\n\t\tthis.emit('item_update', food_pick); \r\n\t}\r\n\r\n\t//send message to every connected client except the sender\r\n\tthis.broadcast.emit('new_enemyPlayer', current_info);\r\n\r\n\tconsumablesManager.updateAllConsumables(this);\r\n\t\r\n\tplayer_lst.push(newPlayer); \r\n}", "function gameOver(k){\n \n var theID = k;\n console.log(\"game is over: \"+theID);\n if(players[theID].replayMode == false){\n\n // my code starts\n var theSocket = allUsers.activeUsers[theID];\n var theOpponent = players[theID].multiplayerInfo.opponentID;\n theOpponentSocket = allUsers.activeUsers[theOpponent];\n console.log(\"winner_rating\"+winner_rating);\n console.log(\"looser_deduction\"+looser_deduction);\n var winner_rating = elo.newRatingIfWon(parseInt(players[theID].trophy_no), parseInt(players[theOpponent].trophy_no));\n var looser_deduction = parseInt(theOpponentSocket.trophy_no)-winner_rating+parseInt(theSocket.trophy_no);\n console.log(theSocket.trophy_no+\"idddddd\");\n console.log(theOpponentSocket.trophy_no+\"opponentID\");\n console.log(\"winner_rating\"+winner_rating);\n console.log(\"looser_deduction\"+looser_deduction);\n theSocket.trophy_no = winner_rating;\n theOpponentSocket.trophy_no = looser_deduction;\n players[theID].trophy_no = winner_rating;\n players[theOpponent].trophy_no = looser_deduction;\n if (winner_rating<800)winner_rating = 800;\n Trophy.getUserBydbid(players[theID].username, function(err, user){\n if(err) throw err;\n if(user){\n console.log(\"winner_rating\"+winner_rating);\n user.trophies = winner_rating;\n rank_decider(user,winner_rating);\n user.save();\n }\n else { \n console.log(\"couldnot update trophies\");\n\n }\n });\n if (looser_deduction<800)looser_deduction = 800;\n Trophy.getUserBydbid(players[theOpponent].username, function(err, user){\n if(err) throw err;\n if(user){\n console.log(\"looser_deduction\"+looser_deduction);\n user.trophies = looser_deduction;\n rank_decider(user,looser_deduction);\n user.save();\n }\n else { \n console.log(\"couldnot update trophies\");\n\n }\n\n \n });\n // my code ends\n \n allGames.noOfGamesPlayed++;\n var theOpponent = players[theID].multiplayerInfo.opponentID;\n var theRoom = players[theID].multiplayerInfo.myRoom;\n players[theID].isMultiplayer =false;\n players[theOpponent].isMultiplayer =false;\n \n storeDataToPastGames(theRoom);\n clearAllIntervals(theRoom,theID,theOpponent);\n \n allUsers.activeUsers[theID].emit('theGameIsOver',true);\n allUsers.activeUsers[theOpponent].emit('theGameIsOver',true);\n \n leaveTheRoom(theID);\n leaveTheRoom(theOpponent);\n \n delete allGames.activeGames[theRoom];\n \n // delete players[theID];\n // delete players[theOpponent];\n }\n else{\n console.log(\"gameover of replay game\");\n clearInterval(currentReplays[k].replayRoomTimer);\n clearInterval(currentReplays[k].replayTimer);\n clearInterval(currentReplays[k].repVar);\n }\n }", "sendMessage() {\n const {input} = this.elements;\n const value = input.value;\n if (value === '') {\n return;\n }\n input.value = '';\n drone.publish({\n room: selectedRoom,\n message: value,\n });\n addMessageToRoomArray(selectedRoom, me, value);\n this.addMessageToList(value, me);\n }", "function sendInfo(){\n\tvar neuron = textNeuron.value;\n\tvar axon = textAxon.value;\n//\ttextNeuron.value = \"\";\n//\ttextAxon.value = \"\";\n//\tlocalStorage.setItem(\"neuronStorage\", \"\");\n//\tlocalStorage.setItem(\"axonStorage\", \"\");\n\tself.port.emit(\"text-entered\", [neuron, axon]);\n\t\n}", "function logPlayerChoices() {\r\n\r\n\r\n // Log to database so other players are aware of our choice\r\n player.time = moment().format(\"X\");\r\n player.status = \"active\";\r\n\r\n // Log to session storage -- use for screen refreshes and downstream pages\r\n sessionStorage.setItem('player', JSON.stringify(player));\r\n\r\n // Log to database\r\n savePlayerToFirebase(player);\r\n}", "function shootGame() {\n\n // Player details from the database\n var playerOne = database.ref('players/1/');\n var playerTwo = database.ref('players/2/');\n\n // Player 1 details from the database\n playerOne.on('value', function(snapshot) {\n var data = snapshot.val();\n var playerOneName = data.name;\n var playerOneWins = data.wins;\n var playerOneLosses = data.losses;\n\n if (player_1 === 1) {\n \n $('#waiting').delay(1000).fadeOut('slow'); \n $('.game-info').show();\n $('#chat-box').show();\n $('#player-1').html('PLAYER 1: ' + playerOneName + ' ');\n $('#score-1').html('Losses: ' + playerOneLosses + ' ' + \"<br>\");\n $('#score-1').append('Wins: ' + playerOneWins + ' ');\n \n }\n })\n \n // Player 2 details from the database\n playerTwo.on('value', function(snapshot) {\n var data = snapshot.val();\n var playerTwoName = data.name;\n var playerTwoWins = data.wins;\n var playerTwoLosses = data.losses;\n \n if (player_2 === 2) {\n $('#waiting-for-player-1').show(); \n $('#player-2').html('PLAYER 2: ' + playerTwoName + ' ');\n $('#score-2').html('LOSSES: ' + playerTwoLosses + ' ' + \"<br>\");\n $('#score-2').append('WINS: ' + playerTwoWins + ' ');\n } \n });\n\n // Clears player details when a player disconnects\n if (playerOne.onDisconnect().remove()) {\n playerCount.set(totalPlayers - 1); // Updates player count\n choice = null; // Clears choices\n }\n // Clears player details when a player disconnects\n if (playerTwo.onDisconnect().remove()) {\n playerCount.set(totalPlayers - 1); // Updates player count\n choice = null; // Clears choices\n }\n\n // Player turns \n database.ref('turn').set(1); // Sets turn count to 1 \n database.ref('turn').on('value', function(snapshot) {\n var turn = snapshot.val();\n\n if (turn === null || turn === 1){\n playerOne.on('value', function(snapshot) {\n var data = snapshot.val();\n var playerOneName = data.name;\n $('#status-1').html(playerOneName + '\\'S TURN!');\n $('#status-2').html(playerOneName + '\\'S TURN!');\n console.log(\"please update to: \" + playerOneName + \"\\\"s turn\");\n if(turn === 1){\n $('.choice-1').show();\n $('#waiting-for-player-2').hide();\n } else {\n $('.choice-1').hide();\n }\n })\n console.log(\"it is player 1's turn\");\n } else if (turn === 2){\n playerTwo.on('value', function(snapshot) {\n var data = snapshot.val();\n var playerTwoName = data.name;\n $('.choice-2').show();\n\n $('#waiting-for-player-1').hide();\n $('#status-2').html(playerTwoName + '\\'S TURN!');\n $('#status-1').html(playerTwoName + '\\'S TURN!');\n console.log(\"please update to: \" + playerTwoName + \"\\\"s turn\");\n \n })\n console.log(\"it is player 2's turn\");\n }\n \n })\n }", "function updateGlobal(socket, message) {\n // socket.broadcast.emit('updateChat', 'SERVER', socket.username + ' has ' + message);\n}", "function sendScores(){\r\n\t\t\r\n\t\tvar scores = {\r\n\t\t\t\t\t\tP1:-1,\r\n\t\t\t\t\t\tP2:-1,\r\n\t\t\t\t\t\tP3:-1,\r\n\t\t\t\t\t\tP4:-1\r\n\t\t\t\t\t};\r\n\t\t\r\n\t\tif(DominoesPlayers[0] != null){\r\n\t\t\tscores.P1 = DominoesPlayers[0].wins;\r\n\t\t\tconsole.log(\"P1:\"+DominoesPlayers[0].wins)\r\n\t\t}\r\n\t\tif(DominoesPlayers[1] != null){\r\n\t\t\tscores.P2 = DominoesPlayers[1].wins;\r\n\t\t\tconsole.log(\"P2:\"+DominoesPlayers[1].wins)\r\n\t\t}\r\n\t\tif(DominoesPlayers[2] != null){\r\n\t\t\tscores.P3 = DominoesPlayers[2].wins;\r\n\t\t\tconsole.log(\"P3:\"+DominoesPlayers[2].wins)\r\n\t\t}\r\n\t\tif(DominoesPlayers[3] != null){\r\n\t\t\tscores.P4 = DominoesPlayers[3].wins;\r\n\t\t\tconsole.log(\"P4:\"+DominoesPlayers[3].wins)\r\n\t\t}\r\n\t\t\r\n\t\tDom.emit('scores',scores);\t\t\r\n\t}", "function sendWriteAction(message) {\r\n\tcallActionSocketGame(message);\r\n\t\r\n\tactualMessage = \"\";\r\n}", "function sendMessage() {\n // Construct a msg object containing the data the server needs to process the message from the chat client.\n var msg = {\n type: \"message\",\n text: jq(\"#ATOMspyPopUpDiv\").attr('obj-prop'),\n id: \"objInfo\",\n date: Date.now()\n };\n\t\n //connection.send(JSON.stringify(msg));\n connection.send(jq(\"#ATOMspyPopUpDiv\").attr('obj-prop'))\n\n connection.onmessage = function(msg){\n \tvar uiRsp=JSON.parse(msg.data).data.text\n if (uiRsp.substring(0, 6)=='UIResp'){\n var msgToShow=uiRsp.split('::')[1];\n var msgtoShowtype\n if (msgToShow.search(\"Already\")>0) {\n \tmsgtoShowtype=\"Error!!!\"\n } else {\n \tmsgtoShowtype=\"Message\"\n }\n \n showAlert(msgtoShowtype,msgToShow);\n }\n \n }\n\t\t\n }", "function savedata(){\n var message = messageField.value;\n\n messagesRef.push({fieldName:'messageField', text:message});\n messageField.value = '';\n }", "function join() {\n var roomName = roomField.value\n , userName = userField.value\n\n roomStore.set(\"room-name\", roomName)\n roomStore.set(\"user-name\", userName)\n\n roomField.value = \"\"\n userField.value = \"\"\n\n room.emit(\"join\", roomName, userName)\n}", "function writeMsg() {\r\n\r\n\t// Clear the previous frame of the bottom left corner text\r\n\ttextctx.clearRect(10,540,500,30);\r\n\t// Clear the previous frame of the top left corner text\r\n\ttextctx.clearRect(10,25,200,50);\r\n\t\r\n\t\r\n\ttextctx.fillStyle = \"rgb(250, 250, 250)\";\r\n\ttextctx.font = \"15px pixelmixregular\";\r\n\ttextctx.textAlign = \"left\";\r\n\ttextctx.textBaseline = \"top\";\r\n\r\n\t\r\n\t\r\n\r\n\t// Only write if the game isn't over\r\n\tif (!gameOver){\r\n\t\r\n\t\ttextctx.fillText(\"Nb Vies : \" + player.lives, 18, 25);\r\n\t\ttextctx.fillText(\"Sante : \" + player.health, 18, 50);\r\n\t\t\r\n\t\tif (presentsToCollect <= 5) {\r\n\t\t\ttextctx.fillText(\"Nombre de cadeaux restants : \" + presentsToCollect, 18, 540);\r\n\t\t}else{\r\n\t\t\t//textctx.fillText(\"Tous les cadeaux sont recueillis! Retournez au début.\");\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n}", "function EventHandler(context, event) {\n context.simpledb.roomleveldata.state=\"phone number\"; \n context.sendResponse(\"Hi, I am your TestMinister Bot. The most simple yet powerful way to take tests and learn. You can take tests by choosing from a large test library and I will give you scorecards for tracking and benchmarking\\n\\nPlease provide your phone number to begin\");\n}", "function saveInformation(event, senderId) {\n allSenders[senderId].states++;\n if (event.message.quick_reply.payload === 'Yes_postback') {\n model.insertData(senderId);\n sendFBmessage.send(senderId, [{text:'Thank you, ' + allSenders[senderId].name + ' \\u263A \\nOur HR-manager will contact you within 3 days.'}]);\n // send giffy when user save information about yourself in our database\n sendFBmessage.sendImage(senderId, 'http://media3.giphy.com//media//Mp4hQy51LjY6A//200.gif');\n } else {\n sendFBmessage.send(senderId, [{text:'Information about you was not saved.'}]);\n sendFBmessage.sendImage(senderId, 'http://media0.giphy.com//media//7ILa7CZLxE0Ew//200.gif');\n }\n}", "updateMessage() {\n if(this.pente.winner) {\n this.interface.updatePenteStatusMessage(\"Gameover (\"\n + ((this.pente.winner == \"w\") ? \"P1\" : \"P2\") + \" Won)\");\n return;\n }\n\n if(!this.pente.active_game) {\n this.interface.updatePenteStatusMessage(\"Choose a game mode\");\n return; \n }\n\n switch(this.pente.game_mode) {\n case 1: \n if(this.pente.next == \"w\") this.interface.updatePenteStatusMessage(\"P1 Turn\"); \n else this.interface.updatePenteStatusMessage(\"P2 Turn\"); \n break;\n case 2: \n if(this.pente.next == \"w\") this.interface.updatePenteStatusMessage(\"P1 Turn\"); \n else this.interface.updatePenteStatusMessage(\"BOT2 Turn\"); \n break;\n case 3: \n if(this.pente.next == \"w\") this.interface.updatePenteStatusMessage(\"BOT1 Turn\"); \n else this.interface.updatePenteStatusMessage(\"P2 Turn\"); \n break;\n case 4: \n if(this.pente.next == \"w\") this.interface.updatePenteStatusMessage(\"BOT1 Turn\"); \n else this.interface.updatePenteStatusMessage(\"BOT2 Turn\"); \n break;\n }\n }", "function storeMessage(box) {\r\n if (isOnline) {\r\n // send article to server\r\n storeMessageLocaly(box);\r\n } else {\r\n // store article localy\r\n storeMessageLocaly(box);\r\n }\r\n}", "sendPlayerInfo(){\n\t\tvar player = {\n\t\t\tdataType: dataTypes.PLAYER,\n\n\t\t\tplayerID: this.player.playerID,\n\t\t\t\n\t\t\tposX: this.player.position.x,\n\t\t\tposY: this.player.position.y,\n\t\t\trotation: this.player.rot,\n\n\t\t\thp: this.player.actualHp,\n\n\t\t\tweapon: this.player.weapon,\n\n\t\t\tdead: this.player.dead,\n\t\t};\n\n\n\t\tplayer = JSON.stringify(player);\n\n\t\tconnection.send(player);\n\t}", "function notifyStartInfo(){\r\n const message = \"Player 1 (P1) will go first, \\n\" +\r\n \"and P1 will be identified by \\\"X\\\" on the board. \\n\" +\r\n \"P2 will be identified by \\\"O\\\".\\n \"\r\n console.log(message);\r\n document.getElementById(\"bottomBox\").textContent=message;\r\n}", "function insertMessageToDB(loggedInUserId, sendTo, message) {\n mysqlCon.query(\"insert into tbl_user_message(sender_id, receiver_id, msg_body) values('\" + loggedInUserId + \"','\" + sendTo + \"','\" + message + \"');\", function (err, result) {\n console.log(result);\n if (err) throw err;\n return result;\n });\n}", "newSystemMessage(newUsername) {\n\n const newSystemMessageObj = {\n type: 'system',\n text: `${this.state.user} changed their name to ${newUsername}`\n }\n \n this.socket.send(JSON.stringify(newSystemMessageObj));\n }", "function handleJoinGame(input){\n if (!gameStarted){\n gameStarted = true;\n }\n activeClients[input.clientId].player.username = input.message.username;\n activeClients[input.clientId].player.reset();\n activeClients[input.clientId].player.score = 0;\n for (let id in activeClients){\n activeClients[id].player.reportUpdate = true;\n }\n}", "function sendData() {\r\n var key = firebase.database().ref(`messages`).push().key;\r\n let obj = {\r\n key: key,\r\n sender: name,\r\n msg: input.value,\r\n msgTime: time,\r\n };\r\n firebase.database().ref(`messages/${key}`).set(obj);\r\n input.value = \"\";\r\n}", "function joinGame() {\r\n var gameName = $(\"#joinGameName\").val()\r\n var password = $(\"#joinPW\").val()\r\n\r\n if (gameName === \"\") {\r\n $(\"#joinError\").html(\"Please enter a game name.\");\r\n return;\r\n }\r\n \r\n socket.emit(\"joinGame\",\r\n {\r\n username : window.username,\r\n gamename : gameName,\r\n password : password\r\n });\r\n}", "handleOnUserMessage(user, message){\n var room = this; //aktuellen Raum bestimmen\n // Code-Duplikate vermeiden, Methode aus vererbtem Teil aufrufen\n super.handleOnUserMessage(user, message);\n\n // Abhandlung nur fürs Game\n var data = JSON.parse(message);\n\n if (data.dataType === GAME_LOGIC) {\n console.log(\"Game-Room: [\" + user.Username + \"] ...\");\n\n // Schiiffe platziert\n if(data.gameState === GAME_sendSchiffe){\n // sind Schiffe valide gesetzt worden?\n var valide = this.areSchiffliValide(data.message);\n console.log(\"areSchiffliValide: \" +valide);\n if(valide){\n\n // Positionen merkeen\n this.SchiffePos[user.id] = {sindBooteGesetzt: true,\n Boote: data.message,\n Getroffen : \"\"\n };\n // Diverse Debugs..\n /*console.log(this.users[0].id);\n console.log(this.users[1].id);\n console.log(this.SchiffePos[this.users[0].id].sindBooteGesetzt);\n console.log(this.SchiffePos[this.users[1].id].sindBooteGesetzt);\n */\n\n // haben schon beide Spiele die Schiffe gesetzt?\n if(this.SchiffePos[this.users[0].id].sindBooteGesetzt &&\n this.SchiffePos[this.users[1].id].sindBooteGesetzt){\n // juppa, es kann somit losgehen ..\n console.log(\"Boote sind gesetzt...\");\n this.currentGameState = GAME_START;\n this.WechsleSpieler();\n }\n }else{\n // Rückmeldung geben, dass Schiffe nicht valide sind\n // Nachricht vorbereiten\n var sndBootNotValid = {\n dataType: GAME_LOGIC,\n gameState: GAME_ShipNotValid,\n message: 'Boote nicht valide'\n };\n user.socket.send(JSON.stringify(sndBootNotValid));\n }\n }\n // Versuche ein Boot zu versenken\n if(data.gameState === GAME_versenkeSchiffe){\n console.log(\"GAME_versenkeSchiffe\");\n\n // Hier sollte man nur sein, wenn beide Spiele auch die Boote gesetzt haben, sonst weitergehen\n if(this.SchiffePos[this.users[0].id].sindBooteGesetzt && this.SchiffePos[this.users[1].id].sindBooteGesetzt){\n\n var myId = user.id;\n var otherId = ((user.id == this.users[0].id))? this.users[1].id : this.users[0].id;\n var otherUser = ((user.id == this.users[0].id))? this.users[1] : this.users[0];\n\n console.log(\"Ich bin:\" + user.Username);\n console.log(\"ID: \" + user.id);\n console.log(\"ID: \" + myId);\n console.log(\"Der andere ist: \" + otherId);\n\n // Bin ich auch wirklich wirklich dran?\n if(this.users[this.playerTurn].id == myId){\n\n // Nachricht vorbereiten\n var sndTreffer = {\n dataType: GAME_LOGIC,\n gameState: -1,\n message: 'g'+data.message\n };\n\n // Ist an Ziel Wasser oder Boot?\n if(this.SchiffePos[otherId].Boote.includes(data.message+\"|\")){\n console.log(\"Treffer!\");\n if(!this.SchiffePos[otherId].Getroffen.includes(data.message+\"|\")) this.SchiffePos[otherId].Getroffen += data.message+\"|\";\n sndTreffer.gameState = Game_Treffer;\n }else{\n console.log(\"Wasser :( \");\n sndTreffer.gameState = GAME_Wasser;\n }\n // Rückmeldung senden\n user.socket.send(JSON.stringify(sndTreffer));\n // \"betroffenen\" auch informieren\n sndTreffer.message = 'i'+data.message;\n otherUser.socket.send(JSON.stringify(sndTreffer));\n\n // alles versenkt, (er/sie/es) hat verloren!\n if(this.SchiffePos[otherId].Getroffen.length == this.SchiffePos[otherId].Boote.length){\n var data = {\n dataType: CHAT_MESSAGE,\n sender: \"Server\",\n message: \"User \" + user.Username + \" hat gewonnen.\"\n };\n room.sendAll(JSON.stringify(data));\n\n // Runde erhöhen\n this.cntRunde++;\n data = {\n dataType: GAME_LOGIC,\n gameState: GAME_RESTART,\n message: \"User \" + user.Username + \" hat gewonnen.\",\n newRunde: this.cntRunde\n };\n room.sendAll(JSON.stringify(data));\n this.currentGameState = GAME_RESTART;\n // Variablen zurücksetzen\n this.SchiffePos[myId] = {\n sindBooteGesetzt: false,\n Boote : \"\",\n Getroffen : \"\"\n };\n this.SchiffePos[otherId] = {\n sindBooteGesetzt: false,\n Boote : \"\",\n Getroffen : \"\"\n };\n\n }\n // der andere ist nun dran mit dem Zug\n this.WechsleSpieler();\n }//ich war wirklich wirklich dran\n else { console.log(\"!!!!: User war nicht dran?! \");}\n }// beide Spieler haben Boote gesetzt\n } // versuche Boot zu versenken\n }//GAME-Logik\n\n}", "function writeToFunmoneyDatabase(who,amount){\r\n let junk = '';\r\n let junkB = '';\r\n let lostAmount = amount * -1;\r\n mikeyHistory = historyAll[\"mikey\"].split(',');\r\n yokoHistory= historyAll[\"yoko\"].split(',');\r\n amount = parseFloat(amount);\r\n lostAmount = parseFloat(lostAmount);\r\n if (who == \"mikey\"){\r\n // add money to mikey\r\n mikeyMoney = mikeyMoney * 1;\r\n mikeyMoney += amount;\r\n let newBal = (mikeyMoney.toFixed(2)).toString();\r\n junk = mikeyHistory.unshift(amount.toString());\r\n junk = mikeyHistory.pop();\r\n let toAppend = mikeyHistory.toString();\r\n // minus money yoko\r\n yokoMoney = yokoMoney * 1;\r\n yokoMoney += lostAmount;\r\n let newBalY = (yokoMoney.toFixed(2)).toString();\r\n junkB = yokoHistory.unshift(lostAmount.toString());\r\n junkB = yokoHistory.pop();\r\n let toAppendY = yokoHistory.toString();\r\n // write db\r\n docFMH.set({\r\n yoko : toAppendY,\r\n mikey : toAppend\r\n }, { merge: true });\r\n docFM.set({\r\n yoko : newBalY,\r\n mikey : newBal\r\n }, { merge: true });\r\n }\r\n if (who == \"yoko\"){\r\n yokoMoney = yokoMoney * 1;\r\n yokoMoney += amount;\r\n let newBal = (yokoMoney.toFixed(2)).toString();\r\n junk = yokoHistory.unshift(amount.toString());\r\n junk = yokoHistory.pop();\r\n let toAppend = yokoHistory.toString();\r\n // mikey minus loss\r\n mikeyMoney = mikeyMoney * 1;\r\n mikeyMoney += lostAmount;\r\n let newBalM = (mikeyMoney.toFixed(2)).toString();\r\n junkB = mikeyHistory.unshift(lostAmount.toString());\r\n junkB = mikeyHistory.pop();\r\n let toAppendM = mikeyHistory.toString();\r\n // write db\r\n docFMH.set({\r\n yoko : toAppend,\r\n mikey : toAppendM\r\n }, { merge: true });\r\n docFM.set({\r\n yoko : newBal,\r\n mikey : newBalM\r\n }, { merge: true });\r\n }\r\n // console.log(amount);\r\n}", "handleOnPlayerMessage(player) {\n let _this = this;\n\n // handle on message\n player.socket.on(\"message\", function (message) {\n let _data = JSON.parse(message);\n\n if (_data.messageType === MESSAGE_TYPE.CLIENT_CHAT) {\n let _playerDisplayName = player.id;\n if (player.playerName) {\n _playerDisplayName = player.playerName;\n }\n let _message = new Message(MESSAGE_TYPE.CLIENT_CHAT);\n _message.content = _playerDisplayName + \" : \" + _data.content;\n _this.sendAll(JSON.stringify(_message));\n } else if (_data.messageType === MESSAGE_TYPE.CLIENT_CARD) {\n // Karte in der Logik verarbeiten.\n scopaLogic.processPlayerMessage(_data, _this);\n } else if (_data.messageType === MESSAGE_TYPE.CLIENT_STATE) {\n // Name und ID des Spielers setzen\n player.playerName = _data.playerName;\n player.playerId = _data.playerId;\n console.log(\"Spielername: \" + _data.playerName + \" Spieler ID\" + _data.playerId);\n }else if (_data.messageType === MESSAGE_TYPE.CLIENT_RESTART) {\n scopaLogic.startGame();\n }\n });\n }", "function SendBoardData(boardData) {\n //Turn board data to fen\n var fen = GetBoardFen(boardData);\n var updateJson = JSON.stringify({\n type: \"updateGame\",\n fen: fen, //Board FEN\n passSpace: enPassantSpace, //which space has enPassantSpace\n opponent: myOpp //Tells server who is the players opponent\n });\n connection.send(updateJson);\n }", "function save_update() {\n\n update_part = {}\n update_part['SV ID'] = part_sv_id;\n update_part['Pickup Location'] = pickup_location\n update_part['Part Description'] = part_descri;\n update_part['Part Number'] = part_number;\n update_part['Qty'] = qty;\n update_part['Status'] = status;\n update_part['Serial No'] = part_sr;\n update_part['sr_number'] = sr_number;\n update_part['Job Name'] = job;\n update_part['apl'] = apl_code;\n // console.log(update_part);\n socket.emit(\"update_part\", update_part);\n\n}", "function sendToServer_pause() {\r\n socket.emit('control', {\r\n 'room': ROOM_ID,\r\n 'username': USER,\r\n 'category': PAUSE,\r\n 'playtime': audio.currentTime\r\n });\r\n}", "function sendName() {\n\tvar clientMsg = document.getElementById('enterName');\n\tif (clientMsg.value) {\n\t\tPlayerName = clientMsg.value;\n\t\tvar data = JSON.stringify({\n\t\t\t'newName' : $(\"#enterName\").val()\n\t\t})\n\t\tsocketConn.send(data);\n\t\tdocument.getElementById('title').innerHTML = \"Welcome to the Quest of The Round Table - \"\n\t\t\t\t+ clientMsg.value + \"'s View\";\n\t\tchangeColor();\n\t\tdocument.getElementById('nameparagraph').style.display = \"none\";\n\t\tdocument.getElementById('send').style.display = \"none\";\n\t\tdocument.getElementById('rigger').style.display = \"none\";\n\t\tdocument.getElementById('riggerAI').style.display = \"none\";\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value = \"> waiting for other players \\n> to create AI player(s), open a new browser window and click AI Player button\";\n\t}\n}", "function getInGame() {\n var chatDataDisc = database.ref(\"/chat/\" + Date.now());\n playerRef = database.ref(\"/players/\");\n \n // On disconnect remove this user's player object\n playerRef.onDisconnect().remove();\n // Send disconnect message to chat with Firebase server generated timestamp and id of '0' to denote system message\n\n // // Remove name input box and show current player number.\n $(\"#new-div\").html(\"<h3>Thrilled you're here, \" + username + \"!\");\n $(\"#username\").hide();\n $(\"#start\").hide();\n }", "function onMessage(event) {\n // Define variables\n var p1;\n var dealer;\n var rtn_msg;\n var help = '*INSTRUCTIONS*\\nHelp: Displays list of commands\\nStart Blackjack: Deals the hands to start the game \\n' +\n 'Hit Me: Adds an extra card to your hand\\nStand: Does not add a card to your hand. Ends the game.'; \n \n // Get the message that the user types\n var bot_name = '@underground blobby ';\n var msg = event.message.text.toLowerCase().replace(bot_name, '');\n var user;\n \n // Look to see if game already started\n if (data['Player 1'] == undefined) {\n p1 = \"\";\n dealer = \"\";\n }\n // Get the hands that were saved\n else {\n p1 = JSON.parse(data['Player 1']);\n dealer = JSON.parse(data['Dealer']);\n }\n \n // Make sure that the same player is playing. Avoid multiple players at the same time. \n if (data['User'] == undefined) {\n user = event.user.displayName;\n }\n else {\n user = data['User'];\n if (user !== event.user.displayName) {\n return {'text': 'Game currently in progress. Please wait for ' + user + ' to finish his/her game.'};\n }\n }\n \n // Start the game and get the data\n if (msg == 'start blackjack') {\n start_game();\n scriptProperties.setProperty('User', user) // Save the user only when they are committed to playing\n data = scriptProperties.getProperties();\n \n // Get the player info that was saved by start_game()\n p1 = JSON.parse(data['Player 1']);\n dealer = JSON.parse(data['Dealer']);\n \n // Return the hands\n rtn_msg = generate_return_message(p1, dealer);\n return {'text': rtn_msg};\n }\n \n // Add an additional card and save the updated player data and deck\n else if (msg == 'hit me') {\n \n // Make sure that the game has already started. If not, display help message\n if (p1 == \"\") {\n return {'text': 'You cannot hit what has not yet been dealt.\\n' + help};\n }\n hit_me(p1);\n scriptProperties.setProperty('Player 1', JSON.stringify(p1));\n rtn_msg = generate_return_message(p1, dealer);\n return {'text': rtn_msg};\n }\n \n // Do not generate a card. Triggers the end of the game.\n else if (msg == 'stand') {\n if (p1 == \"\") {\n return {'text': 'Please start the game first.\\n' + help};\n }\n \n // Dealer will hit only if the player is better\n while (get_player_strength(p1) > get_player_strength(dealer) && get_player_strength(dealer) < 21) {\n hit_me(dealer);\n }\n \n // Clear the data once the dealer is done hitting\n clear_data();\n \n // Generate the return message\n rtn_msg = generate_return_message(p1, dealer, true);\n return {'text': rtn_msg};\n }\n \n // Displays list of commands\n else if (msg == 'help') {\n return {'text': help}\n }\n \n // To clear the data incase someone started a game and never finished\n else if (msg == 'clear') {\n clear_data();\n return {'text': 'Cleared'};\n }\n}", "function showWinMessage(player){\n let playerName=$QS('.player-name');\n let winMsgDiv=$QS('.win-msg-div');\n playerName.innerText=player;\n winMsgDiv.innerText='Wins';\n}", "function informLobby() {\n for(var i in SOCKET_LIST) {\n if(SOCKET_LIST[i].username !== undefined && (SOCKET_LIST[i].roomname !== undefined && SOCKET_LIST[i].roomname !== \"\")) {\n var pack = {\n Room1: getRoomInformation(\"Room1\")\n }\n SOCKET_LIST[i].socket.emit('lobbyInfo', pack);\n }\n }\n}", "asWin(player,drawer,room){\n socket.emit(\"win\",{player : player,drawer: drawer,room: room})\n }", "function joinGame(msg) {\n game.addPlayer(this, msg.username, (msg.color) ? msg.color : Constants.TANK.BLUE, msg.fireToggle);\n}", "function send_data(){\n\tfor (i = 0; i < 8; i++) { \n\t\tuint8[i] = tic80_gpio[i];\n\t}\n if(state==\"host\"){peer1.send(uint8);}\n else if(state==\"client\"){peer2.send(uint8);}\n}", "function EventHandler(context, event) {\r\n if(! context.simpledb.botleveldata.numinstance)\r\n context.simpledb.botleveldata.numinstance = 0;\r\n numinstances = parseInt(context.simpledb.botleveldata.numinstance) + 1;\r\n context.simpledb.botleveldata.numinstance = numinstances;\r\n context.sendResponse(\"Thanks for adding me. You are:\" + numinstances);\r\n \r\n \r\n}", "function update(str1,str2){\n chatter[chatpoint] = \" \\n> \" + str1; chatter[chatpoint] += \"\\n> \" + str2; chatpoint ++ ; if( chatpoint >= chatmax ){ chatpoint = 0; }\n return write();\n}", "function sendMessage() {\n //message content listener\n var text = document.getElementById('sendMessageText').value;\n if (text.replace(/\\s/g, \"\").length === 0) { // Don't send just whitespace\n return;\n }\n\n //data to send\n var data = {\n type: \"message\",\n id: generateMessageId(getUserId(), text),\n author: selfEasyrtcid,\n date: getDate(),\n parentMessageId: getSelectedNodeId(),//getParentMessageId(),// makes it dynamic.\n content: text\n };\n\n //sends data to server\n sendData(\"message\", data);\n\n //will generate message node on client\n addToRoom(\"message\", JSON.stringify(data));\n\n //saves message to db\n addMessagetoDB(data);\n\n //empties text field\n document.getElementById('sendMessageText').value = \"\";\n}", "function sendPosition(x, y) {\n socket.emit('clientPosition', player);\n // console.log(player)\n}", "challange(myId, catId, player2, userName) {\n this.socket.emit(\"challange\", myId, catId, player2, userName);\n }", "function writeSocketGameComplete(writeInfo) {\r\n\t//console.log(\"Write Game OK\");\r\n\tif (writeInfo.bytesWritten < 0) {\r\n\t\tsocketUdp.disconnect(socks.socketId);\r\n\t\tconsole.log(\"Error Writting Game\");\r\n\t} else {\r\n\t\t//TODO\r\n\t\tvar latenciaAux = Q4SClientEmbedded.getQ4SLatency();\t\t\r\n\t\treadLatency(latenciaAux);\t\t\t\r\n\t\t\r\n\t\tplayersLatencies[USER_ID] = currentLatency;\r\n\t\tupdateLatency();\r\n\t\t\r\n\t\tif(!stopSocketGame){\r\n\t\t\t//console.log(\"Next message in Game: \" + limitLatency);\r\n\t\t\tt = setTimeout(function() {\r\n\t\t\t\tsendWindow();\r\n\t\t\t}, limitLatency);\r\n\t\t\t// Establecemos ventana de escritura con el actual MAX latency.\r\n\t\t}\r\n\t}\r\n}", "function sendTheMessage() {\r\n\r\n console.log(\"sending data: \\\"\", sendText, \"\\\"\");\r\n // Send Data to the server to draw it in all other canvases\r\n dataServer.publish(\r\n {\r\n channel: channelName,\r\n message:\r\n {\r\n text: sendText //text: is the message parameter the function is expecting\r\n }\r\n });\r\n\r\n}", "systemMessage(oldUser, newUser) {\n const newMessageObj = {\n type: 'system',\n content: oldUser + ' changed their name to ' + newUser + '.'\n };\n this.socket.send(JSON.stringify(newMessageObj));\n this.setState({currentUser: {name: newUser}});\n }" ]
[ "0.6050087", "0.5949858", "0.58548886", "0.58364403", "0.5824958", "0.5796896", "0.5793975", "0.578975", "0.5778029", "0.5749695", "0.5741349", "0.57377756", "0.57227606", "0.5715116", "0.56820834", "0.56739", "0.56731427", "0.56703824", "0.56426835", "0.5639739", "0.563403", "0.5615712", "0.56090015", "0.56070954", "0.56050205", "0.5587948", "0.5587893", "0.5577878", "0.5569788", "0.5559959", "0.5552089", "0.55496615", "0.5517742", "0.5514934", "0.5513074", "0.55102533", "0.54918253", "0.5489887", "0.5487853", "0.54844123", "0.54792607", "0.54724133", "0.54710984", "0.5466329", "0.5456226", "0.54502326", "0.5449004", "0.54454154", "0.54280686", "0.5426114", "0.5420572", "0.54142225", "0.5414022", "0.5410565", "0.54082626", "0.54073083", "0.5406611", "0.5403135", "0.5386903", "0.53844136", "0.53828573", "0.5381895", "0.53680784", "0.53618824", "0.53586984", "0.5358618", "0.53566074", "0.5354463", "0.53520244", "0.5351939", "0.53517276", "0.5345055", "0.5340135", "0.5339526", "0.5334628", "0.53270173", "0.5324234", "0.5321095", "0.5320476", "0.5319748", "0.5317252", "0.53077066", "0.5299499", "0.5287176", "0.5285136", "0.52768207", "0.5275871", "0.52726996", "0.5272273", "0.5270224", "0.5269241", "0.5261069", "0.5260986", "0.5259823", "0.5259582", "0.5259031", "0.52519244", "0.52458173", "0.523827", "0.5236463" ]
0.56150216
22
Reset the display for the next round.
function resetGame() { // Hide what was chosen during last round $(".choice").attr("hidden", true); // Display the game choice buttons $(".game").attr("hidden", false); $(".game").css("visibility", "visible"); // Update the player instructions. v_message = "Make your choices ..."; updateDatabase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetDisplay() {\n\t\tctx.clearRect(0,0,610,550);\n\t\tctx.strokeRect(40, 10, 530, 539);\n\t\t$(\"#controls button\").button(\"disable\");\n\t\t$(\"#seeker\").slider(\"disable\");\n\t\t$(\"#display-options input\").attr(\"disabled\",\"disabled\");\n\t\t$(\".game-status .p1, .game-status .p2, .game-status .message\").empty();\n\t\t$(\".game-status .message\").removeClass(\"neutral-text p1-text p2-text\").css(\"visibility\",\"hidden\");\n\t\t$(\".display .p1-text, .display .p2-text\").html(1000);\n\t\t$(\".names-time .time\").html(0);\n\t\t$(\"#canvas-alt\").remove();\n\t}", "function resetDisplay(){\r\n $(\"#pause-icon\").addClass(\"fa-pause\");\r\n $(\"#pause-icon\").removeClass(\"fa-play\");\r\n $(\"#display\").removeClass('break');\r\n $(\"#clock-phase\").text(\"Session\");\r\n $(\"#current-session\").text(timers.sessionTime + \" Min\");\r\n $(\"#current-break\").text(timers.breakTime + \" Min\");\r\n setCountDown();\r\n}", "function reset() {\n clearInput();\n round = 0;\n}", "function reset() {\n calculatorData.isAtSecondValue = false;\n calculatorData.displayValue = '';\n calculatorData.result = '';\n calculatorData.isValueDecimal = false;\n updateDisplay();\n}", "clearDisplay() {\n this.current.innerHTML = '0';\n this.last.innerHTML = '';\n return\n }", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "function resetContent(){\r\n\tif(!lastRound()){\r\n\t\tresetButton.textContent = \"Next Round\";\t\t\r\n\t}\r\n\telse{\r\n\t\tresetButton.textContent = \"New Game\";\t\r\n\t}\r\n}", "function reset() {\n\t\t// Generates a new number to guess.\n\t\ttargetNumber = Math.floor((Math.random() * 102) + 19);\n\t\t// Displays that number on the page.\n\t\t$(\".targetdisplay\").html(targetNumber);\n\t\t// Generates new values for the crystals.\n\t\tblue = Math.floor((Math.random() * 12) + 1);\n\t\tred = Math.floor((Math.random() * 12) + 1);\n\t\tyellow = Math.floor((Math.random() * 12) + 1);\n\t\tgreen = Math.floor((Math.random() * 12) + 1);\n\t\t\n\t}", "function reset() {\n setPieces(round);\n }", "function refreshRound(){\r\n\tif(!lastRound()){\r\n\t\ttitleDisplay.textContent = \"Round #\" + nthRound;\r\n\t}\r\n\telse{\r\n\t\ttitleDisplay.textContent = \"Final Round\";\r\n\t}\r\n}", "function reset() {\n\t\tdrawSimpleBoard(board = new Board());\n}", "function resetScreen() {\n currentOperationScreen.textContent = '0';\n lastOperationScreen.textContent = 'xxx';\n holdOne = '';\n holdTwo = '';\n currentOperation = null;\n}", "function reset () {\n\n \t\tquestionCounter++;\n \t\tnumber = 11;\n \t\tdisplayNext();\n\n }", "function reset() {\n graphics.clearAll();\n for (var i = 0; i < grid.length; i++) {\n for (var j = 0; j < grid[i].length; j++) {\n $(\"#\" + grid[i][j]).parent().removeClass(\"red\");\n squares[grid[i][j]] = \"empty\";\n p2Move = false;\n }\n }\n timesPlayed = 0;\n $(\"#screen3\").children().hide();\n $(\"#screen1\").children().show();\n talker.notice(\"start up\");\n}", "function reset(){\n displayInput = [''];\n uniqueNumber = '';\n // clean the screen\n calcLine.textContent = '';\n resultLine.textContent = '';\n}", "function reset () {\n\t\tnewNum = 0;\n\t\tscoreNum = 0;\n\t\t$(\"#results\").html(scoreNum);\n\t\tinitializeGame();\n\t}", "function reset() {\n\thomeScore = 0;\n\tguestScore = 0;\n\thomeDisplay.textContent = homeScore;\n\tguestDisplay.textContent = guestScore;\n\tgameOver = false;\n\thomeDisplay.classList.remove(\"green\");\n\tguestDisplay.classList.remove(\"green\");\n}", "function clearScreens() {\n\n numericString = '';\n display.innerHTML = '';\n units.innerHTML = '';\n document.getElementById('results').innerHTML = 'Results will appear here...';\n document.getElementById('planet').className = \"\";\n\n enablePlaceholder();\n enableDisabled();\n\n }", "function reset() {\n\tvar firstNumber, secondNumber, operator = null;\n\tdisplayText(0);\n}", "function resetRoundScore() {\n gameRoundScore = 0;\n playerRoundScore = 0;\n roundStatus = \"Next Game\";\n document.getElementById('player-result').innerHTML = 0;\n document.getElementById('game-result').innerHTML = 0;\n}", "function reset () {\n\tthis.num1 = 0;\n\tthis.num2 = 0;\n\tthis.operator = \"\";\n\tdisplayNum.innerHTML = 0;\n\tdecimal = 0;\n}", "function resetGame() {\n deck.innerHTML = '';\n tally.textContent = 0;\n seconds = 0;\n minutes = 0;\n moves = 0;\n stars.innerHTML = '';\n pairedCards = [];\n setupDeck();\n modal.style.display = 'none';\n}", "function reset () {\n setCurrentlyClicking(false);\n setCounter(1);\n clearInterval(currentInterval);\n setCurrentInterval(\"\");\n setClickingFast(false);\n setColors(initialColors);\n }", "function reset() {\n noneDisplay.style.display = \"none\";\n tryagain.style.display = \"none\";\n info.classList.remove(\"rightChoice\");\n info.classList.remove(\"animated\");\n info.textContent = \"\";\n}", "function _reset() {\r\n it = 0;\r\n redraw();\r\n looping == false ? noLoop() : 0;\r\n}", "function reset () {\n\tcolors = generateRandomColors(colorsNum);\n\tpickedColor = pickRandomColor();\n\tcolorDisplay.textContent = pickedColor;\n\th1.style.backgroundColor = \"steelblue\";\n\tmessage.textContent = \"\";\n\tresetButton.textContent = \"New Colors\";\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tif (colors[i]) {\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.backgroundColor = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n}", "function reset() {\n time = 0;\n lap = 1;\n\n $(\"#display\").text(\"00:00\");\n}", "function reset() {\n p1Display.textContent = 0;\n p2Display.textContent = 0;\n p1Score = 0;\n p2Score = 0;\n gameOver = false;\n}", "function reset(){\r\n winnerRound.id = \"score-descr\";\r\n winnerRound.textContent = \"start playing\";\r\n score.textContent = \"0 : 0\";\r\n playerPoints = 0;\r\n computerPoints = 0;\r\n buttons.forEach(btn => btn.disabled = false);\r\n resetBtn.textContent = \"RESET\";\r\n}", "function reset() {\n\tiQ = 0;\n\ttotal = iQ;\n\tnumCorrect = 0;\n\t$('.explanationBlock').text('');\n\tupdate();\n\tsetCurrent();\n\tsetZero();\n}", "function reset() {\n // reset points\n userPoints = 0;\n // go back to the first question\n questionsIndex = 0;\n // reset timer\n clock = 55;\n // display the h2 element to show the question\n h2.style.display = \"block\";\n // don't show the buttons\n scoreButtons.style.display = 'none';\n form.style.display = 'none';\n // go back to first question\n displayQuestion();\n}", "function reset(){\n\t//generate new colors\n\tcolors = generateRandomColor(numSquares);\n\t//pick a new random color from array\n\tpickedColor = pickColor();\n\t//change colorDisplay to match picked Color\n\tcolorDisplay.textContent = pickedColor;\n\n\tresetButton.textContent = \"New Colors\";\n\tmsgDisplay.textContent = \"\";\n\n\t//change colors of squares\n\tfor(var i=0; i<squares.length; i++){\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.background = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n\th1.style.background = \"steelblue\";\n}", "function reset() {\n magic.style.display = 'block';\n magic.style.visibility = 'visible';\n}", "function clearDisplay(){\n display.textContent = '0'\n num1=0;\n num2 =0;\n chosen_operator =''\n}", "reset() {\n\t\tthis.stop();\n\n\t\tthis.ticks = 0;\n\t\tthis.interval = 0;\n\t\tthis.node.innerText = \"00:00:00\";\n\t}", "function reset() {\n resetButton.innerHTML = \"RESET\";\n winner.classList.add(\"hide\");\n numShotsOne.innerHTML = 0;\n numShotsTwo.innerHTML = 0;\n numGoalsOne.innerHTML = 0;\n numGoalsTwo.innerHTML = 0;\n resetSpan.classList.remove(\"hide\");\n leftDiv.classList.add(\"possessionIndicator\");\n rightDiv.classList.remove(\"possessionIndicator\");\n toggleTeamDivs();\n running = true;\n}", "function resetGame() {\n moveCounter = 0;\n matchCounter = 0;\n\n moves.style.color = \"green\";\n\n timerStart = false;\n minutes = 0;\n seconds = 0;\n hours = 0;\n\n timer.textContent = hours + \":\" + minutes + \":\" + seconds;\n timer.style.color = \"green\";\n\n starsList[0].style.display = 'inline-block';\n starsList[1].style.display = 'inline-block';\n starsList[2].style.display = 'inline-block';\n\n updateMoveCounter(moveCounter);\n\n for(let i = 0; i < deckSize; i++) {\n deck[i].className = \"card enable\";\n }\n\n setupCards();\n}", "function resetme(){\n\tinitiateBoard();\n\tmode=0;\n\tdisplay(0);\n}", "function resetGame() {\n state.reset();\n drawScoreDisplay();\n document.getElementById('overlay').classList.add('hide');\n // let winContainer = document.getElementsByClassName('win-container');\n // winContainer[0].classList.remove('win');\n while (textDisplay.firstChild) {\n textDisplay.removeChild(textDisplay.firstChild);\n }\n}", "function resetGame() {\n\t$(\"#content\").hide();\n\tquestionNumber = 0;\n\ttotalCorrect = 0;\n\ttotalIncorrect = 0;\n\ttotalUnanswered = 0;\n\tgenerateText();\n\t$(\"#time-remaining\").show();\n\t$(\"#display\").show();\n\tstopwatch();\n}", "function reset() {\n\tif (soundOn)\n\t\tsounds['buttons'].sound.play();\n\tcolors = generateRandomColors(numCircles);\t\n\tpickedColor = pickColor();\t// pick a new random color from array. It is a string like rgb(r, g, b)\n\tcolorDisplay.textContent = pickedColor; // change colorDisplay to match picked color\n\tresetButton.textContent = \"New Colors\"\n\tmessageDisplay.textContent = \"\";\n\n\t// change colors of circles\n\tfor (var i = 0; i < circles.length; i++){\n\t\tif (colors[i]) {\n\t\t\tcircles[i].style.display = \"block\"\n\t\t\tcircles[i].style.background = colors[i];\n\t\t} else {\n\t\t\tcircles[i].style.display = \"none\";\t// hide other circles if mode is easy\n\t\t}\n\t}\n\n\tbanner.style.background = \"steelblue\";\n}", "function reset(){\n document.getElementById(\"main\").innerHTML=null;\n document.getElementById(\"gameScore\").innerHTML=null;\n document.getElementById(\"resultDisplay\").innerHTML=null;\n gameGrid();\n}", "function reset(){\n //level is zero\n count=0;\n //remove the events about colors\n $('.colorblock').unbind();\n // adjust the font style in the click board\n $('#count').html('Level:'+count);\n $('#simon').text('Simon').css({\n fontSize: '7vw',\n textalign: 'center',\n position: 'absolute',\n left:'5vw',\n });\n $('#start').text('Start Game!').css({\n fontSize:'5vw',\n textalign: 'center',\n position: 'absolute',\n top:'15vw',\n left: '5vw',\n });\n getRand();\n flashArray(); \n }", "function roundReset() {\n stopTimer();\n timeRem = timeLimit;\n resetLights();\n playButton.classList.remove(\"noclick\");\n scoreAmount = 0;\n gameAnimal = \"\";\n gameAnimalExample = \"\";\n playButton.innerHTML = \"Play again?\";\n }", "function clearDisplay() {\n\tTi.API.info('called clearDisplay');\n // set the display to empty string\n $.lbl_display.text = '';\n $.lbl_mstore.text = '';\n $.lbl_arabic.text = '';//(0).toString(); //(current_num.arabic).toString();\n // reset the characters pressed variables to empty string\n last0_char = '',\n last1_char = '',\n last2_char = '',\n last_3_chars = '';\n dimChars(null);\n}", "function reset() {\n colors = generateRandomColors(numSquares);\n pickedColor = pickColor();\n colorDisplay.textContent = pickedColor;\n for (var i = 0; i < squares.length; i++) {\n if (colors[i]) {\n squares[i].style.display = 'block';\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = 'none';\n }\n }\n messageDisplay.textContent = '';\n newGameButton.textContent = 'New Colors';\n h1.style.backgroundColor = theme;\n}", "function reset() {\n $('.game-field').html('');\n game.moves = 1;\n $('.game-field').attr('onClick', 'icon(this.id)');\n $('.win').removeClass('win');\n setTimeout(firstMove, 200);\n }", "function reset() {\n\t\ttotalScore = 0;\n\t\t$totalScore.html(totalScore);\n\t\trandomNumber = Math.floor(Math.random() * (120 - 19)) + 19;\n\t\t$(\"#random-number-section\").html(randomNumber);\n\t\tfirstCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tsecondCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tthirdCrystal = Math.floor(Math.random() * 12 + 1);\n\t\tfourthCrystal = Math.floor(Math.random() * 12 + 1);\n\t}", "function reset() {\n\t\ttargetNumber = Math.floor(Math.random() * 80) + 20;\n\t\tplayerScore = 0;\n\t\tbtnGreen = Math.floor(Math.random() * 12) + 1;\n\t\tbtnBlue = Math.floor(Math.random() * 12) + 1;\n\t\tbtnRed = Math.floor(Math.random() * 12) + 1;\n\t\tbtnPurple = Math.floor(Math.random() * 12) + 1;\n \n document.getElementById(\"randNum scoreboard\").innerHTML = targetNumber;\n\t\treturn;\n\t}", "function reset() {\n\tdocument.querySelector(\"span\").textContent = currLevel + 1;\n\tcolor = randomRGB();\n\tdocument.querySelector(\".circle\").style.backgroundColor = color;\n\tshuffleArray(randomArr);\n\tfillSquares(levels[currLevel]);\n}", "function roundReset(){\n score = 0;\n compNum = randomRange(120,19);\n crystal1 = randomRange(12,1);\n crystal2 = randomRange(12,1);\n crystal3 = randomRange(12,1);\n crystal4 = randomRange(12,1);\n $(\"#computerNumber, #score\").empty();\n $(\"#computerNumber\").text(compNum);\n }", "function resetGame(){\t\n\t//play again --> new colors\n\treset.textContent=\"New Colors\";\n\t//change h1 background on reset\n\th1.style.backgroundColor=\"steelblue\";\n\t//remove message try again/correct\n\tmessage.textContent=\"\";\n\t//generate new colors\n\tcolors=generateRandomColors(numOfSquare);\n\t//assign new colors\n\tfor(var i=0;i<squares.length;i++)\n\t{\n\t\t\tif(colors[i]){\n\t\t\t\tsquares[i].style.display=\"block\";\n\t\t\t\tsquares[i].style.backgroundColor=colors[i];\n\t\t\t} \n\t\t\telse squares[i].style.display=\"none\";\n\t}\n\t//set new final color\n\tpickedColor=pickColor();\n\t//set new top RGB\n\tcolorDisplay.textContent=pickedColor;\n}", "function reset(){\n colors = generateRandomColors(numSquares);\n //pick a new random color from away\n pickedColor = pickColor();\n //change color display to match pickedColor\n colorDisplay.textContent = pickedColor;\n // change the color of the squares\n for(var i = 0; i < squares.length; i++){\n if(colors[i]){\n squares[i].style.display = \"block\";\n squares[i].style.background = colors[i];\n } else{\n squares[i].style.display = \"none\";\n }\n }\n resetButton.textContent = \"New Colors\"\n h1.style.backgroundColor = \"steelblue\";\n}", "function clearDisplay() {\n result = 0;\n recentOp = \"\";\n keySelect.display.value = \"\";\n newNum = true;\n }", "function resetGame() {\n\t$(\"#gameOver\").fadeOut();\n\ttotal = 0;\n\tupdateTotal(0);\n\ttotalEmptyCells = 16;\n\tgrid = getGrid();\n\tgridSpans = getSpanGrid();\n\t$(gridSpans).each(function(i,r) { $(r).each(function(i,c) { $(c).parent().css(\"background-color\", \"#D1E3EB\"); $(c).text(\"\"); }); });\n\tsetRandCell(get2or4());\n\tsetRandCell(get2or4());\n}", "resetBoard() {\n this.playerOneSection.innerHTML = '';\n this.playerTwoSection.innerHTML = '';\n this.resolutionMsg.innerText = '';\n this.resolutionActions.innerHTML = '';\n }", "function reset() {\n colors = genRandomColors(numSquares);\n pickedColor = chooseColors();\n colorDisplay.textContent = pickedColor;\n heading.style.backgroundColor = \"steelblue\";\n resetBtn.textContent = \"New colors\";\n message.textContent = \"\";\n\n for (let i = 0; i < squares.length; i++) {\n if (colors[i]) {\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colors[i];\n } else {\n squares[i].style.display = \"none\";\n }\n }\n}", "function resetGame() {\n newSquares = Array(9).fill(null);\n setSquares(newSquares);\n setXTurn(true);\n }", "reset(){\n this.number = 0;\n this.isMine = false;\n this.isFlagged = false;\n this.isOpen = false;\n this.div.style.backgroundImage = cellImages[9];\n }", "function resetGame () {\n\tFIELD = createGrid();\n\tfor(var i = 0; i < NB_ROW; i++){\n\t\tfor(var j = 0; j < NB_LIG; j++){\n\t\t\tFIELDVIEW[i][j].red.alpha = 0;\n\t\t\tFIELDVIEW[i][j].yellow.alpha = 0;\n\n\t\t\tFIELDVIEW[i][j].empty.interactive = true;\n\t\t}\n\t}\n\tdocument.getElementById(\"winner\").innerHTML = \"\";\n}", "function reset(){\n\tcolors=generateColors(numSquares);\n\tpickedColor= pickColor();\n\tcolorDisplay.textContent=pickedColor;\n\t\n\tfor (var i =0; i <squares.length; i++) {\n\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.background=colors[i];\n\n\t\t\tsquares[i].style.display=\"block\";\n\t\t}\n\t\telse\n\t\t\tsquares[i].style.display=\"none\";\n\t}\n\n\n\th1.style.background=\"steelblue\";\n\tmessageDisplay.textContent=\"\";\n\tresetButton.textContent=\"New colors\";\n}", "function resetGame (e) {\n round = 0;\n win = 0;\n lose = 0\n tie = 0;\n const roundNumber = document.getElementById('round');\n const intro = document.getElementById('intro');\n const computer = document.getElementById('computer');\n const outcome = document.getElementById('outcome');\n const winNumber = document.getElementById('win');\n const lossNumber = document.getElementById('loss');\n const tieNumber = document.getElementById('tie');\n intro.innerText = 'Five Rounds';\n computer.innerText = 'One winner';\n outcome.innerText = 'Make your choice';\n roundNumber.innerText = `Round: ${round}`;\n winNumber.innerText = `Win: ${win}`;\n lossNumber.innerText = `Lose: ${lose}`;\n tieNumber.innerText = `Tie: ${tie}`;\n restartButton.style.display = 'none';\n}", "function Calculator_Reset() {\n Calculator.Display_Value = '0';\n Calculator.First_Operand = null;\n Calculator.Wait_Second_Operand = false;\n Calculator.operator = null;\n}", "function resetGame() {\n gameover = false;\n questionsLeft = quizInfo.length;\n x=0;\n score=0;\n $('#score').text(score);\n $('#answer-3').css(\"display\",\"block\");\n $('#playagain').css(\"display\",\"none\");\n nextQuestion();\n }", "function reset() {\n time = 30;\n // DONE: Change the \"display\" div to \"00:00.\"\n $(\".timer\").text(\"00:00\");\n }", "function clearDisplay() {\n rmNodes(document.getElementById('wolframAlphaResponses'));\n rmNodes(document.getElementById('progressDisplay'));\n}", "function clearDisplay(){\n firstNumber = 0;\n lastNumber = 0;\n memory = 0;\n operatorSign = '';\n operatorSignMemory = '';\n firstTextValue.textContent = '';\n secondTextValue.textContent = '';\n displayOperator.textContent = '';\n \n\n firstTextValue.classList.remove('text-muted');\n}", "function reset(){\n colours = generateRandomColours(numOfSquares);\n\n // Pick new colour and change displayed colour\n pickedColour = pickColour();\n colourDisplay.textContent = pickedColour;\n\n // Change colours for squares on page\n for(var i = 0; i < squares.length;i++){\n if(colours[i]){\n squares[i].style.display = \"block\";\n squares[i].style.backgroundColor = colours[i];\n }\n else {\n squares[i].style.display = \"none\";\n }\n }\n h1.style.background = \"steelblue\";\n newColour.textContent = \"New Colour\";\n message.textContent = \"\";\n}", "function displayReset() {\n\t\tremoveChildren();\n\t\tresultScnTitle.textContent = '';\n\t\ttitle.textContent = 'Scientific Taxonomy for Mammals of the World'; // why does this work?? why do we n ot need to remove child node to lose the unicorn?\n\t\twhile (resultScnList.firstChild) {\n\t\t\tresultScnList.removeChild(resultScnList.firstChild); // refreshes tracklist for repeadted searches\n\t\t}\n\t}", "function clearDisplay() {\n hideContainers();\n resetCopyNotes();\n resetClipboardNote();\n }", "function clr() {\n document.getElementById(\"display\").innerHTML = \"\";\n document.getElementById(\"display1\").innerHTML = \"0\";\n console.log(\"clear\");\n}", "reset () {\n this.displayPlot(null)\n this.displayStatistics(null, null)\n this.displayLog(null)\n this.displayError(null)\n this.results = new Map()\n }", "function setDisplayOne () {\n const roundInput = displayInput.map(num=>round(num,4));\n // const finalInput = displayInput.join(' ');\n calcLine.textContent = roundInput.join(' ');\n}", "function reset() {\r\n colors = randomColor(num);\r\n pickedColor = colorPicker();\r\n colorDisplay.text(pickedColor);\r\n resetbtn.text(\"New Colors\");\r\n message.text(\"\");\r\n for (let i = 0; i < sq.length; i++) {\r\n if (colors[i]) {\r\n sq[i].style.display = \"block\";\r\n sq[i].style.background = colors[i];\r\n } else {\r\n sq[i].style.display = \"none\";\r\n }\r\n }\r\n}", "handleReset() {\n if(!solving) {\n resetStartEnd();\n grid = Array(800).fill(null);\n this.setState({squares: grid});\n for(let i = 0; i < 800; ++i) {\n document.getElementsByClassName('square')[i].style = 'background-color: white';\n }\n }\n }", "function resetGame(){\n\n //reset tracking variables to original state\n clickCounter=0;\n playerOnePoints=0;\n roundCount=1;\n\n //reset arrays to empty\n playerChoice.length=0;\n automatedArray.length=0;\n\n round.style.opacity=1;\n clearInterval(gameOverBlink);\n round.style.fontSize=\"2em\";\n score.style.fontSize=\"2em\";\n round.style.color=\"#55c379b0\"; \n round.textContent=`ROUND ${roundCount}`;\n score.textContent=`SCORE: ${playerOnePoints}`;\n generateNewSequence(roundCount);\n setTimeout(showSequence,500,automatedArray);\n \n}", "function reset(){\n gameOver = false;\n p1Display.classList.remove(\"winner\");\n p2Display.classList.remove(\"winner\");\n p1Display.textContent = \"0\";\n p2Display.textContent = \"0\";\n p1Score = 0;\n p2Score = 0;\n}", "function reset() {\n document.querySelector(\".infinity-type-area\").disabled = true;\n document.querySelector(\".start\").disabled = false;\n document.querySelector(\".start\").style.backgroundColor =\n \"var(--primary-color)\";\n document.querySelector(\".start\").style.cursor = \"pointer\";\n document.querySelector(\".infinity-type-area\").style.borderColor = \"#A1A1AA\";\n clearInterval(clocking);\n document.querySelector(\".infinity-min\").innerText = \"00\";\n document.querySelector(\".infinity-sec\").innerText = \"00\";\n min = 0;\n sec = 0;\n document.querySelector(\".infinity-type-area\").value = \"\";\n document.querySelector(\"#timer-wpm-inf\").innerText = \"0\";\n document.querySelector(\"#timer-cpm-inf\").innerText = \"0\";\n document.querySelector(\"#timer-accuracy-inf\").innerText = \"0\";\n document.querySelector(\".infinity-user-type\").innerText = samples[random];\n}", "function reset(){\n clearCanvas();\n outputPad.fromData([]);\n }", "function clearDisplay() {\n display = 0;\n operator_pressed = false;\n previous_number = 0;\n current_operation = \"\";\n document.getElementById(\"display\").value = display;\n}", "function reset() {\n clock.style.display = 'none';\n container.style.display = 'block';\n removeClass(calendar, 'datipi-circle-hidden');\n calendar.style.display = 'block';\n btnPreviousMonth.style.display = 'inline-block';\n btnNextMonth.style.display = 'inline-block';\n if (hours != null) {\n hours.setAttribute('style', '');\n hours.className = 'datipi-circle-selector datipi-hours';\n }\n if (minutes != null) {\n minutes.setAttribute('style', '');\n minutes.className = 'datipi-minutes datipi-circle-hidden';\n }\n initCalendar();\n }", "resetGame() {\n // clear game seeds\n this.gameSeed = '';\n this.currentString = '';\n\n if (this.gameStarted) {\n this.toggleGameStarted();\n this.flashCount();\n document.getElementById('simon-points').innerHTML = '--';\n // delayed set to default in-case point flashing causes issues\n setTimeout(() => { document.getElementById('simon-points').innerHTML = '--'; }, 525);\n this.flashTimer = setInterval(() => { this.flashCount(); }, 1000);\n }\n }", "function resetGame() {\r\n if (hardcore === true) {\r\n timerRunning = true;\r\n timeLeft = timeInitial;\r\n $(\"#time-text\").html(timeLeft);\r\n }\r\n currentNumber = 0;\r\n $(\"#current-text\").html(currentNumber);\r\n setTargetValue();\r\n setCrystalValues();\r\n}", "function reset_game () {\n\tscore = 0;\n\tmoveCountdown = 5;\n\t// resume the event listener to gems\n\tthis.backgroundView.updateOpts({\n\t\tblockEvents: false\n\t});\n\n\tthis._scoreboard.updateOpts({\n\t\tvisible: true,\n\t\ttext: \"\"\n\t});\n\t// hide the header\n\tthis._endheader.updateOpts({\n\t\tx: 125,\n\t\ty: 0,\n\t\tvisible: false,\n\t\tcanHandleEvents: false\n\t});\n\t// remove what's on the header broad\n\tthis._endheader.removeAllSubviews();\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 5;\n maxBet = 20;\n winNumber = 0;\n lossNumber = 0;\n winRatio = false;\n\n resetText();\n\n setEnableSpin();\n}", "function reset(){\n\tscore1 = 0;\n\tscore2 = 0;\n\tp1Display.textContent = score1;\n\tp2Display.textContent = score2;\n\tp1Display.classList.remove(\"winner\");\n\tp2Display.classList.remove(\"winner\");\n\tgameOver = false;\n}", "function reset() {\r\n p1Score = 0;\r\n p2Score = 0;\r\n p1Display.textContent = 0;\r\n p2Display.textContent = 0;\r\n p1Display.classList.remove(\"winner\");\r\n p2Display.classList.remove(\"winner\");\r\n gameOver = false;\r\n}", "function clearScreen() {\n isFloat = false;\n isLastInputOperation = false;\n display.innerHTML = '';\n}", "function resetGame() {\r\n playerScore.innerHTML = 0;\r\n computerScore.innerHTML = 0;\r\n roundOutcome.innerHTML = '-------';\r\n}", "function resetClick(event) {\n resetGame();\n const winnerName = document.getElementById(\"winner-name\");\n winnerName.innerText = \"\";\n const winnerDisplay = document.getElementById(\"winner-display\");\n clearBoard();\n winnerDisplay.style.display = \"None\";\n}", "function resetGame() {\n\n\t// show it (when page loads the bugs are hidden)\n\t$(\".bug-bg\").css({\n\t\t\"display\": \"block\"\n\t});\n\n\t// reset state vars\n\tcurrentHighestIndex = 0;\n\tnumberErrors = 0;\n\n\tplaySound('#resetSound');\n\n\t// reset visuals\n\t$(\"#currentHighestIndex\").html(currentHighestIndex);\n\t$(\"#numberErrors\").html(numberErrors);\n\t// remove all boxes\n\t$(\".hidden-btn\").removeClass(\"correct\").removeClass(\"incorrect\");\n}", "function prob_reset() {\n\t\t$(\"[id$=-score]\").css('background-color', '#fff');\n\t\t$('[class$=-input] input').val(\"\")\n\t\tscore = 0;\n\t\tupdate_score();\n\t\t// clear_colors()\n\t\tif(t){\n\t\t\tclearTimeout(t);\n\t\t}\n\t\tshow_clock(MAX_TIME);\n\t\ttime = MAX_TIME;\n\t\troundStarted = false;\n\t\troundFinished = true;\n\t\t// console.log(roundFinished);\n\t\t// curOperation = \"\";\n\t}", "function reset(){\n\tcolors=generateRandomColors(numSquares);\n\t//pick new random color\n\tpickedColor = pickColor();\n\t//change color display so it resets too\n\tcolorDisplay.textContent = pickedColor;\n\t//remove message after you press play again\n\tmessageDisplay.textContent = \"\";\n\t//change button to \"new colors\" instead of it remaining play again after you win and play again\n\tresetButton.textContent = \"New Colors\";\n\t//change the colors of the squares\n\tfor(var i= 0; i< squares.length;i++){\n\t\tif(colors[i]){\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.background = colors[i];\n\t\t} else {\n\t\t\tsquares[i].style.display = \"none\";\n\t \t}\n\t}\n\t//change background back to it's normal color after you win and play again6\n\th1.style.backgroundColor = \"steelblue\";\n}", "function resetAll(){\n\t\t lastNumber = 0;\n\t\t screenNum=\"\";\n\t\t cont = true;\n\t\t numbers = [];\n\t\t symbols = [];\n\t\t mixArray = [];\n\t\t i = 0;\n\t\t tmp = \"\";\n\t\t dotCounter = 0;\n\t}", "function resetRounds() {\n // reset scores\n scores.player = { wins: 0, losses: 0, ties: 0 };\n scores.cpu = { wins: 0, losses: 0, ties: 0 };\n rounds = 1;\n totalRounds = 0;\n playerRecord.textContent = getRecordText(1);\n cpuRecord.textContent = getRecordText(0);\n ratioText.textContent = \"0.000 %\";\n roundsText.textContent = rounds;\n totalRoundsText.textContent = totalRounds;\n championshipInput.checked = false;\n // reset game results children\n while (gameResults.firstChild) {\n gameResults.removeChild(gameResults.firstChild);\n }\n }", "resetRound() {\n this.moves = 0;\n this.emptyBoard();\n this.result = {status: 'waiting'};\n this.turn = '';\n }", "roundRepeat() {\n $('#repeat-button').html('Try Round ' + round.roundNumber + \" Again\");\n $('.game-container').css('display', 'none');\n $('#modal-repeat').css('display', 'block');\n eventHandlers.repeatRound();\n }", "function resetGame() {\n userGuess = 0;\n $(\".dispGuess\").html(userGuess);\n red = Math.floor(Math.random() * 12) + 1;\n green = Math.floor(Math.random() * 12) + 1;\n blue = Math.floor(Math.random() * 12) + 1;\n yellow = Math.floor(Math.random() * 12) + 1;\n random = Math.floor(Math.random() * (120 - 19 + 1) + 19);\n $(\".dispRand\").text(random);\n }", "function reset(){\n magicElement.style.display = \"block\";\n magicElement.style.visibility = \"visible\";\n}", "function reset() {\n\t\t\tclear_board()\n\t\t}", "function resetBoardStarTrek() {\n$('#one').text('1');\n$('#two').text('Live');\n$('#three').text('3');\n$('#four').text('4');\n$('#five').text('Long');\n$('#six').text('6');\n$('#seven').text('And');\n$('#eight').text('Prosper');\n$('#nine').text('-RIP Nimoy');\nresetOne();\n}" ]
[ "0.75362486", "0.73819315", "0.7286757", "0.7253121", "0.720564", "0.71722883", "0.71388805", "0.7029468", "0.6998004", "0.69702154", "0.6968658", "0.692189", "0.6911407", "0.6861497", "0.68610424", "0.68489814", "0.68306124", "0.68212664", "0.6815459", "0.6813681", "0.6805706", "0.6763681", "0.67576355", "0.6721595", "0.67204213", "0.66990757", "0.66977257", "0.6685677", "0.6665311", "0.66573054", "0.66567475", "0.6656662", "0.6649256", "0.6646801", "0.6645673", "0.6629775", "0.6616676", "0.6613587", "0.66099995", "0.6609106", "0.66039777", "0.6597329", "0.6589973", "0.65858036", "0.6583716", "0.65836596", "0.657863", "0.6570977", "0.6566377", "0.6562083", "0.65582156", "0.6547836", "0.6543798", "0.6540709", "0.65364236", "0.65363646", "0.6524684", "0.6519126", "0.65165424", "0.6513204", "0.6510081", "0.65092194", "0.6508265", "0.6504233", "0.6497629", "0.6497463", "0.64960617", "0.6486516", "0.64794624", "0.6474224", "0.64731437", "0.6470743", "0.64700824", "0.6468598", "0.6465559", "0.64650404", "0.6455461", "0.6452032", "0.64492595", "0.64421487", "0.6437723", "0.6436778", "0.64366686", "0.6432247", "0.6431998", "0.6428057", "0.64265496", "0.6423894", "0.64209276", "0.64195895", "0.6416608", "0.64147085", "0.6413222", "0.641202", "0.6407087", "0.6402448", "0.63981014", "0.6396573", "0.6396027", "0.63886994", "0.63850844" ]
0.0
-1
Determine which player won the game.
function determineWinner () { var winner = ""; // Flag indicating which player won or tie game var intervalID = 0; // Timer interval id. // Determine winner based on each possible combination of choices. switch (v_p1pick) { case "rock": switch (v_p2pick) { case "rock": winner = "tie"; break; case "paper": winner = "p2"; break; case "scissors": winner = "p1"; break; }; // Set the image for Player 1 choice. $("#image1").attr("src","assets/images/rock.jpg") break; case "paper": switch (v_p2pick) { case "rock": winner = "p1"; break; case "paper": winner = "tie"; break; case "scissors": winner = "p2"; break; }; // Set the image for Player 1 choice. $("#image1").attr("src", "assets/images/paper.jpg") break; case "scissors": switch (v_p2pick) { case "rock": winner = "p2"; break; case "paper": winner = "p1"; break; case "scissors": winner = "tie"; break; }; // Set the image for Player 1 choice. $("#image1").attr("src", "assets/images/scissors.jpg") break; }; // Set the image for Player 2 choice. switch (v_p2pick) { case "rock": $("#image2").attr("src", "assets/images/rock.jpg") break; case "paper": $("#image2").attr("src", "assets/images/paper.jpg") break; case "scissors": $("#image2").attr("src", "assets/images/scissors.jpg") break; }; // Update each player's scores according to who won // and update the common message to both players. if (winner === "p1") { v_p1wins = v_p1wins + 1; v_p2losses = v_p2losses + 1; v_message = v_p1name + " wins!!"; } else if (winner === "p2") { v_p2wins = v_p2wins + 1; v_p1losses = v_p1losses + 1; v_message = v_p2name + " wins!!"; } else { v_p1ties = v_p1ties + 1; v_p2ties = v_p2ties + 1; v_message = "Tie Game!!"; }; // Reset the variables with each player's choices. v_p1pick = ""; v_p2pick = ""; updateDatabase(); // Pause for 5 seconds before resetting the game for the next round. intervalID = setTimeout(resetGame, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWin () {\n\t\tif (scores[0] === 10) {\n \t\treturn player1;\n } else if (scores[1] === 10) {\n \t\treturn player2;\n } else {\n \t\treturn null;\n }\n}", "function getWinner(){\n if(player1.score > player2.score){\n winner = \"Player1\"\n } else if(player2.score > player1.score){\n winner = \"Player2\";\n } else {\n winner = \"Draw\"\n }\n return winner;\n }", "function whoWon(){\n if (isGameOver()) {\n if (player1score > player2score) {\n return 1;\n } else if (player2score > player1score) {\n return 2;\n } else if (player1score === player2score) {\n return 3;\n }\n }\n return 0;\n}", "function determinePlayer(player){\n\tif (player == 1){\n\t\treturn playerX\n\t} else {\n\t\treturn playerO\n\t}\n}", "function findWinner(player, computer){\n if(player < computer) return \"win\";\n else if (computer < player) return \"lose\";\n else return \"tie\";\n\n}", "function whichPlayer(player) {\n if (player == 1) {\n return playerOneName;\n } else if (player == 2) {\n return playerTwoName;\n }\n }", "function whoWin(p1, p2) {\n\n // console.log(\"Calculating winers\");\n // console.log(\"Choice 1: \" + p1);\n // console.log(\"Choice 2: \" + p2);\n\n // Probing the choices\n if ((p1 === \"rock\") || (p1 === \"paper\") || (p1 === \"scissors\")) {\n\n if ((p1 === \"rock\" && p2 === \"scissors\") ||\n (p1 === \"scissors\" && p2 === \"paper\") ||\n (p1 === \"paper\" && p2 === \"rock\")) {\n //Player 1 WINS;\n // console.log(\"WINNER: P1\");\n return \"player1\";\n\n } else if (p1 === p2) {\n // It's a tie;\n // console.log(\"its a tie\");\n return \"tie\";\n\n } else {\n //Player 2 WINS;\n // console.log(\"WINNER: P2\");\n return \"player2\";\n }\n }\n }", "function checkWinner() {\n if(playerPosition <= 0) {\n alert('Player 1 Wins!')\n } else if(compPosition <= 0) {\n alert('Computer Wins!')\n }\n }", "function whoWon(){\n\n if ((playerOneChoice === \"Rock\") || (playerOneChoice === \"Paper\") || (playerOneChoice === \"Scissors\")) {\n\n // This logic determines the outcome of the game (win/loss/tie), and increments the appropriate counter.\n if ((playerOneChoice === \"Rock\") && (playerTwoChoice === \"Scissors\")) {\n playerOneWins++;\n playerTwoLosses++;\n $(\"#results\").html(playerOneName + \" wins!\");\n }\n else if ((playerOneChoice === \"Rock\") && (playerTwoChoice === \"Paper\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if ((playerOneChoice === \"Scissors\") && (playerTwoChoice === \"Rock\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if ((playerOneChoice === \"Scissors\") && (playerTwoChoice === \"Paper\")) {\n playerOneWins++;\n playerTwoLosses++;\n }\n else if ((playerOneChoice === \"Paper\") && (playerTwoChoice === \"Rock\")) {\n playerOneWins++;\n playerTwoLosses++;\n }\n else if ((playerOneChoice === \"Paper\") && (playerTwoChoice === \"Scissors\")) {\n playerOneLosses++;\n playerTwoWin++;\n }\n else if (playerOneChoice === playerTwoChoice) {\n ties++;\n }\n }\n\n }", "function getWinner(player, computer) {\n const cases = {\n rock: 'scissors',\n paper: 'rock',\n scissors: 'paper',\n };\n\n if (playerChoice === computerChoice) {\n console.log('TIE');\n\n return 'TIE';\n }\n\n // cases[playerChoice]: find the winning pair for the player's choice\n if (cases[playerChoice] === computerChoice) {\n console.log('PLAYER WINS');\n\n return 'PLAYER WINS';\n }\n\n if (cases[computerChoice] === playerChoice) {\n console.log('COMPUTER WINS');\n\n return 'COMPUTER WINS';\n }\n}", "function whoWon () {\n if (!quiz.isGameOver) {\n return 0\n }\n if (quiz.player1Score > quiz.player2Score) {\n return 1\n } else if (quiz.player1Score < quiz.player2Score) {\n return 2\n } else return 3\n}", "function whoWon () {\n if (!quiz.isGameOver) return 0\n if (quiz.player1Points > quiz.player2Points) return 1\n if (quiz.player1Points < quiz.player2Points) return 2\n return 3\n}", "function getWinner(){\n if(scores.redPieceCount === 0){\n scores.winner = scores.player2;\n message.innerHTML = `Player 2 Wins!!`\n }else if(scores.blackPieceCount === 0){\n scores.winner = scores.player1;\n message.innerHTML = `Player 1 Wins!!`\n }\n}", "function checkForWinner() {\n\n if (playerChoice === puterChoice) {\n result.innerText = \"tie\"\n } else if (playerChoice === \"scissors\" && puterChoice === \"paper\"\n || playerChoice === \"paper\" && puterChoice === \"rock\"\n || playerChoice === \"rock\" && puterChoice === \"scissors\") {\n playerScoreUpdate()\n result.innerText = \"you win\"\n } else {\n result.innerText = \"you lose\"\n puterScoreUpdate\n }\n}", "function findWinner() {\n if (computerScore >= 121) {\n state = \"computerWon\";\n gameSequence();\n return true;\n } else if (playerScore >= 121) {\n state = \"playerWon\";\n gameSequence();\n return true;\n } else {\n return false;\n }\n\n}", "function getOpponent(player) {\n return player === PLAYERS[0] ? PLAYERS[1] : PLAYERS[0];\n}", "function checkWinner(player, computer) {\n if(player === computer) {\n return \"Draw\";\n }\n if (player === \"Rock\") {\n if (computer === \"Paper\") {\n return \"Computer\";\n }else {\n return \"Player\";\n }\n }\n if(player === \"Paper\") {\n if (computer === \"Scissors\") {\n return \"Computer\";\n }else {\n return \"Player\";\n }\n }\n if (player === \"Scissors\") {\n if (computer === \"Rock\") {\n return \"Computer\";\n }else {\n return \"Player\";\n }\n }\n \n}", "function playGame(playerSelection){\n const computerSelection=computerPlay();\n if (playerSelection == computerSelection) {\n return \"It's a tie!\";\n } else if (\n (playerSelection == \"rock\" && computerSelection == \"scissors\") ||\n (playerSelection == \"paper\" && computerSelection == \"rock\") ||\n (playerSelection == \"scissors\" && computerSelection == \"paper\")\n ) {\n playerScore++\n return \"Player 1 wins !\";\n } else if (\n (playerSelection == \"rock\" && computerSelection == \"paper\") ||\n (playerSelection == \"paper\" && computerSelection == \"scissors\") ||\n (playerSelection == \"scissors\" && computerSelection == \"rock\")\n ) {\n computerScore++\n return \"Computer wins!\";\n }\n }", "function checkForWinner() {\n if (state.userScore >= state.firstTo) {\n displayWinner('You are')\n } else if (state.computerScore >= state.firstTo) {\n displayWinner('Computer is')\n }\n}", "function getWinner(playerChoice, computerChoice) {\n\tif (isEqual(playerChoice, computerChoice)) {\n\t\treturn \"It's a tie!\";\n\t} else if (isGreater(playerChoice, computerChoice)) {\n\t\treturn \"You win!\";\n\t}\n\treturn \"I win!\";\n}", "function winner() {\n\tif (playerPoints == 5) {\n\t\tplayerPoints = 0;\n\t\tcomputerPoints = 0;\n\t\treturn \"You won! Let's play again!\";\n\t} else if (computerPoints == 5) {\n\t\tcomputerPoints = 0;\n\t\tplayerPoints = 0;\n\t\treturn \"Game Over! Let's play again!\";\n\t} else {\n\t\treturn \"First to 5 points wins! Let's Go!\";\n\t}\n}", "function __playerWon(player) {\n var playerScores = [], winningPlayer, lostPlayers = [];\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i],\n playerScore = p.getScore();\n\n if (p === player) {\n playerScore++;\n }\n\n playerScores.push(playerScore);\n\n }\n\n //console.log()\n\n //__setGamePauseStatus(true);\n __resetGame(playerScores);\n\n for (var i = 0; i < __players.length; i++) {\n var p = __players[i];\n\n if (player.getName() === p.getName()) {\n winningPlayer = p;\n }\n else {\n lostPlayers.push(p);\n }\n\n p.setScore(playerScores[i]);\n }\n\n __eventCallbacks['gameWin'].call(__game, winningPlayer, lostPlayers);\n\n //__showTitleScreen();\n\n }", "function getWinner(playerChoice, computerChoice) {\n console.log(\"Get winner: player \", playerChoice, \"computer \", computerChoice);\n\n if (playerChoice == computerChoice) {\n //If they chose the same option then it's a draw\n return \"Draw\";\n } else if (playerChoice == \"Rock\" && computerChoice == \"Paper\") {\n // If user chooses Rock & Computer chooses Paper\n return \"computer\"; // Computer wins since Paper covers Rock\n } else if (playerChoice == \"Rock\" && computerChoice == \"Scissors\") {\n // If user chooses Rock & Computer chooses Scissors\n return \"player\"; // Player wins since Rock crushes Scissors\n } else if (playerChoice == \"Rock\" && computerChoice == \"Lizard\") {\n // If user chooses Rock & Computer chooses Lizard\n return \"player\"; // Player wins since Rock crushes Lizard\n } else if (playerChoice == \"Rock\" && computerChoice == \"Spock\") {\n // If user chooses Rock & Computer chooses Spock\n return \"computer\"; // Computer wins since Spock vaporizes Rock\n } else if (playerChoice == \"Paper\" && computerChoice == \"Rock\") {\n // If user chooses Paper & Computer chooses Rock\n return \"player\"; // Player wins since Paper covers Rock\n } else if (playerChoice == \"Paper\" && computerChoice == \"Scissors\") {\n // If user chooses Paper & Computer chooses Scissors\n return \"computer\"; // Computer wins since Scissors cuts Paper\n } else if (playerChoice == \"Paper\" && computerChoice == \"Lizard\") {\n // If user chooses Paper & Computer chooses Lizard\n return \"computer\"; // Computer wins since Lizard eats Paper\n } else if (playerChoice == \"Paper\" && computerChoice == \"Spock\") {\n // If user chooses Paper & Computer chooses Spock\n return \"player\"; // Player wins since Paper disproves Spock\n } else if (playerChoice == \"Scissors\" && computerChoice == \"Rock\") {\n // If user chooses Scissors & Computer chooses Rock\n return \"computer\"; // Computer wins since Rock crushes Scissors\n } else if (playerChoice == \"Scissors\" && computerChoice == \"Paper\") {\n // If user chooses Scissors & Computer chooses Paper\n return \"player\"; // Player wins since Scissors cuts Paper\n } else if (playerChoice == \"Scissors\" && computerChoice == \"Lizard\") {\n // If user chooses Scissors & Computer chooses Lizard\n return \"player\"; // Player wins since Scissors decapitates Lizard\n } else if (playerChoice == \"Scissors\" && computerChoice == \"Spock\") {\n // If user chooses Scissors & Computer chooses Spock\n return \"computer\"; // Computer wins since Spock smashes Scissors\n } else if (playerChoice == \"Lizard\" && computerChoice == \"Rock\") {\n // If user chooses Lizard & Computer chooses Rock\n return \"computer\"; // Computer wins since Rock smashes Lizard\n } else if (playerChoice == \"Lizard\" && computerChoice == \"Paper\") {\n // If user chooses Lizard & Computer chooses Paper\n return \"player\"; // Player wins since Lizard eats Paper\n } else if (playerChoice == \"Lizard\" && computerChoice == \"Scissors\") {\n // If user chooses Lizard & Computer chooses Scissors\n return \"computer\"; // Computer wins since Scissors decapitates Lizard\n } else if (playerChoice == \"Lizard\" && computerChoice == \"Spock\") {\n // If user chooses Lizard & Computer chooses Spock\n return \"player\"; // Player wins since Lizard poisons Spock\n } else if (playerChoice == \"Spock\" && computerChoice == \"Rock\") {\n // If user chooses Spock & Computer chooses Rock\n return \"player\"; // player wins since Spock vaporizes Rock\n } else if (playerChoice == \"Spock\" && computerChoice == \"Paper\") {\n // If user chooses Spock & Computer chooses Paper\n return \"computer\"; // computer wins since Paper disproves Spock\n } else if (playerChoice == \"Spock\" && computerChoice == \"Scissors\") {\n // If user chooses Spock & Computer chooses Scissors\n return \"player\"; // player wins since Spock smashes Scissors\n } else if (playerChoice == \"Spock\" && computerChoice == \"Lizard\") {\n // If user chooses Spock & Computer chooses Lizard\n return \"computer\"; // computer wins since Lizard poisons Spock\n }\n}", "function decideWinner(playerSelection, computerSelection) {\n if (playerSelection == computerSelection) return 0;\n if (\n (playerSelection == \"rock\" && computerSelection == \"scissor\") ||\n (playerSelection == \"paper\" && computerSelection == \"rock\") ||\n (playerSelection == \"scissor\" && computerSelection == \"paper\")\n ) {\n return 1;\n } else {\n return -1;\n }\n}", "function judgeWinner(play1, play2) {\n\n if (play1.name === play2.name ||\n play1.wins.includes(play2.name) && play2.wins.includes(play1.name)) {\n return gameWinner.DRAW;\n }\n\n let winner = play1.wins.includes(play2.name);\n\n if (winner) {\n return gameWinner.PLAYER1;\n } else if (!winner) {\n return gameWinner.PLAYER2;\n }\n\n return winner;\n}", "function getWinner() {\n\n\t\t\t\tif (self.tictactoe.winner == 1) {\t\t\t\t\t\t// if player 1 wins...\n\t\t\t\t\tself.tictactoe.p1score++;\t\t\t\t\t\t\t\t\t// increment score for player 1\n\t\t\t\t\tself.tictactoe.p1wins = true;\t\t\t\t\t\t\t// set p1wins to true to display Player 1 Wins in div with ng-class\n\t\t\t\t\t$timeout(self.clearGrid, 1000);\t\t\t\t\t\t// clear grid after 1 second\n\t\t\t\t}\n\n\t\t\t\telse if (self.tictactoe.winner == 2) {\t\t\t// if player 2 wins...\n\t\t\t\t\tself.tictactoe.p2score++;\t\t\t\t\t\t\t\t\t// increment score for player 2\n\t\t\t\t\tself.tictactoe.p2wins = true;\t\t\t\t\t\t\t// set p2wins to true to display Player 2 Wins in div with ng-class\n\t\t\t\t\t$timeout(self.clearGrid, 1000);\t\t\t\t\t\t// clear grid after 1 second\n\t\t\t\t}\n\n\t\t\t\telse if (self.tictactoe.winner === false && self.tictactoe.gridSize == 9 && self.tictactoe.counter == 9) {\n\t\t\t\t\tself.tictactoe.tie = true;\n\t\t\t\t\t$timeout(self.clearGrid, 1000);\n\t\t\t\t}\n\t\t\t\telse if (self.tictactoe.winner === false && self.tictactoe.gridSize == 16 && self.tictactoe.counter == 16) {\n\t\t\t\t\tself.tictactoe.tie = true;\n\t\t\t\t\t$timeout(self.clearGrid, 1000);\n\t\t\t\t}\n\t\t\t\telse if (self.tictactoe.winner === false && self.tictactoe.gridSize == 25 && self.tictactoe.counter == 25) {\n\t\t\t\t\tself.tictactoe.tie = true;\n\t\t\t\t\t$timeout(self.clearGrid, 1000);\n\t\t\t\t}\n\t\t\t\tself.tictactoe.$save();\n\t\t\t}", "function winning(player){\n\treturn (\n\t\t(board[0] == player && board[1] == player && board[2] == player) ||\n\t\t(board[3] == player && board[4] == player && board[5] == player) ||\n\t\t(board[6] == player && board[7] == player && board[8] == player) ||\n\t\t(board[0] == player && board[3] == player && board[6] == player) ||\n\t\t(board[1] == player && board[4] == player && board[7] == player) ||\n\t\t(board[2] == player && board[5] == player && board[8] == player) ||\n\t\t(board[0] == player && board[4] == player && board[8] == player) ||\n\t\t(board[2] == player && board[4] == player && board[6] == player)\n\t)\n\t\t\n}", "function checkWinner(playerSelection, computerSelection) {\n if (playerSelection !== computerSelection) {\n for (i = 0; i < rules.length; i++) {\n // check which rule contains both player hand and computer hand\n if (rules[i].toLowerCase().indexOf(playerSelection) >= 0 && rules[i].toLowerCase().indexOf(computerSelection) >= 0) {\n // when rule begins with player hand then player wins\n if (rules[i].toLowerCase().indexOf(playerSelection) === 0) {\n afterTurnMessage.innerHTML = `Player wins! ${rules[i]}`;\n previousWinner = \"player\";\n previousPlayerSelection = playerSelection;\n incrementPlayerScore();\n } else { // when rule doesn't begin with player hand then computer wins\n afterTurnMessage.innerHTML = `Computer wins! ${rules[i]}`;\n previousWinner = \"computer\";\n previousComputerSelection = computerSelection;\n incrementComputerScore();\n }\n }\n }\n } else { // if player and computer have the same hand\n afterTurnMessage.innerHTML= \"It's a draw!\";\n previousWinner = \"draw\";\n }\n}", "function didSomeoneWin() {\n if (playerScore === 5 || computerScore === 5) {\n gameOverMan();\n }\n}", "displayWinner() {\n var winningPiece = game.isXTurn ? 'x' : 'o'\n if(game.singleplayer || game.vsAi)\n game.winner = winningPiece\n else\n {\n if(game.player === winningPiece)\n game.winner = game.username\n else\n game.winner = game.opponent\n }\n\n\n game.saveBoard()\n\n game.state.start('win')\n }", "function getWinner(player, computer){\n\t\n\t//tie case\n\tif(player === computer){\n\t\treturn \"tie\";\n\t}\n\n\t//player win conditions\n\tif((player === \"rock\" && computer === \"scissors\")\n\t\t|| (player === \"paper\" && computer === \"rock\")\n\t\t\t|| (player === \"scissors\" && computer === \"paper\")){\n\t\tplayerScore++;\n\t\treturn \"player\";\n\t}\n\n\t//computer win conditions\n\tif((computer === \"rock\" && player === \"scissors\")\n\t\t|| (computer === \"paper\" && player === \"rock\")\n\t\t\t|| (computer === \"scissors\" && player === \"paper\")){\n\t\tcomputerScore++;\n\t\treturn \"computer\";\n\t}\n}", "function getWinner() {\n \n // var token = [\"x\", \"o\"];\n // for (var i = 0; i < tokens.length; i++)\n // var t = tokens[i];\n // var winner_found = false\n // if \n\n // if(t == \"x\") {\n // // player 1 wins, increase p1 score, return\n // } else {\n // //player 2 wins, increase p2 score, return\n // }\n\n // checks for x win\n if (\n ((self.gameBoard.boxes[0].isX) \n && (self.gameBoard.boxes[1].isX) \n && (self.gameBoard.boxes[2].isX)) \n || ((self.gameBoard.boxes[3].isX) \n && (self.gameBoard.boxes[4].isX) \n && (self.gameBoard.boxes[5].isX)) \n || ((self.gameBoard.boxes[6].isX)\n && (self.gameBoard.boxes[7].isX) \n && (self.gameBoard.boxes[8].isX)) \n || ((self.gameBoard.boxes[0].isX) \n && (self.gameBoard.boxes[3].isX) \n && (self.gameBoard.boxes[6].isX)) \n || ((self.gameBoard.boxes[1].isX) \n && (self.gameBoard.boxes[4].isX) \n && (self.gameBoard.boxes[7].isX)) \n || ((self.gameBoard.boxes[2].isX) \n && (self.gameBoard.boxes[5].isX) \n && (self.gameBoard.boxes[8].isX)) \n || ((self.gameBoard.boxes[0].isX) \n && (self.gameBoard.boxes[4].isX) \n && (self.gameBoard.boxes[8].isX)) \n || ((self.gameBoard.boxes[2].isX) \n && (self.gameBoard.boxes[4].isX) \n && (self.gameBoard.boxes[6].isX))\n ){\n /*\n changes gameStatus & p1 score if x has won\n stops looking for a win or tie\n */\n self.gameBoard.gameStatus = self.gameBoard.player1.myName + \" wins!\";\n self.gameBoard.p1++;\n self.gameBoard.$save(self.gameBoard.p1);\n return;\n }\n \n // checks for o win\n if (\n ((self.gameBoard.boxes[0].isO) \n && (self.gameBoard.boxes[1].isO) \n && (self.gameBoard.boxes[2].isO)) \n || ((self.gameBoard.boxes[3].isO) \n && (self.gameBoard.boxes[4].isO) \n && (self.gameBoard.boxes[5].isO)) \n || ((self.gameBoard.boxes[6].isO) \n && (self.gameBoard.boxes[7].isO) \n && (self.gameBoard.boxes[8].isO)) \n || ((self.gameBoard.boxes[0].isO) \n && (self.gameBoard.boxes[3].isO) \n && (self.gameBoard.boxes[6].isO)) \n || ((self.gameBoard.boxes[1].isO) \n && (self.gameBoard.boxes[4].isO) \n && (self.gameBoard.boxes[7].isO)) \n || ((self.gameBoard.boxes[2].isO) \n && (self.gameBoard.boxes[5].isO) \n && (self.gameBoard.boxes[8].isO)) \n || ((self.gameBoard.boxes[0].isO) \n && (self.gameBoard.boxes[4].isO) \n && (self.gameBoard.boxes[8].isO)) \n || ((self.gameBoard.boxes[2].isO) \n && (self.gameBoard.boxes[4].isO) \n && (self.gameBoard.boxes[6].isO))\n ){\n /*\n changes gameStatus & p2 score if o has won\n stops looking for a win or tie\n */\n self.gameBoard.gameStatus = self.gameBoard.player2.myName + \" wins!\";\n self.gameBoard.p2++;\n self.gameBoard.$save(self.gameBoard.p2);\n return;\n }\n \n // checks for tie\n var cellEmpty = false;\n for (var i = 0; i < self.gameBoard.boxes.length; i++) {\n if ((self.gameBoard.boxes[i].isX === false) \n && (self.gameBoard.boxes[i].isO === false)) {\n cellEmpty = true;\n }\n }\n if (cellEmpty === false) {\n /*\n changes gameStatus & tie count if it is a tie\n */\n self.gameBoard.gameStatus = \"It's a tie!\"\n self.gameBoard.$save(self.gameBoard.gameStatus);\n self.gameBoard.tie++;\n self.gameBoard.$save(self.gameBoard.tie);\n }\n \n }", "function getOpponent(player) {\n \"use strict\";\n\tif (player === 'X') {\n\t\treturn 'O';\n\t} else if (player === 'O') {\n\t\treturn 'X';\n\t}\n}", "#determineIfGameOver() {\n const p1victory = this.players[1].gameboard.allShipsSunk();\n const p2victory = this.players[0].gameboard.allShipsSunk();\n \n if (p1victory) {\n this.#page.setDialog(GAME_STATE.p1victory);\n this.#isWinnerP1 = true;\n } else if (p2victory) {\n this.#page.setDialog(GAME_STATE.p2victory);\n this.#isWinnerP1 = false;\n }\n\n if (p1victory || p2victory) {\n this.#gameOver = true;\n this.#endGame();\n }\n }", "function getScoreToWin()\r\n{\r\n\tscoreToWin = -10;\r\n\tfor(var i = 0; i < worms.length; i++)\r\n\t{\r\n\t\tif(players[i])\r\n\t\t\tscoreToWin+=10;\r\n\t}\r\n}", "function whoWon(playerWins, computerWins) {\n if (playerWins == computerWins) {\n console.log(\"It's a draw!\");\n } else if (playerWins > computerWins) {\n console.log(\"You beat the computer!\");\n } else {\n console.log(\"You got beat by the computer!\");\n }\n}", "function whoWon(){\n\tif(gameOver() == true){\n\t\tmodal.style.display = \"block\";\n\t\t$(\".modalContent\").removeClass(\"closeModal\");\n\t\t$(\".modalContent\").addClass(\"openModal\");\n\n\t\tif(playerScores[0] > playerScores[1]){\n\t\t\t$(\".modalBody\").empty().append(\"Player 1 has won!\");\n\t\t\t// $(\".modalBody\").append(\"Player 1 has won!\");\n\t\t} \n\n\t\telse if(playerScores[1] > playerScores[0]){\n\t\t\t$(\".modalBody\").empty().append(\"Player 2 has won!\");\n\t\t\t// $(\".modalBody\").append(\"Player 2 has won!\");\n\t\t} \n\n\t\telse{\n\t\t\t$(\".modalBody\").empty().append(\"It's a draw...\");\n\t\t\t// $(\".modalBody\").append(\"It's a draw...\");\n\t\t}\n\t}\n}", "function playGame(){\n const userChoice = getUserChoice('paper');\n const computerChoice = getComputerChoice();\n console.log('You selected: ' + userChoice);\n console.log('The computer selected: ' + computerChoice);\n \n console.log(determineWinner(userChoice, computerChoice));\n }", "function getGameWinner(callback) {\n var winner;\n for (var i = 0; i < tictactoe.win_combos.length; i++) {\n if (isWin(i, tictactoe.first_player)) {\n winner = tictactoe.first_player;\n }\n if (isWin(i, tictactoe.second_player)) {\n winner = tictactoe.second_player;\n }\n }\n callback(winner);\n }", "function win1(val){ return setPlayer1.indexOf(val) >= 0; }", "function result() {\n if (\n (playerHand === 'ROCK' && opponentHand === 'SCISSOR') || \n (playerHand === 'PAPER' && opponentHand === 'ROCK') || \n (playerHand === 'SCISSOR' && opponentHand === 'PAPER') \n ) {\n return 'WIN';\n } else if (\n (playerHand === 'ROCK' && opponentHand === 'ROCK') || \n (playerHand === 'PAPER' && opponentHand === 'PAPER') || \n (playerHand === 'SCISSOR' && opponentHand === 'SCISSOR') \n ) {\n return 'DRAW';\n } else {\n return 'LOSE';\n }\n}", "getGameWinner() {\n\t\treturn this.stage.getWinner();\n\t}", "function CheckForWinner(game) {\n // Check for horizontal wins\n for (i = 0; i <= 6; i += 3) {\n if (game[i] === HUMAN_PLAYER && game[i + 1] === HUMAN_PLAYER && game[i + 2] === HUMAN_PLAYER)\n return 2;\n if (game[i] === COMPUTER_PLAYER && game[i + 1] === COMPUTER_PLAYER && game[i + 2] === COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for vertical wins\n for (i = 0; i <= 2; i++) {\n if (game[i] === HUMAN_PLAYER && game[i + 3] === HUMAN_PLAYER && game[i + 6] === HUMAN_PLAYER)\n return 2;\n if (game[i] === COMPUTER_PLAYER && game[i + 3] === COMPUTER_PLAYER && game[i + 6] === COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if (CheckDiagonalWin(HUMAN_PLAYER, game))\n return 2;\n\n if (CheckDiagonalWin(COMPUTER_PLAYER, game))\n return 3;\n\n // Check for tie\n for (i = 0; i < BOARD_SIZE; i++) {\n if (game[i] !== HUMAN_PLAYER && game[i] !== COMPUTER_PLAYER)\n return 0;\n }\n return 1;\n}", "function whoWins(playerOne, playerTwo)\n{\t\n\tif (playerOne === \"rock\" && playerTwo === \"scissor\") \n\t{\n\t alert(\"player One Wins!\");\n\t} \n\telse if (playerOne === \"rock\" && playerTwo === \"paper\")\n\t{\n\t alert(\"player two Wins!\");\n\t} \n\telse if (playerOne === \"scissor\" && playerTwo === \"rock\")\n\t{\n\t alert(\"player two Wins!\");\n\t} \n\telse if (playerOne === \"scissor\" && playerTwo === \"paper\")\n\t{\n\t alert(\"player One Wins!\");\n\t} \n\telse if (playerOne === \"paper\" && playerTwo === \"scissor\")\n\t{\n\t alert(\"player two Wins!\");\n\t} \n\telse if (playerOne === \"paper\" && playerTwo === \"rock\")\n\t{\n\t\talert(\"player One Wins!\");\n\t}\n\telse if (playerOne === playerTwo) \n\t{\n\t alert(\"its a tie\");\n\t}\n}", "function getWinner(playerMove,computerMove) {\n var winner;\n if (playerMove == \"rock\" && computerMove == \"rock\") {\n winner = \"tie\";\n } else if (playerMove == \"rock\" && computerMove == \"paper\") {\n winner = \"computer\";\n } else if (playerMove == \"rock\" && computerMove == \"scissors\") {\n winner = \"player\";\n } else if (playerMove == \"paper\" && computerMove == \"rock\") {\n winner = \"player\";\n } else if (playerMove == \"paper\" && computerMove == \"paper\") {\n winner = \"tie\";\n } else if (playerMove == \"paper\" && computerMove == \"scissors\") {\n winner = \"computer\";\n } else if (playerMove == \"scissors\" && computerMove == \"rock\") {\n winner = \"computer\";\n } else if (playerMove == \"scissors\" && computerMove == \"paper\") {\n winner = \"player\";\n } else if (playerMove == \"scissors\" && computerMove == \"scissors\") {\n winner = \"tie\";\n } else {\n console.log(\"Try again! Pick either rock, paper, or scissors.\");\n }\n return winner;\n}", "winnerIs(state){\n return state.players[0]['isXWin'] ? state.players[0]['playerX'] : state.players[0]['playerO']\n }", "function chooseWinner(user, computer) {\n if (user === computer) {\n return \"draw\";\n } else if (\n (user === \"paper\" && computer === \"rock\") ||\n (user === \"scissors\" && computer === \"paper\") ||\n (user === \"rock\" && computer === \"scissors\")\n ) {\n return \"win\";\n } else {\n return \"loose\";\n }\n}", "function winnerCheck(){\n console.log(\"in winnerCheck function\");\n\n var result = \"no winner yet\";\n\n\n if (players[0].health < 1 && players[1].health < 1) {\n result=\"Draw\";\n } else if (players[0].health < 1) {\n result = players[1].name + \" Wins!!!\";\n } else if (players[1].health < 1) {\n result = players[0].name + \" Wins!!!\";\n }\n\n return result;\n }", "function getWinner (playerMove, computerMove){\n\tif (playerMove === computerMove) { //if statements\n \twinner = \"tie\";\n } else if (playerMove === \"rock\" && computerMove === \"scissors\") {\n \twinner = \"player\";\n } else if (playerMove === \"paper\" && computerMove === \"rock\") {\n \twinner = \"player\";\n } else if (playerMove === \"scissors\" && computerMove === \"paper\") { \n \twinner = \"player\";\n } else {\n \twinner = \"computer\";\n }\n return winner; //stops function and returns value of winner\n\t}", "function checkWon() {\n isPlayerWon = playerGuess.value.toUpperCase() === computerBase;\n isComputerWon = computerGuess.value === playerBase;\n}", "function checkWin() {\n if ((userGuess === \"r\") && (opponentGuess === \"s\")) {\n wins++;\n } else if ((userGuess === \"r\") && (opponentGuess === \"p\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"r\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"p\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"r\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"s\")) {\n losses++;\n } else if (userGuess === opponentGuess) {\n ties++;\n }\n}", "function checkWin(a, b) {\n const total = 1 + checkDirection(a) + checkDirection(b);\n if (total >= 4 && total < 5) {\n return that.currentPlayer;\n } else {\n return null;\n }\n }", "function win2(val) { return setPlayer2.indexOf(val) >= 0; }", "function checkWin(board, player) {\r\n let plays = board.reduce((a, e, i) => (e === player) ? a.concat(i) : a, []);\r\n let gameWon = null;\r\n for (let [index, win] of winCombos.entries()) {\r\n if (win.every(elem => plays.indexOf(elem) > -1)) {\r\n gameWon = {index: index, player: player};\r\n break;\r\n }\r\n }\r\n return gameWon;\r\n}", "function checkWinner(result){\n result.match('xxx') ? gameOver('Player 1') : result.match('ooo') ? gameOver('Player 2') : null;\n}", "function determineWinner(userChoice, computerChoice){\n if(userChoice === computerChoice){\n return \"tie!\";\n };\n if(userChoice === \"rock\"){\n if(computerChoice === \"paper\"){\n return \"computer won!!!\";\n } else {\n return \"You won!\";\n }\n }\n if(userChoice === \"paper\"){\n if(computerChoice === \"scissors\"){\n return \"computer won!\";\n } else {\n return \"you suck lmao\";\n }\n }\n if(userChoice === \"scissors\"){\n if(computerChoice === \"rock\"){\n return \"computer won a!\"\n } else {\n return \"yes u won!\"\n }\n }\n if(userChoice === \"bomb\"){\n return \"holy shit stop cheating!\";\n }\n }", "function playGame() {\n const userChoice = getUserChoice('paper');\n const computerChoice = getComputerChoice();\n console.log(`You: ${userChoice}\nComputer: ${computerChoice}`)\n console.log(determineWinner(userChoice, computerChoice));\n}", "opponent() {\n return this.players[1 - this.turn]\n }", "function whoWonRound() {\n // USER CHOOSE ROCK\n if (userMove === 0 && botRandom === 2) {\n return \"ROCK beats SCISSORS\"\n } else if (userMove === 0 && botRandom === 1) {\n // OR\n return \"PAPER beats ROCK\"\n } else if (userMove === botRandom) {\n return \"TIE GAME !\"\n }\n // USER CHOOSE PAPER\n if (userMove === 1 && botRandom === 0) {\n return \"PAPER beats ROCK\"\n } else if (userMove === 1 && botRandom === 2) {\n return \"SCISSORS beats PAPER\"\n } else if (userMove === botRandom) {\n return \"TIE GAME !\"\n }\n // USER CHOOSE SCISSORS\n if (userMove === 2 && botRandom === 1) {\n return \"SCISSORS beats PAPER\"\n } else if (userMove === 2 && botRandom === 0) {\n return \"ROCK beats SCISSORS\"\n } else if (userMove === botRandom) {\n return \"TIE GAME !\"\n }\n}", "function winnerCheck(){\n \n //default result is no winner\n var result = \"no winner\";\n \n //if both players health becomes 0 or less there is a TIE\n if (playerOneHealth < 1 && playerTwoHealth <1 ){\n result = \"You Both Die\";\n \n //if one player's health reaches 0 or less they are the LOSER \n }else if(playerOneHealth<1){\n result = playerTwoName + \" WINS!!!\"\n }else if(playerTwoHealth<1){\n result = playerOneName + \" WINS!!!\"\n };\n \n //returns results to fight function\n return result;\n}", "GetWinner()\n\t{\n\t\tlet GameFinished = false;\n\t\n\t\t//\thave we done the max words?\n\t\tconst WordsFoundCount = Object.keys(this.State.FoundWords).length;\n\t\tif ( WordsFoundCount >= this.Rules.GameEndWordCount )\n\t\t\tGameFinished = true;\n\t\t\t\n\t\t//\tcount scores\n\t\tconst Scores = this.GetPlayerScores();\n\t\tlet PublicMineCount = 0;\n\t\tlet BestScore = 0;\n\t\tlet BestPlayers = [];\n\t\tfor ( let [Player,Score] of Object.entries(Scores) )\n\t\t{\n\t\t\tPublicMineCount += Score;\n\t\t\tif ( Score > BestScore )\n\t\t\t{\n\t\t\t\tBestPlayers = [Player];\n\t\t\t\tBestScore = Score;\n\t\t\t}\n\t\t\telse if ( Score == BestScore )\n\t\t\t{\n\t\t\t\tBestPlayers.push(Player);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( BestScore >= this.Rules.GameEndPointCount )\n\t\t\tGameFinished = true;\n\t\t\n\t\tif ( !GameFinished )\n\t\t\treturn false;\n\t\t\t\n\t\treturn BestPlayers;\n\t}", "function isWinner(selection, opponentSelection) {\r\n return (selection.beats === opponentSelection.name)\r\n}", "function computeWinner(){\n let winner;\n\n if(P1.score <= 21){\n if(P1.score > P2.score || P2.score>21){\n blackjackGame.win++;\n winner = P1;\n }else if(P1.score < P2.score){\n blackjackGame.loss++;\n winner = P2;\n }else if(P1.score === P2.score){\n blackjackGame.draw++;\n }\n }else if(P1.score > 21 && P2.score <=21){\n blackjackGame.loss++;\n winner = P2;\n }else if(P1.score > 21 && P2.score > 21){\n blackjackGame.draw++;\n }\n return winner;\n}", "function checkForWinner (playerScore) {\n\n\twinningCombos.forEach((combo) => {\n\t\tlet score = 0;\n\n\t\tcombo.forEach((num) => {\n\t\t\tif (playerScore.includes(num)) {\n\t\t\t\tscore++\n\n\t\t\t}\n\t\t})\n\n\t\tif(score >= 3 && playerScore === orangeScore) {\n\t\t\tplayer1.hasWon = true;\n\t\t\tendGame();\n\n\t\t} else if (score >= 3 && playerScore === blueScore) {\n\t\t\tplayer2.hasWon = true;\n\t\t\tendGame();\n\t\t } \n\t})\n}", "function checkWinner(user, computer) {\n gamePlayed++;\n var verdict;\n\n if (user == computer) {\n gameDraw++;\n verdict = 'draw';\n }\n if (\n user == \"paper\" && computer == \"rock\" ||\n user == \"rock\" && computer == \"scissors\" ||\n user == \"scissors\" && computerPlay == \"paper\"\n ) {\n gameWon++;\n verdict = 'win';\n }\n if (\n computer == \"paper\" && user == \"rock\" ||\n computer == \"rock\" && user == \"scissors\" ||\n computer == \"scissors\" && user == \"paper\"\n ) {\n gameLost++;\n verdict = 'lose';\n }\n\n updateScoreDisplay(gameDraw, gameWon, gameLost, gamePlayed);\n $(\"#game-result\").html(\"You \" + verdict + \"!\").hide().fadeIn(3000);\n}", "function decideWinner() {\n\tgameOver = true;\n\tcardOpacity();\n\tif (player1.score > 21 && player2.score > 21) {\n\t\ttextTitle.textContent = \"No one won!\";\n\t\tdrawSound.play();\n\t\tplayer1.draws++;\n\t\tplayer2.draws++;\n\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t} else if (player1.score > 21) {\n\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\tlossSound.play();\n\t\tplayer2.wins++;\n\t\tplayer1.losses++;\n\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t} else if (player2.score > 21) {\n\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\twinSound.play();\n\t\tplayer1.wins++;\n\t\tplayer2.losses++;\n\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t} else {\n\t\tconst player1Complement = 21 - player1.score;\n\t\tconst player2Complement = 21 - player2.score;\n\t\tif (player1Complement < player2Complement) {\n\t\t\ttextTitle.textContent = \"Player 1 won!\";\n\t\t\twinSound.play();\n\t\t\tplayer1.wins++;\n\t\t\tplayer2.losses++;\n\t\t\tdocument.querySelector(\".player1-wins\").textContent = player1.wins;\n\t\t\tdocument.querySelector(\".player2-losses\").textContent = player2.losses;\n\t\t} else if (player2Complement < player1Complement) {\n\t\t\ttextTitle.textContent = \"Player 2 won!\";\n\t\t\tlossSound.play();\n\t\t\tplayer2.wins++;\n\t\t\tplayer1.losses++;\n\t\t\tdocument.querySelector(\".player1-losses\").textContent = player1.losses;\n\t\t\tdocument.querySelector(\".player2-wins\").textContent = player2.wins;\n\t\t} else {\n\t\t\ttextTitle.textContent = \"Draw\";\n\t\t\tdrawSound.play();\n\t\t\tplayer1.draws++;\n\t\t\tplayer2.draws++;\n\t\t\tdocument.querySelector(\".player1-draws\").textContent = player1.draws;\n\t\t\tdocument.querySelector(\".player2-draws\").textContent = player2.draws;\n\t\t}\n\t}\n}", "function findWinner(thePlayer){\n\tvar winner = '';\t\n\tconsole.log(' findWinner board: ', board);\n\tif(returnTheWinner(thePlayer, board[0], board[1], board[2])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[3], board[4], board[5])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[6], board[7], board[8])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[0], board[4], board[8])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[2], board[4], board[6])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[0], board[3], board[6])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[1], board[4], board[7])){\n\t\twinner = turn;\n\t}\n\tif(returnTheWinner(thePlayer, board[2], board[5], board[8])){\n\t\twinner = turn;\n\t}\n\t\n\tif(winner != ''){\n\t\tendGame(winner);\t\t\t\n\t}\n\telse if(count == 9){\n\t\tResult.render('tie','Tie!' );\n\t\t//disableAll();\t\n\t}\n\telse{ changeTurn();}\n}//end function", "function getWinner(dealer, player){\n var outcumte = compareScores(dealer, player);\n declareOutcome(dealer, player, outcome);\n }", "function winner() {\n let p1Count = 0;\n let p2Count = 0;\n let retVal = false;\n\n for (y = 0; y < 8; y++)\n for (x = 0; x < 8; x++) {\n if (board[y][x] == PLAYER1)\n p1Count++;\n if (board[y][x] == PLAYER2)\n p2Count++;\n }\n\n DK_SCORE.value = p1Count;\n LT_SCORE.value = p2Count;\n\n if (boxesTaken > 63) {\n if (p1Count > p2Count)\n PopUpMessage(\"Dark Player won\");\n if (p1Count < p2Count)\n PopUpMessage(\"Light Player won\");\n if (p1Count == p2Count)\n PopUpMessage(\"It's a tie!\");\n retVal = true;\n }\n\n return retVal;\n}", "function checkWin(){\n\t//ROW WIN CONDITIONS\nif (oneV === twoV && twoV === threeV && oneV === threeV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\tconsole.log(whoPlayerTemp);\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (fourV === fiveV && fourV === sixV && fiveV === sixV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (sevenV === eightV && sevenV === nineV && eightV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//COLUMN WIN CONDITIONS\n\t} else if (oneV === fourV && oneV === sevenV && fourV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (twoV === fiveV && twoV === eightV && fiveV === eightV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === sixV && threeV === nineV && sixV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//CROSS WIN CONDITIONS\n\t} else if (oneV === fiveV && oneV === nineV && fiveV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === fiveV && threeV === sevenV && fiveV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t}\n\t$('#p2Score').text(playerTwoWins);\n\t$('#p1Score').text(playerOneWins);\n\t// checkTie();\n\tbestOfFiveWinner();\n}", "function playRound(playerSelection, computerSelection) {\r\n let gameDatabase = {\r\n rock: {win: \"scissors\", lose: \"paper\"},\r\n paper: {win: \"rock\", lose: \"scissors\"},\r\n scissors: {win: \"paper\", lose: \"rock\"}\r\n };\r\n\r\n if (gameDatabase[playerSelection].win == computerSelection) {\r\n return 1; \r\n }\r\n else if (gameDatabase[playerSelection].lose == computerSelection) {\r\n return -1; \r\n }\r\n else {\r\n return 0;\r\n }\r\n}", "function winnerCheck() {\n \n\t //result is defaulted to \"no winner\"\n var result = \"no winner\";\n \n //if both players' healths are less than 1 or equal to 0 or less, then both players die at the end of the round.\n if (fighters[0].health < 1 && fighters[1].health < 1) {\n result = \"Both Fighters Die!\";\n \n\t\t//otherwise if player 1's health is less than 1 or equal to 0 or less, then player 2 is declared the winner of the fight.\n } else if (fighters[0].health < 1) {\n result = fighters[1].name + \" WINS!!!\";\n \n\t\t//otherwise if player 2's health is less than 1 or equal to 0 or less, then player 1 is declared the winner of the fight.\n } else if (fighters[1].health < 1) {\n result = fighters[0].name + \" WINS!!!\";\n }\n\t\t//return the value of the result variable outside of the function.\n return result;\n }", "function determineWinner(computerOption, playerOption) {\n\n computerOption = computerImage.alt;\n playerOption = playerImage.alt;\n\n if (computerOption === playerOption) {\n return 'It is a tie!';\n\n } else if (computerOption !== playerOption) {\n if (computerOption === options[0] && playerOption === options[2] ||\n computerOption === options[0] && playerOption === options[3] ||\n computerOption === options[2] && playerOption === options[1] ||\n computerOption === options[2] && playerOption === options[3] ||\n computerOption === options[4] && playerOption === options[0] ||\n computerOption === options[4] && playerOption === options[2] ||\n computerOption === options[1] && playerOption === options[0] ||\n computerOption === options[1] && playerOption === options[4] ||\n computerOption === options[3] && playerOption === options[1] ||\n computerOption === options[3] && playerOption === options[4]) {\n return 'Computer wins!';\n\n } else {\n return 'You win!';\n }\n }\n}", "function checkWin(board,player){\n let gameWon=null;\n if(isChallenge){\n for(var i in toWinList4){\n if(boardList[toWinList4[i][0]]==player&&boardList[toWinList4[i][1]]==player&&boardList[toWinList4[i][2]]==player&&boardList[toWinList4[i][3]]==player){\n gameWon={player:player,winCells:toWinList4[i]}\n }\n }}else{\n for(var i in toWinList3){\n if(boardList[toWinList3[i][0]]==player&&boardList[toWinList3[i][1]]==player&&boardList[toWinList3[i][2]]==player){\n gameWon={player:player,winCells:toWinList3[i]}\n }\n }\n }\n return gameWon;\n}", "function decideWinner() {\n let winner;\n if (YOU.score <= 21) {\n if (YOU.score > DEALER.score || (DEALER.score > 21)) {\n console.log('you win');\n winner = YOU;\n BlackJack['win']++;\n\n } else if (YOU.score < DEALER.score) {\n console.log('you lost');\n winner = DEALER;\n BlackJack['loss']++;\n\n } else if (YOU.score === DEALER.score) {\n console.log('you drew!');\n BlackJack['draw']++;\n\n }\n\n } else if (YOU.score > 21 && (DEALER.score <= 21)) {\n console.log('you lost!');\n winner = DEALER;\n BlackJack['loss']++;\n\n\n } else if (YOU.score > 21 && (DEALER.score > 21)) {\n console.log('you drew!');\n BlackJack['draw']++;\n\n }\n console.log('winner is :', winner);\n return winner;\n}", "currentPlayerWon() {\n let winStr = this.currentPlayer.sym.repeat(3);\n let winMove = winningMoves.findIndex((_,j) => getWinningMoveStrings(j) === winStr);\n\n if (winMove !== -1) {\n highlightWinningMove(winMove);\n return true;\n } else {\n return false; \n }\n }", "function winnerCheck(){\r\n var result=\"no winner\";\r\n if (playerOne[2]<1 && playerTwo[2]<1)\r\n {\r\n result = \"You Both Die\";\r\n } else if(playerOne[2]<1){\r\n result =playerTwo[0]+\" WINS!!!\"\r\n } else if (playerTwo[2]<1)\r\n {\r\n result = playerOne[0]+\" WINS!!!\"\r\n };\r\n return result;\r\n }", "function game() {\n let playerPoints = 0;\n let computerPoints = 0;\n\n for (let i = 0; i < 5; i++) {\n let result = playRound(userPlay(), computerPlay());\n\n // display the value returned on who won\n console.log(result);\n\n // tally up the points\n if (result.slice(0, 6) === 'Player') {\n playerPoints++;\n } else if (result.slice(0, 8) === 'Computer') {\n computerPoints++;\n }\n }\n // choose the final winner based on who won the most rounds (or tie if they have the same wins)\n if (playerPoints > computerPoints) {\n return 'Player has won the game!';\n } else if (playerPoints < computerPoints) {\n return 'Computer has won the game!';\n } else {\n return 'Tie game!';\n }\n}", "getWinner() {\n // le gagnant est le dernier joueur à avoir joué\n return this.getCurrentPlayer();\n }", "gameOver() {\n if (playerScore === winningScore || computerScore === winningScore) {\n isGameOver = true;\n // Set Winner\n let winner = playerScore === winningScore ? 'Player' : 'Computer';\n this._showGameOverEl(winner);\n }\n }", "function didYouWin() {\n if (cells[0].textContent == player && cells[1].textContent == player && cells[2].textContent == player) {\n declareWinner(player);\n } else if (cells[3].textContent == player && cells[4].textContent == player && cells[5].textContent == player) {\n declareWinner(player);\n } else if (cells[6].textContent == player && cells[7].textContent == player && cells[8].textContent == player) {\n declareWinner(player);\n } else if (cells[0].textContent == player && cells[3].textContent == player && cells[6].textContent == player) {\n declareWinner(player);\n } else if (cells[1].textContent == player && cells[4].textContent == player && cells[7].textContent == player) {\n declareWinner(player);\n } else if (cells[2].textContent == player && cells[5].textContent == player && cells[8].textContent == player) {\n declareWinner(player);\n } else if (cells[0].textContent == player && cells[4].textContent == player && cells[8].textContent == player) {\n declareWinner(player);\n } else if (cells[2].textContent == player && cells[4].textContent == player && cells[6].textContent == player) {\n declareWinner(player);\n } else {\n // If no one wins the game on this move, check for a tie --\n tieGame();\n }\n}", "function determineOutcome(playerSelections) {\n let userSelection = playerSelections.user;\n let opponentSelection = playerSelections.opponent;\n if (userSelection == opponentSelection) {\n return \"tie\";\n } else if (userSelection == \"rock\") {\n if (opponentSelection == \"scissors\") {\n return \"win\";\n } else {\n return \"lose\";\n }\n } else if (userSelection == \"paper\") {\n if (opponentSelection == \"rock\") {\n return \"win\";\n } else {\n return \"lose\";\n }\n } else if (userSelection == \"scissors\") {\n if (opponentSelection == \"paper\") {\n return \"win\";\n } else {\n return \"lose\";\n }\n }\n }", "function winning(board, player) {\n if(\n (board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)\n ) {\n return true;\n } else {\n return false;\n }\n }", "function getWinner(player1Card, player2Card) {\n if(player1Card > player2Card) {\n player1.score += 1;\n return player1\n } else if (player1Card < player2Card) {\n player2.score += 1;\n return player2\n } else {\n return 0\n }\n}", "function getOutcome(player, com) {\n switch (true) {\n case player === com: \n return 0;\n break;\n case player === \"paper\" && com === \"rock\":\n return 1;\n break;\n case player === \"rock\" && com === \"scissors\":\n return 1;\n break;\n case player === \"scissors\" && com === \"paper\":\n return 1;\n break;\n default:\n // in all other cases, we lose :(\n return 2;\n }\n}", "function checkForWin(player) {\n if (player === 'Player 1') {\n var board = p1board;\n if (board[0] === 'x' && board[1] === 'x' && board[2] === 'x') {\n alert(`${player} wins!`)\n } else if (board[3] === 'x' && board[4] === 'x' && board[5] === 'x') {\n alert(`${player} wins!`)\n } else if (board[6] === 'x' && board[7] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[4] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[4] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[3] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[1] === 'x' && board[4] === 'x' && board[7] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[5] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n }\n } else {\n var board = p2board;\n if (board[0] === 'x' && board[1] === 'x' && board[2] === 'x') {\n alert(`${player} wins!`)\n } else if (board[3] === 'x' && board[4] === 'x' && board[5] === 'x') {\n alert(`${player} wins!`)\n } else if (board[6] === 'x' && board[7] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[4] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[4] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[0] === 'x' && board[3] === 'x' && board[6] === 'x') {\n alert(`${player} wins!`)\n } else if (board[1] === 'x' && board[4] === 'x' && board[7] === 'x') {\n alert(`${player} wins!`)\n } else if (board[2] === 'x' && board[5] === 'x' && board[8] === 'x') {\n alert(`${player} wins!`)\n }\n}}", "winner() {\n return Players.findOne({score: 100}).name;\n }", "function checkWin(board, player) {\n let plays = board.reduce((a, e, i) =>\n (e === player) ? a.concat(i) : a, []);\n let gameWon = null;\n for (let [index, win] of winCombos.entries()) {\n if (win.every(elem => plays.indexOf(elem) > -1)) {\n gameWon = {index: index, player: player}; \n break;\n }\n }\n //if the loops show a win then \n return gameWon;\n}", "function playRound(player1Selection, player2Selection) {\n var player1HasWon = true;\n var tied = false;\n player1Selection = player1Selection.toUpperCase();\n player2Selection = player2Selection.toUpperCase();\n if (player1Selection === 'ROCK' && player2Selection === 'PAPER') {\n player1HasWon = false;\n }\n\n if (player1Selection === 'SCISSORS' && player2Selection === 'ROCK') {\n player1HasWon = false;\n }\n\n if (player1Selection === 'PAPER' && player2Selection === 'SCISSORS') {\n player1HasWon = false;\n }\n\n if (player1Selection === player2Selection) {\n tied = true;\n }\n\n if (tied) {\n return 3;\n }\n\n if (player1HasWon) {\n return 1;\n } else {\n return 2;\n }\n}", "function setScore(players, theWinner) {\n var winningPlayer = players.filter((player) => {\n return player.getName() === theWinner;\n });\n\n var score = winningPlayer[0].score;\n\n if ($('#playerOneNameText').html() === theWinner) { \n $('#playerOneScore').html(`(${score})`);\n } else if ($('#playerTwoNameText').html() === theWinner) { \n $('#playerTwoScore').html(`(${score})`);\n } else if ($('#playerThreeNameText').html() === theWinner) { \n $('#playerThreeScore').html(`(${score})`);\n }\n}", "function checkForWin() {\n\n var d = $vast.MathUtil.getPointDistance(mainPlayer.x, mainPlayer.y, goal.x, goal.y);\n if (d <= 1) {\n mainPlayer.setPosition(64, 64);\n }\n }", "function getCurrentPlayer() {\n\treturn gameState.players[gameState.turnIndex];\n}", "function compTryToWin() {\n for (var i = 0; i < winners.length; i++) {\n if (board[winners[i][0]] == compChoice && board[winners[i][1]] == compChoice && board[winners[i][2]] == \"\") {\n return winners[i][2];\n }\n else if (board[winners[i][0]] == compChoice && board[winners[i][2]] == compChoice && board[winners[i][1]] == \"\") {\n return winners[i][1];\n }\n else if (board[winners[i][1]] == compChoice && board[winners[i][2]] == compChoice && board[winners[i][0]] == \"\") {\n return winners[i][0];\n } \n }\n return false;\n}", "function checkWinner(player){\n let win = null;\n\n //loops through each possible wins and checks the board if a particular player has played \n // in all the possible spots \n for(let index = 0; index < possibleWins.length && !win; index++){\n\n let item = possibleWins[index];\n\n if (board[ item[0] ] === player && board[ item[1] ] === player\n && board[ item[2] ] === player) {\n\n win = { item, player};\n }\n }\n\n return win;\n}", "function score(winner) {\n if (winner === \"win\") {\n userScore++;\n console.log(\n `The score is Player: ${userScore} vs Computer ${computerScore}`\n );\n } else if (winner === \"lose\") {\n computerScore++;\n console.log(\n `The score is Player: ${userScore} vs Computer ${computerScore}`\n );\n } else {\n console.log(\n `The score is Player: ${userScore} vs Computer ${computerScore}`\n );\n }\n}", "function winnerCheck(){\r\t\t// check using a console.log() if this function is working \r\t\t// console.log(\"in winnerCheck FN\");\r\r\t\t// create a \"no winner\" outcome and set it to a variable named result\r\t\tvar result = \"no winner\";\r\r\t\t// use a conditional statement to check if both players' health fell below 0\r\t\tif (p1[2] < 1 && p2[2] < 1) {\r\t\t\t// if above is true, both players lose\r\t\t\tresult = \"You both lost\";\r\t\t\t// since they both didn't lost then check if one of the players' health is below 0 to determine the loser and the other the winner\r\t\t} else if (p1[2] < 1) {\r\t\t\tresult = p2[0] + \" Wins!\";\r\t\t} else if (p2[2] < 1) {\r\t\t\tresult = p1[0] + \" Wins!\";\r\t\t}\r\t\t// return the value to the result variable to make this function reuseable\r\t\treturn result;\r\t}", "function gameLogic(players) {\n const playerOne = players[0];\n const playerTwo = players[1];\n const choiceOne = playerOne.choice;\n const choiceTwo = playerTwo.choice;\n\n const playerOneWinner = {\n winner: playerOne,\n loser: playerTwo\n };\n\n const playerTwoWinner = {\n winner: playerTwo,\n loser: playerOne\n };\n\n if (choiceOne === choiceTwo) {\n return null;\n }\n if (choiceOne === \"rock\") {\n if (choiceTwo === \"paper\") {\n return playerTwoWinner;\n } else {\n return playerOneWinner;\n }\n }\n if (choiceOne === \"paper\") {\n if (choiceTwo === \"scissors\") {\n return playerTwoWinner;\n } else {\n return playerOneWinner;\n }\n }\n if (choiceTwo === \"rock\") {\n return playerTwoWinner;\n } else {\n return playerOneWinner;\n }\n}", "function opponent(player){\n return (player === PLAYER ? COMPUTER : PLAYER);\n}", "function winning(board, player) {\n if (\n (board[0] == player && board[1] == player && board[2] == player) ||\n (board[3] == player && board[4] == player && board[5] == player) ||\n (board[6] == player && board[7] == player && board[8] == player) ||\n (board[0] == player && board[3] == player && board[6] == player) ||\n (board[1] == player && board[4] == player && board[7] == player) ||\n (board[2] == player && board[5] == player && board[8] == player) ||\n (board[0] == player && board[4] == player && board[8] == player) ||\n (board[2] == player && board[4] == player && board[6] == player)\n ) {\n return true;\n } else {\n return false;\n }\n }", "function playRound(playerSelection, computerSelection){\n if(playerSelection === computerSelection)\n {\n return \"draw\";\n }else if(((playerSelection === \"paper\") && (computerSelection === \"rock\")) || ((playerSelection === \"scissor\") && (computerSelection === \"paper\")) || ((playerSelection === \"rock\") && (computerSelection === \"scissor\"))){\n playerScore++;\n return \"playerWin\";\n }else{\n computerScore++;\n return \"computerWin\";\n }\n}", "function winCheck() {\n if (userScore === computerPick) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n alert(\"Winning isn’t everything, it’s the ONLY thing\");\n newGame();\n }\n\n else if (userScore > computerPick) {\n losses++;\n $(\"#losses\").html(\"Losses: \" + losses);\n alert(\"...if you ain't first, you're last\");\n newGame();\n };\n }" ]
[ "0.7470841", "0.73979217", "0.730281", "0.72820836", "0.72731924", "0.7266726", "0.7259731", "0.7257109", "0.72549754", "0.7249323", "0.7204083", "0.71785057", "0.7111715", "0.7098823", "0.70804036", "0.7043733", "0.7024506", "0.7014854", "0.7000613", "0.6978096", "0.69530445", "0.69219536", "0.691799", "0.68939596", "0.6892177", "0.688957", "0.6867036", "0.68660027", "0.68648124", "0.6859581", "0.6857365", "0.683381", "0.6829555", "0.6820163", "0.6818752", "0.6815269", "0.6791504", "0.67859995", "0.67809474", "0.67754585", "0.67687887", "0.67665213", "0.6751978", "0.67387486", "0.6731658", "0.67296594", "0.67219347", "0.6705934", "0.670023", "0.66955185", "0.6692945", "0.66863286", "0.668316", "0.6678623", "0.6674445", "0.6672411", "0.6671411", "0.66706884", "0.66622865", "0.66593117", "0.6658176", "0.66553295", "0.66552025", "0.66509724", "0.6649379", "0.6646448", "0.66457605", "0.66453844", "0.66417235", "0.6639423", "0.6617378", "0.66084105", "0.66056824", "0.66049457", "0.6601208", "0.6601095", "0.6595714", "0.6591314", "0.65871143", "0.65798134", "0.6572575", "0.656175", "0.6561119", "0.65606093", "0.6553197", "0.6553013", "0.65501976", "0.6546761", "0.65439343", "0.6540481", "0.6531841", "0.6530347", "0.65287447", "0.6525851", "0.6525194", "0.6521571", "0.6520442", "0.65176785", "0.6508671", "0.6507303", "0.65027094" ]
0.0
-1
For license information, please see license.txt Function to at variables in string
function parse(str) { var args = [].slice.call(arguments, 1), i = 0; return str.replace(/%s/g, () => args[i++]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processVariables(str) {\n if (!str) return '';\n var variables = ['MONTH','QUARTER','YEAR'];\n for (var i=0; i<variables.length; i++) {\n var variable = variables[i];\n var regexp = new RegExp(':' + variable + '[+-]?[\\\\d]*', 'g');\n var matches = str.match(regexp);\n if (!matches) {\n continue;\n }\n for (var j=0; j<matches.length; j++) {\n var match = matches[j];\n var offset = 0;\n if (match.split('+').length > 1) {\n offset = match.split('+')[1];\n } else if (match.split('-').length > 1) {\n offset = parseInt(match.split('-')[1]) * -1;\n }\n str = str.replace(match, getDatePart(variable, offset));\n }\n }\n\n return str;\n}", "function getVariable(str) {\n\n return str;\n}", "function set_str_vars(string, attrs) {\n if (null==string) {\n return string;\n }\n pieces = string.split(/[\\[\\]]/);\n if (pieces.length%2 == 0) {\n return \"error: unmatched brackets in template response\";\n //This actually only checks to make sure there are an even number of brackets.\n //It treats 'hi [name]' just like 'hi ]name]'\n }\n string = pieces[0];\n ix = 1;\n while (ix < pieces.length) {\n s = '_'+pieces[ix];\n if (attrs[s]) s = attrs[s];\n else s = \"unknown\";\n string += s + pieces[ix+1];\n ix += 2;\n }\n return string;\n}", "asString() {\nvar x, y, z;\n[x, y, z] = this.xyz;\nreturn `<${x} ${y} ${z}>`;\n}", "asString() {\nvar w, x, y, z;\n[x, y, z, w] = this.xyzw;\nreturn `<${x} ${y} ${z}; ${w}>`;\n}", "function stringPartita(ht,at){\r\n return ht + \" - \" + at;\r\n}", "function stringsLiteral(){\n const x = \"todos\";\n const y = \"clase\";\n console.log(`Hola a ${x} los de la ${y}`);\n}", "function pgp_getVar(varName){\r\n\treturn varName+pgp_location;\r\n}", "function variables(name, str) {\n var re = new RegExp(name + '\\\\.([a-zA-Z_][a-zA-Z_0-9]*)', 'g');\n var nameVar = {}, varname, vartype;\n var match = null;\n while (match = re.exec(str)) {\n if (!(match[1] in nameVar)) {\n varname = name + '_' + match[1] + '_' + (variables.count++);\n nameVar[match[1]] = varname;\n }\n }\n return nameVar; \n}", "function setStrings() {\n $initString = titles[currentTitle].start;\n outputString = titles[currentTitle].finish;\n symbols = $initString + outputString;\n\n for (let i = 0; i < symbols.length; i++){\n if (symbols[i] == \" \"){\n symbolsNoSpaces = symbols.substr(0,i) + symbols.substr(i + 1);\n }\n }\n\n console.log('init = ' + $initString);\n console.log('output = ' + outputString);\n console.log('symbols = ' + symbols);\n}", "function f(strings, name, age){\n\treturn `${strings} ${name} ${age}`\t\n\t// My name is , and i am , years old rambo 34\n\t// strings[0] = 'My name is '\n}", "function tag(strings) {\n console.log(strings.raw[0]);\n\n}", "static vStr(xyz, n) {\nvar t, xs, ys, zs;\n//----\n[xs, ys, zs] = (function() {\nvar i, len1, results;\nresults = [];\nfor (i = 0, len1 = xyz.length; i < len1; i++) {\nt = xyz[i];\nresults.push(this.fStr(t, n));\n}\nreturn results;\n}).call(this);\nreturn `<${xs} ${ys} ${zs}>`;\n}", "function foo(str, a) {\n\teval( str ); // cheating!\n\tconsole.log( a, b );\n}", "function applyEnvParameters(str){\n //find all $(...) and replace them with parameters\n var envParam = Object.keys(parameters);\n if(envParam.length > 0){\n var re = new RegExp(\"\\\\$\\\\((\"+envParam.join(\"|\")+\")\\\\)\",\"g\");\n str = str.replace(re, function(matched){\n return parameters[matched.slice(2,matched.length-1)];\n });\n }\n\n // Make uniforms to be used as parameters in shaders, like $(uniformName)\n // var envUniforms = Object.keys(resource.uniform);\n // re = new RegExp(\"\\\\$\\\\((\"+envUniforms.join(\"|\")+\")\\\\)\",\"g\");\n // str = str.replace(re, function(matched){\n // return resource.uniform[matched.slice(2,matched.length-1)].data;\n // });\n\n return str;\n }", "function tag(strings) {\n console.log(strings.raw[0]);\n}", "function extractVariable() {\n extract('var');\n}", "function GetValueFromInfoString(infoString, name, defaultValue)\n{\n\tvar pos = infoString.indexOf(\";\" + name + \"=\");\n\t\n\tif (pos >= 0)\n\t\treturn infoString.substring(pos + name.length + 2, infoString.indexOf(\";\", pos + name.length + 2));\n\telse\n\t\treturn defaultValue;\n}", "function fix_string_formatting(string, variables) {\n console.log(\"inside fix_string\");\n list = string.split('%s');\n console.log(list);\n new_str = list[0];\n for (var i = 1; i < list.length; i++) {\n new_str += (' $' + i + ' ' + list[i]);\n console.log('\\n'+i+'\\n' + new_str + '\\n');\n }\n \n return new_str;\n }", "function sayHello3(name, age){\n // `(백틱)으로 String을 입력하고 필요한 변수를 ${변수명}을 통해 넣어준다.\n console.log(`Hello ${name} you are ${age} years old.`);\n}", "function getStrInfo(str) {\n console.log('The string length is: ' + str.length + ' chars')\n console.log('The first Charter is: ' + str[0] + ', and the last charter is: ' + str[str.length - 1]);\n console.log('String in uppercase: ' + str.toUpperCase() + ', string in lowcase: ' + str.toLowerCase())\n}", "function _attribution(str) {\r\n var all = new Array();\r\n while(1) {\r\n var eq = str.indexOf(\"=\");\r\n if(str.length == 0 || eq == -1) {\r\n return all;\r\n } \r\n var id1 = str.indexOf(\"\\'\");\r\n var id2 = str.indexOf(\"\\\"\");\r\n var ids = new Number();\r\n var id = new String();\r\n if((id1 < id2 && id1 != -1) || id2 == -1) {\r\n ids = id1;\r\n id = \"\\'\";\r\n }\r\n if((id2 < id1 || id1 == -1) && id2 != -1) {\r\n ids = id2;\r\n id = \"\\\"\";\r\n }\r\n var nextid = str.indexOf(id,ids + 1);\r\n var val = str.substring(ids + 1,nextid);\r\n \r\n var name = _strip(str.substring(0,eq));\r\n all[name] = _entity(val);\r\n str = str.substring(nextid + 1,str.length);\r\n }\r\n return \"\";\r\n}", "function printString(fName,lName,age){\n fName = \"Jane \";\n lName = \"Doe \";\n age = 100\n return (`${fName} ${lName} ${age}` );\n}", "function getVardas3() {\n return vardas + \"3\";\n}", "function EX_12(stringA, stringB)\n\t{\n\t// INSERT YOUR CODE HERE\n\t}", "function BOT_rawStringExtraction(s) {\r\n\tvar res = s ;\r\n\tres = res.replace(/ +$/g, \"\"); // deletewhitespaces at end\r\n\t\r\n\t// javascript expression following words compute|calculate|evaluate|comp|calc and placed AT END\r\n\tBOT_theReqJavascript = res; \r\n\tres = res.replace(/(.*) (compute|calculate|evaluate|comp|calc) (.*)/g, \"$1 compute\");\r\n\tBOT_theReqJavascript = BOT_theReqJavascript.replace(/(.*) (compute|calculate|evaluate|comp|calc) (.*)/g, \"$3\");\r\n\r\n\t// strong stressers double at end\r\n\tres = res.replace(/(.*)\\!\\!$/g, \"$1 _harsh\");\r\n\tres = res.replace(/(.*)\\?\\?$/g, \"$1 _surprise\");\r\n\tres = res.replace(/(.*)\\*\\*$/g, \"$1 _begging\");\r\n\tres = res.replace(/(.*)\\@\\@$/g, \"$1 _apology\");\r\n\tres = res.replace(/(.*)\\&\\&$/g, \"$1 _counterstatement\");\r\n\t\r\n\t// light stressers single at end\r\n\tres = res.replace(/(.*)\\!$/g, \"$1 _strong\");\r\n\tres = res.replace(/(.*)\\?$/g, \"$1 _interrogation\");\r\n\tres = res.replace(/(.*)\\*$/g, \"$1 please\"); // _please below\r\n\tres = res.replace(/(.*)\\@$/g, \"$1 _sorry\");\r\n\tres = res.replace(/(.*)\\&$/g, \"$1 _irony\");\r\n\t\r\n\tres = \" \"+res+\" \"; ;\r\n\t\r\n\t// please\r\n\tres = res.replace(/(.*)please(.*)/g, \"$1 $2 _please\");\r\n\t\r\n\t// possibility -- TO DO: impossible unavailable\r\n\t/*\r\n\tvar t = [\"can i\",\"is it possible to\",\"is it authorized to\",\"is it authorised to\",\"possible\",\"possibility\", \r\n\t\t\t\"available\",\"availability\",\"authorized\",\"authorised\",\"authorization\",\"authorisation\"];\r\n\r\n\tvar rex;\r\n\tfor (var i in t) {\r\n\t\t\trex = new RegExp(eval(\"/(.*) \" + t[i] + \" (.*)/g\"));\r\n\t\t\tres = res.replace(rex, \"$1 $2 _possibility\");\r\n\t\t}\r\n\tres = res.replace(/^ [\\?p] ?(\\w) (.*)/g, \"$1 $2 _possibility\"); // pa | p a | ?a | ? a at begin \r\n\t\r\n\t// is|are at begin\r\n\tres = res.replace(/^( is | are )(.*)/g, \" v $2\");\r\n\t*/\r\n\treturn res\r\n}", "function props(str) {\n return str\n .replace(/\\.\\w+|\\w+ *\\(|\"[^\"]*\"|'[^']*'|\\/([^/]+)\\//g, '')\n .replace(globals, '')\n .match(/[$a-zA-Z_]\\w*/g)\n || []\n}", "function print_string()\r\n{\r\n\t//tips:64 dot matrix;x=64,y=104;show string is Hello world;color=4(yellow),eg:1(red),3(bule)...\r\n var string = \"DS64(64,104,'Hello world!',4)\";\r\n\ttftlcd.send(clear);\t\r\n\ttftlcd.send(upright);\t\r\n\ttftlcd.send(string);\r\n\ttftlcd.send(println);\r\n}", "function scrabble(a_string, obj_values) {\n let word_value = 0;\n a_string = a_string.toUpperCase();\n // let lookup = \"\";\n\n for (let i = 0; i < a_string.length; i++) {\n word_value = word_value + eval(\"obj_values.\" + a_string.charAt(i));\n // console.log(a_string.charAt(i) + \" is worth \" + obj_values.a_string.charAt(i));\n // console.log(obj_values.eval(a_string.charAt(i)));\n // lookup = \"obj_values.\" + a_string.charAt(i);\n // console.log(eval(lookup));\n // console.log(eval(\"obj_values.\" + a_string.charAt(i)));\n\n // console.log(a_char);\n } // end of for loop\n return word_value;\n }", "function getVar(s, name, def) {\n\treturn JSON.parse(match(s, new RegExp(\"var \"+name+\" *= *([^;]+);\"),1,def));\n}", "function formatString (formatString, variables) {\n\tfor (let i = 0; i < variables.length; i++) {\n\t\tformatString = formatString.replace(`{${i}}`, variables[i]);\n\t}\n\treturn formatString;\n}", "function TemplateStrings() {\n\n\n // Basic literal string creation\n console.log(`Normal string`);\n\n // Multiline strings\n var multiLineString = `Multi\n line string`;\n console.log(multiLineString);\n\n\n // Interpolate variable bindings\n var name = \"Bob\", time = \"today\";\n console.log(`Hello ${name}, how are you ${time}?`);\n\n console.log(String.raw`In Es5 '\\n is a line feed.`);\n}", "function hello(first, last){\n let myName = first + ' ' + last;\n console.log(`Hello, ${myName}.`); //In order for $ to work use backtics ``\n}", "function injectStrings(code, strings) {\n return code.replace(/'(\\d+)'/g, function(all, index) {\n var val = strings[index];\n if(val.charAt(0) === \"/\") {\n return val;\n }\n return (/^'((?:[^'\\\\\\n])|(?:\\\\.[0-9A-Fa-f]*))'$/).test(val) ? \"(new $p.Character(\" + val + \"))\" : val;\n });\n }", "function createVar(string) {\t//transfer a string to individual VAR element\n\tvar frag = document.createDocumentFragment();\n\tfor (var i in string) {\n\t\tvar tag = document.createElement(\"var\");\n\t\ttag.setAttribute(\"id\", \"char\");\n\t\ttag.setAttribute(\"math_id\", math_id++);\n\t\ttag.innerHTML = string[i];\n\t\ttag.addEventListener('click', c, false);\n\t\tfrag.appendChild(tag);\n\t}\n\treturn frag;\n}", "function location(x,y) {\n\tvar z = x + \" \" + y;\n\tconsole.log(z);\n}", "function interpolate(str) {\n return \"My favorite food is \" + str + \"!\";\n}", "function parseSrcVar( thing )\n {\n try {\n if( thing.startsWith( \"$\" ) )\n {\n return { tag: src_var_tag,\n name: thing.substring( 1 ) };\n }\n }\n catch( err ) {}\n throw new Error( \"Query: Expecting variable. Found: \" + thing );\n }", "function example2 () {\n\n let sum = (a, b) => a + b\n \n function strParse (strings, ...params) {\n console.log(strings);\n console.log(strings.raw);\n console.log(params);\n }\n\n let a = 'test'\n let b = 13\n\n let s = strParse`Some ${a}\n string with another param ${b}\n and sum of 5 and 4, that is ${sum(5,4)}`\n}", "interpolate(str = '', data = {}, globals = {}) {\n // Merge global values into the data object, prefixing each key with 'global.'\n Object.entries(globals).forEach(\n ([key, value]) => {\n data[`global.${key}`] = value;\n }\n );\n\n // Interpolate the values into the string provided by their keys\n Object.entries(data).forEach(\n ([key, value]) => {\n (typeof value === 'string')\n &&\n (str = str.replace(`{${key}}`, value));\n }\n );\n\n return str;\n }", "function getVars(varstring) {\n\n var doc = document;\n var ret = {};\n if (document.querySelectorAll('#gsft_main').length) //ui16\n doc = document.querySelector('#gsft_main').contentWindow.document;\n else if (document.querySelectorAll(\"[component-id]\").length && //polaris ui\n document.querySelector(\"[component-id]\").shadowRoot.querySelectorAll(\"#gsft_main\").length) {\n doc = document.querySelector(\"[component-id]\").shadowRoot.querySelector(\"#gsft_main\").contentWindow.document; \n }\n else if (document.querySelectorAll('div.tab-pane.active').length == 1) { //studio\n try{\n doc = document.querySelector('div.tab-pane.active iframe').contentWindow.document;\n ret.g_ck = doc.querySelector('input#sysparm_ck').value;\n }\n catch(ex){\n doc = document;\n }\n }\n\n if (varstring.indexOf('g_list') > -1)\n setGList(doc);\n\n\n var variables = varstring.replace(/ /g, \"\").split(\",\");\n var scriptContent = \"\";\n for (var i = 0; i < variables.length; i++) {\n var currVariable = variables[i];\n scriptContent += \"try{ if (typeof window.\" + currVariable + \" !== 'undefined') document.body.setAttribute('tmp_\" + currVariable.replace(/\\./g, \"\") + \"', window.\" + currVariable + \"); } catch(err){console.log(err);}\\n\"\n }\n\n var detail = { \n \"detail\" : {\n \"type\" : \"code\", \n \"content\" : scriptContent \n }\n };\n if (typeof cloneInto != 'undefined') detail = cloneInto(detail, document.defaultView); //required for ff\n var event = new CustomEvent('snuEvent', detail);\n doc.dispatchEvent(event);\n\n for (var i = 0; i < variables.length; i++) {\n var currVariable = variables[i];\n ret[currVariable.replace(/\\./g, \"\")] = doc.body.getAttribute(\"tmp_\" + currVariable.replace(/\\./g, \"\"));\n doc.body.removeAttribute(\"tmp_\" + currVariable.replace(/\\./g, \"\"));\n }\n return ret;\n}", "static qStr(qv, n) {\nvar t, w, x, y, z;\n//----\n[x, y, z, w] = (function() {\nvar j, len, results;\nresults = [];\nfor (j = 0, len = qv.length; j < len; j++) {\nt = qv[j];\nresults.push(this.fStr(t, n));\n}\nreturn results;\n}).call(this);\nreturn `<${x} ${y} ${z}; ${w}>`;\n}", "peekVarString () {\n let pos = this.pos;\n let s = this.readVarString();\n this.pos = pos;\n return s\n }", "function globalVariableInject(stringToInject) {\n\tif(stringToInject.indexOf(\"%%\")!= -1) {\n\t\tvar stringToReturn = stringToInject;\n\t\twhile(stringToReturn.indexOf(\"%%\")!= -1){\n\t\t\tvar First = stringToInject.indexOf(\"%%\");\n\t\t\tvar Next = stringToInject.indexOf(\"%%\", First+2);\n\t\t\tvar JSVariable = stringToInject.substring(First+2, Next);\n\t\t\tvar evalJS = eval(JSVariable);\n\t\t\tstringToReturn = stringToReturn.split(\"%%\"+JSVariable+\"%%\").join(evalJS);\n\t\t}\n\t\treturn stringToReturn;\n\t} else {\n\t\treturn stringToInject;\n\t}\n}", "function S_templateStrings2() {\n // code snippet begin ----\n let a = 4;\n let b = 17;\n\n /* statement string with math expression placeholders that\n will be replaced by their respective results */\n let statement = `Twenty-one is ${a + b} and not ${2 * a + b}.`;\n\n console.log(statement); \n // code snippet end ----\n \n setInnerHTML(\"#result-text-2\", statement);\n}", "function getPosition(str) {\n\n var stringStats = { originalString : str};\n\n // We make a first run through the string and take the letters in it and initialize the object with an empty array.\n for (var i = 0; i < str.length; i++) {\n // Found a way to create a dynamic key with brackets ---> obj[variableReference]\n stringStats[str[i]] = [];\n }\n // Once we have the object initialized with empty arrays we can loop again to finish the count.\n for (i = 0; i < str.length; i++) {\n stringStats[str[i]] = stringStats[str[i]].concat(i);\n }\n\n return stringStats;\n}", "function str_val(str) {\n\n \n}", "function interpolate(str, data) {\n\treturn str.replace(/\\$<([^>]+)>/gm, (s, key) => data[key])\n}", "scanFileHandleGetVars(text, pathBasename, variables) {\n const varRegex = /^ *\\${1}\\S*:/gm;\n let varMatches;\n while ((varMatches = varRegex.exec(text)) !== null) {\n if (varMatches.index === varRegex.lastIndex) {\n varRegex.lastIndex++;\n }\n varMatches.forEach((match) => {\n variables = this.createVar(match, pathBasename, variables).state;\n });\n }\n return variables;\n }", "function dwString(inputString){\n\tdebugWrite(inputString);\n}", "function req_string(){\n\tlet word = ;\n\treturn word\n}", "function createVar(string) {\t//transfer a string to individual VAR element\r\n\tvar frag = document.createDocumentFragment();\r\n\tfor (var i in string) {\r\n\t\tvar tag = document.createElement(\"var\")\r\n\t\t\t\t\t\t .attr(\"math_id\", math_id++)\r\n\t\t\t\t\t\t .addListener('click', c);\r\n\t\ttag.innerHTML = string[i];\r\n\t\tfrag.appendChild(tag);\r\n\t}\r\n\treturn frag;\r\n}", "function getData({s, r, t, u}){\n return `${s}${r}${t}${u}`; // backtick\n}", "fulfillString(str) {\n return str.replace(/{{([^}]+)}}/g, (match, group) => {\n if (this.hasSlot(group)) {\n return this.slot(group);\n }\n if (this.hasRequestAttr(group)) {\n return this.getRequestAttr(group);\n }\n if (this.hasSessionAttr(group)) {\n return this.getSessionAttr(group);\n }\n if (this.hasPersistentAttr(group)) {\n return this.getPersistentAttr(group);\n }\n return match;\n });\n }", "function rd_Approximate_localize(strVar)\r\n {\r\n return strVar[\"en\"];\r\n }", "function literals(name, age) {\n return 'Hello ' + name + '. Your age is ' + age + ' years old.';\n}", "function stringout(variables){\n if(typeof(variables) != \"object\") variables = [variables];\n return salfunction(variables, stringoutelements, stringoutcache);\n}", "function xdtlGetValue(s, c) {\n\tc = c || \":\"; \n\tvar result = '';\n\n\t//Java 1.8 compatible (Javascript way)\n\tvar arr = s.split(c);\t\t\t\t\t \n\tif (arr.length > 0) {\n\t\tresult = arr[1];\n\t}\n\treturn result;\n}", "function printMyDetails(){\n let message = (`Hello World, this is ${myDetails.name} with HNGi7 ID ${myDetails.HNG_ID} using ${myDetails.language} for stage 2 task and my email is ${myDetails.emailAddress}`)\n \n console.log(message);\n}", "function pasarVariables() {\n cadVariables = location.search.substring(1,location.search.length); //VARIABLES EN EL LINK\n arrVariables = cadVariables.split(\"&\");\n for (i=0; i<arrVariables.length; i++) {\n arrVariableActual = arrVariables[i].split(\"=\");\n }\n return (arrVariableActual[1]);\n}", "function productDescription( strings, productName, productPrice ){\n console.log(strings); // first argument is non dynamic part of temlate string\n console.log(productName);\n console.log(productPrice);\n let priceCategory = 'cheap';\n if(productPrice > 20){\n priceCategory = 'fairly priced'\n }\n return `${strings[0]}${productName}${strings[1]}${priceCategory}${strings[2]}`\n}", "function tag(strings, ...values) {\n console.log(strings.raw[0]); \n // \"string text line 1 \\n string text line 2\"\n}", "function getElementStyleVal(str, key, clipStr) {\n var finalVal = '';\n if(str.indexOf(key) != -1) {\n var start = str.indexOf(key);\n start = str.indexOf('(', start)+1;\n var end = str.indexOf(')', start);\n\n if(clipStr != '')\n end = end - clipStr.length;\n\n finalVal = str.substring(start, end);\n }\n return finalVal;\n}", "function debug() {\n if (attrs.isDebug) {\n //stringify func\n var stringified = scope + \"\";\n \n // parse variable names\n var groupVariables = stringified\n //match var x-xx= {};\n .match(/var\\s+([\\w])+\\s*=\\s*{\\s*}/gi)\n //match xxx\n .map(d => d.match(/\\s+\\w*/gi).filter(s => s.trim()))\n //get xxx\n .map(v => v[0].trim());\n \n //assign local variables to the scope\n groupVariables.forEach(v => {\n main[\"P_\" + v] = eval(v);\n });\n }\n }", "function StringHelp() {\n}", "function getStringDeets(string) {\n\t\treturn {\n\t\t\tfirstChar: string.charAt(0),\n\t\t\tlastChar: string.charAt(string.length - 1),\n\t\t\tlength: string.length,\n\t\t\tshoutedVersion: string.toUpperCase()\n\t\t};\n\t}", "function retr(input)\n{\n var index = names.indexOf(input);\n return variables[index];\n}", "function PrintVars(stream)\r\n{\r\n stream.WriteLine(\"Variables:\");\r\n stream.WriteLine(\" VERSION=\" + VERSION);\r\n stream.WriteLine(\" DEVENV=\" + DEVENV);\r\n stream.WriteLine(\" DEVENVFLAGS=\" + DEVENVFLAGS);\r\n stream.WriteLine(\" CPPFLAGS=\" + CPPFLAGS);\r\n stream.WriteLine(\" LDFLAGS=\" + LDFLAGS);\r\n stream.WriteLine(\" LIBS=\" + LIBS);\r\n stream.WriteLine(\" CONVERT=\" + CONVERT);\r\n stream.WriteLine(\" CXX=\" + CXX);\r\n stream.WriteLine(\" LD=\" + LD);\r\n stream.WriteLine(\" AR=\" + AR);\r\n stream.WriteLine(\" AS=\" + AS);\r\n stream.WriteLine(\" SLNVER=\" + SLNVER);\r\n stream.WriteLine(\" SLNCOMMENT=\" + SLNCOMMENT);\r\n stream.WriteLine(\" UNICODELOG=\" + UNICODELOG);\r\n stream.WriteLine(\" NOSTCRT=\" + NOSTCRT);\r\n stream.WriteLine(\" WINDIFF=\" + WINDIFF);\r\n stream.WriteLine(\" ICCCONVERT=\" + ICCCONVERT);\r\n stream.WriteLine(\" PLATFORM=\" + PLATFORM);\r\n stream.WriteLine(\" CLVARSBAT=\" + CLVARSBAT);\r\n stream.WriteLine(\" ICCVER=\" + ICCVER);\r\n stream.WriteLine(\"\");\r\n}", "function analyseDlintLocationString(locationStr, benchmark, website) {\n\t\tvar fileLocation, iidFileLocation;\n\t\tlocationStrRegexp.lastIndex = 0;\n\t\tvar regExpRes = locationStrRegexp.exec(locationStr);\n\t\tlocationStrRegexp.lastIndex = 0;\n\t\tif (!regExpRes) {\n\t\t\t//console.log('unrecognizable location string: ' + locationStr);\n\t\t\treturn;\n\t\t}\n\t\tfileLocation = dataBaseDIR + benchmark + '/' + website + '/src/' + regExpRes[1];\n\t\tiidFileLocation = fileLocation + '_jalangi_sourcemap.js';\n\t\treturn {\n\t\t\tfilename: regExpRes[1],\n\t\t\tline: regExpRes[2] | 0,\n\t\t\tcol: regExpRes[3] | 0,\n\t\t\tendLine: regExpRes[4] | 0,\n\t\t\tendCol: regExpRes[5] | 0,\n\t\t\tfile: fileLocation,\n\t\t\tiidFileLocation: iidFileLocation\n\t\t};\n\t}", "read_varstring() {\n let size = this.read_varint32();\n return this.read_string(size);\n }", "function sayHello(name='Chan', age=30){\n return `Hello ${name} your ${age} years old`;\n}", "function someProcess() {\n let myName = \"X-AE-12\";\n console.log(myName);\n}", "function getInfo() {\n return '%s-%s';\n}", "function findVariables(string) {\n // Do not parse empty files. Otherwise gonzales.parse will fail\n if (!string) {\n return [];\n }\n\n var out = [],\n ast = gonzales.parse(string, {\n syntax: syntax\n }),\n visitor = {\n // Visitor for SASS, SCSS and plain CSS syntaxes\n test: function(name, nodes) {\n return (name === 'declaration' && nodes.content[0].content[0].type === 'variable') || (name === 'variable' && nodes.content[0].type === 'ident');\n },\n process: function(nodes) {\n if (nodes.type !== 'declaration') {\n out.push(nodes.content[0].content);\n }\n }\n };\n\n traverser.traverse(ast, visitor);\n return out;\n}", "function parseAssignment(variable, value, modify, modifyArg=null) {\n\t\n\tdebug(\"Parsing assignment of '\"+dispTokens(value)+\"' to '\"+dispTokens(variable)+\"'\");\n\t\n\tvar func = \"\";\n\tif (modify) {\n\t\tfunc += \"modify\";\n\t} else {\n\t\tfunc += \"set\";\n\t}\n\t\n\tvar result = \"\";\n\t\n\tif (variable.length === 1) {\n\t\tresult += tows(\"_\"+func+\"GlobalVar\", actionKw)+\"(\"+variable[0].text+\", \";\n\t\t\n\t} else {\n\t\t//Check for dot; if it is present, it can only be a player variable\n\t\tvar operands = splitTokens(variable, \".\", false, true);\n\t\tif (operands.length === 2) {\n\t\t\t\n\t\t\tconsole.log(operands);\n\t\t\t\n\t\t\t//Check for array\n\t\t\tif (operands[0].length > 1 && operands[0][1].text === '[') {\n\t\t\t\tresult += tows(\"_\"+func+\"PlayerVarAtIndex\", actionKw)\n\t\t\t\t\t\t+\"(\"+parse(operands[1])+\", \"+operands[0][0].text+\", \"\n\t\t\t\t\t\t+parse(operands[0].slice(2, operands[0].length-1))+\", \";\n\t\t\t} else {\n\t\t\t\tif (operands[0].length > 1) {\n\t\t\t\t\terror(\"Unauthorised player variable\", operands[1]);\n\t\t\t\t}\n\t\t\t\tresult += tows(\"_\"+func+\"PlayerVar\", actionKw)+\"(\"+parse(operands[1])+\", \"+operands[0][0].text+\", \";\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tif (variable[1].text === '[') {\n\t\t\t\tresult += tows(\"_\"+func+\"GlobalVarAtIndex\", actionKw)+\"(\"+variable[0].text+\", \"+parse(variable.slice(2, variable.length-1))+\", \";\n\t\t\t} else {\n\t\t\t\terror(\"Unauthorized global variable\", variable);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (modify) {\n\t\tresult += tows(modifyArg, operationKw)+\", \";\n\t}\n\t\n\tresult += parse(value)+\")\";\n\treturn result;\n}", "function getVardas5(){\n return vardas + \"5\";\n}", "function gatherStrings(obj) {\n\n}", "function getVardas1() {\n return vardas + \"1\";\n}", "function variables(light = true) {\n if (light)\n return `\n:root {\n --default-font: 'Inter', -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Microsoft YaHei Light\", sans-serif;\n --font-monospace: 'Source Code Pro', monospace;\n --background-primary: #ffffff;\n --background-modifier-border: #ddd;\n --text-accent: #705dcf;\n --text-accent-hover: #7a6ae6;\n --text-normal: #2e3338;\n --background-secondary: #f2f3f5;\n --background-secondary-alt: #e3e5e8;\n --text-muted: #888888;\n}`;\n else\n return `\n:root {\n --background-primary: #202020;\n --background-modifier-border: #333;\n --text-accent: #7f6df2;\n --text-accent-hover: #8875ff;\n --text-normal: #dcddde;\n --background-secondary: #161616;\n --background-secondary-alt: #000000;\n --text-muted: #999;\n}\n`;\n}", "function parse_locator(locator)\n{\n var result = locator.match(/^([A-Za-z]+)=(.+)/);\n if (result) {\n return { type: result[1].toLowerCase(), string: result[2] };\n }\n return { type: 'implicit', string: locator };\n}", "function stringDebugger(sF,sT,sE,sA,sB) {\n\tvar aDebug = new Array(sF,sT,sE,sA,sB);\n\tfor (tc=0; tc < 5; tc++) {\n\t\tif (aDebug[tc] == undefined) {\n\t\t\taDebug[tc] = \"<font color='#ff0000'>undefined</font>\";\n\t\t}\n\t}\n\tdocit(\"<hr>\");\n\tdocit(\"<font size=+2><b>String Debugger BEGIN</b></font>\");\n\tdocit(\"sFilename = \" + aDebug[0]);\n\tdocit(\"sTestcaseName = \" + aDebug[1]);\n\tdocit(\"sExpected = \" + aDebug[2]);\n\tdocit(\"sActual = \" + aDebug[3]);\n\tdocit(\"sBugReport = \" + aDebug[4]);\n\tdocit(\"<font size=+1><b>String Debugger END</b></font>\");\n\tdocit(\"<hr>\");\n}", "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`);\n console.log(`.substr(2, 3) - ${value.substr(2, 3)}`); // (start-index, length) start at start-index, read for 3 characters \n console.log(`.substring(2, 3) - ${value.substring(2, 3)}`); // (start-index, end-index) start at start-index, up to but not including the end-index\n \n /*\n Other Methods\n - split(string)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "function printWeather(weather) {\n //Wind string starts with 'From', so slice out F from string and print f.\n const printString = `Current temperature in ${weather.current_observation.display_location.full} is ${weather.current_observation.temperature_string}, with winds f${weather.current_observation.wind_string.slice(1)}.`;\n console.log(printString);\n}", "function sample(){\n var x=\"hello\";\n var y=\"Nitish\";\n return x+\" \"+y;\n}", "function toVar(variable) {\n if (variable) {\n var first = variable[0];\n if (first === '?' || first === '$') return Parser.factory.variable(variable.substr(1));\n }\n return variable;\n }", "function sc_format(s) {\n var len = s.length;\n var p = new sc_StringOutputPort();\n var i = 0, j = 1;\n\n while( i < len ) {\n var i2 = s.indexOf(\"~\", i);\n\n if (i2 == -1) {\n\t p.appendJSString( s.substring( i, len ) );\n\t return p.close();\n } else if (i2 == (len - 1)) {\n\t p.appendJSString(s.substring(i, len));\n\t return p.close();\n } else if (i2 == (len - 2) && s.charAt(i2 + 1) == \":\") {\n\t p.appendJSString(s.substring(i, len));\n\t return p.close();\n } else {\n\t if (i2 > i) p.appendJSString(s.substring(i, i2));\n\n\t var alternativeForm = (s.charAt(i2 + 1) == \":\");\n\t if (alternativeForm) i2++;\n\n\t // already advance before evalualating escape sequences.\n\t // this way it is easier to see.\n\t // no escape sequence requires 'i'.\n\t i = i2 + 2;\n\n\t switch(s.charCodeAt(i2 + 1)) {\n\t case 65:\n\t case 97:\n\t // a\n\t if (alternativeForm)\n\t\t sc_displayCircle(arguments[j], p);\n\t else\n\t\t sc_display(arguments[j], p);\n\t j++;\n\t break;\n\n\t case 83:\n\t case 115:\n\t // s\n\t if (alternativeForm)\n\t\t sc_writeCircle(arguments[j], p);\n\t else\n\t\t sc_write(arguments[j], p);\n\t j++;\n\t break;\n\n\t case 86:\n\t case 118:\n\t // v\n\t if (alternativeForm)\n\t\t sc_displayCircle(arguments[j], p);\n\t else\n\t\t sc_display(arguments[j], p);\n\t p.appendJSString(\"\\n\");\n\t j++;\n\t break;\n\n\t case 67:\n\t case 99:\n\t // c\n\t p.appendJSString(String.fromCharCode(arguments[j]));\n\t j++;\n\t break;\n\n\t case 88:\n\t case 120:\n\t // x\n\t p.appendJSString(arguments[j].toString(16));\n\t j++;\n\t break;\n\n\t case 79:\n\t case 111:\n\t // o\n\t p.appendJSString(arguments[j].toString(8));\n\t j++;\n\t break;\n\n\t case 66:\n\t case 98:\n\t // b\n\t p.appendJSString(arguments[j].toString(2));\n\t j++;\n\t break;\n\n\t case 37:\n\t case 110:\n\t // %, n\n\t p.appendJSString(\"\\n\");\n\t break;\n\n\t case 114:\n\t // r\n\t p.appendJSString(\"\\r\");\n\t break;\n\n\t case 126:\n\t // ~\n\t p.appendJSString(\"~\");\n\t break;\n\n\t default:\n\t sc_error( \"format: illegal ~\"\n\t\t\t+ String.fromCharCode(s.charCodeAt(i2 + 1))\n\t\t\t+ \" sequence\" );\n\t return \"\";\n\t }\n }\n }\n\n return p.close();\n}", "function parse_variables() {\n\n\t\t\t\twindow.W = W = parseFloat(localStorage.getItem('SPLITTER_W'));\n\t\t\t\twindow.B = B = parseFloat(localStorage.getItem('SPLITTER_B'));\n\t\t\t\twindow.Mf = Mf = parseFloat(localStorage.getItem('SPLITTER_MF'));\n\t\t\t\twindow.Mt = Mt = parseFloat(localStorage.getItem('SPLITTER_MT'));\t\t\t\t\n\n\t\t\t}", "function parsePattern(pattern,vars){\n console.log(\"parsePattern\");\n console.log(\" parsing pattern: \"+pattern+\" with vars: \"+vars);\n var sageCode = \"\";\n var j = 0;\n while(j < pattern.length){\n if(pattern.charAt(j) == \"\\\\\"){\n console.log(\" found a variable\");\n var curVar = \"\";\n j++;\n while(pattern.charAt(j).match(/[0-9]/)){\n curVar += pattern.charAt(j);\n j++;\n }\n console.log(\" variable: \"+curVar+\" inserting: \"+vars[curVar]);\n sageCode+=vars[curVar];\n }\n sageCode+=pattern.charAt(j);\n console.log(\" output: \"+sageCode);\n j++;\n }\n return(sageCode);\n}", "function getVarFromUrl(varname, offset){\n if(typeof offset == 'undefined') offset = 1;\n var index = waq.url.parts.indexOf(varname);\n return waq.url.parts[index+offset];\n }", "function stringFormat(str, args) {\n var content = str;\n for (var i=0; i < args.length; i++) {\n var replacement = '{' + i + '}';\n content = content.replace(replacement, args[i]);\n }\n return content;\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function sayHi(name, age) {\n return `Hello, ${name}, youa are ${age} years old`;\n}", "function isVar(t) { return t[0] == '$'; }", "function pyMyString(str) {\n if (str.substring(0,2) === \"Py\") {\n console.log(str);\n } else {\n let newString = \"Py\" + str;\n console.log(newString);\n }\n}", "function stringFunctions(value) {\n console.log(`.length - ${value.length}`);\n console.log(`.endsWith('World') - ${value.endsWith(\"World\")}`);\n console.log(`.startsWith('Hello') - ${value.startsWith(\"Hello\")}`);\n console.log(`.indexOf('Hello') - ${value.indexOf(\"Hello\")}`); // index of where the word starts in the string\n console.log(`.substr(2,3) - ${value.substr(2,3)}`) // .substr(start-index, length)\n console.log(`.substring(2,3) - ${value.substring(2,3)}`) // .substring(start-index, end-index)\n // up to, but including the char at end-index\n\n /*\n Other Methods\n - split(string)\n - substr(number, number)\n - substring(number, number)\n - toLowerCase()\n - trim()\n - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\n */\n}", "function findVariableNameInAString(input) {\n const regex = /\\b_([a-zA-Z\\d]+)\\b/gm;\n let match = regex.exec(input);\n let result = [];\n while(match) {\n result.push(match[1]);\n match = regex.exec(input);\n }\n\n console.log(result.join(','));\n}", "function test() {\n var params = 'param=valorEnviado';\n //alert(params);\n printText(null, params);\n}", "function IndexCal(letter)\n{\n var sentence=\"Maryum\";\n\ndocument.write((sentence[letter]));\n\n}" ]
[ "0.6294985", "0.6255095", "0.6231003", "0.6083021", "0.6017686", "0.5892693", "0.58016527", "0.57685065", "0.57240236", "0.5569855", "0.5528753", "0.5480313", "0.545602", "0.5448759", "0.5438926", "0.543641", "0.5419741", "0.536137", "0.5339832", "0.53323114", "0.5321396", "0.5317547", "0.5315456", "0.53101283", "0.5309288", "0.52916235", "0.5269062", "0.5267537", "0.526513", "0.5254239", "0.52528805", "0.52298415", "0.52201295", "0.5219693", "0.5212739", "0.5205799", "0.5200912", "0.5197775", "0.51951224", "0.519225", "0.5188679", "0.51865816", "0.51831293", "0.51596606", "0.5153644", "0.5151907", "0.51432145", "0.5143132", "0.5136576", "0.5133324", "0.5122083", "0.5120135", "0.5119012", "0.5118249", "0.51167816", "0.51124394", "0.5112341", "0.5110388", "0.5110319", "0.5104288", "0.510394", "0.5096277", "0.5084454", "0.5082576", "0.5075915", "0.50750166", "0.5072705", "0.50705314", "0.5068708", "0.50685036", "0.50666225", "0.5063983", "0.50625247", "0.50567293", "0.50551", "0.5053446", "0.50510514", "0.5044504", "0.50362825", "0.50295943", "0.50240666", "0.5020267", "0.5017993", "0.50133705", "0.5012364", "0.50039816", "0.5001866", "0.49977618", "0.4994863", "0.49948597", "0.49900362", "0.49900362", "0.49900362", "0.49900362", "0.4987138", "0.49869153", "0.49761882", "0.49709117", "0.49700028", "0.4968844", "0.4968685" ]
0.0
-1
pick & show random word
function showWord(words){ // generate random Array Index const randIndex = Math.floor(Math.random() * words.length); // output random word currentWord.innerHTML = words[randIndex].toUpperCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showWord(words) {\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n }", "function showWord(words) {\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}", "function showWord(words){\r\n const randIndex = Math.floor(Math.random()*words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n}", "function showword(words){\n const randindex = Math.floor(Math.random() * words.length);\n\n //output random word\n currentword.innerHTML = words[randindex];\n}", "function SelectWord() {\n\treturn words[Math.floor(Math.random()*words.length)];\n}", "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output the random word\n currentWord.innerHTML = words[randIndex];\n}", "function selectWord() {\n return wordList[Math.floor(Math.random() * wordList.length)];\n }", "function chooseRandomWord() {\n //store random word\n currentWord = wordLibraryArray[Math.floor(Math.random() * wordLibraryArray.length)];\n currentWordArray = currentWord.split('');\n remainingLetters = currentWord.length;\n displayStatus(currentWord);\n}", "function showWord(words)\r\n{\r\n\t//generate random array index\r\n\tconst randIndex=Math.floor(Math.random() * words.length);\r\n\t//output random word\r\n\tcurrentWord.innerHTML=words[randIndex];\r\n}", "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "function showWord(words){\r\n// generate random array index//\r\nconst randIndex =math.floor(math.random() * words.length);\r\n// output random words//\r\ncurrentWord.innerHTML = words[randIndex];\r\n}", "function showWord(words){\r\n //Generate random array Index\r\n const randIndex=Math.floor(Math.random()*words.length);\r\n //Output random word\r\n currentWord.innerHTML=words[randIndex];\r\n}", "function showWord(words){\n //get random index of array\n const randIndex = Math.floor(Math.random() * words.length);\n //Output random word\n currentWord.innerHTML = words[randIndex];\n}", "function showWord(words){\n\n //Generate randow array index\n const randIndex = Math.floor(Math.random() *words.length);\n //Output random word\n currentWord.innerHTML=words[randIndex];\n}", "function rndChooseWord() {\n\n // This randomly selects a word from the list\n currentWordPos = (Math.floor(Math.random() * (wordstring.length)) + 1);\n\n}", "function selectWord() { \n var words = [\"apple\", \"ice\", \"orange\", \"car\", \"computer\", \n \"game\", \"math\", \"school\", \"juice\", \"soda\", \n \"carrot\", \"purple\", \"movie\", \"superhero\"];\n return words[Math.round(Math.random() * words.length)];\n}", "function pickWord(words) {\n return words[Math.floor(Math.random() * words.length)]\n}", "function pickWord() {\n \"use strict\";\n return words[Math.floor(Math.random() * words.length)];\n}", "function pick() {\r\n index = Math.floor(Math.random() * words.length);\r\n return words[index];\r\n}", "function chooseWord () {\n var word = words[Math.floor(Math.random() * words.length)];\n answer = word.toUpperCase();\n hiddenWord(answer);\n}", "function pickword(dictionary) {\n return dictionary[Math.floor(Math.random() * (dictionary.length - 1))];\n }", "function selectRandomWord(words){\n let wordIndex = Math.floor(Math.random()*words.length);\n return words[wordIndex];\n }", "function selectWord() {\n var randomNumber0to1 = Math.random();\n var randomDecimal = randomNumber0to1 * artistsNames.length;\n var randomIndex = Math.floor(randomDecimal); \n currentWord = new Word(artistsNames[randomIndex]);\n}", "function getWord(){\nrdm = Math.floor((Math.random() * words.length-1) + 1);\n console.log('Word: ' + words[rdm]);\nconsole.log('Random: ' + rdm)\ndocument.getElementById(\"printWord\").innerHTML = words[rdm];\ndocument.getElementById(\"cajatexto\").value =\"\";\nfocusTextBox();\ndspWord = words[rdm];\ndraw();\n}", "function pickWord(list) {\n return list[Math.floor(Math.random() * list.length)];\n}", "function pickword() {\n let word = wordPool[Math.floor(Math.random() * wordPool.length)];\n return word;\n}", "function pickWord(words) {\n var word = stringToArray(words[Math.floor((Math.random() * words.length) + 0)]);\n return word;\n}", "function pickWord(word) {\n var words = [\"monkey\", \"crocodile\", \"hippopotamus\", \"giraffe\", \"pterodactyl\"];\n var word = words[Math.floor(Math.random() * words.length)];\n return word; // Return a random word\n}", "function showWord() {\r\n // Generate random index\r\n const randIndex = Math.floor(Math.random() * 274918);\r\n // Output a random word\r\n setTimeout(() => {currentWord.innerHTML = words[0][randIndex]}, 200)\r\n}", "function rndWord() {\n counter ++;\n if (correctCount == words.length) {\n showDone();\n return;\n }\n word = undefined;\n while (!word || word.learned) {\n word = words[Math.floor(Math.random() * words.length)];\n }\n showWord();\n}", "function randoWordSelect() {\n\n var rando = Math.floor(Math.random() * 27)\n currentWord = words.wordSelection[x];\n // below code will not allow a repeat word to be shown\n if (wordsPlayed.includes(currentWord)){\n randoWordSelect();\n } else {\n player = new Display(currentWord);\n letter = new Check(currentWord);\n }\n wordsGuessed.push(currentWord);\n}", "function chooseWord(list_of_words){ \n return list_of_words[Math.floor(Math.random()*list_of_words.length)];\n}", "function showText() {\n $(\"#textDisplay\").empty();\n $(\"#instructions\").empty();\n randomWords = [];\n for (var i = 0; i < wordCount; i++) {\n var ranWord = wordList[Math.floor(Math.random() * wordList.length)];\n if (wordList[wordList.length - 1] !== ranWord || wordList[wordList.length - 1] === undefined) {\n randomWords.push(ranWord);\n }\n }\n randomWords.forEach(function(word){\n $(\"#textDisplay\").append($(\"<span>\",{\"text\": word + \" \",\"class\":\"word\"}));\n });\n textDisplay.firstChild.classList.add(\"highlightedWord\")\n }", "function displayWord(array){\n word = array[Math.floor(Math.random() * array.length)];\n var display = document.getElementById(\"display\");\n display.innerText = word;\n}", "function init() {\n //picks a random number and matches it to a letter\n currentWord = words[Math.floor(Math.random()*words.length)];\n wordHint.textContent = currentWord.split(\"\").map(letter => letter = \"__\").join(\" \");\n}", "randomWord() {\n return this.randomOption(this.words);\n }", "function selectWord() {\n compGuess = mtnNames[Math.floor(Math.random()*mtnNames.length)];\n isPlaying = true;\n compGuessArr = compGuess.split(\"\");\n console.log('Comp guess array set here '+compGuessArr);\n }", "function randomWord(){\n answer = fruits[Math.floor(Math.random() * fruits.length)];\n}", "function pickAWord() \n{\n\t\tcurrentWord = words[Math.floor(Math.random() * words.length)];\n\tfor(var i = 0; i < currentWord.length; i++)\n\t{\n\t\tanswer[i] = \"_\";\n\t\tdocument.getElementById(\"blanks\").innerHTML = answer;\n\n\t\t// removing the commas from in between the lines.\n\t\tvar remove = document.getElementById(\"blanks\");\n\t\tremove.innerHTML = answer.join(\" \");\n\t\t\n\t}\n}", "function findRandomWord() {\n let range = halloweenArray.length;\n\n // selects a random index from array from the halloween words\n halloweenArrayIndex = Math.round(Math.random() * (range - 1));\n\n // stores that random picked word inside the currentWordArray\n currentWordArray = halloweenArray[halloweenArrayIndex].split(\"\");\n\n // removes the randomly selected word from the halloween array so it cant be used again\n halloweenArray.splice(halloweenArrayIndex, 1);\n\n // selects the hint that goes along with the randomly selected word and sends it to the HTML page\n document.getElementById(\"hint\").innerHTML = hints[halloweenArrayIndex];\n\n // Removes the hint from the array so it can't be selected again\n hints.splice(halloweenArrayIndex, 1);\n\n}", "function random_word(){\n var n = 4 + Math.floor(Math.random() * 6);\n return random_text(n);\n }", "function pickSearchTerm() {\n let options = [\"stop\", \"mad\", \"angry\", \"annoyed\", \"cut it\" ];\n return options[Math.floor(Math.random() * 4)];\n}", "function revealChoices() {\n // Pick 2 words randomly from the word list.\n wordListSample = _.sample(wordList, 3)\n // Hide reveal button after it is clicked.\n document.getElementById(\"revealButton\").style.display = \"none\";\n // Reveal and set text of the first random word.\n document.getElementById(\"choiceOne\").innerHTML = wordListSample[0];\n document.getElementById(\"choiceOne\").style.display = \"block\";\n // Reveal and set text of the second random word.\n document.getElementById(\"choiceTwo\").innerHTML = wordListSample[1];\n document.getElementById(\"choiceTwo\").style.display = \"block\";\n // Reveal and set text of the third random word.\n document.getElementById(\"choiceThree\").innerHTML = wordListSample[2];\n document.getElementById(\"choiceThree\").style.display = \"block\";\n}", "function showWord(words) {\n //a variable to grab a number math.foor to round down, math.random to RNG, words.length for length of words array\n //Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n //We initialized currentWord at start of JS file and use innerHTML to grab value from html h2\n currentWord.innerHTML = words[randIndex];\n}", "function getWords() {\n word.innerText = list[Math.floor(Math.random() * list.length)];\n}", "function wordSelect() {\n // Select a word\n //Math.floor(Math.random() * (max - min) + min)\n let rnd = Math.floor(Math.random() * wordBank.length);\n\n let word = wordBank[rnd].toLowerCase();\n // let word = \"node js\"; // for testing\n //console.log(word);\n \n let result = new Word(word);\n // store the word\n return result;\n}", "function Words() {\n var random = Math.floor(Math.random() * words.length);\n var randomword = words[random];\n console.log(randomword);\n}", "function wordGenerator() {\n randomWord = wordList[Math.floor(Math.random() * wordList.length)];\n // console.log(\"Computer Picked: \" + randomWord);\n letters = randomWord.split('');\n console.log(letters);\n // display length of the random word selected as underscores\n hiddenWord = [];\n for (var i = 0; i < randomWord.length; i++) {\n hiddenWord.push(\"_\");\n console.log(\"computer picked: \" + randomWord);\n // push those underscores to an html element so it displays on the page\n document.getElementById(\"randomWord\").innerText = hiddenWord.join(' ');\n };\n}", "function getWord() {\n var number = Math.floor(Math.random() * words.length);\n return words[number].toLowerCase();\n }", "function getRandomWord() {\n var wordList = [\"DOG\",\"BIRD\",\"MOOSE\",\"CAT\",\"HORSE\",\"COW\",\"PIG\"];\n return wordList[Math.floor(Math.random() * wordList.length)];\n }", "function setGameWord() {\n\tlet random = Math.floor(Math.random() * wordArray.length);\n\tselectedWord = wordArray[random];\n}", "function setWord() {\n currentWord = words[Math.floor(Math.random() * words.length)];\n word.innerHTML = currentWord;\n currentLocation = 0;\n }", "function chooseRandomWord() {\n\n randomWord = wordList[Math.floor(Math.random() * wordList.length)].toUpperCase();\n someWord = new word(randomWord);\n\n console.log(gameTextColor(\"Your word contains \" + randomWord.length + \" letters.\"));\n console.log(gameTextColor(\"WORD TO GUESS: \" + randomWord));\n\n someWord.splitWord();\n someWord.generateLetters();\n guessLetter();\n}", "function getRandomWord() {\n return words[Math.floor(Math.random() * words.length)];\n\n}", "function randomWord() {\r\n answer = guessme[Math.floor(Math.random() * guessme.length)];\r\n console.log(answer);\r\n}", "generateWord() {\n var randomNumber = Math.floor(Math.random() * listOfWords.length)\n chosenWord = listOfWords[randomNumber]\n this.answer = chosenWord\n }", "function randomWord() {\n result = wordslist[Math.floor(Math.random()*wordslist.length)];\n}", "function selectWord() {\n var words = [\"mongoose\", \"pressure\", \"cooker\", \"reactor\", \"sequel\", \"onomatopoeia\", \"monitor\", \"printer\", \"speakers\", \"drive\"];\n randomWord = words[Math.floor(Math.random() * words.length)];\n //console.log(\"random Word: \" + randomWord); // testing\n var newRandWord = new Word(randomWord);\n return newRandWord;\n}", "function getRandomWord() {\n return words[Math.floor(Math.random() * words.length)];\n}", "function getRandomWord() {\n return words[Math.floor(Math.random() * words.length)];\n}", "word(){\n let index = Math.floor((Math.random() * words.length));\n return words[index];\n }", "function createWord() {\r\n let randomNumber = Math.floor(Math.random()*wordList.length);\r\n let wordObject = wordList[randomNumber];\r\n\r\n //definitionText.style.visibility=\"hidden\";\r\n document.getElementById('definition').innerHTML = wordObject.definition;\r\n\r\n\r\n return wordObject.name.toUpperCase(); // to pass to letter buttons\r\n}", "function getRandomWord() {\r\n\twordString = wordRandomizer();\r\n\tlowerCaseRandomWord = wordString.toLowerCase();\r\n}", "function randWord(obj) {\n\tgame.fullWord = game.answerKey[Math.floor(Math.random() * game.answerKey.length)];\n}", "function newWord() {\n $('#word_hint').html(words[Math.floor((Math.random() * words.length))]);\n resetTimer();\n vrtionary.ultimateClear();\n vrtionary.setTeamTime(30);\n}", "function wordSelectorFromArray(theArray, theId){\n\n var adjectivesLength = theArray.length;\n var myRandomNumber = Math.floor(Math.random()*(adjectivesLength-1));\n document.getElementById(theId).innerHTML = theArray[myRandomNumber];\n\n}", "function generateRandomWord() {\n randomWord = words[Math.floor(Math.random() * (words.length))];\n}", "function loadWord() {\n randomWord = wordList[Math.floor(Math.random() * wordList.length)];\n randomWord = randomWord.toUpperCase().split('');\n for(var i = 0; i < arrBlank.length; i++) {\n arrBlank[i].style.visibility = 'hidden';\n arrBlank[i].textContent = randomWord[i];\n }\n}", "function randomWord() {\n\twordToGuess = words[Math.floor(Math.random() * words.length)];\n}", "function getRandomWord() {\n // array taken from https://gist.github.com/borlaym/585e2e09dd6abd9b0d0a\n wordList = [\n \"Aardvark\",\n \"Albatross\",\n \"Alligator\",\n \"Alpaca\",\n \"Ant\",\n \"Anteater\",\n \"Antelope\",\n \"Ape\",\n \"Armadillo\",\n \"Donkey\",\n \"Baboon\",\n \"Badger\",\n \"Barracuda\",\n \"Bat\",\n \"Bear\",\n \"Beaver\",\n \"Bee\",\n \"Bison\",\n \"Boar\",\n \"Buffalo\",\n \"Butterfly\",\n \"Camel\",\n \"Capybara\",\n \"Caribou\",\n \"Cassowary\",\n \"Cat\",\n \"Caterpillar\",\n \"Cattle\",\n \"Chamois\",\n \"Cheetah\",\n \"Chicken\",\n \"Chimpanzee\",\n \"Chinchilla\",\n \"Chough\",\n \"Clam\",\n \"Cobra\",\n \"Cockroach\",\n \"Cod\",\n \"Cormorant\",\n \"Coyote\",\n \"Crab\",\n \"Crane\",\n \"Crocodile\",\n \"Crow\",\n \"Curlew\",\n \"Deer\",\n \"Dinosaur\",\n \"Dog\",\n \"Dogfish\",\n \"Dolphin\",\n \"Dotterel\",\n \"Dove\",\n \"Dragonfly\",\n \"Duck\",\n \"Dugong\",\n \"Dunlin\",\n \"Eagle\",\n \"Echidna\",\n \"Eel\",\n \"Eland\",\n \"Elephant\",\n \"Elk\",\n \"Emu\",\n \"Falcon\",\n \"Ferret\",\n \"Finch\",\n \"Fish\",\n \"Flamingo\",\n \"Fly\",\n \"Fox\",\n \"Frog\",\n \"Gaur\",\n \"Gazelle\",\n \"Gerbil\",\n \"Giraffe\",\n \"Gnat\",\n \"Gnu\",\n \"Goat\",\n \"Goldfinch\",\n \"Goldfish\",\n \"Goose\",\n \"Gorilla\",\n \"Goshawk\",\n \"Grasshopper\",\n \"Grouse\",\n \"Guanaco\",\n \"Gull\",\n \"Hamster\",\n \"Hare\",\n \"Hawk\",\n \"Hedgehog\",\n \"Heron\",\n \"Herring\",\n \"Hippopotamus\",\n \"Hornet\",\n \"Horse\",\n \"Human\",\n \"Hummingbird\",\n \"Hyena\",\n \"Ibex\",\n \"Ibis\",\n \"Jackal\",\n \"Jaguar\",\n \"Jay\",\n \"Jellyfish\",\n \"Kangaroo\",\n \"Kingfisher\",\n \"Koala\",\n \"Kookabura\",\n \"Kouprey\",\n \"Kudu\",\n \"Lapwing\",\n \"Lark\",\n \"Lemur\",\n \"Leopard\",\n \"Lion\",\n \"Llama\",\n \"Lobster\",\n \"Locust\",\n \"Loris\",\n \"Louse\",\n \"Lyrebird\",\n \"Magpie\",\n \"Mallard\",\n \"Manatee\",\n \"Mandrill\",\n \"Mantis\",\n \"Marten\",\n \"Meerkat\",\n \"Mink\",\n \"Mole\",\n \"Mongoose\",\n \"Monkey\",\n \"Moose\",\n \"Mosquito\",\n \"Mouse\",\n \"Mule\",\n \"Narwhal\",\n \"Newt\",\n \"Nightingale\",\n \"Octopus\",\n \"Okapi\",\n \"Opossum\",\n \"Oryx\",\n \"Ostrich\",\n \"Otter\",\n \"Owl\",\n \"Oyster\",\n \"Panther\",\n \"Parrot\",\n \"Partridge\",\n \"Peafowl\",\n \"Pelican\",\n \"Penguin\",\n \"Pheasant\",\n \"Pig\",\n \"Pigeon\",\n \"Pony\",\n \"Porcupine\",\n \"Porpoise\",\n \"Quail\",\n \"Quelea\",\n \"Quetzal\",\n \"Rabbit\",\n \"Raccoon\",\n \"Rail\",\n \"Ram\",\n \"Rat\",\n \"Raven\",\n \"Red deer\",\n \"Red panda\",\n \"Reindeer\",\n \"Rhinoceros\",\n \"Rook\",\n \"Salamander\",\n \"Salmon\",\n \"Sand Dollar\",\n \"Sandpiper\",\n \"Sardine\",\n \"Scorpion\",\n \"Seahorse\",\n \"Seal\",\n \"Shark\",\n \"Sheep\",\n \"Shrew\",\n \"Skunk\",\n \"Snail\",\n \"Snake\",\n \"Sparrow\",\n \"Spider\",\n \"Spoonbill\",\n \"Squid\",\n \"Squirrel\",\n \"Starling\",\n \"Stingray\",\n \"Stinkbug\",\n \"Stork\",\n \"Swallow\",\n \"Swan\",\n \"Tapir\",\n \"Tarsier\",\n \"Termite\",\n \"Tiger\",\n \"Toad\",\n \"Trout\",\n \"Turkey\",\n \"Turtle\",\n \"Viper\",\n \"Vulture\",\n \"Wallaby\",\n \"Walrus\",\n \"Wasp\",\n \"Weasel\",\n \"Whale\",\n \"Wildcat\",\n \"Wolf\",\n \"Wolverine\",\n \"Wombat\",\n \"Woodcock\",\n \"Woodpecker\",\n \"Worm\",\n \"Wren\",\n \"Yak\",\n \"Zebra\"\n ];\n\n var x = Math.floor((Math.random() * wordList.length));\n return wordList[x].toUpperCase();\n }", "function wordRandomizer() {\r\n\treturn randomWords[Math.floor(Math.random()*randomWords.length)];\r\n}", "function getRandomWord() {\n const index = Math.floor(Math.random() * dictionary.length);\n return dictionary[index];\n}", "function RandomWord() {\n var wordRandom = Math.floor(Math.random() * (wordList.length));\n return wordList[parseInt(wordRandom)];\n}", "function getWord() {\n var wordIndex = Math.floor(Math.random() * 10);\n var word = words[wordIndex]\n return word\n}", "function getRandomEasyWord() {\n theWord = wordsEasy[Math.floor(Math.random() * wordsEasy.length)];\n console.log(theWord);\n return theWord\n}", "function getRandomWord(){\n return randomWords[Math.floor(Math.random() * randomWords.length)];\n}", "function randColor() {\n\n // Set random word\n\n\n // Set random word color\n\n\n }", "function displayWords (words) {\n 'use strict'\n\n // add the word to the main display\n $.each(words, function (index, obj) {\n $password.val($password.val() + obj.word.capitalize())\n $passwordConfirm.val($passwordConfirm.val() + obj.word.capitalize())\n var $specialChar = specialCharacters[Math.floor(Math.random() * specialCharacters.length)];\n if (index != (words.length - 1)) {\n var $rand = ~~(Math.random() * 10)\n $password.val($password.val() + $specialChar + $rand)\n $passwordConfirm.val($passwordConfirm.val() + $specialChar + $rand)\n }\n })\n}", "function randWord(){\n var a = 'abtchyplwwah'; \n var b = 'aeyuioee';\n var c = 'eetleouiynmcc'\n var d = 'mnbceeytplttk';\n var w = [a,b,c,d];\n var str = '';\n for(var i=0; i++; i<4)\n {\n var n = (w[i][Math.floor(Math.random() * w[i].length)]);\n n = n || 'e';\n str += n;\n }\n\n }", "function getRandom(word) {\n return word[Math.floor(Math.random() * word.length)];\n }", "function chooseSolution(){\n\t\tvar choice = Math.floor(Math.random() * wordList.length);\n\t\tsolution = wordList[choice].toLowerCase();\n\t\tsolution = solution.split(\"\");\n\t\tsolutionDisplay=[];\n\t\tfor (var i = 0; i < solution.length; i++) {\n\t\t\tsolutionDisplay.push(\"_\");\n\t\t}\n\t}", "function getRandomWord(listOfWords) {\n indexWordSelect = Math.floor(Math.random() * wordsList.length);\n return listOfWords[indexWordSelect];\n}", "function getRandomWord() {\n var x = Math.random() * library.length;\n x = Math.floor(x);\n return library[x];\n }", "function wat(){\n var ranNo = Math.round(Math.random()*10)\n var funnyMessage = [\"You trying to trick me?\", \"Same case silly billy!\", \"Come on stop messing around!\",\n \"What?\", \"cAn NoT cOmPuTe\", \"Computer says no...\", \"Are you trying to be funny?\",\n \"OK I'll just convert that... Not!\", \"You're not the sharpest tool in the box, are you?\", \"How am I supose to work with this?\" ];\n $(\"#textOutput\").val(funnyMessage[ranNo]);\n}", "function wordGen() {\n\tcurrentWord = wordList[Math.floor(Math.random() * wordList.length)].toLowerCase();\n}", "function getRandomNumber() {\n return Math.floor((Math.random() * arrayOfWords.length) + 1);\n} // gets a random number to randomize which item the button click picks from the array", "function getRandomNumber() {\n return Math.floor((Math.random() * arrayOfWords.length) + 1);\n} // gets a random number to randomize which item the button click picks from the array", "function getRandomWord(listOfWords) {\n return listOfWords[getRandomNumber()]\n}", "function select() {\n\t\tif (chosenCategory === randomWord[0]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation One\";\n\t\t} else if (chosenCategory === randomWord[1]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation Two\";\n\t\t}\n\t}", "function selectRandom(){\n var randomNumber = Math.floor(Math.random() * (1, arrayLength));\n var randomWord = wordArray[randomNumber];\n return randomWord;\n}", "function defAndWord(){\r\n\r\n document.getElementById('wordDef').innerHTML=def[randIndex];\r\n}", "function play(){\n randNum = Math.floor(Math.random() * words.length);\n choosenWord = words[randNum];\n rightword = [];\n wrongword = [];\n underscore = [];\n remains = 10;\n document.getElementById(\"underscore\").textContent = generateUnderscore();\n document.getElementById(\"underscore\").textContent = underscore;\n document.getElementById(\"right\").textContent = rightword;\n document.getElementById(\"wrong\").textContent = wrongword;\n \n console.log(choosenWord)\n\n}", "function getWord(){\r\n\t// gets a random number within the list number of elements.\r\n\tvar randomNumber = Math.floor(Math.random() * wordList.length);\r\n\t// gets the word from that random position.\r\n\tvar returnWord = wordList[randomNumber];\r\n\treturn returnWord;\r\n}", "function generateEasy(easyWords) {\n temp = \"\"\n $.getJSON(easyWords, function(data) {\n let wordVal = Math.floor(Math.random() * data.length)\n actual = data[wordVal].word.toUpperCase()\n for (let i = 0; i < actual.length; i++) {\n if (actual.substring(i, i + 1) == \" \") {\n temp += \" \"\n } \n else {\n temp += \"_\"\n }\n }\n $(\".easy\").text(temp)\n })\n}", "function generateSentence() {\nvar randomIndex = Math.floor(Math.random() * sentences.length);\ncurrentSentence = sentences[randomIndex];\nprompt.innerHTML = currentSentence;\n}", "function startGame() {\n select = Math.floor(Math.random() * wordList.length);\n chosenWord = wordList[select];\n gameWord = new Word(chosenWord);\n gameWord.createWord();\n if (select > -1) {\n wordList.splice(select, 1);\n }\n console.log(\n \"You get 8 letter guesses to correctly find the type of fruit.\\n Good luck!\"\n .cyan\n );\n promptUser();\n}", "function chooseRandomWord() {\n randomWord = wordList[Math.floor(Math.random() * wordList.length)].toUpperCase();\n //Set the random word chosen from the word list to aWord.\n aWord = new Word (randomWord);\n //Tell the user how many letters are in the word.\n console.log(\"Your word contains \" + randomWord.length + \" letters.\");\n console.log(\"Word to guess: \");\n //Use the Word constructor in Word.js to split the word and generate letters.\n aWord.splitWord();\n guessLetter();\n //aWord.lettersNeeded();\n \n }", "function pickWord() {\n //Randomly picks one word from wordList\n word = wordList[Math.floor(Math.random() * wordList.length)]\n //Splitting word by each character and placing it into the empty wordToGuess array\n wordToGuess = word.split(\"\");\n console.log(word);\n //Creating the blank spaces for the guessable word\n for(var i = 0; i < wordToGuess.length; i++) {\n displayWord.push(\"_\");\n }\n var wordDisplay = displayWord.join(\" \");\n document.getElementById(\"word-to-guess\").innerHTML = wordDisplay;\n}", "selectRandomText()\n {\n const textes = this.state.textes; \n this.setState({selectedText: textes[Math.floor(Math.random() * textes.length)]});\n this.setState({currentAudioUrl: null});\n }", "function getRandom() {\n return Math.floor(Math.random() * words.length);\n}" ]
[ "0.8195292", "0.81868297", "0.81232285", "0.8092015", "0.7974458", "0.7954044", "0.7947433", "0.79459184", "0.7929834", "0.7914344", "0.78949654", "0.7879488", "0.78731376", "0.78596306", "0.7837906", "0.7717689", "0.769889", "0.76771945", "0.76375425", "0.7619843", "0.7613188", "0.75957847", "0.75948465", "0.75849885", "0.7572175", "0.75314736", "0.7529501", "0.7528452", "0.75145847", "0.748315", "0.7481329", "0.7476238", "0.7460998", "0.74160296", "0.7399606", "0.7395391", "0.7371649", "0.73654616", "0.7365386", "0.7364207", "0.7362793", "0.7361133", "0.7334678", "0.7283146", "0.7275265", "0.7274103", "0.7270816", "0.72340167", "0.72298366", "0.7229501", "0.72289646", "0.72271365", "0.72235566", "0.71850944", "0.71798223", "0.71702135", "0.71621704", "0.71524155", "0.7147717", "0.7147717", "0.7127219", "0.71233326", "0.71061164", "0.7104712", "0.70967966", "0.7092596", "0.7088953", "0.70883083", "0.7071481", "0.7068498", "0.7060092", "0.70296556", "0.7013059", "0.7012808", "0.7010907", "0.7009013", "0.7005891", "0.70020324", "0.69988567", "0.6985622", "0.698412", "0.69487214", "0.69309986", "0.6908323", "0.688883", "0.68882734", "0.68882734", "0.68807805", "0.68804026", "0.68782663", "0.6855309", "0.6849664", "0.68496096", "0.68459415", "0.68372244", "0.68345565", "0.6832703", "0.683256", "0.68224066", "0.6821198" ]
0.78401124
14
Returns the path at which the asset can be found in the archive
function getPathInArchive(asset) { if (Platform.OS === 'android') { var assetDir = getBasePath(asset); // E.g. 'assets_awesomemodule_icon' // The Android resource system picks the correct scale. return (assetDir + '/' + asset.name) .toLowerCase() .replace(/\//g, '_') // Encode folder structure in file name .replace(/([^a-z0-9_])/g, '') // Remove illegal chars .replace(/^assets_/, ''); // Remove "assets_" prefix } else { // E.g. 'assets/AwesomeModule/[email protected]' return getScaledAssetPath(asset); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get assetPath() {}", "get assetPath() {}", "get assetBundleManifestPath() {}", "get assetpath() {\n // Don't override existing assetpath.\n if (!this.__assetpath) {\n // note: assetpath set via an attribute must be relative to this\n // element's location; accomodate polyfilled HTMLImports\n const owner = window.HTMLImports && HTMLImports.importForElement ? HTMLImports.importForElement(this) || document : this.ownerDocument;\n const url = (0, _resolveUrl.resolveUrl)(this.getAttribute('assetpath') || '', owner.baseURI);\n this.__assetpath = (0, _resolveUrl.pathFromUrl)(url);\n }\n\n return this.__assetpath;\n }", "function getAssetsPath() {\r\n return getBuildPath() + config.build.assetsPath;\r\n}", "get assetsDir() {\n let ret = this.YAML.akashaepub\n && this.YAML.akashaepub.assetsDir\n ? this.YAML.akashaepub.assetsDir\n : \"assets\"; // : undefined;\n // This could be an array of values\n if (Array.isArray(ret)) {\n return ret;\n }\n // Make sure assets directory exists\n let stats;\n try {\n stats = fs.statSync(ret);\n } catch (e) {\n stats = undefined;\n }\n if (stats && stats.isDirectory()) {\n return ret;\n } else if (ret === \"assets\") {\n return undefined;\n } else {\n throw new Error(`assetsDir does not exist ${ret}`);\n }\n }", "getAssetRoots() {\n return [__dirname];\n }", "get fullPath() {\n return path.join(this.assembly.directory, this.directoryName);\n }", "function getBasePath(asset) {\n // TODO(frantic): currently httpServerLocation is used both as\n // path in http URL and path within IPA. Should we have zipArchiveLocation?\n var path = asset.httpServerLocation;\n if (path[0] === '/') {\n path = path.substr(1);\n }\n return path;\n}", "function getAssetPath (category) {\n return process.env.WEBPACK_ENV === 'development' ?\n `${category}/[name].[ext]` :\n `${category}/[hash].[ext]`;\n}", "get mainAsset() {}", "function getChunkAssetPath(assetsByChunkName, chunkName) {\n if (assetsByChunkName && assetsByChunkName[chunkName]) {\n if (typeof assetsByChunkName[chunkName] === 'string') {\n return assetsByChunkName[chunkName];\n } else {\n return assetsByChunkName[chunkName][0];\n }\n }\n return null;\n }", "function buildAssetPath(imgSrc) {\n return `./dist/${imgSrc}`;\n}", "function getAssetsPath()\n\t{\n\t\tvar generatorConfigFile = new File(\"~/generator.js\");\n\t\tvar cfgObj = {};\n\t\tvar gao = {};\n\t\tvar baseDirectory = undefined;\n\n\t\tif(generatorConfigFile.exists)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar str = JSUI.readFromFile(generatorConfigFile, \"UTF-8\");\n\n\t\t\t\tcfgObj = JSON.parse(str.replace(\"module.exports = \", \"\"));\n\t\t\t\tgao = cfgObj[\"generator-assets\"];\n\t\t\t\tbaseDirectory = gao[\"base-directory\"];\n\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\tif($.level) $.writeln(\"Error parsing generator.js\");\n\t\t\t}\n\t\t}\n\t\treturn baseDirectory;\n\t}", "_getArtifactPathFromFullyQualifiedName(fullyQualifiedName) {\n const { sourceName, contractName } = (0, contract_names_1.parseFullyQualifiedName)(fullyQualifiedName);\n return path.join(this._artifactsPath, sourceName, `${contractName}.json`);\n }", "async _getArtifactPath(name) {\n if ((0, contract_names_1.isFullyQualifiedName)(name)) {\n return this._getValidArtifactPathFromFullyQualifiedName(name);\n }\n const files = await this.getArtifactPaths();\n return this._getArtifactPathFromFiles(name, files);\n }", "function assetFinder(combatChoice) {\n return \"assets/\" + combatChoice + \".png\"\n }", "function getPathOnDevserver(devServerUrl, asset) {\n return devServerUrl + getScaledAssetPath(asset) + '?hash=' + asset.hash;\n}", "_getArtifactPathSync(name) {\n if ((0, contract_names_1.isFullyQualifiedName)(name)) {\n return this._getValidArtifactPathFromFullyQualifiedNameSync(name);\n }\n const files = this._getArtifactPathsSync();\n return this._getArtifactPathFromFiles(name, files);\n }", "atPath(fileName) {\n return new ArtifactPath(this, fileName);\n }", "get localPath() {\n return this._manager.contents.localPath(this._path);\n }", "get templateFullPath() {\n return path.join(this.assembly.directory, this.templateFile);\n }", "getSrcPath()\n {\n return path.join(this.getRootPath(), 'src');\n }", "getResourcePath(staticSymbol) {\n return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;\n }", "getResourcePath(staticSymbol) {\n return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;\n }", "getResourcePath(staticSymbol) {\n return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;\n }", "getResourcePath(staticSymbol) {\n return this.symbolResourcePaths.get(staticSymbol) || staticSymbol.filePath;\n }", "function getAsset(name, dir, ext){\n\treturn host + \"img/\" + dir + \"/\" + name + \".\" + ext + \"?v=\" + siteVersion;\n}", "get 'asset-path'() { return process.env.PUBLIC_URL ? `\"${process.env.PUBLIC_URL}\"` : '\"/\"'; }", "getResourcePath() {\n let annotationAttachment = this.props.model.filterAnnotationAttachments((attachment) => {\n return attachment.getAnnotationName().value === 'resourceConfig';\n })[0];\n annotationAttachment = annotationAttachment || {};\n annotationAttachment.attributes = annotationAttachment.attributes || [];\n const pathAtributeNode = _.filter(annotationAttachment.attributes, (atribute) => {\n return atribute.getName().value === 'path';\n })[0];\n if (pathAtributeNode && pathAtributeNode.getValue() && pathAtributeNode.getValue()) {\n return pathAtributeNode.getValue().getValue().unescapedValue;\n }\n return '/' + this.props.model.name.value;\n }", "get path() {\n return this.constructor.buildPath(\n this._org,\n this._type,\n this._name,\n this._version,\n this._extra,\n );\n }", "static get path() {\n let url = _PROPERTIES_.get(this).path;\n if (!!!url) {\n // Reverse-Engineer the path from the <script> element.\n let a = document.createElement('a'),\n href = _PROPERTIES_.get(this).script.src + '/../';\n a.href = href;\n // Store path locally to avoid external tampering\n url = _PROPERTIES_.get(this).path = a.href;\n\n /** @todo Insecure. Used for electron compatibility.\n * Add support for custom protocols.\n */\n // Support Electron file: protocol\n if ('file:' === a.protocol\n && 'function' === typeof require\n && 'object' === typeof require('electron')) {\n let {webFrame} = require('electron');\n webFrame.registerURLSchemeAsPrivileged('file');\n }\n }\n return url;\n }", "get sourceBookFullPath() {\n return path.normalize(path.join(this.configDirPath, this.bookroot ? this.bookroot : \"\"));\n }", "function assetUrl (asset, extraParams) {\n try {\n var url = asset.fields.file.url;\n if (extraParams) {\n var queryString = '';\n for (var key in extraParams) {\n queryString += '&' + key + '=' + extraParams[key];\n }\n url += '?' + queryString.substr(1);\n }\n return url;\n } catch (e) {\n console.error('Asset had no file URL:', asset);\n return 'images/show_item_01.jpg';\n }\n }", "get SNAPSHOT_DIR() {\n return resolve(__dirname, '../snapshot')\n }", "function _getBasePath() {\r\n\tvar refPath = '/assets/kindeditor/';\r\n\tvar els = document.getElementsByTagName('script'), src;\r\n\tfor (var i = 0, len = els.length; i < len; i++) {\r\n\t\tsrc = els[i].src || '';\r\n\t\tif (/(kindeditor|application)[\\w\\-\\.]*\\.js/.test(src)) {\r\n\t\t\treturn src.substring(0, src.indexOf('assets')) + refPath;\r\n\t\t}\r\n\t}\r\n\treturn refPath;\r\n}", "get _location() {\n if (this._file)\n return this._file.path;\n\n if (this._uri)\n return this._uri.spec;\n\n return \"\";\n }", "function getScaledAssetPath(asset) {\n const scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get());\n const scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';\n const type = !asset.type ? '' : `.${asset.type}`;\n if (__DEV__) {\n return asset.httpServerLocation + '/' + asset.name + scaleSuffix + type;\n }\n else {\n return asset.httpServerLocation.replace(/\\.\\.\\//g, '_') + '/' + asset.name + scaleSuffix + type;\n }\n}", "getFileUrl(path) { return this.engine.getFileUrl(path); }", "function getJSPath() {\r\n return getAssetsPath() + config.build.jsPath;\r\n}", "function getS3Artifact(artifact) {\n return artifact.location.split(':')[5]\n}", "getUrl() {\n return this.folder.url()+\"/\"+this.file;\n }", "set assetPath(value) {}", "set assetPath(value) {}", "function getItemFilePath (item) {\n\t\tvar f = config.archiveFolder + utils.getDatePath (item.when) + utils.padWithZeros (item.id, 5) + \".json\";\n\t\treturn (f);\n\t\t}", "getResource() {\n return super.getAsNullableString(\"resource\");\n }", "formArtifactPathFromFullyQualifiedName(fullyQualifiedName) {\n const { sourceName, contractName } = (0, contract_names_1.parseFullyQualifiedName)(fullyQualifiedName);\n return path.join(this._artifactsPath, sourceName, `${contractName}.json`);\n }", "resolveAsPath() { }", "async getLocalUriForImage() {\n const { image } = this.props.route.params;\n\n // Make sure the directory exists, and create the uri for the image in that directory\n await this.ensureDirExists();\n const localFileUri = this._imageDirectory + `${uuidv4()}.jpeg`;\n console.log(localFileUri);\n\n // Get data pertaining to the image if it already exists in the directory\n const fileInfo = await FileSystem.getInfoAsync(localFileUri);\n if (!fileInfo.exists) {\n await FileSystem.downloadAsync(image.downloadURL, localFileUri);\n }\n return localFileUri;\n }", "getAssetRoots() {\n return getRoots()\n }", "get bookroot() {\n // console.log(this.YAML);\n let ret = this.YAML\n && this.YAML.akashaepub.bookroot\n ? this.YAML.akashaepub.bookroot\n : \"documents\"; // : undefined;\n // This could be an array of values\n if (Array.isArray(ret)) {\n return ret;\n }\n // Make sure assets directory exists\n let stats;\n try {\n stats = fs.statSync(ret);\n } catch (e) {\n stats = undefined;\n }\n // console.log(`bookroot `, ret);\n if (stats && stats.isDirectory()) {\n return ret;\n } else if (ret === \"documents\") {\n return undefined;\n } else {\n throw new Error(`bookroot does not exist ${ret}`);\n }\n }", "get path() {}", "function detectAssetURL() {\n try {\n // Try to get the url from the canonical tag on the page.\n return document.querySelector('link[rel=\"canonical\"]').href;\n } catch (e) {\n window.console.warn(\n 'This page does not include a canonical link tag. Talk has inferred this asset_url from the window object. Query params have been stripped, which may cause a single thread to be present across multiple pages.'\n );\n\n return window.location.origin + window.location.pathname;\n }\n}", "function getZipFilePath() {\n var fileName = task.getInput('zipfilename', true);\n var folder = task.getPathInput('zipfiledirectory', true).replace(/\\\"/g, \"\");\n task._writeLine('Looking for zip files in: ' + folder);\n task._writeLine(\"* * * START Files in Zip File Directory * * *\");\n var matchingFilePath = getMatchingZipFileInDirectory(folder, fileName);\n task._writeLine(\"* * * END Files in Zip File Directory * * *\");\n task._writeLine('matchingFile:' + matchingFilePath);\n return matchingFilePath;\n}", "get cahceFile() {\n return Url.join(CACHE_STORAGE, this.#id);\n }", "function getEnginePath()\n{\n var enginePath = air.EncryptedLocalStore.getItem(\"enginePath\");\n return enginePath;\n}", "get assetBundleName() {}", "getResourcesDirectory() {\n let appPath = remote.app.getAppPath();\n\n if (process.cwd() === appPath) return './';\n else return process.resourcesPath + '/';\n }", "function embeddedAsmPath(scope) {\n const appAsmRoot = assemblyBuilderOf(appOf(scope)).outdir;\n const stage = core_1.Stage.of(scope) ?? appOf(scope);\n const stageAsmRoot = assemblyBuilderOf(stage).outdir;\n return path.relative(appAsmRoot, stageAsmRoot) || '.';\n}", "getUrl() {\n if (this.state != remote_file) {\n return undefined;\n }\n let [ssName, storageService] = getStorageService();\n return storageService.getUrl(this._obj.location);\n }", "get location() {\n if (this.#SAFMode === 'single') return null;\n if (this.#uri) {\n try {\n return Url.dirname(this.#uri)\n } catch (error) {\n return null;\n }\n }\n return null;\n }", "function scriptPath()\n {\n // obtain plugin path from the script element\n var src;\n if (document.currentScript) {\n src = document.currentScript.src;\n } else {\n var sel = document.querySelector('script[src$=\"/whiteboard.js\"]')\n if (sel) {\n src = sel.src;\n }\n }\n\n var path = typeof src === undefined ? src\n : src.slice(0, src.lastIndexOf(\"/\") + 1);\n return path;\n }", "function getSrc(router, resource) {\n return router ? router.basePath + resource.src : resource;\n}", "function srcPath(src) {\n return path.join(snowpackOutDir, 'src', src);\n}", "getStaticAssetManifest() {\n return RouteGroup_1.staticAssetManifest;\n }", "makeImagePath(product) {\n return require(`../assets/images/${product.images[0]}`);\n }", "function localFile(fileName) {\n\treturn fileURLToPath(new URL(fileName, import.meta.url));\n}", "function getScriptPath() {\n var scripts = document.getElementsByTagName('script');\n return scripts.length ? scripts[scripts.length - 1].src : '';\n }", "path (fileName, { title, published, meta = {} }) {\n if (meta.slug) {\n return meta.slug\n }\n\n const slug = slugify(title || fileName)\n const date = published.toString().split(/\\s+/).slice(1, 4).reverse()\n return `${date[0]}/${date[2].toLowerCase()}/${date[1]}/${slug}/`\n }", "function filename() {\r\n var rutaAbsoluta = self.location.href;\r\n var posicionUltimaBarra = rutaAbsoluta.lastIndexOf(\"/\");\r\n var rutaRelativa = rutaAbsoluta.substring(posicionUltimaBarra + \"/\".length, rutaAbsoluta.length);\r\n return rutaRelativa;\r\n}", "function getPath(){\n\t\treturn this.path;\n\t}", "function distAssetsPath(...pathSegements) {\n return pkgRootPath(bldConsts.distDirname, 'pattern-library-assets', ...pathSegements);\n}", "get imagePath(){\n return My_Resource +'/img/' + this.logoName;\n }", "function getPosterPath (torrentSummary) {\n if (!torrentSummary || !torrentSummary.posterFileName) return null\n const posterPath = path.join(config.POSTER_PATH, torrentSummary.posterFileName)\n // Work around a Chrome bug (reproduced in vanilla Chrome, not just Electron):\n // Backslashes in URLS in CSS cause bizarre string encoding issues\n return posterPath.replace(/\\\\/g, '/')\n}", "function getBuildPath() {\r\n return config.build.path;\r\n}", "function findImageURL() {\n for (var _i = 0, _a = triviaData.includes.Asset; _i < _a.length; _i++) {\n var asset = _a[_i];\n if (currentQuestion.fields.image.sys.id == asset.sys.id) {\n return \"https:\" + asset.fields.file.url;\n }\n }\n return;\n}", "getDistributableFile(name) {\n return new Promise((resolve, reject) => {\n try {\n let bundlePath = `${this.rootPath}/${name}/Manifest.json`;\n fs_1.access(bundlePath, fs_1.constants.R_OK, (error) => {\n if (error) {\n reject(error);\n }\n else {\n resolve(bundlePath);\n }\n });\n }\n catch (error) {\n reject(error);\n }\n });\n }", "get bookRenderDest() {\n if (this.YAML.akashaepub && this.YAML.akashaepub.bookdest) {\n return this.YAML.akashaepub.bookdest;\n } else if (this.YAML.rendered) {\n return this.YAML.rendered;\n } else {\n return \"out\";\n }\n /* return (this.YAML.akashaepub && this.YAML.akashaepub.bookdest)\n ? this.YAML.akashaepub.bookdest\n : \"out\"; // : undefined; */\n }", "function getTorrentPath (torrentSummary) {\n if (!torrentSummary || !torrentSummary.torrentFileName) return null\n return path.join(config.TORRENT_PATH, torrentSummary.torrentFileName)\n}", "function isAsset(url) {\n // Look if belongs to primary\n if (assetsList.indexOf(url.pathname) !== -1) return true;\n // In case slash at the end is forgotten\n if (assetsList.indexOf(`${url.pathname}/`) !== -1) return true;\n return false;\n}", "get pathSrc() {\n\t\treturn this._options['pathSrc'];\n\t}", "abs (relativePath) {\n return this.url(relativePath).href;\n }", "function absImgLoc(scriptname) {\n\t\tvar scriptElements = document.getElementsByTagName('script');\n\t\tfor (var i = 0; i < scriptElements.length; i++) {\n\t\t\tvar source = scriptElements[i].src;\n\t\t\tif (source.indexOf(scriptname) > -1) {\n\t\t\t\tvar loc = source.substring(0, source.indexOf(scriptname)) + scriptname;\n\t\t\t\treturn loc.replace(scriptname, 'images/');\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function getAsset(assetId) {\n\n // find the asset\n var foundAsset = _.find(includes.Asset, function (asset) {\n\n return asset.sys.id === assetId;\n\n });\n\n// console.log('GETASSET foundAsset:', foundAsset);\n\n // TODO: Think about returning the found object as-is\n return {\n id: assetId,\n title: foundAsset.fields.title,\n url: foundAsset.fields.file.url\n };\n\n }", "getHmrPath() {\n return `${this.publicPath}__wpackio`;\n }", "get path() {\n return this.constructor.buildPath(\n this._org,\n this._type,\n this._name,\n this._alias,\n );\n }", "get publicPath() { return path.resolve('./' + this.publicFolder + '/' )}", "GetAsset(path, type){\n\t\tvar assets = this.assets.getChildren();\n\t\t//Check there already is an asset entry for this path\n\t\tfor(var i = 0; i < assets.length; i++)\n\t\t\tif(assets[i].getAttribute(\"src\") === path)\n\t\t\t\treturn assets[i].getAttribute(\"id\");\n\n\t\t//Create a new asset entry if it did not exist yet\n\t\tvar asset = document.createElement(type);\n\t\tasset.setAttribute(\"src\",path);\n\n\t\t//Asset id\n\t var id = \"asset-\" + this.asset_id++;\n\t asset.setAttribute(\"id\", id);\n\n\t \tthis.assets.appendChild(asset);\n\n\t return id;\n\t}", "_setPathAndFileType(targetPath) {\n if (this.node.data.isInsideArchive()) {\n targetPath = \"\";\n }\n else {\n if (this.node.data.isFile() || this.node.data.isArchive()) {\n if (targetPath.indexOf('/') > -1) {\n targetPath = targetPath.substr(0, targetPath.lastIndexOf('/'))\n }\n else if (targetPath.indexOf('\\\\') > -1) {\n targetPath = targetPath.substr(0, targetPath.lastIndexOf('\\\\'))\n }\n else {\n targetPath = \"\";\n }\n }\n }\n if (this.firstInit) {\n if (this.comm && this.comm.localRepo) {\n this.deployFile = {\n repoDeploy: this.comm.localRepo,\n targetPath: targetPath\n }\n } else {\n this.deployFile = {\n repoDeploy: this.node.data.type == 'local' ? this.comm.reposList[0] : '',\n targetPath: targetPath\n }\n }\n } else {\n if (this.deployFile && this.deployFile.unitInfo && this.deployFile.unitInfo.mavenArtifact) {\n this.deployFile.unitInfo.mavenArtifact = false;\n }\n if (this.deployFile && this.deployFile.unitInfo && this.deployFile.unitInfo.debianArtifact) {\n this.deployFile.unitInfo.debianArtifact = false;\n }\n this.deployFile.unitInfo = {};\n this.deployFile.fileName = '';\n this.deploySingleUploader.clearQueue();\n this.deployFile.targetPath = targetPath;\n }\n this.uploadCompleted = false;\n this.firstInit = false;\n }", "getAsset (file) {\n return AV.Asset.fromFile(folder + file);\n }", "insuranceCardPath () {\n if (!this.coverage.card_front)\n return;\n return this.coverage.card_front.path;\n }", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-18,\"y\":-17,\"w\":37,\"h\":17},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAAHElEQVR42u3BAQEAAACCIP+vbkhA\\nAQAAAAAAfBoZKAABfmfvpAAAAABJRU5ErkJggg==\",\n\t};\n}", "getProperPath(a_src) {\n\t\tif (!Utils.IsAbsolutePath(a_src)) {\n\t\t\treturn this.path;\n\t\t} else return \"\";\n\t}", "getDistributableFile(config) {\n return this.checkVersion(config)\n .then((result) => {\n if (result) {\n return new Promise((resolve, reject) => {\n try {\n let bundlePath = `${this.rootPath}/${config.domain}/${config.name}/dist/bundle.zip`;\n fs.access(bundlePath, fs.constants.R_OK, (error) => {\n if (error) {\n let message = '';\n if (error && (error.code === 'ENOENT')) {\n message = `Distributable file not found for component \"${config.domain}/${config.name}\"`;\n }\n else {\n message = error.message;\n }\n reject(new Error(`Error registering component ${config.domain}/${config.name}: ${message}`));\n }\n else {\n resolve(bundlePath);\n }\n });\n }\n catch (error) {\n reject(new Error(`Error registering component ${config.domain}/${config.name}: ${error.message}`));\n }\n });\n }\n else {\n return Promise.reject(new Error(`Version \"${config.version}\" of component \"${config.domain}/${config.name}\" not found in the workspace`));\n }\n });\n }", "findMedalImage(medal) {\n const host = \"https://bungie.net/\";\n\n let iconPath = MedalsDefinition[medal].iconImage;\n let fullIconPath = host + iconPath;\n\n return (fullIconPath);\n }", "function scriptPath() {\n\t\t// obtain plugin path from the script element\n\t\tvar path;\n\t\tif (document.currentScript) {\n\t\t\tpath = document.currentScript.src.slice(0, -20);\n\t\t} else {\n\t\t\tvar sel = document.querySelector('script[src$=\"scrollable_slides.js\"]');\n\t\t\tif (sel) {\n\t\t\t\tpath = sel.src.slice(0, -20);\n\t\t\t}\n }\n\n\t\treturn path;\n\t}", "function pathSolver(src) {\n return 'resources/' + src;\n}", "get url() {\n return artifactAttribute(this, 'URL');\n }", "LoadAsset() {}", "getPath() {\n if (this.props.root) {\n return this.props.instance.path;\n }\n return this.props.getPath(this.props.instance.uniqueId);\n }" ]
[ "0.72988594", "0.72988594", "0.6928078", "0.6344683", "0.6304178", "0.62533545", "0.61659217", "0.6121274", "0.59751874", "0.5935436", "0.5926797", "0.5808916", "0.5782934", "0.5780586", "0.57536286", "0.5746315", "0.57212144", "0.56528574", "0.56408256", "0.5589051", "0.55822265", "0.5570647", "0.5551792", "0.5551143", "0.5551143", "0.5551143", "0.5551143", "0.554026", "0.5527556", "0.55122685", "0.5485394", "0.5457194", "0.5450292", "0.5448448", "0.5447218", "0.54436684", "0.54414153", "0.54165024", "0.5409238", "0.5383633", "0.53662467", "0.5362042", "0.53515255", "0.53515255", "0.53416705", "0.5310146", "0.5304554", "0.52726454", "0.5271166", "0.5269281", "0.52617836", "0.5254155", "0.5240553", "0.52281857", "0.5224934", "0.5224103", "0.5219229", "0.5210434", "0.51983094", "0.51971364", "0.5185521", "0.51805395", "0.5179683", "0.5163178", "0.51519996", "0.51498693", "0.5146504", "0.51443607", "0.5143255", "0.5138391", "0.5137688", "0.5132993", "0.5132354", "0.5124743", "0.5121938", "0.5103061", "0.50966173", "0.50954115", "0.5093743", "0.5091624", "0.5084241", "0.5066631", "0.5064758", "0.5060093", "0.50488746", "0.50476223", "0.5041152", "0.50329214", "0.50326383", "0.5032136", "0.50271475", "0.50257903", "0.50248855", "0.5016515", "0.50147545", "0.5012467", "0.5009396", "0.5006587", "0.5002941", "0.49965468" ]
0.73705804
0
Returns an absolute URL which can be used to fetch the asset from the devserver
function getPathOnDevserver(devServerUrl, asset) { return devServerUrl + getScaledAssetPath(asset) + '?hash=' + asset.hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function url(id) {\n var basedir = getCallsiteDirname();\n return 'url(' + requireAssets(id, basedir) + ')';\n}", "getURL(url) {\n return this.isDev() ? path.join(\"../\", url) : url\n }", "get 'asset-path'() { return process.env.PUBLIC_URL ? `\"${process.env.PUBLIC_URL}\"` : '\"/\"'; }", "get assetPath() {}", "get assetPath() {}", "getUrl() {\n if (this.state != remote_file) {\n return undefined;\n }\n let [ssName, storageService] = getStorageService();\n return storageService.getUrl(this._obj.location);\n }", "getPublicPathUrl() {\n return `${this.getServerUrl()}${this.publicPath}`;\n }", "function getResourceUrl(url) {\n return _baseUrl + url;\n}", "function getResourceUrl(url) {\n return _baseUrl + url;\n}", "function getResourceUrl(url) {\n return _baseUrl + url;\n}", "function getResourceUrl(url) {\n return _baseUrl + url;\n}", "function getResourceUrl(url) {\r\n return _baseUrl + url;\r\n}", "function getResourceUrl(url) {\r\n return _baseUrl + url;\r\n}", "getURL() {\n return Meteor.absoluteUrl(`${ UploadFS.config.storesPath }/${ this.name }`, {\n secure: UploadFS.config.https\n });\n }", "get BASE_URL() {\n return this.USE_LOCAL_BACKEND ?\n 'http://' + manifest.debuggerHost.split(`:`).shift() + ':3000/' + this.API_VERSION :\n 'https://mhacks.org/' + this.API_VERSION\n }", "function assetUrl (asset, extraParams) {\n try {\n var url = asset.fields.file.url;\n if (extraParams) {\n var queryString = '';\n for (var key in extraParams) {\n queryString += '&' + key + '=' + extraParams[key];\n }\n url += '?' + queryString.substr(1);\n }\n return url;\n } catch (e) {\n console.error('Asset had no file URL:', asset);\n return 'images/show_item_01.jpg';\n }\n }", "function getImageBaseUrl (url, config, item) {\n var baseUrl = ''\n if (item.use_file_server) {\n baseUrl = config.file_server\n }\n return baseUrl\n}", "get url() {\n return `/preview/${this.context.envRuntime.id}`;\n }", "get url() {\n return artifactAttribute(this, 'URL');\n }", "function getAsset(name, dir, ext){\n\treturn host + \"img/\" + dir + \"/\" + name + \".\" + ext + \"?v=\" + siteVersion;\n}", "function dbv_get_static_url() {\n var str = $('#dbv_main_js').attr('src').split('/');\n str.pop();\n return str.join('/');\n}", "function detectAssetURL() {\n try {\n // Try to get the url from the canonical tag on the page.\n return document.querySelector('link[rel=\"canonical\"]').href;\n } catch (e) {\n window.console.warn(\n 'This page does not include a canonical link tag. Talk has inferred this asset_url from the window object. Query params have been stripped, which may cause a single thread to be present across multiple pages.'\n );\n\n return window.location.origin + window.location.pathname;\n }\n}", "function getServerURL() {\n const url = isDev ? \"http://localhost:4000\" : document.location.host;\n log(\"Requested server: \", url);\n return url;\n}", "function SafeResourceUrl() { }", "function SafeResourceUrl() { }", "function SafeResourceUrl() { }", "get() {\n return `${process.env.APP_URL}/files/${this.path}`;\n }", "get apiUrl() {\n return `http://${this.host}:${this.tempApiPort}/api`; // setups up the url that the api is located at and used as a shortcut for our fetch api scripts to retrieve data\n }", "getFileUrl(path) { return this.engine.getFileUrl(path); }", "function getVendorPublicPath() {\n return `http://localhost:9000/vendor/`;\n}", "validateAssetUrl (data) {\n\t\tconst assetEnv = this.apiConfig.api.assetEnvironment;\n\t\tconst pluginName = this.pluginName.replace(/ /g, '').toLowerCase();\n\t\tAssert.equal(\n\t\t\tdata.latestAssetUrl, \n\t\t\t`https://assets.codestream.com/${assetEnv}/${pluginName}/codestream-latest.vsix`,\n\t\t\t'asset URL is not correct'\n\t\t);\n\t}", "worldUrl() {\n return this.serverFolder.baseUrl+this.serverFolder.name;\n }", "getUrl() {\n return this.folder.url()+\"/\"+this.file;\n }", "function getResourceUrl() { return \"http://\"+location.href.split(\"//\")[1].split(\"/\").splice(0,3).join(\"/\")+'.json?api_key='+MoviePilot.apikey;}", "function getFileURL() {\n return urlVars['file'];\n}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "function SafeResourceUrl() {}", "static get FILE_URL() {\n const port = 8000;\n return `http://localhost:${port}/data/vgsales55c93b8.csv`;\n }", "function glazierUrl(url) {\n if (Glazier.manifest) {\n var translatedUrl = Glazier.manifest[url];\n if (translatedUrl) {\n return Glazier.assetHost + translatedUrl;\n }\n }\n return null;\n}", "function getUrl() {\n var url = \"https://raw.githubusercontent.com/radytrainer/test-api/master/test.json\";\n return url;\n}", "getServerUrl() {\n const {\n host,\n port\n } = this.serverConfig;\n return `//${host || 'localhost'}:${port}`;\n }", "get assetpath() {\n // Don't override existing assetpath.\n if (!this.__assetpath) {\n // note: assetpath set via an attribute must be relative to this\n // element's location; accomodate polyfilled HTMLImports\n const owner = window.HTMLImports && HTMLImports.importForElement ? HTMLImports.importForElement(this) || document : this.ownerDocument;\n const url = (0, _resolveUrl.resolveUrl)(this.getAttribute('assetpath') || '', owner.baseURI);\n this.__assetpath = (0, _resolveUrl.pathFromUrl)(url);\n }\n\n return this.__assetpath;\n }", "function GetImageURL(imagePath) {\n// return URLUtility.VirtualPath + imagePath;\n return imagePath;\n}", "function url(path){\n return process.env.NODE_ENV === \"development\"?\n `http://localhost:3333${path}`: path\n}", "function getAssetPath (category) {\n return process.env.WEBPACK_ENV === 'development' ?\n `${category}/[name].[ext]` :\n `${category}/[hash].[ext]`;\n}", "baseUrl(){\n return `https://www.warcraftlogs.com:443/${this.version}`\n }", "function buildSpecUrl() {\n let {protocol, host} = window.location\n let url = window.PRELOAD.swagger_url || '/docs?format=openapi'\n return `${protocol}//${host}${url}`\n}", "function getBaseURL() {\n if (__CLIENT__) {\n return window.location.origin;\n } else if (process.env.DOCKER === 'true') {\n return `http://${config.hosts.django}:${config.ports.django}`;\n }\n\n return `http://localhost:${config.ports.django}`;\n}", "function getServerUrl() {\n return useLocalServer ? SERVER_URL_UPDATE_LOCAL : SERVER_URL_UPDATE\n}", "function getBasePath () {\n\n return (process.env.NODE_ENV === 'production') ?\n 'http://ghanozjson.ap01.aws.af.cm' : 'http://localhost:3000';\n}", "function getWebsiteDevelopmentURL(companyName) {\n if (!companyName) {\n throw new Error(\n 'Failed to create development URL: Company name not specified.'\n );\n }\n\n return (\n encodeURIComponent(\n companyName.toLowerCase().replace(/[^\\x00-\\x7F\\s]/g, '')\n ) + settings.devWebsiteBaseURL\n );\n}", "function getURLHttpSimpleLoad() {\n return getServerURL('extensions/api_test/webrequest/simpleLoad/a.html');\n}", "function getBaseUrl() {\n return window.location.protocol + \"//\" + window.location.host;\n}", "get __effectiveBaseUrl() {\n return this.baseUrl\n ? this.constructor\n .__createUrl(this.baseUrl, document.baseURI || document.URL)\n .href.replace(/[^\\/]*$/, \"\")\n : \"\";\n }", "function getDSUrl() {\n\t\t\t\tvar scripts = doc.getElementsByTagName('script');\n\t\t\t\tvar url = '';\n\t\t\t\tvar i = void 0;\n\t\t\t\tfor (i = 0; i < scripts.length; i++) {\n\t\t\t\t\tif (scripts[i].selfSrc) {\n\t\t\t\t\t\turl = scripts[i].selfSrc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn url;\n\t\t\t}", "function fnBaseURLWeb(url) {\n return window.appURL + url;\n}", "get url() {\n return `/api/projects/file/${this.projectId}${this.filePath}`\n }", "function getBaseUrl() {\n var scripts = document.getElementsByTagName('script');\n var element;\n var src;\n\n for (var i = 0; i < scripts.length; i++) {\n element = scripts[i];\n src = element.src;\n\n if (src && /ToneDen\\.js/.test(src)) {\n return /(.+\\/)ToneDen\\.js/.exec(src)[1];\n }\n }\n\n return null;\n }", "abs (relativePath) {\n return this.url(relativePath).href;\n }", "static get API_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/`;\r\n }", "function cardManifestUrl(cardManifest, url) {\n if (cardManifest && cardManifest.assets && cardManifest.assets[url]) {\n return cardManifest.assets[url];\n }\n}", "function getMediaURL(url) {\n //if (device.platform.toLowerCase() === \"android\") {\n return \"/android_asset/www/\" + url;\n //}\n\n return url;\n}", "get __effectiveBaseUrl() {\n return this.baseUrl\n ? this.constructor.__createUrl(\n this.baseUrl,\n document.baseURI || document.URL\n ).href.replace(/[^\\/]*$/, '')\n : '';\n }", "static get API_URL() {\n const port = 1337; // Change this to your server port\n return `http://localhost:${port}`;\n }", "devBaseUrls() {\n var baseUrl = new URL(window.location.origin);\n var parts = baseUrl.hostname.split(\".\");\n\n if (parts.includes(\"platformsh\") && parts.includes(\"www\")) {\n // We are on a Platform.sh development environment under\n // the app subdomain. Let's strip out the www subdomain.\n parts.shift();\n baseUrl = \"https://\" + parts.join(\".\");\n\n // Create docs url.\n let docsUrl = new URL(baseUrl);\n docsUrl.hostname = \"docs.\" + docsUrl.hostname;\n this.docs = docsUrl;\n\n // Create app url.\n let appUrl = new URL(baseUrl);\n appUrl.hostname = \"app.\" + appUrl.hostname;\n this.app = appUrl;\n }\n }", "get cahceFile() {\n return Url.join(CACHE_STORAGE, this.#id);\n }", "function getScaledAssetPath(asset) {\n const scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get());\n const scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';\n const type = !asset.type ? '' : `.${asset.type}`;\n if (__DEV__) {\n return asset.httpServerLocation + '/' + asset.name + scaleSuffix + type;\n }\n else {\n return asset.httpServerLocation.replace(/\\.\\.\\//g, '_') + '/' + asset.name + scaleSuffix + type;\n }\n}", "function getPublicUrl (filename) {\n return `https://storage.googleapis.com/${config.CLOUD_BUCKET}/${filename}`;\n}", "get serverRelativeUrl() {\n return tag.configure(SharePointQueryable(this, \"serverRelativeUrl\"), \"f.serverRelativeUrl\");\n }", "function getTargetUrl() {\n var url = options.server.url;\n if (options.server.zPort) {\n url = url.replace(/^https\\:/, 'http:');\n if (url.match(/\\:(\\d+)/)) {\n url = url.replace(/\\:(\\d+)/, ':' + options.server.zPort);\n } else {\n url += ':' + options.server.zPort;\n }\n }\n url += options.zendesk.path;\n return url;\n }", "function GetBaseUrl(context) {\n var baseUrl = \"\";\n const FHIRVersion = \"/4_0_0/\";\n var protocol = \"http://\";\n if (context.req.secure) { protocol = \"https://\"; }\n baseUrl = protocol + context.req.headers.host + FHIRVersion;\n return baseUrl;\n}", "function getMediaURL(s) {\n if (device.platform.toLowerCase() === \"android\") {\n return \"/android_asset/www/\" + s;\n }\n return s;\n}", "fullUrl( relpath ) {\n if ( /^([\\w\\-]+\\:)?\\/\\/.*$/.test( relpath ) ) return relpath;\n let loc = window.location;\n let path = String( loc.pathname || '' ).replace( /\\/+$/g, '' );\n let rel = String( relpath || '' ).replace( /^\\/+/g, '' );\n return loc.protocol +'//'+ loc.host + path +'/'+ rel;\n }", "function findImageURL() {\n for (var _i = 0, _a = triviaData.includes.Asset; _i < _a.length; _i++) {\n var asset = _a[_i];\n if (currentQuestion.fields.image.sys.id == asset.sys.id) {\n return \"https:\" + asset.fields.file.url;\n }\n }\n return;\n}", "function getBaseUrl() {\n var scripts = document.getElementsByTagName(\"script\"),\n script = scripts[scripts.length-1].src,\n slugs = script.split('/');\n\n slugs.pop();\n\n return slugs.join('/') + '/';\n }", "function getAssetsPath() {\r\n return getBuildPath() + config.build.assetsPath;\r\n}", "get __effectiveBaseUrl() {\n return this.baseUrl\n ? this.constructor.__createUrl(\n this.baseUrl,\n document.baseURI || document.URL\n ).href.replace(/[^\\/]*$/, '')\n : '';\n }", "static imageRootUrl() {\r\n return (`/dist/img/`);\r\n }", "function SafeResourceUrl(){}", "static bluredImageUrlForRestaurant(restaurant) {\r\n // for development we need to remove \"/mws-restaurant-stage-1\"\r\n const url = window.location.href;\r\n if(url.startsWith('https')) {\r\n return (`/mws-restaurant-stage-1/img/${restaurant.photograph}`);\r\n }\r\n return (`/img/${restaurant.photograph || 10}-800_lazy_load.jpg`); \r\n }", "processRelativeUrl(relativePath){\n //console.log(relativePath);\n const rootDir = path.resolve(process.cwd(), \"public\"); //current working directory + /public\n //console.log([rootDir, relativePath]);\n const prefix = path.join(\"..\", \"node_modules\");\n \n if(!_.startsWith(relativePath, prefix))\n return relativePath;\n \n const vendorUrl = \"/vendor/\" + relativePath.substring(prefix.length);\n const sourceFile = path.join(rootDir, relativePath);\n const destFile = path.join(rootDir, vendorUrl);\n \n //console.log(`${sourceFile} -> ${destFile}`);\n fse.copySync(sourceFile, destFile); \n \n return vendorUrl;\n }", "static baseUrl() {\n return '/'\n }", "getServerAPIURL() {\n let result = \"/api\";\n if ((window.ENV) && (window.ENV.serverURL)) {\n result = window.ENV.serverURL;\n }\n return result;\n }", "get assetBundleManifestPath() {}", "function getRequestBaseURL() {\n\n var url;\n\n if (useProxy) {\n url = proxyURL;\n } else if (oauth && oauth.instance_url) {\n url = oauth.instance_url;\n } else {\n url = serverURL;\n }\n\n // dev friendly API: Remove trailing '/' if any so url + path concat always works\n if (url.slice(-1) === '/') {\n url = url.slice(0, -1);\n }\n\n return url;\n }", "function toUrl(origPath) {\n let execPath = origPath;\n\n execPath = removeExternal(execPath);\n execPath = removeRootPath(execPath);\n execPath = relativeToHtml(execPath);\n execPath = normalizePath(execPath);\n\n if (execPath !== origPath) {\n log(\"reduce: %s => %s\", origPath, execPath);\n }\n\n const stamp = timestamp(origPath);\n\n log(\"stamp: %s @ %s\", execPath, stamp);\n\n return `${execPath}?v=${stamp}`;\n }", "function getBaseURL() {\n var baseURL = window.location.protocol + '//' + window.location.hostname + ':' + api_port;\n return baseURL;\n}", "function urlFor(source) {\n return builder.image(source)\n }", "function getShortURL () {\n\t//base 36 characters\n\tvar alphanumeric = ['0','1','2','3','4','5','6','7','8','9','A','B',\n\t\t\t\t\t\t'C','D','E','F','G','H','I','J','K','L','M','N',\n\t\t\t\t\t\t'O','P','Q','R','S','T','U','V','W','X','Y','Z'];\n\tvar urlString = \"http://localhost:3000/\";\n\tfor (i = 0; i < 4; i++) {\n\t\tvar num = randomNum(0,35);\n\t\turlString = urlString + alphanumeric[num];\n\t}\n\n\treturn urlString;\n}", "static get API_URL(){\n\t\tconst port = 8081;\n\t\treturn `http://localhost:${port}`\n\t}", "static get path() {\n let url = _PROPERTIES_.get(this).path;\n if (!!!url) {\n // Reverse-Engineer the path from the <script> element.\n let a = document.createElement('a'),\n href = _PROPERTIES_.get(this).script.src + '/../';\n a.href = href;\n // Store path locally to avoid external tampering\n url = _PROPERTIES_.get(this).path = a.href;\n\n /** @todo Insecure. Used for electron compatibility.\n * Add support for custom protocols.\n */\n // Support Electron file: protocol\n if ('file:' === a.protocol\n && 'function' === typeof require\n && 'object' === typeof require('electron')) {\n let {webFrame} = require('electron');\n webFrame.registerURLSchemeAsPrivileged('file');\n }\n }\n return url;\n }", "function buildAssetPath(imgSrc) {\n return `./dist/${imgSrc}`;\n}", "function baseUrl() {\n\n var protocol = window.location.protocol\n , host = window.location.host\n , pathName = window.location.pathname.split('/');\n\n return protocol + '//' + host + '/' + pathName[1];\n\n}", "function computeURL() {\n var url = settings.url;\n if(typeof settings.url == 'function') {\n url = settings.url.call();\n }\n return url;\n }", "function localURL() { \n var pathWORes = location.pathname.substring(0, location.pathname.lastIndexOf(\"/\")+1);\n var protoWDom = location.href.substr(0, location.href.indexOf(\"/\", 8));\n return protoWDom + pathWORes;\n }", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"f\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"a\" /* apiBaseUrl */] + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"f\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"a\" /* apiBaseUrl */] + urlPart;\n}" ]
[ "0.6948651", "0.6923575", "0.68518424", "0.66799545", "0.66799545", "0.65441257", "0.6415133", "0.63643956", "0.63643956", "0.63643956", "0.63643956", "0.63579535", "0.63579535", "0.62959653", "0.6251196", "0.6241207", "0.6232682", "0.62325305", "0.6221429", "0.62188184", "0.6217524", "0.6194065", "0.6187425", "0.60993993", "0.60993993", "0.60993993", "0.601842", "0.5991979", "0.59798837", "0.59635025", "0.5943454", "0.5939044", "0.5922312", "0.59221965", "0.59103554", "0.5909845", "0.5909845", "0.5909845", "0.5909845", "0.5909845", "0.589819", "0.58823633", "0.58815306", "0.5859967", "0.58544123", "0.5838756", "0.5815093", "0.57874113", "0.5780509", "0.5779439", "0.57752514", "0.57728916", "0.57689947", "0.5767298", "0.5764543", "0.57566667", "0.57412523", "0.5739327", "0.5733476", "0.5730823", "0.5729652", "0.57295835", "0.5718462", "0.57080275", "0.5706763", "0.57048815", "0.5701505", "0.57005215", "0.5699557", "0.56980485", "0.56865907", "0.56763554", "0.56761134", "0.56601334", "0.5660105", "0.56460077", "0.5642519", "0.5635587", "0.5634692", "0.5616419", "0.5606157", "0.56040037", "0.55876786", "0.5557515", "0.5551734", "0.5547723", "0.55428743", "0.5542061", "0.5541021", "0.5540032", "0.5538274", "0.55329955", "0.55313015", "0.5529919", "0.55272865", "0.5526087", "0.551808", "0.55112314", "0.55073667", "0.55073667" ]
0.74271345
0
Returns a path like 'assets/AwesomeModule'
function getBasePath(asset) { // TODO(frantic): currently httpServerLocation is used both as // path in http URL and path within IPA. Should we have zipArchiveLocation? var path = asset.httpServerLocation; if (path[0] === '/') { path = path.substr(1); } return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get assetPath() {}", "get assetPath() {}", "function getAssetsPath() {\r\n return getBuildPath() + config.build.assetsPath;\r\n}", "get assetBundleManifestPath() {}", "function _getBasePath() {\r\n\tvar refPath = '/assets/kindeditor/';\r\n\tvar els = document.getElementsByTagName('script'), src;\r\n\tfor (var i = 0, len = els.length; i < len; i++) {\r\n\t\tsrc = els[i].src || '';\r\n\t\tif (/(kindeditor|application)[\\w\\-\\.]*\\.js/.test(src)) {\r\n\t\t\treturn src.substring(0, src.indexOf('assets')) + refPath;\r\n\t\t}\r\n\t}\r\n\treturn refPath;\r\n}", "function getAssetsPath()\n\t{\n\t\tvar generatorConfigFile = new File(\"~/generator.js\");\n\t\tvar cfgObj = {};\n\t\tvar gao = {};\n\t\tvar baseDirectory = undefined;\n\n\t\tif(generatorConfigFile.exists)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvar str = JSUI.readFromFile(generatorConfigFile, \"UTF-8\");\n\n\t\t\t\tcfgObj = JSON.parse(str.replace(\"module.exports = \", \"\"));\n\t\t\t\tgao = cfgObj[\"generator-assets\"];\n\t\t\t\tbaseDirectory = gao[\"base-directory\"];\n\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\tif($.level) $.writeln(\"Error parsing generator.js\");\n\t\t\t}\n\t\t}\n\t\treturn baseDirectory;\n\t}", "function getJSPath() {\r\n return getAssetsPath() + config.build.jsPath;\r\n}", "function getScreenshotFolderPath(module) {\n const path = module.filename.split(\"/\");\n path.pop();\n return path.join(\"/\");\n}", "function imageUrl(path) {\n try {\n return require('text!gcli/ui/' + path);\n }\n catch (ex) {\n var filename = module.id.split('/').pop() + '.js';\n var imagePath;\n\n if (module.uri.substr(-filename.length) !== filename) {\n console.error('Can\\'t work out path from module.uri/module.id');\n return path;\n }\n\n if (module.uri) {\n var end = module.uri.length - filename.length - 1;\n return module.uri.substr(0, end) + '/' + path;\n }\n\n return filename + '/' + path;\n }\n}", "function getPathInArchive(asset) {\n if (Platform.OS === 'android') {\n var assetDir = getBasePath(asset);\n // E.g. 'assets_awesomemodule_icon'\n // The Android resource system picks the correct scale.\n return (assetDir + '/' + asset.name)\n .toLowerCase()\n .replace(/\\//g, '_') // Encode folder structure in file name\n .replace(/([^a-z0-9_])/g, '') // Remove illegal chars\n .replace(/^assets_/, ''); // Remove \"assets_\" prefix\n } else {\n // E.g. 'assets/AwesomeModule/[email protected]'\n return getScaledAssetPath(asset);\n }\n}", "function getModuleFileName(module) {\n const path = module.filename.split(\"/\");\n return path.pop();\n}", "function getMyBasepath(uri) {\r\n return 'app/views/appViews/' + uri;\r\n}", "function buildAssetPath(imgSrc) {\n return `./dist/${imgSrc}`;\n}", "getSrcPath()\n {\n return path.join(this.getRootPath(), 'src');\n }", "function moduleWebPath(file) {\n\tif (!/node_modules\\/spyce\\/build\\/modules/.test(file)) throw new Error('Spyce Error: Invalid module file.');\n\n\treturn file.split('node_modules/spyce/build/').pop();\n}", "function getVendorPublicPath() {\n return `http://localhost:9000/vendor/`;\n}", "function getAssetPath (category) {\n return process.env.WEBPACK_ENV === 'development' ?\n `${category}/[name].[ext]` :\n `${category}/[hash].[ext]`;\n}", "function getPath() {\n let i = 1\n let repeat = true;\n while (repeat) {\n if (fs.existsSync(`./dist/Team-${i}.html`)) {\n i++\n }\n else {\n return `./dist/Team-${i}.html`\n }\n }\n}", "getAssetRoots() {\n return [__dirname];\n }", "get fullPath() {\n return path.join(this.assembly.directory, this.directoryName);\n }", "getHtmlPath(path) {\n const config = this.service.config;\n const htmlSuffix = config.exportStatic && typeof config.exportStatic === 'object' && config.exportStatic.htmlSuffix;\n path = path.slice(1);\n\n if (path === '' || path === 'index.html') {\n return 'index.html';\n } // remove last slash\n\n\n path = path.replace(/\\/$/, '');\n\n if (htmlSuffix) {\n return path;\n } else {\n return `${path}/index.html`;\n }\n }", "getModuleName(modulePath) {\n if (typeof modulePath !== 'string') {\n return undefined;\n }\n const parts = modulePath.split(/\\\\|\\//);\n //get folder name\n const moduleName = parts.pop();\n if (!moduleName) {\n return undefined;\n }\n //get the next folder name\n const maybeNamespaceFolderName = parts.pop();\n if (maybeNamespaceFolderName === null || maybeNamespaceFolderName === void 0 ? void 0 : maybeNamespaceFolderName.startsWith('@')) {\n return maybeNamespaceFolderName + '/' + moduleName;\n }\n else {\n return moduleName;\n }\n }", "function srcPath(src) {\n return path.join(snowpackOutDir, 'src', src);\n}", "get assetpath() {\n // Don't override existing assetpath.\n if (!this.__assetpath) {\n // note: assetpath set via an attribute must be relative to this\n // element's location; accomodate polyfilled HTMLImports\n const owner = window.HTMLImports && HTMLImports.importForElement ? HTMLImports.importForElement(this) || document : this.ownerDocument;\n const url = (0, _resolveUrl.resolveUrl)(this.getAttribute('assetpath') || '', owner.baseURI);\n this.__assetpath = (0, _resolveUrl.pathFromUrl)(url);\n }\n\n return this.__assetpath;\n }", "function scriptPath()\n {\n // obtain plugin path from the script element\n var src;\n if (document.currentScript) {\n src = document.currentScript.src;\n } else {\n var sel = document.querySelector('script[src$=\"/whiteboard.js\"]')\n if (sel) {\n src = sel.src;\n }\n }\n\n var path = typeof src === undefined ? src\n : src.slice(0, src.lastIndexOf(\"/\") + 1);\n return path;\n }", "function makePath(relativePath) {\n return path.join(path.dirname(import.meta.url.replace('file:', '')), relativePath)\n}", "function getModuleName(path) {\n\treturn String(path).replace(/(?:(?:.+\\/)?node_modules\\/|\\/|\\.\\.\\/)((@[^\\/]+\\/)?[^\\/]+)(\\/.*)?$/g, '$1');\n}", "function getPathPrefix() {\n return THIS_SCRIPT.src.substring(\n 0,\n THIS_SCRIPT.src.lastIndexOf('/')\n ) + '/';\n}", "function getCodePath(name) {\n var safeName = name.split(/[\\/\\.]/g).slice(-1)[0];\n return path.join(__dirname, \"..\", \"code\", safeName) + \".js\";\n }", "function url(id) {\n var basedir = getCallsiteDirname();\n return 'url(' + requireAssets(id, basedir) + ')';\n}", "makeImagePath(product) {\n return require(`../assets/images/${product.images[0]}`);\n }", "function relativePath() {\n let path = window.location.pathname;\n let pathWithoutFile = path.substr(0, path.lastIndexOf('/'));\n let pathRelative = ( (pathWithoutFile === '') ? '' : '../' ) + 'hoot-services';\n return pathRelative;\n}", "function basepath(uri) {\n return 'app/views/' + uri;\n }", "get 'asset-path'() { return process.env.PUBLIC_URL ? `\"${process.env.PUBLIC_URL}\"` : '\"/\"'; }", "generateModuleCachePath(pkg) {\n invariant(this.cacheFolder, 'No package root');\n invariant(pkg, 'Undefined package');\n\n const slug = this.generateUniquePackageSlug(pkg);\n return path.join(this.cacheFolder, slug, 'node_modules', pkg.name);\n }", "static get path() {\n let url = _PROPERTIES_.get(this).path;\n if (!!!url) {\n // Reverse-Engineer the path from the <script> element.\n let a = document.createElement('a'),\n href = _PROPERTIES_.get(this).script.src + '/../';\n a.href = href;\n // Store path locally to avoid external tampering\n url = _PROPERTIES_.get(this).path = a.href;\n\n /** @todo Insecure. Used for electron compatibility.\n * Add support for custom protocols.\n */\n // Support Electron file: protocol\n if ('file:' === a.protocol\n && 'function' === typeof require\n && 'object' === typeof require('electron')) {\n let {webFrame} = require('electron');\n webFrame.registerURLSchemeAsPrivileged('file');\n }\n }\n return url;\n }", "function basepath(uri) {\n return 'views/' + uri;\n }", "function getModuleCssLocation (module) {\n try {\n if (isTachyonsModule(module)) {\n return 'node_modules/' + module + '/' + require('./node_modules/' + module + '/package.json').style\n } else if (isNormalizeModule(module)) {\n return 'node_modules/' + module + '/' + module\n } else {\n console.error('Unknown module: ' + module)\n }\n } catch (e) {\n console.log(e)\n }\n}", "function basepath(uri) {\n return 'app/views/' + uri;\n }", "function basepath(uri) {\n return 'app/views/' + uri;\n }", "function getCSSPath() {\r\n return getAssetsPath() + config.build.cssPath;\r\n}", "getFilePath() {\n let filePath = callsites()[2].getFileName(); // [0] and [1] return global fractal.config.js.\n return filePath.replace('.js', '.yml');\n }", "function getChunkAssetPath(assetsByChunkName, chunkName) {\n if (assetsByChunkName && assetsByChunkName[chunkName]) {\n if (typeof assetsByChunkName[chunkName] === 'string') {\n return assetsByChunkName[chunkName];\n } else {\n return assetsByChunkName[chunkName][0];\n }\n }\n return null;\n }", "get templateFullPath() {\n return path.join(this.assembly.directory, this.templateFile);\n }", "function getModulePathBasedOnParentModule(module) {\n const modulePath = module.indexOf('/') >= 0 || module.indexOf(path.sep) >= 0 ? path.join(path.dirname(getStack()[3].getFileName()), module) : module;\n return require.resolve(modulePath);\n}", "getHmrPath() {\n return `${this.publicPath}__wpackio`;\n }", "function file2moduleName(filePath) {\n\treturn filePath.replace(/\\\\/g, \"/\")\n\t\t.replace(/^\\/base\\//, \"\")\n\t\t.replace(/\\.js/, \"\");\n}", "getURL(url) {\n return this.isDev() ? path.join(\"../\", url) : url\n }", "projectPath() {\n return atom.project.getPaths()[0];\n }", "getAppPath()\n {\n return path.join(this.getRootPath(), 'app');\n }", "makeImagePath1(product) {\n return require(`../assets/images/${product.images[1]}`);\n }", "get assetBundleName() {}", "function assetFinder(combatChoice) {\n return \"assets/\" + combatChoice + \".png\"\n }", "makeImagePath2(product) {\n return require(`../assets/images/${product.images[2]}`);\n }", "get path() {}", "function Asset(filename){\n return HtmlService.createTemplateFromFile(app.assets_dir+filename).evaluate().getContent();\n}", "function getComponentPathString(schemaName) {\n return `#/components/schema/${schemaName}`\n}", "function getFontPath() {\r\n return getAssetsPath() + config.build.fontPath;\r\n}", "function getPath() {\n var path;\n if (BST.DEBUG) {\n path = \"../php/bst.php\";\n }\n else {\n path = \"../../../php/bst/bst.php\";\n }\n return path;\n }", "function getExternalModuleNameFromPath(host, fileName) {\n var getCanonicalFileName = function (f) { return host.getCanonicalFileName(f); };\n var dir = ts.toPath(host.getCommonSourceDirectory(), host.getCurrentDirectory(), getCanonicalFileName);\n var filePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory());\n var relativePath = ts.getRelativePathToDirectoryOrUrl(dir, filePath, dir, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false);\n return ts.removeFileExtension(relativePath);\n }", "function getScaledAssetPath(asset) {\n const scale = AssetSourceResolver.pickScale(asset.scales, PixelRatio.get());\n const scaleSuffix = scale === 1 ? '' : '@' + scale + 'x';\n const type = !asset.type ? '' : `.${asset.type}`;\n if (__DEV__) {\n return asset.httpServerLocation + '/' + asset.name + scaleSuffix + type;\n }\n else {\n return asset.httpServerLocation.replace(/\\.\\.\\//g, '_') + '/' + asset.name + scaleSuffix + type;\n }\n}", "function getNewFilePath(newPackageName) {\n return newPackageName.split('.').join('/'); \n}", "function pathtourl (path) {\n\t\t\t\treturn (pagetable.opmlLink + path + appPrefs.cmsFileSuffix);\n\t\t\t\t}", "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "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 }", "function __getFilename(path) {\n\treturn require(\"path\").resolve(__dirname + \"/\" + path);\n}", "function image(relativePath) {\n\treturn \"img/core-img/\" + relativePath;\n}", "name(module, chunks, cacheGroupKey) {\n const moduleFileName = module.identifier().split('/').reduceRight(item => item);\n const allChunksNames = chunks.map((item) => item.name).join('~');\n return `${cacheGroupKey}-${allChunksNames}-${moduleFileName}`;\n }", "function toPath( name ) {\n\treturn name.replace( '-', '.' );\n}", "function toPath( name ) {\n\treturn name.replace( '-', '.' );\n}", "function libraryPath() {\n return `${consumerPath()}${NODE_MODULES}/${npmPackage.name}`;\n}", "function resolveToSrc() {\n return path.join(rootDir, 'src');\n}", "function modulePath(identifier) {\n // the format of module paths is\n // '(<loader expression>!)?/path/to/module.js'\n let loaderRegex = /.*!/\n return identifier.replace(loaderRegex, '')\n}", "get path() {\n return this.constructor.buildPath(\n this._org,\n this._type,\n this._name,\n this._version,\n this._extra,\n );\n }", "function GeneratePath()\n{\n\n\n\n}", "function karmaFileToModule(fileName) {\n return fileName.replace(System.baseURL, '')\n .replace('.js', '');\n}", "function getPathOnDevserver(devServerUrl, asset) {\n return devServerUrl + getScaledAssetPath(asset) + '?hash=' + asset.hash;\n}", "get assetsDir() {\n let ret = this.YAML.akashaepub\n && this.YAML.akashaepub.assetsDir\n ? this.YAML.akashaepub.assetsDir\n : \"assets\"; // : undefined;\n // This could be an array of values\n if (Array.isArray(ret)) {\n return ret;\n }\n // Make sure assets directory exists\n let stats;\n try {\n stats = fs.statSync(ret);\n } catch (e) {\n stats = undefined;\n }\n if (stats && stats.isDirectory()) {\n return ret;\n } else if (ret === \"assets\") {\n return undefined;\n } else {\n throw new Error(`assetsDir does not exist ${ret}`);\n }\n }", "function getLoaderPath(fileName){\n var exists = glob.sync( normalize(packagesPath, fileName + '@*.js') );\n if(exists && exists.length != 0){\n return normalize(packagesPath, fileName + '@*.js');\n } else {\n return normalize(packagesPath, fileName + '.js');\n }\n }", "function getEmbedScriptPath(e) {\n\tvar t = document.getElementsByTagName(\"script\"), n = \"\", r = \"\";\n\tfor (var i = 0; i < t.length; i++) {\n\t\tt[i].src.match(e) && (n = t[i].src);\n\t}\n\tn != \"\" && (r = \"/\");\n\treturn n.split(\"?\")[0].split(\"/\").slice(0, -1).join(\"/\") + r\n}", "function pathSolver(src) {\n return 'resources/' + src;\n}", "function buildModulePath(file, moduleName) {\n const name = normalizeModuleFilename(trimStringChars(moduleName));\n return path.resolve(path.dirname(file), name);\n}", "function abbrPath(base) {\n var basePath = base === undefined ? Object(_page__WEBPACK_IMPORTED_MODULE_1__[\"pagePath\"])() : base || '/';\n return Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"urlRelative\"])(basePath, _page__WEBPACK_IMPORTED_MODULE_1__[\"abbrPath\"]);\n}", "function scriptPath() {\n try {\n return app.activeScript;\n }\n catch (e) {\n return File(e.fileName);\n }\n}", "getResourcesDirectory() {\n let appPath = remote.app.getAppPath();\n\n if (process.cwd() === appPath) return './';\n else return process.resourcesPath + '/';\n }", "function pathTo(filename) {\n return __dirname + '/' + filename;\n}", "static getFullPath() {\n return this.baseUrl() + this.apiRoute() + '/' + this.route() + '/'\n }", "function getBuildPath() {\r\n return config.build.path;\r\n}", "function getPath(path)\r\n{\r\n\treturn getUtilities('path', { path: path }).path;\r\n}", "function getBlockPath(blockName){\n\n\t\treturn \"blocks/\" + blockName;\n\t}", "processRelativeUrl(relativePath){\n //console.log(relativePath);\n const rootDir = path.resolve(process.cwd(), \"public\"); //current working directory + /public\n //console.log([rootDir, relativePath]);\n const prefix = path.join(\"..\", \"node_modules\");\n \n if(!_.startsWith(relativePath, prefix))\n return relativePath;\n \n const vendorUrl = \"/vendor/\" + relativePath.substring(prefix.length);\n const sourceFile = path.join(rootDir, relativePath);\n const destFile = path.join(rootDir, vendorUrl);\n \n //console.log(`${sourceFile} -> ${destFile}`);\n fse.copySync(sourceFile, destFile); \n \n return vendorUrl;\n }", "function resolveModuleName(base, name) {\n\tlet stack = base.split('/');\n\tstack.pop();\n\tname.split('/').forEach((segment, i) => {\n\t\tif ( segment == '..' ) {\n\t\t\tstack.pop();\n\t\t} else if ( segment === '.' ) {\n\t\t\t// ignore\n\t\t} else {\n\t\t\tif ( i === 0 ) {\n\t\t\t\tstack = [];\n\t\t\t}\n\t\t\tstack.push(segment);\n\t\t}\n\t});\n\treturn stack.join('/');\n}", "get path () {\n return __dirname\n }", "function pkgPath( _path ){\n var _pkgPath = '../web/packages/toj/%s';\n return _pkgPath.replace('%s', _path);\n }", "function embeddedAsmPath(scope) {\n const appAsmRoot = assemblyBuilderOf(appOf(scope)).outdir;\n const stage = core_1.Stage.of(scope) ?? appOf(scope);\n const stageAsmRoot = assemblyBuilderOf(stage).outdir;\n return path.relative(appAsmRoot, stageAsmRoot) || '.';\n}", "static dirname(path) {\n return Path.join(path, '..');\n }", "static getPath(pkgName) {\n\t\treturn PackageManager._namePathMap[pkgName];\n\t}", "static getExtensionRessourcePath(path) {\n switch (Application.getCurrentBrowser()) {\n case Browser.CHROME:\n return chrome.extension.getURL('res/' + path);\n default:\n return null;\n }\n }", "function image(relativePath) {\n return \"/static/editablegrid-2.0.1/images/\" + relativePath;\n}", "function path() {\n return \"/help/taskHelp\";\n}" ]
[ "0.720717", "0.720717", "0.6714291", "0.66264737", "0.6525416", "0.652097", "0.6433398", "0.63855135", "0.6257597", "0.6245888", "0.6233124", "0.61162937", "0.6095459", "0.60704434", "0.6065881", "0.60069966", "0.5997081", "0.59740335", "0.5961288", "0.59564257", "0.59315115", "0.5930055", "0.5924701", "0.5912406", "0.5890538", "0.5875473", "0.58743054", "0.58662605", "0.58290404", "0.5793522", "0.57729435", "0.57728523", "0.5761851", "0.5744086", "0.5739688", "0.5733589", "0.57122535", "0.5710694", "0.5708856", "0.5708856", "0.570684", "0.5698387", "0.5696659", "0.56939864", "0.569308", "0.5692348", "0.5687097", "0.5685048", "0.56807697", "0.5657991", "0.565547", "0.56308556", "0.5623121", "0.5622423", "0.56005704", "0.55980265", "0.5591309", "0.5589319", "0.5588035", "0.557839", "0.5574502", "0.5564953", "0.55638313", "0.5539253", "0.55354744", "0.5533635", "0.55333096", "0.5527257", "0.5525853", "0.5525853", "0.5519505", "0.5510414", "0.5491111", "0.54899144", "0.5486843", "0.5477335", "0.5476859", "0.54729915", "0.5470517", "0.547023", "0.5463946", "0.54627043", "0.5460835", "0.54531443", "0.5446144", "0.5445111", "0.5442554", "0.5439835", "0.54299086", "0.5425886", "0.5417962", "0.5417141", "0.5412272", "0.540341", "0.53965753", "0.53959554", "0.53918976", "0.538915", "0.5386417", "0.53853345" ]
0.553292
67
Delete snippet by id
function delete_snippet(id) { $(".snippet_row_" + id).remove(); // if there aren't any visible rows (i.e. excluding the 0 row that we use for cloning) if ($('#manage_snippets_table .snippet_row:visible').length <= 0) { $('#no_snippets_row').show(); } else { $('#no_snippets_row').hide(); } $.ajax({ url: ajaxurl, data: { id: id, action: "orb_ctc_addon_cloud_lib_delete" }, success: function (json) { // update max items via js $('.usage_items').text(get_snippet_count()); if (json.status) { // the row is deleted anyways so nothing to do. // just have some coffee. } else { alert(json.msg); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteExercise(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/exercises/\" + id\n })\n .then(function () {\n $(`[data-exercise=${id}]`).remove();\n });\n }", "function remove(id){\n var direccion = urlDelete.replace('insertIdHere', id);\n $.get(direccion, function(){\n var elemento = $(`#${id}`)[0];\n $(elemento).remove();\n })\n }", "function remove(id) {\n return db('sections')\n .where({ id })\n .del();\n}", "delete() {\n $(`comment-${this.config['id']}`).remove();\n }", "function delTemplate(id) {\n\n\t//該当値行を削除する\n\t$('#' + id).remove();\n}", "deleteSnippet(index = -1) {\n const numSnippets = this._snippets.length;\n if (index < 0 || index > numSnippets) {\n this._snippets.pop();\n }\n else {\n // Update list\n for (let i = index + 1; i < numSnippets; i++) {\n this._snippets[i].id = this._snippets[i].id - 1;\n }\n this._snippets.splice(index, 1);\n }\n }", "function deletenote(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/notes/\" + id\n })\n .done(function() {\n getnotes(noteCategorySelect.val());\n });\n }", "function deleteItem(id) {\n executeHTTPRequest(id, 'DELETE', '/remove')\n}", "function removeQuoteById(id){\n document.querySelector(`[data-delete-id='${id}']`).parentElement.parentElement.remove()\n }", "function deleteById(id) {\n return fs.readFile(dbPath, \"utf-8\").then((jsonData) => {\n const articles = JSON.parse(jsonData);\n\n const newArticles = articles.filter((article) => {\n return article.id !== id;\n });\n\n return fs.writeFile(dbPath, JSON.stringify(newArticles));\n });\n}", "static delete(id) {\n //FIXME\n }", "function deleteIt(){\n \tupdateDB(\"delete\", pageElements.alertText.dataset.id);\n }", "async deleteById(id) {\n return await conn.query(\"DELETE FROM Fitness_RoutineExercises WHERE routineExercises_id=?\", id);\n }", "deleteLike(id)\n {\n // We need the index position of the item\n // with the specified ID\n const index = this.likes.findIndex(element => element.id === id);\n\n // Remove the element from the likes array using the splice() method\n // and the index we found above.\n this.likes.splice(index, 1);\n\n // Use localStorage API to persist data\n this.persistData();\n }", "function deletePost() {\n\tvar snippet = {\n\t\tquery : {\n\t\t\t// published: false,\n\t\t\tid: \"-K_WonIe_j7iSm-WeyC8\"\n\t\t}\n\t}\n\n\trimer.post.delete(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "deleteContributedStory({id}) {\n\n return this._getCollection()\n .then(collection => collection.deleteOne({\n _id: MongoDb.ObjectId(id)\n }));\n }", "deleteNote(id) {\n let index = this.jsonData().findIndex(element => parseInt(element.id) === parseInt(id));\n if (index !== -1) {\n let noteData = this.jsonData();\n noteData.splice(index, 1);\n this.storeData(noteData);\n }\n }", "function deleteRequest(id){\n //finds the li element in the HTML for quote\n let li1 = document.getElementById(`li-${id}`)\n //fetch request configs\n let config = {\n method: 'DELETE',\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }\n //fetch request to update database\n fetch(quoteUrl + `/${id}`, config)\n .then(response => response.json());\n //removes the li element from the HTML\n li1.remove()\n}", "function rf(id) { tagger.remove(asInt(id)); }", "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: authHeader(),\n };\n return fetch(`${apiUrl}/articalremove/${id}`, requestOptions).then(handleResponse);\n}", "function deleteTag (id) {\n fetch(`http://localhost:3001/api/tags/delete/${id}`, {\n method : 'DELETE'\n }).then(res => {\n renderTags()\n toast.error(\"Tag Est Bien Supprimer !!!\", {\n position: \"bottom-right\"\n })\n })\n }", "function deleteItem(id) {\n axios.delete(\"/delete/\" + id);\n }", "function _deleteStory(id) {\n const requestOptions = {\n method: 'DELETE',\n url: `story/delete/${id}`\n };\n\n return api(requestOptions)\n}", "function deleteAnnotationById(id) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4 && xhr.status === 200) {\n console.log(xhr.responseText);\n }\n }\n xhr.open(\"DELETE\", \"https://youtube-annotate-backend.herokuapp.com/api/remove/\" + id, true);\n xhr.send(null);\n}", "async deleteRecipe(id) {\n if (!id) throw \"You must provide a valid recipe id\";\n\n const recipeCollection = await recipes();\n const deletionInfo = await recipeCollection.removeOne({_id: id});\n if (deletionInfo.deletedCount === 0) {\n throw `Could not delete post with id of ${id}`;\n }\n // console.log(\"Recipe deleted\");\n }", "function deleteLessonFromMain(id) {\n API.deleteLessonFromMain(id)\n .then(res => loadLessonsMain())\n .catch(err => console.log(err));\n }", "function deleteItem(id) { //uses incrementing Id to delete individul messages with the \"X\" span.\n console.log(\"DeleteItem\", id);\n const rowEl = document.getElementById(id);\n rowEl.remove();\n }", "function deleteById(id) {\n id = parseInt(id)\n let exercise = findById(id);\n\n if (!exercise) \n throw new Error(`No exercise for id: ${id}`);\n\n exercises.delete(id)\n\n return exercise;\n}", "function deleteItem() {\n SidebarActions.deleteItem('Content', $scope.data.thisContent);\n}", "deleteRecipe(id) {\n this.recipes = this.recipes.filter((recipe) => recipe.id !== id);\n\n // commits changes to local storage\n this._commit(this.recipes);\n }", "function removeItem(id) {\n\t// we search for the id\n\tvar _index = -1;\n\tvar _section = -1;\n\tfor (var _sec in myKey.data) {\n\t\tfor (var _item in myKey.data[_sec][\"content\"]) {\n\t\t\tif (myKey.data[_sec][\"content\"][_item][\"id\"] == id) {\n\t\t\t\t_section = _sec;\n\t\t\t\t_index = _item;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\tvar _result = window.confirm(\"Êtes-vous sur de vouloir supprimer '\"+myKey.data[_section][\"content\"][_index][\"title\"]+\"' ? Cette opération est irréversible.\");\n\t\n\tif (_result === true && _index != -1 && _section != -1) {\n\t\t// we delete the line in the array\n\t\tmyKey.data[_section][\"content\"].splice(_index,1);\n\t\t\t\t\t\t\t\n\t\t// we serialize and then encrypt data (the whole section)\n\t\tvar _content = JSON.stringify(myKey.data[_section][\"content\"]);\n\t\tvar _data = myKey.encrypt(_content);\n\t\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: serverUrl+\"request/change_data\",\n\t\t\tdata: {content: _data, id: myKey.data[_section][\"id\"], user: myKey.user, key: myKey.key},\n\t\t\tsuccess: success,\n\t\t\terror: serverError\n\t\t});\t\n\t\t\n\t\t// delete DOM\n\t\t$(\"#row_\"+id).remove();\n\t}\n}", "function deleteReview(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/review/\" + id\n })\n .then(function() {\n getReviews(postRatingSelect.val());\n });\n }", "deleteStructureProteinMarkup({id}) {\n delete this._proteinsMarkedOnStructure[id];\n }", "async function remove(id) {\n const review = await findById(id);\n await review.remove(id);\n }", "function deleteById(id) {\n var data = {\n WasteID: id\n };\n WasteItemService.DeleteByWasteItemID(data, function (res) {\n if (res.Success) {\n Notifications.addMessage({\n 'status': 'information',\n 'message': $translate.instant('Delete_Success_MSG')\n });\n $timeout(function () {\n $scope.Search()\n }, 1000);\n } else {\n Notifications.addError({\n 'status': 'error',\n 'message': $translate.instant('saveError') + res.Message\n });\n }\n\n },\n function (error) {\n Notifications.addError({\n 'status': 'error',\n 'message': $translate.instant('saveError') + error\n });\n })\n }", "function deletePost(postId) {\n // TODO : Implement this\n}", "function removeTodo(id){\n console.log(id);\n document.getElementById(id).remove();\n }", "delete() {\n $(`#${this.idDOM}`).remove();\n }", "deleteById(id) {\n let sqlRequest = \"DELETE FROM repo WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.run(sqlRequest, sqlParams);\n }", "function deleteEffect(id) {\n console.log(id);\n jsPlumb.remove(id);\n}", "function deleteSource(oid)\n{\n $.parse.delete('sources/' + oid, function(json){\n $(\"[oid='\" + oid + \"']\").parent(\".source\").remove();\n });\n}", "deleteById(id) {\n let sqlRequest = \"DELETE FROM taskItem WHERE id=$id\";\n let sqlParams = {$id: id};\n return this.common.run(sqlRequest, sqlParams);\n }", "function adminDelete(id){\n manga = biblioteca[id]\n let validar = confirm(`Esta seguro de querer eliminar a ${manga.titulo}`)\n\n if(validar){\n biblioteca.splice(id,1)\n localStorage.setItem('biblioteca',JSON.stringify(biblioteca))\n alert(`Se borro ${manga.titulo}`)\n cargarManga4(biblioteca)\n }\n}", "function deleteItem(id) {\n\n\t//該当値行を削除する\n\t$('#' + id).remove();\n}", "function deleteById(id){\n var list = createJsonList()\n var index = 0;\n for(var i =0; i < list.length; i++){\n var cur = list[i];\n if(id == parseInt(cur.id)){\n index = i;\n break;\n }\n }\n list.splice(index,1);\n clearCanvas()\n jsonListToCanvas(list)\n}", "function removeContent(id) {\r\n\r\n var node = document.getElementById(id);\r\n\r\n if (node) {\r\n\t node.parentNode.removeChild(node);\r\n\t node = null;\r\n }\r\n}", "function deleteItem(id) {\n fetch(`${uri}/${id}`, {\n method: 'DELETE',\n mode: 'cors',\n })\n .catch(error => console.error('Unable to delete item.', error)); // logs a caught error\n}", "function deleteById(storename, id) {\r\n console.log(\"deleteAction: storename: \" + storename);\r\n setDatabaseName('dbCat', ['users', 'items', 'categories', 'subcategories ', 'events', 'watchlist']);\r\n setCurrObjectStoreName(storename);\r\n startDB(function () {\r\n deleteOne(id, function () {\r\n alert(\"deleted!\");\r\n location.reload();\r\n });\r\n }); // async func\r\n }", "function removeHowto(id){\n return db('howtos')\n .where('id', id)\n .del()\n .then(response => (!response ? null : response))\n}", "function deleteMessage(id) {\n // console.log(id);\n // const id = event.target.dataset.id\n fetch(`${BASE_URL}/${id}`, {\n method: 'DELETE',\n })\n .then(response => response.json())\n .then(result => console.log('Success:', result))\n .catch(error => console.error('Error:', error));\n}", "function deleteEvaluation(id){\n\n}", "delete() {\n this.comments.forEach(comment => comment.delete());\n this.comments = [];\n $(`#${this.idDOM}`).remove();\n }", "delete () {\n Api.delete(null, ApiUrls.sources, this.id);\n }", "function deleteOfflineReview(id) {\r\n return dbPromise.then(function(db) {\r\n const tx = db.transaction('offline', 'readwrite');\r\n tx.objectStore('offline').get(id).then(review => {\r\n return tx.objectStore(\"offline\").delete(id);\r\n });\r\n tx.complete.then(() => console.log('done'));\r\n })\r\n}", "function deleteCourse(id) {\n fetch(stdurl + '?id=' + id, {\n method: \"DELETE\"\n }).then(response => response.json()).then(data => {\n getCourses();\n }).catch(error => {\n console.log(\"Error:\", error);\n })\n}", "deleteTopic(name, id) {\n this.deleteBox.seen = true\n this.deleteBox.name = name\n this.deleteBox.id = id\n this.deleteBox.desc = `با تایید عملیات سرفصل با نام ${name} حذف خواهد شد`\n }", "function remove(id) {\n $.ajax({\n url: base_url + `todos/${id}`,\n method: \"DELETE\",\n headers: {\n token: localStorage.getItem(\"access_token\")\n }\n })\n .done(response => {\n aut()\n })\n .fail((xhr, text) => {\n console.log(xhr, text)\n })\n }", "function deleteIds (id) {\n return fetch(`${moviesURL}/${id}`, {\"method\": \"delete\", headers: header})\n .then(res => res.json())\n .catch(console.error)\n }", "function delItem(id) {\n connection.query(\"DELETE FROM itemList where id = ?\", [id], function(\n error,\n results,\n fields\n ) {\n if (error) throw error;\n console.log(results);\n });\n }", "function _delete (id, cb) {\n const key = ds.key([kind, parseInt(id, 10)]);\n ds.delete(key, cb);\n}", "[mutation.REMOVE_ELEMENT] (state, id) {\n NodeHelpers.deleteNodeById(id, state.snapshot)\n }", "function deleteSingleAnswer(id, callback) {\n\tquery(\"delete from answers where answerid = \" + id, callback);\n}", "function deleteLinkUp(id) {\n const target = id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/linkup/\" + id\n }).then(function() {\n $(`#${target}`).remove();\n console.log(\"success\");\n });\n }", "function deleteBookmark(id) {\n $.ajax(`/bookmarks/${id}`, {\n type: \"DELETE\",\n })\n .then(() => {\n console.log(\"Bookmark deleted.\");\n location.reload()\n })\n}", "delete() {\n this.html.remove();\n }", "static deleteById(id) {\n firestore.collection(collectionPath).doc(id).delete().then(function () {\n broadcastMessage(\"deleted\");\n });\n }", "deleteMessageById(id) {\n Common.assertNotNull(id);\n const step = this.getStepByMessageId(id);\n if (step) {\n const index = this.model.diagram.steps.indexOf(step);\n if (index !== -1) {\n this.model.diagram.steps.splice(index, 1);\n }\n }\n this.renumber();\n }", "function DeleteItem(id) {\n ajaxCall(\"DELETE\", \"../api/items/\" + id, \"\", deleteSuccess, error);\n }", "function deleteComment(postElement, id) {\n var comment = postElement.getElementsByClassName('comment-' + id)[0];\n comment.parentElement.removeChild(comment);\n}", "function deleteComment(postElement, id) {\n var comment = postElement.getElementsByClassName('comment-' + id)[0];\n comment.parentElement.removeChild(comment);\n}", "function deleteDraft(id) {\n\n confirmBox(function () {\n var removed = draftData.splice(id, 1);\n $('#existing-drafts').html('');\n\n bottomAlert('Draft deleted.', '#ec407a', 2000);\n\n saveData();\n renderDrafts();\n\n closeConfirmBox();\n }, function () {\n closeConfirmBox();\n });\n}", "function deleteInt(id) {\n transition(DELETE);\n //Located in the hooks/useApplicationData.js\n cancelInterview(id)\n .then(() => transition(EMPTY))\n .catch(error => transition(ERR_DELETE, true));\n }", "function deleteItem(id) {\n\tfor (let i = 0; i < todoArr.length; i++) {\n\t\tif (todoArr[i].id == id) {\n\t\t\ttodoArr.splice(i, 1);\n\t\t\t// localStorage.removeItem(id);\n\t\t}\n\t}\n\tinsertItem();\n}", "function deleteItem( id ) {\n $http.delete( storelist_url + '/' + id ).then(\n function(response) {\n console.log(response);\n deferred.resolve(response);\n },\n function(error) {\n deferred.reject(error);\n }\n );\n return deferred.promise;\n }", "async function excluirDivida(id) {\n await api.delete(`dividas/${id}`)\n window.location.href = 'index.js'\n }", "function deleteMedia(id) {\n Media.delete(id)\n .then(function onSuccess(response) {\n console.log(response);\n })\n .catch(function onError(response) {\n console.log(response);\n });\n }", "function deleteRecord(id) {\n bookmarkTable.get(id).deleteRecord();\n }", "function deleteComment(id, reason)\n {\n // Deleting the post, this part was made by Ozuzanna, mostly\n new mw.Api().post({\n action: 'delete',\n pageid: id.substring(5),\n reason: reason,\n bot: true,\n token: mw.user.tokens.get('editToken')\n }) \n .done(function(d)\n {\n if (!d.error)\n {\n // Hiding the deleted comment\n var el = $(\"#\" + id), next = el.next();\n el.slideToggle();\n if(next.is('ul')) next.slideToggle();\n }\n else new BannerNotification((config.vocab.fail || \"Failed to delete comment\") + \": \" + d.error.code, 'error').show();\n })\n .fail(function() { new BannerNotification((config.vocab.fail || \"Failed to delete comment\"), 'error').show(); });\n }", "function deleteRecord(id) {\n\t\t\n\t\t\n\t\taddOverLay();\n\t\t$.ajax({\n\t\t\turl : HOST_PATH + \"admin/article/movetotrash\",\n\t\t\tmethod : \"post\",\n\t\t\tdata : {\n\t\t\t\t'id' : id\n\t\t\t},\n\t\t\tdataType : \"json\",\n\t\t\ttype : \"post\",\n\t\t\tsuccess : function(data) {\n\t\t\t\t\n\t\t\t\tif (data != null) {\n\t\t\t\t\t\n\t\t\t\t\twindow.location.href = HOST_PATH + \"admin/article\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\twindow.location.href = HOST_PATH + \"admin/article\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t}", "function deletePost(id) {\n // console.log(id)\n $.ajax({\n method: \"DELETE\",\n url: \"api/private/\" + id\n })\n .then(function() {\n getPosts() // show me posts after deleting\n\n });\n }", "function del(id) {\n setNumberOfDeletes(numberOfDeletes + 1);\n let index = -1;\n setItems([\n ...items.filter(item_ => {\n if (item_.id !== id) {\n return true;\n } else {\n index = id;\n }\n })\n ]);\n\n let absoluteIndex = -1;\n items.map((item, i) => {\n if (item.id === index) {\n absoluteIndex = i;\n }\n });\n\n dispatch(\n saveResume({\n work: work.filter((work, i) => {\n return i !== absoluteIndex;\n })\n })\n );\n }", "function courseDelete(id, code){\n\t\t$.post( \"../Tab_Course/course_delete.php\", {\n\t\t\tid: id,\n\t\t\tcode: code\n\t\t}, function( data ) {\n \t\t\tswal(data.title, data.message, data.alert);\n \t\t\tif(data.alert==\"success\"){\n\t\t\t\tunloadCourseInfo();\n\t\t\t\t$(\".table_course_row_\"+id).remove();\n \t\t\t}\n\t\t}, \"json\");\n\t}", "function remove(id) {\n return db('tags').where({ id }).del();\n}", "function _delete(id) {\n const requestOptions = {\n method: 'DELETE',\n headers: { ...authHeader(), 'Content-Type': 'application/json' },\n };\n return fetch(`${config.apiUrl}/writeup/${id}`, requestOptions).then(handleResponse);\n}", "deleteAdjustment(state, id) {\n const ind = findIndex(state.adjustments, (r) => {\n return r.id === id\n })\n\n state.adjustments.splice(ind, 1)\n }", "function deleteQ(){\n var pageElement = document.querySelector(\".sub-question-area\");\n pageElement.remove();\n }", "delete() {\n let $self = $(`#${this.idDOM}`);\n if(this.commentSection !== undefined) {\n this.commentSection.delete();\n this.commentSection = undefined;\n }\n $self.remove();\n Object.keys(this.buttons).forEach(type => this.buttons[type].delete());\n }", "static test_delete(id) {\n return CourseModel.send_delete(\"/courses/\" + id + \"?query_only=true\")\n }", "function deleteArticle(id) {\n fetch('http://localhost:8080/rest-api/articles/' + id, {\n method: 'delete',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: JSON.stringify(TOKEN),\n },\n })\n .then(function (response) {\n if (response.status == 204) {\n goToPage('/articles');\n } else {\n localStorage.errorMessage = 'Error deleting article';\n goToPage('/error-page');\n }\n })\n .catch(function (error) {\n localStorage.errorMessage = error;\n });\n}", "function deleteItem(id) {\n // console.log('deleting item');\n // console.log('deleting item', id);\n // delete item with the ID from items array\n // const newItems = items.filter((item) => item.id !== id);\n // console.log(newItems);\n items = items.filter((item) => item.id !== id);\n // console.log(items);\n\n // dispatch itemsUpdated events to trigger the event listes for displaying items and mirroring local storage\n list.dispatchEvent(new CustomEvent('itemsUpdated'));\n}", "function deleteTranslation(contentId, locale, originatingElement) {\n $.ajax({\n url: '/SamuraiCMS/edit/content_id/' + contentId + '/locale/' + locale + '/delete/Delete/',\n dataType: \"html\",\n data: {},\n beforeSend: function () {\n mov.helper.overlay.apply( originatingElement );\n },\n success: function (data) {\n $(originatingElement).html('Deleted');\n $(originatingElement).attr(\"onclick\", \"\");\n $(originatingElement).removeClass(\"sm-action\");\n _toggleSmSaveAsPanelVisibility(); // Close the sidebar\n _toggleSmSaveAsPanelVisibility(); // Re-open and reload sidebar\n },\n both: function () {\n mov.helper.overlay.clear( originatingElement );\n }\n });\n }", "function _delete(id) {\n return fetchWrapper.delete(`${accountUrl}/${id}`)\n}", "removePost(id){\n console.log(\"remove id:\" + id);\n fetch(\"http://localhost:8080/delete/\" + id, {\n method: 'DELETE',\n });\n }", "function remove(id){\n return db('trips').where('id',id).del();\n}", "function deleteComment(id) {\n let comments = localStorage.getItem(\"allComments\");\n if (comments == null) {\n allComments = [];\n } else {\n allComments = JSON.parse(comments);\n }\n allComments.splice(id, 1);\n localStorage.setItem(\"allComments\", JSON.stringify(allComments));\n showComments();\n}", "function deleteNote(id) {\n\n firebase\n .firestore()\n .collection(\"NoteApp\")\n .where('id', '==' ,id)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => doc.ref.delete());\n });\n // To delete that item, we filter out the item we don't want\n setNotes(notes.filter((item) => item.id !== id));\n }", "function removeListItem(id) {\n var request = $http({\n method: \"delete\",\n url: \"/api/delete_document\",\n params: {\n id: id\n },\n data: {\n id: id\n }\n });\n return(request.then(handleSuccess, handleError));\n }", "function removePart(tool_id) {\n axios.post(props.url + \"/delete?tool_id=\" + tool_id).then((response) => {\n window.location.reload()\n });\n }", "function deleteFile(id) {\n chrome.runtime.sendMessage({\n type: \"remove\",\n id: id\n });\n}", "function deleteMovie(id) {\n AJAXRequest(`${serverURL}/${id}`, 'DELETE').then(getAllMovies)\n }" ]
[ "0.6677927", "0.6606545", "0.6560378", "0.64950675", "0.64659834", "0.6445743", "0.64454406", "0.63364446", "0.6326042", "0.62944067", "0.62941897", "0.62693906", "0.62572294", "0.6239765", "0.62353086", "0.6210317", "0.61874735", "0.61831236", "0.61811054", "0.6143782", "0.6115675", "0.61076796", "0.6103657", "0.6098965", "0.60966146", "0.6084505", "0.60818076", "0.6075661", "0.6072149", "0.6069697", "0.6052618", "0.60466343", "0.60444236", "0.6039509", "0.60348266", "0.60263354", "0.60239065", "0.6023563", "0.6022668", "0.6011347", "0.6004665", "0.60009444", "0.60008407", "0.59898186", "0.5988082", "0.5979899", "0.5967594", "0.5958367", "0.59574395", "0.59437597", "0.59409595", "0.5935675", "0.5924694", "0.59126544", "0.59031737", "0.5898169", "0.5897857", "0.58957297", "0.5894894", "0.5894538", "0.5890882", "0.5889117", "0.5885623", "0.5879074", "0.5877406", "0.5877266", "0.58754456", "0.58731467", "0.58619356", "0.58619356", "0.58617574", "0.58615863", "0.58599794", "0.5858886", "0.58508795", "0.5849349", "0.5849196", "0.5844363", "0.58434725", "0.58401656", "0.58389527", "0.58384097", "0.58362275", "0.5834526", "0.58337206", "0.583152", "0.5828863", "0.5826703", "0.5825156", "0.5822824", "0.5821005", "0.58201426", "0.5819425", "0.58168405", "0.5813758", "0.5809428", "0.5805799", "0.5803731", "0.58037263", "0.58020663" ]
0.7400315
0
on body load function
function main() { //get canvas elementFromPoint canvas = document.getElementById("AMC"); if(!canvas) console.log("Obtaining canvas from main document failed\n"); else console.log("Obtaining canvas from main document succeeded\n"); //print obtained canvas width and height on console console.log("Canvas width:" + canvas.width +" height:" +canvas.height); canvas_original_width = canvas.width; canvas_original_height = canvas.height; //register keyboard and mouse event with window class window.addEventListener("keydown", keydown, false); window.addEventListener("click", mouseDown, false); window.addEventListener("resize", resize, false); init(); resize(); draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBodyLoad() {\n document.body.classList.add('loaded');\n}", "function onLoad()\n{}", "function onBodyLoad() {\n document.querySelector('.presentation').classList.add('visible')\n\n // Set up\n getSlideNumberFromUrlFragment()\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber], true)\n\n // Slide manipulation\n hyphenateSlides()\n setUpBetterPunctuation()\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "function onPageLoaded() {\n}", "function onloadHandler(){\n console.info(\"Nick Cage is ready!\");\n // where the magic happens\n replaceAllElements();\n }", "function onBodyLoad() {\n\t\n\t/*\n\t * Wait for device API libraries to load\n\t */\n\tif (isMobile.any()) {\n\t\tdocument.addEventListener(\"deviceready\", onDeviceReady, false);\n\t} else {\n\t\tonDeviceReady();\n\t}\n\t\n}", "function loaded() {\n\taddElements();\n\tosScroll();\n\t// initiate tabs\n\t$('#tabs').tab();\n\t// set event listeners\n\tsetOneTimeEventListeners();\n\t//updateChecked();\n}", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function pageFullyLoaded () {}", "onload() {\n this.init();\n }", "function page_loaded() {\n post_load_setup();\n}", "function onBodyLoad() {\n\t console.log(\"onBodyLoad\");\n\tdocument.addEventListener(\"deviceready\", onDeviceReady, false);\n }", "function alwaysRunOnload () {\n\t\n\t}", "function onLoad() {\n document.documentElement.removeAttribute(\"viewBox\");\n readFrames();\n sozi.events.fire(\"documentready\");\n }", "function onLoad() {\n document.documentElement.removeAttribute('viewBox');\n readFrames();\n sozi.events.fire('documentready');\n }", "onload() {}", "_didLoad () {\n // Clear the height cache\n this._lastHeight = 0\n \n // Post-process content\n this._unescapeImageURLs()\n \n // Setup event listeners\n this._addHeightListener('details', 'toggle')\n this._addHeightListener('img, svg', 'load')\n }", "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function on_page_load() {\n // Initialize On-scroll Animations\n AOS.init({\n anchorPlacement: 'top-left',\n duration: 600,\n easing: \"ease-in-out\",\n once: true,\n mirror: false,\n disable: 'mobile'\n });\n }", "function onload() {\r\n\tload();\r\n}", "async onLoad() {}", "onLoad() {}", "onLoad() { }", "function pageLoaded() {\n\n\t\tvar elHeader = document.getElementsByTagName('header')[0];\n\n\t\telHeader.addEventListener(animationEvent, removeFOUT);\n\n\t\tfunction removeFOUT() {\n\n\t\t\tclassie.add(elHTML, 'ready');\n\t\t\telHeader.removeEventListener(animationEvent, removeFOUT);\n\n\t\t}\n\n\t}", "function loadBody(success) {\n function complete() {\n if (typeof eventID !== \"undefined\") {\n $(\".event-id\").text(eventID);\n $(\".event-id\").addClass(\"active-event\");\n }\n\n if (success != undefined) {\n success();\n }\n }\n\n detectTouchDevice();\n $(\"body\").load(pageTemplateURL, complete);\n}", "function mainLoaded() {\n if (typeof(executeOnContentLoad) == \"function\") {\n if (contentLoadDestination && location.hash != contentLoadDestination) return;//wait til we are on the correct page\n var fn = executeOnContentLoad;\n executeOnContentLoad = null;\n contentLoadDestination = null;\n fn();\n }\n }", "loaded() {}", "function onLoad() {\n sozi.events.listen('framechange', onFrameChange);\n }", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function onLoaded()\n\t{\n\t\twindow.initExhibitorsList();\n\t\twindow.initFloorPlans();\n\t\twindow.initConciege();\n\t\twindow.initAmenities();\n\t\twindow.initVisas();\n\t}", "function on_dom_content_loaded () {\n //remove this handler\n document.removeEventListener(\"DOMContentLoaded\", on_dom_content_loaded, false);\n\n //call the onLoad function\n Survana.Workflow.OnPageLoad();\n }", "function onPageLoad() {\n\n}", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tsetSelectMenuesValues(function(){\r\n\t\t\t\tgetXMLData(function(){\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n}", "function setLoadlist() {\n getWindowHeight(); //get window height\n getWindowWidth(); //get window width\n setParallaxContainerDimensions(); //set parallax container height & width\n setParallaxImgDimensions(); //set parallax image element height & width\n getParallaxInfo(); //get parallax container and element information\n getWindowScrollPos(); //get current window scroll position\n\n if (typeof _onReady === 'function') {\n _onReady.call();\n }\n\n setParallaxScroll();\n }", "function _onload(ev) {\n _emit('load', [ev]);\n }", "function cb_contentLoaded(cb) {}", "onLoad() { \n\n }", "function eltdfOnWindowLoad() {\n\t eltdfWooCommerceStickySidebar().init();\n\t eltdfInitButtonLoading();\n eltdfInitProductListMasonryShortcode();\n }", "function eltdfOnDocumentReady() {\n eltdfHeaderBehaviour();\n eltdfSideArea();\n eltdfSideAreaScroll();\n eltdfFullscreenMenu();\n eltdfInitDividedHeaderMenu();\n eltdfInitMobileNavigation();\n eltdfMobileHeaderBehavior();\n eltdfSetDropDownMenuPosition();\n eltdfDropDownMenu();\n eltdfSearch();\n eltdfVerticalMenu().init();\n }", "onPageReady () {}", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tgetPT1000XMLData(function(){\r\n\t\t\tshowPT1000values();\r\n\t\t});\r\n\t});\r\n}", "onLoad () {}", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function eltdfOnWindowLoad() {\n\n }", "function onPageLoad() {\r\n\t// although jQuery already has an on page load, \r\n\t// this function was added for sake of organization.\r\n\tvar trigger = \"load\";\r\n}", "function OnLoaded(){\n const sections=document.getElementsByTagName(\"section\");\n buildNavigationBar(sections);\n buildSectionArray(sections)\n createScrollToTopView();\n}", "function onPageLoad()\n\t{\n\t\t//Set page size\n\t\tSetSize();\n\t\tloadPreferences();\n\t}", "function load(){\r\n\r\n}", "function startOnLoad() {\n}", "function startOnLoad() {\n}", "function onBodyLoad()\r\n {\r\n document.addEventListener(\"deviceready\",onDeviceReady,false);\r\n }", "load() {\r\n\r\n }", "onPageLoaded() {\n window.clearTimeout(this.animationTimeout_);\n window.clearTimeout(this.loadingTimeout_);\n this.setUIStep(AssistantLoadingUIState.LOADED);\n }", "function eltdfOnWindowLoad() {\n eltdfDropDownMenu();\n eltdfSetDropDownMenuPosition();\n eltdfInitDividedHeaderMenu();\n }", "onLoad () {\n\n }", "async afterLoad () {\n }", "function handlePageLoad() {\n // Add a listener to be triggered when we scroll through the pages\n window.addEventListener('hashchange', function() {\n debug('Hash change detected: ' + location.hash + ' State: ' + document.readyState);\n processUserList();\n }, false);\n\n queryUserId();\n queryReviveSkill();\n }", "function coreInitLoadPage() {\n if (typeof $(\"body\").attr(\"control\") !== \"undefined\")\n WEBUI.MAINPAGE = $(\"body\")[$(\"body\").attr(\"control\").split(\".\")[1]]();\n }", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideArea();\n edgtfSideAreaScroll();\n edgtfFullscreenMenu();\n edgtfInitMobileNavigation();\n edgtfMobileHeaderBehavior();\n edgtfSetDropDownMenuPosition();\n edgtfDropDownMenu(); \n edgtfSearch();\n }", "function init() {\n\t\t$(document).on('pageBeforeInit', function (e) {\n\t\t\tvar page = e.detail.page;\n\t\t\tload(page.name, page.query);\n\t\t});\n }", "onLoad() {\n if (isFunction(onLoad)) {\n onLoad();\n }\n }", "function addLoadEvent( _func ) {\r\n// document.observe('dom:loaded', _func);\r\n Event.observe(window, 'load', _func);\r\n}", "onAfterLoadPage(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "onAfterLoadPage(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "function mkdfOnWindowLoad() {\n\t\tuncoveringFooter();\n\t}", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function finishedLoad() {\n console.log('finishedLoad()');\n if (externalIsLoaded()) {\n init();\n }\n }", "function qodeOnWindowLoad() {\n qodeInitElementorCoverBoxes();\n }", "function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}", "function onLoadComplete()\n {\n this.loaded = true;\n }", "function init() {\n if ($('.detail-page').length > 0) {\n renderLoader();\n setArticleParams();\n getArticle();\n bindEvents();\n }\n }", "complete() {\n this.trigger('load_complete');\n }", "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "function initOnDomReady() {}", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function afterLoading(){\n\t\t\tupdatePageInfo();\n\t\t}", "onContentLoaded() {\r\n // Stub\r\n }", "function onHtmlLoaded(){\n \n // move article if header height changes during browser resize\n\t$(window).resize(positionArticle);\n\t\n\t//Create top menu (buttons and username)\n addTopMenu();\n \n //initial positioning of articles based on header size \n positionArticle();\n \n currentArticleId = getUrlParam(\"id\"); //Get selected article ID\n \n var article = new Article(); //Create new article object \n article.getArticleById(currentArticleId).done(displayArticle); //Request article by id and display it\n \n}//END onHtmlLoaded function", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function handleDomContentLoaded(event) {\n\n }", "function onLoadComplete() {\n}", "function screenLoad(){\r\n\t\t\tcenterAlignPortraits();\r\n\t\t\tadjustBiographyPlacement();\r\n\t\t\tupdateLatonaTeamRowHeight();\r\n\t\t}", "onStoreLoadStart() {\n if (this.loadMask) {\n this.maskBody(this.loadMask);\n }\n }", "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "function initLoad()\n{\n console.log('page load');\n myGame.buildBoard();\n myGame.nextMove();\n myGame.reset();\n}", "function loaded(){\n\t\tipcRenderer.send('asynchronous-message', {\"tag\":\"loaded\"});\n\t\t$( document ).tooltip();\n\t}", "async onPageLoad() {\n\n }", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function loadComplete() {\n\thasLoaded = true;\n}", "function _load() {\r\n document.getElementById(\"loading-icon\").style.visibility = \"hidden\";\r\n document.getElementById(\"body\").style.visibility = \"visible\";\r\n }", "function batHandleLoad() {\n var footer = $(\"#footer\");\n var pos = footer.position();\n var height = $(window).height();\n height = height - pos.top;\n height = height - footer.height();\n if (height > 0) {\n footer.css({\n 'margin-top': height + 'px'\n });\n }\n $(\"#userId\").focus();\n }", "function onInit() {\r\n\r\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\r\n\r\n }", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function init() {\n documentReady(documentLoaded);\n}", "function pageLoaded() {\n \n\t\tvar cmd = sendToDebugService('GlobalPageLoaded', { });\n \t// before returning - process all pending queue messages \n \twhile ((msg = JsHybuggerNI.getQueuedMessage(false)) != null) {\n \t\tprocessCommand(parseSafe(msg),null);\n \t\t}\n }", "function pagesOnload(){\n var start_hash=location.hash;\n if(!start_hash){ /* the url has no hash . run the callback function of the first page */\n var callback = $(\".fullPage\").eq(0).attr(\"inView\");\n strTofunc(callback);\n\t\t return false;\n }\n /* if the url has hash , locate to the page */\n locateToHash(start_hash);\n }", "function onLoadComplete () {\n // ready = true;\n}", "function onPageInit(e){\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function onPageInit(e){\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function __onLoad() {\n\tLOADED=true;\n}" ]
[ "0.7331144", "0.7243662", "0.7133408", "0.7052372", "0.6990392", "0.697745", "0.6972269", "0.69541526", "0.694778", "0.6864656", "0.6843282", "0.6814684", "0.6801337", "0.6775726", "0.6762896", "0.67622274", "0.67222625", "0.6705906", "0.66984266", "0.66921777", "0.66772544", "0.6656085", "0.66391236", "0.6633773", "0.65967554", "0.6591787", "0.6590676", "0.65865624", "0.6586534", "0.65764385", "0.65651935", "0.6560917", "0.6559288", "0.65584123", "0.65516675", "0.6550958", "0.65446895", "0.6539207", "0.6533426", "0.65304005", "0.652033", "0.6505003", "0.64908195", "0.6482127", "0.6468808", "0.64590305", "0.6456841", "0.6454548", "0.64497334", "0.64497334", "0.6434426", "0.6431015", "0.6424484", "0.64129853", "0.6410495", "0.6407375", "0.6397776", "0.63968676", "0.6391773", "0.6373578", "0.6353303", "0.6352895", "0.6351836", "0.6351836", "0.63503355", "0.63481605", "0.6346618", "0.6342075", "0.63346547", "0.6334104", "0.63314635", "0.63302994", "0.631701", "0.63146394", "0.63132054", "0.6300119", "0.6299061", "0.6292657", "0.62914646", "0.6291433", "0.6284912", "0.62831783", "0.6279305", "0.6272395", "0.6272395", "0.6270749", "0.6270435", "0.6259922", "0.6259213", "0.6258118", "0.62549734", "0.62542516", "0.62487346", "0.62393856", "0.62347484", "0.6212433", "0.62119323", "0.62070554", "0.6205526", "0.6205526", "0.6198209" ]
0.0
-1
writeCards(["Lisa", "Kaitlin", "Jan"], 'surprise');
function countDown(num) { let i = -1 while(i < num){ console.log(num--); } return num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeCards (names, birthday) {\n let thankYouCards = [];\n for (let i = 0; i < names.length; i++) {\n thankYouCards.push(`Thank you, ${names[i]}, for the wonderful ${birthday} gift!`)\n }\nreturn thankYouCards\n}", "function writeCards(arrayOfNames, eventName) {\n let returnArray = []\n for (let i = 0; i < arrayOfNames.length; i++) {\n returnArray.push(`Thank you, ${arrayOfNames[i]}, for the wonderful ${eventName} gift!`); \n }\n return returnArray; \n}", "function writeCards(names, holiday) {\n let cards = []\n for (let i = 0; i < names.length; i++) {\n cards.push(`Thank you, ${names[i]}, for the wonderful ${holiday} gift!`);\n }\n\n return cards;\n}", "function printStringsDeck() {\n var result = \"\";\n for (var i = 0; i < 52; i++) {\n result += \"Card ---> \" + deckCards.arrayOfCards[i] + \"\\n\";\n }\n return result;\n}", "function writeCards(namesArray, event) {\n let cards = []\n for (let i=0; i < namesArray.length; i++ ){\n cards.push(`Thank you, ${namesArray[i]}, for the wonderful ${event} gift!`);\n console.log(`Thank you, ${namesArray[i]}, for the wonderful ${event} gift!`);\n\n }\n\n return cards;\n}", "function writeCards(names, eventName) {\n let thankYouArray = [];\n for (let i = 0; i < names.length; i++) {\n thankYouArray.push(`Thank you, ${names[i]}, for the wonderful ${eventName} gift!`);\n }\n return thankYouArray;\n}", "function writeCards(namesArray, nameEvent) {\n let arr = []\n for (let i = 0; i < namesArray.length; i++) {\n arr.push(`Thank you, ${namesArray[i]}, for the wonderful ${nameEvent} gift!`);\n }\n return arr;\n}", "function printDeck() {\n var result = \"[\";\n for (var i = 0; i < deckCards.arrayOfCards.length; i++) {\n result += deckCards.arrayOfCards[i] + \", \";\n }\n result += \"]\";\n return result;\n}", "function writeCards(array, event) {\n let result = [];\n for(let i=0; i < array.length; i++) {\n result.push(`Thank you, ${array[i]}, for the wonderful ${event} gift!`);\n }\n return result;\n }", "function consoleCards(array){\n for(x in array){\n console.log(x + '. ' + array[x].name);\n }\n}", "function generateDeck(cards) {\n // Loop through each element in the cards array and create its HTML\n var deck = cards.map(function(card) {\n return `<li class=\"card\"><i class=\"${card}\"></i></li>`;\n });\n\n return deck.join('');\n}", "function displayCardFromDeck(card){\n return card.value + \" of \" + card.suit;\n}", "function cardToString(){ \n // not sure if is prototype or just function\n\n var number; //rank \n var suit;\n\n switch (this.number) {\n case \"A\" :\n number = \"Ace\";\n break;\n case \"2\" :\n number = \"Two\";\n break;\n case \"3\" :\n number = \"Three\";\n break;\n case \"4\" :\n number = \"Four\";\n break;\n case \"5\" :\n number = \"Five\";\n break;\n case \"6\" :\n number = \"Six\";\n break;\n case \"7\" :\n number = \"Seven\";\n break;\n case \"8\" :\n number = \"Eight\";\n break;\n case \"9\" :\n number = \"Nine\";\n break;\n case \"10\" :\n number = \"Ten\";\n break;\n case \"J\" :\n number = \"Jack\"\n break;\n case \"Q\" :\n number = \"Queen\"\n break;\n case \"K\" :\n number = \"King\"\n break;\n }\n\n switch (this.suit) {\n case \"C\" :\n suit = \"Clubs\";\n break;\n case \"D\" :\n suit = \"Diamonds\"\n break;\n case \"H\" :\n suit = \"Hearts\"\n break;\n case \"S\" :\n suit = \"Spades\"\n break;\n }\n\n return number + \"_of_\"+ suit;\n //will reference to find and change for the picture.\n}", "function giveCards() {\n\tshuffle(cards).forEach(function createCard(x) {\n\t\t$(\".deck\").append(`<li class=\"card\"><i class=\"fa ${x}\"></i></li>`);\n\t});\n}", "function createCardlist(){\n var arr = [];\n for (var i = 1; i<=52; i++)\n {\n var face = i%13;\n switch(face){\n case 1:\n face = \"Ace\";\n break;\n case 11:\n face = \"Jack\";\n break;\n case 12:\n face = \"Queen\";\n break;\n case 0:\n face = \"King\";\n break;\n default:\n face = face.toString();\n break;\n }\n\n var suit;\n switch(Math.floor(i/13)) {\n case 0:\n suit = \"Spade\";\n break;\n case 1:\n suit = \"Diamond\";\n break;\n case 2:\n suit = \"Heart\";\n break;\n case 3:\n suit = \"Club\";\n break;\n default:\n break;\n }\n arr[i-1] = face + \" of \" + suit;\n }\n return arr;\n}", "function addDeck()\r\n{\r\n\tfor (var s=0; s<SUITE.length; s++)\r\n\t\tfor (var c=0; c<CARDS_IN_SUITE; c++)\r\n\t\t\tCards.push(s+':'+(c+1));\r\n\t\tshuffleCards();\r\n}", "function randomizer() {\n buildDeck();\n var index = Math.floor(Math.random() * deck.length); \n\n return \"Your card is **\" + deck[index] + \"**\";\n}", "function makeDeck() {\n var count = 0;\n var name = ['9', '10', '11', '12', '13', '14'];\n var suit = ['c', 's', 'd', 'h'];\n for (var n = 0; n < name.length; n++) {\n for(var s = 0; s < suit.length; s++) {\n var newCard = new Card(name[n], suit[s], parseInt(name[n], 10), `cardDeck/${name[n]}${suit[s]}.png`); \n if (suit[s] === 'c' || suit[s] === 's') {\n newCard.color = \"black\";\n } else newCard.color = \"red\";\n euchreDeck[count] = newCard;\n count++;\n }\n }\n}", "function drawcards(cards, suits) {\n var lines = [\"\", \"\", \"\", \"\", \"\"];\n var value = [];\n if (cards.length == 1) { //if only one card is passed we draw the first card face down\n lines = [\".---.\", \"|///|\", \"|///|\", \"|///|\", \"'---'\"];\n }\n //topline\n for (i = 0; i < cards.length; i++) {\n lines[0] += \".---.\";\n }\n lines[0] += \"</br>\";\n\n //2nd line (contains value)\n for (i = 0; i < cards.length; i++) {\n lines[1] += \"|\" + cardvalue(cards[i]);\n if (cardvalue(cards[i]) == 10) {\n lines[1] += \" |\";\n } else {\n lines[1] += \"&nbsp; |\";\n }\n }\n lines[1] += \"</br>\";\n\n //3rd line (contains suit)\n for (i = 0; i < cards.length; i++) {\n\n lines[2] += \"| \" + suits[i] + \" |\";\n }\n lines[2] += \"</br>\";\n\n //4th line (contains value)\n for (i = 0; i < cards.length; i++) {\n if (cardvalue(cards[i]) == 10) {\n lines[3] += \"| \" + cardvalue(cards[i]) + \"|\";\n } else {\n lines[3] += \"| &nbsp;\" + cardvalue(cards[i]) + \"|\";\n }\n\n }\n lines[3] += \"</br>\";\n\n //bottom line\n for (i = 0; i < cards.length; i++) {\n lines[4] += \"'---'\";\n }\n lines[4] += \"</br>\";\n return lines[0] + lines[1] + lines[2] + lines[3] + lines[4];\n}", "function showCard() {\n\n myDeck = shuffle(myDeck);\n for(var i=0; i < myDeck.length; i++){\n div = document.createElement('div');\n div.className = 'card';\n\n \n var ascii_char = '&' + myDeck[i].suit.toLowerCase() + ';';\n }\n div.innerHTML = '<span class=\"number\">' + myDeck[i].name + '</span><span class=\"suit\">' + ascii_char + '</span>';\n document.getElementById(\"cardDeck\").appendChild(div);\n}", "function Deck() {\n this.names = [2, 3, 4, 5, 6, 7, 8, 9, 10, \"J\", \"Q\", \"K\", \"A\"];\n this.suits = [\"♠\", \"♣\", \"♥\", \"♦\"];\n\n let cards = [];\n\n for (let s = 0; s < this.suits.length; s++) {\n for (let n = 0; n < this.names.length; n++) {\n cards.push(new Card(this.names[n], this.suits[s]));\n }\n }\n\n return cards;\n}", "function ShowCards(deck)\n{\n deck.forEach(element => {\n console.log(element.value + ' of ' + element.suit)\n });\n\n console.log('***************************************************')\n}", "function listCards(arr) {\r\n for (i in arr) {\r\n console.log(i + \": \" + arr[i].value + \" of \" + arr[i].suit);\r\n }\r\n}", "function dealCard(person, array) {\n const card = document.createElement('div');\n card.className = 'card container';\n let randomCard = newDeck.cards.pop();\n card.innerHTML = randomCard.value + \" \" + randomCard.suit;\n if (randomCard.suit == \"&#9829;\" || randomCard.suit == \"&#9830;\") {\n card.style.color = 'red';\n }\n array.push(randomCard.points);\n person.appendChild(card);\n}", "function createDeck()\n{\n var suits = [\"clubs\",\"diamonds\",\"hearts\",\"spades\"];\n \n for (i = 0; i<4;i++)\n {\n for (j = 2; j<15; j++)\n {\n cards.push({\n suit:suits[i],\n value:j \n });\n }\n }\n\n //shuffles the array\n shuffleArray(cards);\n}", "function generateStandardDeck()\n{\n\tvar deck = new Array();\n\t\n\tfor (s = CLUB; s <= SPADE; s++)\n\t{\n\t\tfor (r = ACE; r <= KING; r++)\n\t\t{\n\t\t\tcardStr = r + \";\" + s + \";\" + r + \"-\" + s + \".png\";\n\t\t\t\n\t\t\tdeck.push(cardStr);\n\t\t}\n\t}\n\t\t\n\treturn deck;\n}", "constructor(){\n this.name=\"Card Games\";\n this.suit={a:\"Spades\",b:\"Hearts\",c:\"Diamonds\",d:\"Clubs\"};\n //this.suit=[\"Spades\",\"Hearts\",\"Diamonds\",\"Clubs\"];\n //J,Q,K=14-16; Right now: 1 and 11 is Ace\n this.cardNum=[1,2,3,4,5,6,7,8,9,10,11,12,13];\n //console.log(\"creating card games\");\n }", "giveCards() {\n var suit = [\"♣️\", \"♦️\", \"♥️\", \"♠️\"];\n var rank = [\"King\", \"Queen\", \"Jack\", \"Ace\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"];\n var cards = new Array();\n var n = suit.length * rank.length;\n for (let i = 0; i < suit.length; i++) {//adding of all 52 cards in array\n\n for (let j = 0; j < rank.length; j++) {\n cards.push(\"\" + rank[j]+ suit[i] );\n\n }\n\n }\n var l, temp;\n for (let index = 0; index < n; index++) {//mixing all the cards\n var l = Math.floor(Math.random() * n);\n temp = cards[l];\n cards[l] = cards[index];//swapping cards\n cards[index] = temp;\n\n }\n return cards;\n }", "giveCards(){\n var suit=[\"♣️\",\"♦️\", \"♥️\", \"♠️\"];\n var rank=[\"King\",\"Queen\",\"Jack\",\"Ace\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\"];\n var cards=new Array();\n var n=suit.length*rank.length;\n for (let i = 0; i < suit.length; i++) {//adding of all 52 cards in array\n \n for (let j = 0; j < rank.length; j++) {\n cards.push(\"\"+suit[i]+rank[j]);\n \n }\n \n }\n var l,temp;\n for (let index = 0; index < n; index++) {//mixing all the cards\n var l=Math.floor(Math.random()*n);\n temp=cards[l];\n cards[l]=cards[index];//swapping cards\n cards[index]=temp;\n \n }\n return cards;\n }", "function displayHandUpdate(){\r\n displayHand = [`Cards:`];\r\n \r\n for (let i=0; i<cards.length; i++){\r\n displayHand.push(\" \"+ cards[i])\r\n\r\n } displayHand = displayHand.join(\"\");\r\n hand.textContent = displayHand;\r\n \r\n}", "function cardToOutputString(card) {\n var faceValue = cardFaceValue(card);\n\n if (faceValue >= royalStartNumeric) {\n return royalNames[faceValue - royalStartNumeric];\n }\n return numberNames[faceValue - 1];\n}", "function createDeck() {\r\n let deckDOM = document.querySelector('.deck');\r\n\r\n shuffle(deckOfCards);\r\n\r\n let temp = '';\r\n let i = 0;\r\n let len = deckOfCards.length;\r\n for (; i < len; i++) {\r\n temp = temp + printCardHTML(deckOfCards[i]);\r\n }\r\n\r\n deckDOM.innerHTML = temp;\r\n}", "function evalCards() {\n\n}", "function generate(){\n\tdeck = []\n\tfor(var x = 1; x<=13; x++){\n\t\tfor(var y=0; y<=3; y++){\n\t\t\tif(x === 1){\n\t\t\t\tdeck.push(['A', suit[y]]);\n\t\t\t}else if(x===11){\n\t\t\t\tdeck.push(['J', suit[y]]);\n\t\t\t}else if(x===12){\n\t\t\t\tdeck.push(['Q', suit[y]]);\n\t\t\t}else if(x===13){\n\t\t\t\tdeck.push(['K', suit[y]]);\n\t\t\t}else{\n\t\t\t\tdeck.push([x.toString(), suit[y]]);\n\t\t\t}\n\n\t\t}\n\t}\n}", "function generateDeck() {\n for (var num = 0; num < 16; num += 1) {\n $(deck).append('<li class=\"card\"><i class=\"fa ' + givenCardsArray[num] + '\"></i></li>');\n }\n}", "function deck(){\n\tconst names = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];\n\tconst suits = ['H','D','S','C'];\n\n\treturn suits.reduce((deck, suit) => {\n\t deck.push(...names.map((name) => { return {\"suit\": suit, \"name\": name}}));\n\t return deck;\n\t }, []);\n}", "function CreateCardDeck()\n{\n var cardDeck = [];\n var suits = [\"hearts\",\"clubs\",\"spades\",\"diamonds\"];\n var cardValue = [\"ace\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"jack\",\"queen\",\"king\"];\n\n for(var i=0;i<suits.length;i++)\n {\n for(var j=0;j<cardValue.length;j++)\n {\n var newCard = {\n suit: suits[i],\n value: cardValue[j]\n };\n cardDeck.push(newCard);\n }\n }\n return cardDeck;\n}", "function draw(pack, amount) {\n\tvar drawedCards = [];\n\tdrawedCards = pack.slice(0, amount); // Haal x kaarten uit de stapel en sla deze op\n\tpack.splice(0, amount); // Haal de kaarten uit de stapel\n\t\n\t//hand.push.apply(hand, drawedCards); // Voeg de kaarten toe aan de kaarten op de hand\n\treturn drawedCards;\n}", "printDeck(){\n console.log(\"Printing deck..\");\n for (const card of this.cards){\n card.displayCard();\n }\n // for (let i=0; i < this.cards.length; i++){\n // console.log(`${i+1}:${this.cards[i]}`);\n //}\n }", "function generate_deck() {\n var suits = ['♦', '♣', '♥', '♠'];\n var card_nums = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'];\n var deck = [];\n for (var i = 0; i < card_nums.length; i++) {\n for (var j = 0; j < suits.length; j++) {\n deck.push(card_nums[i] + suits[j]);\n }\n }\n scriptProperties.setProperty('Deck', JSON.stringify(deck));\n return deck;\n}", "function addCharacterCards(element, arr) {\n $.each(arr, function (indexInArray) {\n element.append(createCharacterCard(arr[indexInArray], indexInArray));\n });\n }", "deckOfCards() {\n try {\n var suits = [\"♣\", \"♦\", \"♥\", \"♠\"];\n var ranks = [\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"Jack\",\n \"Queen\",\n \"King\",\n \"Ace\"\n ];\n /**\n * To calculate total number of cards\n */\n var totalCards = suits.length * ranks.length;\n /**\n * To create a deck of array\n */\n var cardArray = [];\n for (let currentSuit = 0; currentSuit < suits.length; currentSuit++) {\n for (let currentRank = 0; currentRank < ranks.length; currentRank++) {\n var temp = \"\";\n cardArray.push(temp + ranks[currentRank] + suits[currentSuit]);\n }\n }\n /**\n * To shuffle the deck\n */\n for (let shuffle = 0; shuffle < totalCards; shuffle++) {\n var num = Math.floor(Math.random() * totalCards);\n /**\n * Performing swapping\n */\n var temp = cardArray[shuffle];\n cardArray[shuffle] = cardArray[num];\n cardArray[num] = temp;\n }\n return cardArray;\n } catch (error) {\n console.log(error.message);\n }\n }", "function readMyCards() {\n // Get my cards\n var cards = document.getElementsByClassName('you-player')[0];\n var card1 = cards.getElementsByClassName('card')[0],\n card2 = cards.getElementsByClassName('card')[1];\n\n // Convert each of my cards to string\n var card1String = face[card1.children[0].innerText] + ' of ' + suit[card1.children[1].innerText];\n var card2String = face[card2.children[0].innerText] + ' of ' + suit[card2.children[1].innerText];\n\n return 'Cards in hand are ' + card1String + ' and ' + card2String;\n}", "function deckOCards() {\n let suits = ['♠', '♦', '♥', '♣'];\n let values = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'A', 'J', 'Q', 'K'];\n let deck = [];\n suits.forEach((suit) => {\n let cards = values.map((value) => ({suit: suit, value: value}));\n deck = deck.concat(cards);\n });\n // whenever deckOCards is invoked, we shuffle it\n const shuffled = shuffle(deck);\n return shuffled;\n } // deckOCards ends", "function cardClick(card, array) {\n \n var letter = array.slice();\n $(card).text(letter);\n lastCardId = $(card).attr(\"id\");\n}", "function getCardString(card){\n return card.value + ' of ' + card.suit;\n}", "function createCard(card) {\n // if card isn't faceUp\n if (!card.faceUp) {\n return unknownCard;\n\n }\n\n var cardText = (card.rank != \"10\" ? `______\n|R S|\n| |\n|S R|\n` + (unicode ? \"\\u203E\\u203E\\u203E\\u203E\\u203E\\u203E\" : \"------\") : `______\n|R S|\n| |\n|S R|\n`+ (unicode ? \"\\u203E\\u203E\\u203E\\u203E\\u203E\\u203E\" : \"------\"));\n var s;\n switch(card.suit) {\n case \"Spades\":\n s = (unicode ? \"\\u2660\" : \"S\");\n break;\n case \"Hearts\":\n s = (unicode ? \"\\u2665\" : \"H\");\n break;\n case \"Clubs\":\n s = (unicode ? \"\\u2663\" : \"C\");\n break;\n case \"Diamonds\":\n s = (unicode ? \"\\u2666\" : \"D\");\n break;\n }\n\n var r = card.rank;\n\n // replace all instances of \"R\" with rank\n cardText = cardText.replace(/R/g, r);\n\n // replace all instances of \"S\" with rank\n cardText = cardText.replace(/S/g, s);\n\n // if card is black, replace all spaces with a \"/\"\n if (isBlack(card.suit)) {\n cardText = cardText.replace(/ /g, \"/\");\n }\n\n return cardText;\n}", "deckBuilder(){\n const deckSize = Object.keys(this.suitObjects).length*this.suitValues.length;\n for (let i = 0; i < deckSize; i++) {\n// Add a card to the cards deck\nthis.deckOfCards.unshift(this.drawCardAtRandom());}\nconst pre = document.querySelector('#preserve');\npre.innerHTML ='Here is your shuffled\\n deck of cards 🤩';\nreturn this.deckOfCards;\n }", "deckBuilder(){\n const deckSize = Object.keys(this.suitObjects).length*this.suitValues.length;\n for (let i = 0; i < deckSize; i++) {\n// Add a card to the cards deck\nthis.deckOfCards.unshift(this.drawCardAtRandom());}\nconst pre = document.querySelector('#preserve');\npre.innerHTML ='Here is your shuffled\\n deck of cards 🤩';\nreturn this.deckOfCards;\n }", "function /*char*/ suit(/*int*/ card) {\n\t//return( suits['c'+(card % NSUITS)] );\n\treturn( suits[card % NSUITS] );\n}", "function createBasicCards() {\n inquirer.prompt([\n {\n name: \"front\",\n message: \"What should the flashcard ask?\"\n }, {\n name: \"back\",\n message: \"What should the answer be?\"\n }\n ]).then(function(answers) {\n\n var basicCard = new MakeCard(answers.front, answers.back);\n\n var logBasicCardQuestion = answers.front;\n var logBasicCardAnswer = answers.back;\n\n console.log(\"Your Card has been created and added to the list.\")\n\n fs.appendFileSync(\"questions.txt\", logBasicCardQuestion + '\\n');\n fs.appendFileSync(\"answers.txt\", logBasicCardAnswer + '\\n');\n\n startProgram();\n });\n}", "function getCardString(card) {\n return card.value + ' of ' + card.suit;\n}", "function createCard() {\n let cardList = shuffle(cards);\n cardList.forEach(function(card) {\n $(\".deck\").append('<li><i class=\"card fa ' + card + '\"></i></li>');\n\n });\n}", "function createClozeCards() {\n inquirer.prompt([\n {\n name: \"front\",\n message: \"Write the full text of the Clozecard question.\"\n }, {\n name: \"cloze\",\n message: \"What information should be removed?\"\n }\n ]).then(function(answers) {\n\n var str = answers.front;\n answers.front = str.replace(answers.cloze, \"...\");\n\n var clozeCard = new ClozeCard(answers.front, answers.cloze);\n\n var logClozeCardQuestion = answers.front;\n var logClozeCardAnswer = answers.cloze;\n\n console.log(\"Your Card has been created and added to the list.\")\n\n fs.appendFileSync(\"questions.txt\", logClozeCardQuestion +'\\n');\n fs.appendFileSync(\"answers.txt\", logClozeCardAnswer + '\\n');\n\n startProgram();\n });\n}", "function createCards() {\n\ttitles_flipped = 0; \n\tvar card = '';\n\tmemorCards.shuffle(); \n\tfor(var i = 0 ; i < memorCards.length; i++){\n\tcard = card + '<div id=\"title_' + i + '\" class=\"'+memorCards[i]+'\"onclick=\"cardSwitch(\\''+i+'\\',\\''\n\t+memorCards[i]+'\\')\"></div>';\n\tmemoryValues = [];\n\tmemoryTitleIds = []; \n\n\t}\t\n\t\tdocument.getElementById('playground').innerHTML = card; \n}", "showCard() {\n // console.log(`${this.name} of ${this.suit}`);\n }", "function dealtCards(dealtCardsArray) {\n console.log(dealtCardsArray);\n }", "function drawCards(amountOfCards,sort) {\r\n if (amountOfCards <= deckOfCards.length) {\r\n for (var i = 0; i < amountOfCards; i++) {\r\n hand.push(deckOfCards.shift());\r\n }\r\n if (sort) {\r\n sortCards(hand);\r\n }\r\n }\r\n}", "function makeSandwich() {\r\n 'A slice of bread';\r\n 'Add cheese';\r\n 'A slice of bread';\r\n}", "function chooseCards() {\n\tvar number = 1;\n\twhile (number <= pairs) {\n\t\tvar picture = number.toString()+\".png\";\n\t\t\n\t\t// The picturename is pushed to the array two times, because in the game\n\t\t// there are always two cards with the same picture.\n\t\tcards.push(picture);\n\t\tcards.push(picture);\n\t\tnumber++;\n\t}\n}", "function createHTML() {\n let cardList = shuffle(myCards);\n cardList.forEach(function(card) {\n $(\".deck\").append('<li><i class=\"card fa ' + card + '\"></i></li>');\n })\n}", "function createGameBoard() {\n // ForEach method called on trueCardArr adds each card into the deck, returning the entire deck at the end\n\ttrueCardArr.forEach(function(card) {\n return deck.innerHTML += card;\n });\n\treturn deck;\n}", "function drawRandomCard(deck){\r\n\tvar rand = Math.floor(Math.random() * 52);\r\n\t\r\n\treturn deck[rand];\r\n}", "deckOfCards() {\n try {\n var suits = [\"Clubs\", \"Diamonds\", \"Hearts\", \"Spades\"];\n var ranks = [\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"Jack\",\n \"Queen\",\n \"King\",\n \"Ace\"\n ];\n /**\n * To calculate total number of cards\n */\n var totalCards = suits.length * ranks.length;\n /**\n * To create a deck of array\n */\n var cardArray = [];\n for (let currentSuit = 0; currentSuit < suits.length; currentSuit++) {\n for (let currentRank = 0; currentRank < ranks.length; currentRank++) {\n var temp = \"\";\n cardArray.push(temp + ranks[currentRank] + suits[currentSuit]);\n }\n }\n /**\n * To shuffle the deck\n */\n for (let shuffle = 0; shuffle < totalCards; shuffle++) {\n var num = Math.floor(Math.random() * totalCards);\n /**\n * Performing swapping\n */\n var temp = cardArray[shuffle];\n cardArray[shuffle] = cardArray[num];\n cardArray[num] = temp;\n \n }\n return cardArray;\n } catch (error) {\n console.log(error.message);\n }\n }", "function exploKitt() {\n const explodingKitten = new Card ('Exploding Kitten', 'explodyKit1','images/explodingkittencard.png')\n deck.push(explodingKitten);\n shuffle(deck);\n}", "function placeCardsOnDeck(){\n\tgameDeck.innerHTML=\"\";\n\tfor(var r=0; r<myCardList.length; r++){\n\t\t// Create one card\n\t\tlet thisCard = document.createElement(\"LI\");\n\t\tthisCard.setAttribute(\"class\", \"card\");\n\t\tthisCard.innerHTML = \"<i class='\" + myCardList[r] + \"'></i>\";\n\t\t// Display the created card\n\t\tgameDeck.appendChild(thisCard);\n\t}\n}", "cardToString(){\n return this.number + \" of \" + this.suit + \" (\" + this._isFaceUp + \")\";\n }", "displayOutcomeCard(){\n // Prepare card value\nconst span = document.createElement('span');\nspan.innerHTML = `${this.outcomeCard.join(\"\")}`;\n// Prepare holder of suit and value\nconst li = document.createElement('li');\nli.classList.add('poker');\n// Load holder with value and background image \nli.appendChild(span);\n// Add composed card to ul container document\nconst ul = document.querySelector('ul');\nul.appendChild(li);\nreturn this.outcomeCard;\n }", "function randomCards() {\n let randomIndex = Math.floor(Math.random() * 13);\n return BlackJack['cards'][randomIndex];\n\n}", "function renderTxtFormat(cards, attrib) {\n var output = 'Sideboard\\r\\n' + _.reduce(cards, function (memo, card) {\n return memo += card.count + ' ' + card.title + '\\r\\n';\n }, '');\n return output;\n }", "function drawCards(deck, num) {\n const hand = [];\n for (let i = 0; i < num; i++) {\n const idx = Math.floor(Math.random() * deck.length);\n hand.push(...deck.splice(idx, 1));\n }\nreturn hand;\n}", "function newBoard(){\n\nvar numOfSymbols = document.getElementById(\"numSymbols\").value;\n\n document.getElementById(\"game\").innerHTML = \"\";\n document.getElementById(\"try\").innerHTML = \"?!#'s: \";\n\n\n if (numOfSymbols > 9)\n {\n numOfSymbols = 8;\n }\n\n //var new_array = [];\n //based on number of symbols...\n for (var i = 0; i < (numOfSymbols*2); i++){\n new_array.push(symbolArray[i]);\n }\n\n turned = 0;\n var output = '';\n\n new_array.shuffleCards();\n\n for(var i = 0; i < new_array.length; i++)\n {\n output += '<div id=\"card_'+ i +'\" onclick=\"turnCards(this,\\'' + new_array[i]+'\\')\"></div>';\n }\n document.getElementById('game_board').innerHTML = output;\n}", "function showCard(i) {\n firstDeck[i].classList.add('selected');\n return firstDeck[i].innerText;\n}", "function makeCards(array) {\n // cards =[];\n fullDeck = [];\n for(let i = 0; i < array.length; i++) {\n fullDeck.push(array[i]);\n }\n //doubles the creation of each card image creating the full deck\n fullDeck = [...fullDeck, ...fullDeck];\n }", "function createDeck(cards, deck) {\n shuffle(cards); // shuffle card list\n deck.innerHTML = ''; // reset deck in DOM\n \n // create document fragment to more efficiently add new card elements to the deck\n const deckFrag = document.createDocumentFragment();\n // loop through each card and create its HTML\n for (card of cards) {\n const newCard = document.createElement('li'); // create a new list item\n newCard.classList.add('card'); // make list item a card\n\n const faClass = 'fa-' + card; // create class matching card's font awesome icon\n const fa = document.createElement('i'); // create element for fa icon\n fa.classList.add('fa', faClass); // add font awesome classes to element\n\n newCard.appendChild(fa); // append fa element to new card\n deckFrag.appendChild(newCard); // append new card to fragment\n }\n deck.appendChild(deckFrag); // append fragment of new cards to the deck one time\n\n}", "function card(suit, value, name) {\n this.suit = suit; // string of c/d/h/s\n this.value = value; // number 1 - 10\n this.name = name; // string of the full card name\n}", "function format_single(card) {\n return card[0] + \" \" + cardNames[card[1]];\n }", "function makeDeck() {\n let deck = [];\n const suits = ['spades', 'hearts', 'clubs', 'diamonds'];\n const values = [2, 3, 4, 5, 6, 7, 8, 9, 10, 'jack', 'queen', 'king', 'ace'];\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 13; j++) {\n deck.push(new Card(suits[i], values[j]));\n }\n }\n return deck;\n }", "function getCard() {\n const deck = {\n suits: ['Clubs', 'Spades', 'Spades', 'Hearts','Diamonds'],\n cards: {\n '1': 'A',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n '10': '10',\n '11': 'J',\n '12': 'Q',\n '13': 'K',\n }\n }\n let randomCard = (Math.floor(Math.random() * 12 + 1))\n let randomSuit = (Math.floor(Math.random() * 4))\n console.log(`You drew a ${deck.cards[randomCard]} of ${deck.suits[randomSuit]}`)\n}", "generateCards() {\n var cards = [];\n var suits = ['spades', 'clubs', 'diamonds', 'hearts'];\n var values = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'jack', 'queen', 'king', 'ace'];\n\n // Maps out the objects for each card\n suits.map((_suit) => {\n return values.map((_value) => {\n return cards.push({ suit: _suit, value: _value, showBack: true });\n });\n });\n\n // Returns the newly created and shuffled deck\n return this.shuffleCards(cards);\n }", "function setCards(suit, face, cards){\n var i;\n var j;\n var x=0;\n var y=0;\n console.log(\"Setting up the deck...\");\n for(i = 0; i < suit.length; i++){ \n x=0;\n for(j = 0; j < face.length; j++){\n var tempSuit = suit[y];\n var tempFace = face[x];\n var tempCard = {face:tempFace, suit:tempSuit};\n cards.push(tempCard);\n x++;\n }\n y++;\n }\n}//end of setCards()", "function reprCardArray(array: Array<Card>) {\n var cards = [];\n for(var i=0;i<array.length;i++) cards.push(array[i].reprString());\n return \"[\" + cards.join(', ') + \"]\";\n}", "function makeCardHTML() {\n\tlet shuffledCards = shuffle(cardTypes);\n\tlet newCard;\n\tfor (cards in shuffledCards) {\n\t\tnewCard = $(`<li class=\"card\"><i class=\"fa ${shuffledCards[cards]}\"></i></li>`);\n\t\tdeck.append(newCard.clone());\n\t}\n}", "function deck() {\n this.names = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];\n this.suits = ['H', 'D', 'S', 'C'];\n var cards = [];\n\n for (var i = 0; i < this.suits.length; i++) {\n for (var j = 0; j < this.names.length; j++) {\n var val = j + 1;\n // if card is JQKA set value\n if (val > 10) {\n val = 10;\n } else if (val === 1) {\n val = 11;\n }\n cards.push(new card(val, this.names[j], this.suits[i]));\n }\n }\n return cards;\n}", "function buildBlackjack()\n{\n\n\tvar html = '<script type=\"text/javascript\" src=\"student.js\"></script>';\n\t\thtml += \"<table border=0 style='margin:auto'><tr>\";\n html += '<td><form><input type=\"BUTTON\" onClick=\"Javascript:hand = dealCards(2);\" value=\"Deal > > >\"></form></td>';\n\t\thtml += '<script type=\"text/javascript\">showCards(7)</script> <!-- See note below about showCards -->';\n \thtml += '<td><form><input type=\"BUTTON\" onClick=\"Javascript:hand = hitCard(hand)\" value=\"< < < Hit Me\"></form></td>';\n\t\thtml += '</tr></table>';\n\t\t\n\t\tproductarea.document.writeln(html);\n \t\n\t\t\n} // end of function buildBlackjack", "function renderAllCards(arrayQuotes){\r\n const grilla = document.getElementById(\"cards\");\r\n let contenido = \"\";\r\n for (const card of arrayQuotes) {\r\n contenido += quoteCardTemplate(card);\r\n }\r\n grilla.innerHTML = contenido;\r\n}", "function printAnswer(){\n var print = \" \";\n for (var i = 0; i < answer.length; i++) {\n print = print.concat(answer[i].toUpperCase());\n }\n document.getElementById(\"updateScreen\").innerText = \" Name: \" + print;\n}", "function getCardString(card) {\n return card.value + \" of \" + card.suit;\n}", "function newDeck() {\n var suit = [\"S\", \"H\", \"C\", \"D\"];\n var face = [\"A\", 2, 3, 4, 5, 6, 7, 8, 9, 10, \"J\", \"Q\", \"K\"];\n var cardCounter = 0;\n\n for (var i = 0; i < suit.length; i++) {\n for (var j = 0; j < face.length; j++) {\n var card = {\n suit: suit[i],\n face: face[j]\n }\n deck[cardCounter] = card;\n cardCounter++;\n }\n }\n}", "function runBasic() {\n// output instructions\n console.log(\"\\nAfter each card is shown, Press Ener to flip the card and see the next\\n\");\n// construct and fill 5 cards\n cards.push(new basicCard(\"This computer was the first portable computer?\", \"Osborne I\"));\n cards.push(new basicCard(\"A famous Super Bowl advertisement, from 1984, announced this computer?\", \"Macintosh\"));\n cards.push(new basicCard(\"The predessessor of the modern Internet?\", \"ARPANET\"));\n cards.push(new basicCard(\"Paul Allen and this man created Microsoft.\", \"Bill Gates\"));\n cards.push(new basicCard(\"IBM created this computer and won playing against Gary Kasparov in chess?\", \"Deep Blue\"));\n // call the display function\n queryCard(0)\n}", "function newGame(){\r\n\r\n\tcards_flipped = 0;\r\n\tvar output = '';\r\n\tcardGame_array.shuffle();\r\n\tfor(var i = 0; i < cardGame_array.length; i++){\t\t\t\r\n\t\toutput += '<div id=\"card_'+i+'\" onclick=\"cardGameFlipcard(this,\\''+cardGame_array[i]+'\\')\"></div>'\r\n\t}\r\n\tdocument.getElementById('felt').innerHTML = output;\r\n\t\r\n\t\r\n}", "function assign (array) {\n // Clear Deck\n clientDeck = []\n\n for (var i = 0; i < array.length; i++) {\n\n // ------GET VALUE OF CARDS ------\n var vaalue = array[i] % 13;\n if (vaalue % 13 >= 10) {\n vaalue = 0;\n }\n // console.log(vaalue)\n\n // ------GET order OF CARDS ------\n var orrder = array[i] % 13;\n\n // ------GET SUIT OF CARDS ------\n var suuit = Math.floor((array[i] - 1) / 13);\n if (suuit === 0) {\n suuit = 'Diamonds';\n } else if (suuit === 1) {\n suuit = 'Clubs';\n } else if (suuit === 2) {\n suuit = 'Hearts';\n } else if (suuit === 3) {\n suuit = 'Spades';\n }\n // console.log(suuit)\n\n // ------GET FACE OF CARDS ------\n var faace = array[i] % 13;\n if (faace === 11) {\n faace = 'Jack';\n } else if (faace === 12) {\n faace = 'Queen';\n } else if (faace === 0) {\n faace = 'King';\n } else if (faace === 1) {\n faace = 'Ace';\n }\n\n var cardy = new card(vaalue, suuit, faace, orrder);\n clientDeck.push(cardy);\n }\n // console.log(clientDeck);\n\n}", "function shuffle(cards)\n{\n\t// for loop???\n\t \n}", "function renderMwDeckFormat(cards, sbCards, attrib) {\n var output = '// ' + attrib + '\\r\\n';\n var prefix = \" \";\n if (cards !== null && cards.length > 0) {\n output += _.reduce(cards, function (memo, card) { return memo += prefix + card.count + ' [' + card.set.toUpperCase() + '] ' + card.title.replace(' & ', '/') + '\\r\\n'; }, '');\n }\n if (sbCards !== null && sbCards.length > 0) {\n prefix = \"SB: \";\n output += _.reduce(sbCards, function (memo, card) { return memo += prefix + card.count + ' [' + card.set.toUpperCase() + '] ' + card.title.replace(' & ', '/') + '\\r\\n'; }, \"// Sideboard:\\r\\n\");\n }\n return output;\n }", "function generaCard(array){\n iconsContainer.innerHTML = \"\"\n //creo card per ogni...\n for (i = 0; i < array.length; i++){\n\t\tlet {family, prefix, type, color, name} = array[i];\n const content = ` \n <div class=\"icon-card d-flex\">\n <i class=\"${family} ${prefix}${name}\" style= \"color:${color}\"></i>\n <h4>${name}</h4>\n </div>\n `;\n\n iconsContainer.innerHTML += content;\n }\n}", "function addCardsToDeck(cards, deck) {\n var elements = [];\n var id = 1;\n for (var card of cards) {\n var element = $(`<li class='card' id='card${id}'</li>`);\n element.append(`<i class='fa ${card}'></i>`);\n elements.push(element);\n id++;\n }\n deck.append(elements);\n}", "function createStackOfCards(cards) {\n if (cards.length == 0)\n return emptyCard;\n\n // loop each card, save cardText\n var cardText = \"\";\n for (var i = 0; i < cards.length; i++) {\n if (cardText == \"\")\n cardText = createCard(cards[i]);\n else\n cardText = stackCards(createCard(cards[i]), cardText);\n }\n\n return cardText;\n}", "function createCards(cards) {\n let type;\n return cards.map((cardConfig) => {\n const tempCards = [];\n if (cardConfig[2]) {\n type = cardConfig[2];\n }\n for (let i = 0; i < cardConfig[0]; i++) {\n tempCards.push({text: cardConfig[1], type})\n }\n return tempCards;\n }).flat().map( function(item, index){\n const el = document.createElement('div');\n el.setAttribute('text', item.text);\n el.setAttribute('type', item.type);\n el.innerHTML = `\n<p>\n ${item.type}\n</p>\n<p>\n ${item.text}\n</p>\n`;\n el.classList.add('card');\n document.body.appendChild(el);\n addListeners(el);\n el.setAttribute('deck', 'origin');\n return el;\n });\n}", "function dealCard(){\r\n \r\n cards.push(card[Math.floor(Math.random()*card.length)])\r\n}", "function Deck(cards) {\r\n this.count = function () {\r\n return cardArr.length;\r\n }\r\n this.shuffle = function () {\r\n\r\n }\r\n this.draw = function () {\r\n\r\n }\r\n this.add = function () {\r\n \r\n shuffle();\r\n }\r\n}", "function myFriends(array) {\n for (var i = 0; i < array.length; i++) {\n document.write('I love ' + array[i]);\n document.write(\"<br>\");\n }\n}" ]
[ "0.73049355", "0.7050327", "0.70452535", "0.6843317", "0.68239504", "0.67984444", "0.6783954", "0.6764512", "0.6733885", "0.66254485", "0.64052397", "0.6364714", "0.62897104", "0.62504303", "0.624323", "0.62428135", "0.624153", "0.62324065", "0.620111", "0.61764693", "0.61563104", "0.6146641", "0.6146474", "0.61403316", "0.6084735", "0.6072644", "0.6072586", "0.6050751", "0.60297006", "0.6001129", "0.59511", "0.59389013", "0.5924872", "0.5924618", "0.5888219", "0.5858232", "0.58530605", "0.58403933", "0.58336866", "0.58328724", "0.5822935", "0.581709", "0.58114356", "0.58088875", "0.5804886", "0.58023393", "0.580045", "0.5798123", "0.5798123", "0.57961833", "0.57802856", "0.57799214", "0.57776177", "0.577732", "0.57683593", "0.5767303", "0.57597274", "0.5758245", "0.5755527", "0.57490534", "0.5744631", "0.57360375", "0.5731934", "0.5726853", "0.57217693", "0.57201856", "0.5710961", "0.57084954", "0.57063067", "0.5701235", "0.5698641", "0.56957364", "0.56863886", "0.5685249", "0.56814235", "0.5680155", "0.5678782", "0.567563", "0.56662285", "0.5664848", "0.5662657", "0.5651094", "0.5648767", "0.56450397", "0.564396", "0.56407475", "0.56385654", "0.5637298", "0.56370085", "0.5634377", "0.5630934", "0.56287307", "0.5624947", "0.5624898", "0.56187", "0.5612551", "0.56068134", "0.5599737", "0.55979156", "0.5586276", "0.55831087" ]
0.0
-1
return the twodigit hexadecimal code for a byte
function toHexString(charCode) { return ("0" + charCode.toString(16)).slice(-2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hex_byte(num)\n{\n return hex_chr.charAt((num >> 4) & 0x0F) + hex_chr.charAt(num & 0x0F);\n}", "function byteToHex(byte) {\n return ('0' + byte.toString(16)).slice(-2);\n}", "function byte2Hex(n) {\n var nybHexString = \"0123456789ABCDEF\";\n return String(nybHexString.substr((n >> 4) & 0x0F,1)) + nybHexString.substr(n & 0x0F,1);\n }", "function byte2Hex(n) {\n var nybHexString = \"0123456789ABCDEF\";\n return String(nybHexString.substr((n >> 4) & 0x0F,1)) + nybHexString.substr(n & 0x0F,1);\n}", "function byte2Hex(n) {\n var nybHexString = \"0123456789ABCDEF\";\n return String(nybHexString.substr((n >> 4) & 0x0F,1)) + nybHexString.substr(n & 0x0F,1);\n}", "function char(x) { return parseInt(x, 16); }", "function hexcode(v) { return v < 10 ? 0x30 + v : 0x61 + v - 10 }", "function hex(b) {\n return ('0' + b.toString(16)).substr(-2);\n}", "byte2Hex(n) {\r\n const nybHexString = '0123456789ABCDEF';\r\n return String(nybHexString.substr((n >> 4) & 0x0F,1)) + nybHexString.substr(n & 0x0F,1);\r\n }", "function bit4tohexchar(b) {\n //if (b > 0x9) { return b + 55; } // upper case\n if (b > 0x9) { return b + 87; } // lower case\n return b + 48;\n }", "function byteToHex(byte) {\n const hex = byte.toString(16);\n return hex.length === 2 ? hex : `0${hex}`;\n}", "function byte_2_hex(num){\n\tif(num<16)\n\t\treturn '0'+num.toString(16);\n\telse\n\t\treturn num.toString(16);\n}", "function __hex($num) {\r\nvar str = \"\";\r\nfor(var j = 7; j >= 0; j--)\r\nstr += _chars.charAt(($num >> (j * 4)) & 0x0F);\r\nreturn str;\r\n}", "function ord(c,n) {\n \t\treturn 0xFF & c.charCodeAt(n);\n \t}", "function byteToHex(num) {\n\t\t return ('0'+num.toString(16)).slice(-2);\n\t\t}", "function chr(x) {\n \t\treturn String.fromCharCode(0xFF & x);\n \t}", "function toHex (byte) {\n let hex = byte.toString(16);\n return hex.length === 1 ? \"0\" + hex : hex;\n}", "function hextodec(hex_value){\n if (hex_value.length % 2) { hex_value = '0' + hex_value; }\n var bn = BigInt('0x' + hex_value);\n var d = bn.toString(10);\n return d;\n}", "function byte2hexStr(byte) {\n var hexByteMap = \"0123456789ABCDEF\";\n var str = \"\";\n str += hexByteMap.charAt(byte >> 4);\n str += hexByteMap.charAt(byte & 0x0f);\n return str;\n}", "function byte(b){\n if(b.length < 2)\n b = \"0\" + b;\n return b;\n}", "function hexVal (c) {\n return (\n c < 58 ? c - 48 : // 0 - 9\n c < 71 ? c - 55 : // A - F\n c - 87 // a - f\n );\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n }", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function _hex(n) {\n var str = n.toString(16).toUpperCase();\n return str.length == 2 ? str : '0' + str;\n}", "function toHex(n){return (n<16?\"0\":\"\")+n.toString(16);}", "static getAHexCharacter() {\n const characters = [\n '0', '1', '2', '3',\n '4', '5', '6', '7',\n '8', '9', 'A', 'B',\n 'C', 'D', 'E', 'F',\n ];\n\n const randomNumber = this.generateRandomNumber(characters.length);\n\n return characters[randomNumber];\n }", "function toHexString(charCode)\r\n\t{\r\n\t\treturn (\"0\" + charCode.toString(16)).slice(-2);\r\n\t}", "function toHexWord(value) {\n return toHex(value, 4);\n}", "function toHexWord(value) {\n return toHex(value, 4);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}", "function bytesToHex(c)\n{\n var digits = \"0123456789abcdef\";\n var num = c.length;\n var s = \"\";\n for (var i = 0; i < num; ++i) {\n var hi = Math.floor(c[i] >> 4);\n var lo = c[i] & 0xF;\n s += digits[hi] + digits[lo];\n }\n return s;\n}", "function charToHex(c) {\r\n var ZERO = 48;\r\n var NINE = ZERO + 9;\r\n var littleA = 97;\r\n var littleZ = littleA + 25;\r\n var bigA = 65;\r\n var bigZ = 65 + 25;\r\n var result;\r\n\r\n if (c >= ZERO && c <= NINE) {\r\n result = c - ZERO;\r\n } else if (c >= bigA && c <= bigZ) {\r\n result = 10 + c - bigA;\r\n } else if (c >= littleA && c <= littleZ) {\r\n result = 10 + c - littleA;\r\n } else {\r\n result = 0;\r\n }\r\n return result;\r\n}", "function toHexByte(value) {\n return toHex(value, 2);\n}", "function toHexByte(value) {\n return toHex(value, 2);\n}", "function byteToHexStr(d) {\n\t\t\t\tif (d < 0) {\n\t\t\t\t\td = 0xFF + d + 1;\n\t\t\t\t}\n\t\t\t\tvar hex = Number(d).toString(16);\n\t\t\t\tvar padding = 2;\n\t\t\t\twhile (hex.length < padding) {\n\t\t\t\t\thex = '0' + hex;\n\t\t\t\t}\n\t\t\t\treturn hex;\n\t\t\t}", "function toHexString(charCode) {\n return (\"0\" + charCode.toString(16)).slice(-2);\n}", "function charHexToBinary(buf) {\r\n var result;\r\n\r\n // First upper case the character so we don't have to test for \"a-f\"\r\n buf = buf.toUpperCase();\r\n\r\n var charCode = buf[0].charCodeAt(0);\r\n\r\n if ((charCode >= \"0\".charCodeAt(0)) && (charCode <= \"9\".charCodeAt(0))) {\r\n result = charCode - \"0\".charCodeAt(0);\r\n }\r\n else if ((charCode >= \"A\".charCodeAt(0)) && (charCode <= \"F\".charCodeAt(0))) {\r\n result = (charCode - \"A\".charCodeAt(0)) + 10;\r\n }\r\n else {\r\n throw \"invalid HEX char\";\r\n }\r\n\r\n return result;\r\n}", "hex(x) {\n var hexDigits = new Array(\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\");\n return isNaN(x) ? \"00\" : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];\n }", "function decToHex(d) { var dr = Number(d).toString(16); while(dr.length < 4) { dr = '0'+dr; } return '0x'+dr.toUpperCase(); }", "function toHex(d) {\n return ('0' + Number(d).toString(16)).slice(-2)\n}", "function toHex(d) {\n return ('0' + Number(d).toString(16)).slice(-2)\n}", "function byteToHexStr(d) {\n\tif (d < 0) {\n\t\td = 0xFF + d + 1;\n\t}\n\tvar hex = Number(d).toString(16);\n\tvar padding = 2;\n\twhile (hex.length < padding) {\n\t\thex = '0' + hex;\n\t}\n\treturn hex;\n}", "function byteString(num) {\nlet s = num.toString(16).toUpperCase();\nreturn (s.length === 1) ? '0' + s : s;\n}", "function componentToHex (c) {\n var v = Number(c).toString(16);\n if (v.length < 2) {\n v = '0' + v;\n }\n return (v);\n}", "function binb2hex( data )\n{\n for( var hex='', i=0; i<data.length; i++ )\n {\n while( data[i] < 0 ) data[i] += 0x100000000;\n hex += ('0000000'+(data[i].toString(16))).slice( -8 );\n }\n return hex.toUpperCase();\n}", "static bytesToHex(bytes) {\n return bytes.reduce(\n (str, byte) => str + byte.toString(16).padStart(2, '0'),\n ''\n )\n }", "function c(n){\r\n\treturn String.fromCharCode(n);\r\n}", "function hexToBin(a) {\r\n\tvar newVal = \"\";\r\n\tfor (i = 0; i < a.length; i++) \r\n\t\tnewVal += (\"0000\" + parseInt(a.charAt(i),16).toString(2)).slice(-4);\r\n\treturn newVal;\r\n}", "function formatHex(t) { //char\n // not compatible with GWT...\n // return String.format(\"\\\\u%04x\", (int)t);\n var sb = '';\n sb += '\\\\u';\n var s = t.charCodeAt(0).toString(16);\n for (var i = s.length; i < 4; i++) {\n sb += '0';\n }\n sb += s;\n return sb;\n }", "function hex2(x)\n{\n\treturn hexify(Math.floor(reblock(x)%16))\n}", "function binToHex(a) {\r\n\tvar newVal = \"\";\r\n\tfor (i = 0; i < a.length/8; i++) \r\n\t\tnewVal += (\"00\" + parseInt(a.slice(8*i, 8*i+8),2).toString(16)).slice(-2);\r\n\treturn newVal;\r\n}", "function convertToHex(n) {\n return Number(n).toString(16);\n}", "function f(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;\n// must be an even number of digits\nvar a=t.length;$(a%2===0,\"Invalid hex string\"),r>a/2&&(r=a/2);for(var s=0;r>s;s++){var l=parseInt(t.substr(2*s,2),16);$(!isNaN(l),\"Invalid hex string\"),e[n+s]=l}return o._charsWritten=2*s,s}", "function binaryNibbleToAsciiHexDigit(nibble) {\r\n var charCode;\r\n var str = \"\";\r\n\r\n if ((nibble >= 0) && (nibble <= 9)) {\r\n charCode = (\"0\".charCodeAt(0)) + nibble;\r\n str += String.fromCharCode(charCode);\r\n }\r\n else if ((nibble >= 10) && (nibble <= 15)) {\r\n charCode = (\"A\".charCodeAt(0)) + (nibble - 10);\r\n str += String.fromCharCode(charCode);\r\n }\r\n \r\n return str;\r\n}", "function bin2hex(s) {\r\n\tvar i, l, o0o = '',\r\n\tn;\r\n\ts += '';\r\n\tfor (i = 0, l = s.length; i < l; i++) {\r\n\t\tn = s.charCodeAt(i).toString(16);\r\n\t\to0o += n.length < 2 ? '0' + n : n;\r\n\t}\r\n\treturn o0o;\r\n}", "function binaryByteToAsciiHex(binaryByte) {\r\n var str = \"\";\r\n\r\n var upperNibble = (binaryByte >> 4) & 0x0F;\r\n var lowerNibble = (binaryByte & 0x0F);\r\n\r\n str += binaryNibbleToAsciiHexDigit(upperNibble);\r\n str += binaryNibbleToAsciiHexDigit(lowerNibble);\r\n\r\n return str;\r\n}", "function i(e) {\n return (\"0\" + e.toString(16)).substr(-2);\n }", "function ctl(ch){return String.fromCharCode(ch.charCodeAt(0)-64);}", "function tohex(n, npos) {\n if (n < 0) {\n n = 0xFFFFFFFF + n + 1;\n }\n return (\"00000000\" + n.toString(16).toUpperCase()).substr(-npos);\n }", "function componentToHex(c) {\n var hex = c.toString(16)\n return hex.length == 1 ? '0' + hex : hex\n}", "function hex(what)\n{\n // adjust negative numbers\n if (what < 0)\n what = 0xFFFFFFFF + what + 1;\n // convert to hexadecimal string\n var result = what.toString(16);\n // add leading zeros\n return ('0000000' + result).slice(-8);\n}", "function hexlify(bytes) {\n var res = [];\n for (var i = 0; i < bytes.length; i++)\n res.push(hex(bytes[i]));\n\n return res.join('');\n}", "function hexlify(bytes) {\n var res = [];\n for (var i = 0; i < bytes.length; i++)\n res.push(hex(bytes[i]));\n\n return res.join('');\n}", "function int128le_to_hex(a, b, c, d) {\n var ra = \"\"\n var t = 0\n var ta = 0\n for (var i = 3; i >= 0; i--) {\n ta = arguments[i]\n t = (ta & 0xFF)\n ta = ta >>> 8\n t = t << 8\n t = t | (ta & 0xFF)\n ta = ta >>> 8\n t = t << 8\n t = t | (ta & 0xFF)\n ta = ta >>> 8\n t = t << 8\n t = t | ta\n ra = ra + to_zerofilled_hex(t)\n }\n return ra\n }", "function byteToCan(v){\n\tvar res = '' + v.toString(16);\n\twhile (res.length < 2) res = '0' + res;\n\treturn res;\n}", "function cpFC(s){var hi,lo\n if(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(s)){\n hi=s.charCodeAt(0)\n lo=s.charCodeAt(1)\n return 0x10000+(((hi&0x3FF) << 10) | (lo&0x3FF))}\n return s.charCodeAt(0)}", "function componentToHex(c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n}", "function componentToHex(c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n}", "function digitToHex(n) {\r\n var hexToChar = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\r\n 'A', 'B', 'C', 'D', 'E', 'F');\r\n\r\n var mask = 0xf;\r\n var result = \"\";\r\n\r\n for (i = 0; i < 2; ++i) {\r\n result += hexToChar[n & mask];\r\n n >>>= 4;\r\n }\r\n return reverseStr(result);\r\n}", "componentToHex(c) {\n let hex = c.toString(16);\n return hex.length === 1 ? \"0\" + hex : hex;\n }", "function componentToHex(c) {\r\n var hex = c.toString(16);\r\n return hex.length == 1 ? \"0\" + hex : hex;\r\n}" ]
[ "0.75188696", "0.7042452", "0.7005195", "0.6967609", "0.6967609", "0.6950585", "0.692007", "0.68321645", "0.6793029", "0.6785783", "0.67763716", "0.6761339", "0.6718711", "0.6692226", "0.6689676", "0.66757405", "0.6617002", "0.660528", "0.6604771", "0.6595199", "0.65835464", "0.658311", "0.6555673", "0.6555673", "0.6555673", "0.65193725", "0.64918107", "0.6476985", "0.64767957", "0.64663744", "0.64663744", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6465778", "0.6462168", "0.64265627", "0.6383194", "0.6383194", "0.6370411", "0.636048", "0.6340213", "0.6296304", "0.6292943", "0.6266896", "0.6266896", "0.6265704", "0.624805", "0.6235526", "0.62250227", "0.6214486", "0.62129956", "0.6184219", "0.61565506", "0.6140754", "0.6116521", "0.61156166", "0.6101632", "0.61002576", "0.6095115", "0.60915726", "0.60850114", "0.60780644", "0.6068779", "0.6061417", "0.60564554", "0.6055805", "0.6055805", "0.6048794", "0.6044413", "0.6043097", "0.6030509", "0.6030509", "0.6029277", "0.6017009", "0.6014247" ]
0.64684343
29
! Vue.js v2.5.3 (c) 20142017 Evan You Released under the MIT License.
function r(e){return void 0===e||null===e}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {\n\n }", "function vueTest() {\n new Vue({\n \n el: '#vueApp',\n \n data: {\n \"hello\" : \"Spinning Parrot\",\n image: 'img/spinning-parrot.gif'\n }\n \n });\n }", "created() {\n this.$nuxt = true\n }", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "mounted() {\n console.log('Mounted!')\n }", "ready() {\n this.vm = new Vue({\n el: 'body',\n components: {\n rootvue: require('./vue'),\n },\n });\n }", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function hM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"interaction.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "data() {\n return {};\n }", "created() { }", "created() { }", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "created() {\n\n }", "created() {\n\n }", "created() {\n\n }", "created() {\n\n }", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "mounted(){\n console.log('Mounted');\n }", "created(){\n\n }", "mounted() {\n this.initialize()\n }", "created() {\n }", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "mounted() {\n console.log(this.element); // eslint-disable-line\n }", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "created() {\n\n\t}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function p(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function loadVue(){\n\n\tlisteObjBoutons = loadVueObjects();\n\n\tmvButtons = new Vue({\n\t\tel:\"#boutonsMots\",\n\t\tdata:{\n\t\t\tlisteMots:listeObjBoutons,\n\t\t\tsize: MOTS_NUMBER,\n\t\t\tetendu: (MOTS_NUMBER>4),\n\t\t\tdisplay:\"flex\"\n\t\t},\n\t\tmethods:{\n\t\t\ttestAnswer: verification,\n\t\t\treInit: function(){\n\t\t\t\tfor (let i = 0; i < this.listeMots.length; i++) {\n\t\t\t\t\tthis.listeMots[i].tvalue = false;\n\t\t\t\t\tthis.listeMots[i].fvalue = false;\n\t\t\t\t\tthis.listeMots[i].disabled = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\nmvNextButton = new Vue({\n\t\tel:\"#nextButton\",\n\t\tdata:{\n\t\t\tmessage : \"Image suivante\",\n\t\t\tdisplay: \"none\"\n\t\t},\n\t\tmethods:{\n\t\t\tnext: chargementImageMot,\n\t\t\tactive: function () {\n\t\t\t\tthis.display=\"block\";\n\t\t\t}\n\t\t}\n\t});\n}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "created() {\r\n\r\n\t}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "mounted() {\n this.local()\n }", "function annulerAffichage(){\r\n var app = new Vue({\r\n el: '#meteo',\r\n data: {\r\n message:'ATTENTION : probleme de geolocalisation veuillez l\\'activer dans votre navigateur'\r\n }\r\n })\r\n}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function initVue() {\n\n new Vue({\n\n el: \"#containerId\",\n data: {\n \"h1title\": 0,\n \"url\": \"img/scotland.jpeg\"\n }, // END OF DATA\n\n methods: {\n increase: function() {\n this.h1title++;\n }, // END OF INCREASE\n\n decrease: function() {\n this.h1title--;\n } // END OF DECREASE\n\n } // END OF METHODS\n }); // END OF VUE\n\n} // END OF FUNCTION initVue", "ready() {\n let logCtrl = this.$logTextArea;\n let logListScrollToBottom = function () {\n setTimeout(function () {\n logCtrl.scrollTop = logCtrl.scrollHeight;\n }, 10);\n };\n\n\n window.plugin = new window.Vue({\n el: this.shadowRoot,\n created() {\n },\n init() {\n },\n data: {\n logView: \"\",\n findResName: \"\",\n },\n methods: {\n _addLog(str) {\n let time = new Date();\n // this.logView = \"[\" + time.toLocaleString() + \"]: \" + str + \"\\n\" + this.logView;\n this.logView += \"[\" + time.toLocaleString() + \"]: \" + str + \"\\n\";\n logListScrollToBottom();\n },\n onBtnClickFindReferenceRes() {\n console.log(\"1\");\n },\n onResNameChanged() {\n console.log(\"2\");\n },\n dropFile(event) {\n event.preventDefault();\n let files = event.dataTransfer.files;\n if (files.length > 0) {\n let file = files[0].path;\n console.log(file);\n } else {\n console.log(\"no file\");\n }\n },\n drag(event) {\n event.preventDefault();\n event.stopPropagation();\n // console.log(\"dragOver\");\n },\n\n }\n });\n }", "data() {\n return {\n saludocomponent: \"hola desde vue\"\n };\n }", "function wl(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "registerVmProperty() {\n const { vmProperty, modules } = this.options;\n this.Vue.prototype[vmProperty] = modules;\n }", "function Vue(options) {\n var oberver = new Observer(options.data)\n var render = compile(options.el, oberver)\n render()\n}", "mounted() {\n\t\tvar h = document.createElement('DIV');\n\t\th.innerHTML = `<div>this is create append child</div>`;\n\t\tdocument.body.appendChild(h);\n\t\tconsole.log('this is log vue mounted function ', this.$el, this , this.el);\n\t}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function a(e,t){'undefined'!=typeof console&&(console.warn('[vue-i18n] '+e),t&&console.warn(t.stack))}", "function la(e,t){if(typeof console!==\"undefined\"){console.warn(\"[vue-i18n] \"+e);if(t){console.warn(t.stack)}}}", "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}", "function i(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "data() {\n return {\n saludo: '¡Hola! Soy Desiré, te saludo desde un componente'\n }\n }", "function WD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function i(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function bn(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function Ht(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function q(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "registerVmProperty() {\n const { vmProperty, modules } = this.options;\n this.registerError(modules);\n this.Vue.prototype[vmProperty] = modules;\n }", "mounted() {\n store.commit('updateHash');\n }", "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function a(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "install(vue) {\n \n vue.prototype.$renderer = this;\n vue.prototype.$engine = this.engine;\n \n vue.prototype.$start = this.start.bind(this);\n vue.prototype.$stop = this.stop.bind(this);\n vue.prototype.$pipe = this.pipe.bind(this);\n vue.prototype.$unpipe = this.unpipe.bind(this);\n }", "function vt(e,t){if(!e){throw new Error(\"[vue-router] \"+t)}}", "ready() {\n this.vue = createVUE(this[\"$mainDiv\"]);\n Editor.log(\"ConvertHelper view ready\");\n }", "function ex(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function e(t,n){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),n&&console.warn(n.stack))}", "install(vue) {\n /* globalize class */\n vue.prototype.$input = this;\n vue.prototype.$mouse = this.mouse;\n vue.prototype.$keyboard = this.keyboard;\n }", "function n(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function n(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}" ]
[ "0.695794", "0.6913845", "0.68894804", "0.6556369", "0.6501232", "0.6373165", "0.6373165", "0.63345695", "0.6331294", "0.6320368", "0.6306127", "0.630461", "0.62363356", "0.62242454", "0.622238", "0.61852306", "0.61851555", "0.6168488", "0.61634433", "0.61634433", "0.61620957", "0.6141377", "0.6141377", "0.6141377", "0.6141377", "0.61088663", "0.605504", "0.6049829", "0.60340357", "0.60293794", "0.6022953", "0.6021341", "0.60073185", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.6006354", "0.59341913", "0.59142953", "0.5911628", "0.5907505", "0.5905747", "0.58940285", "0.5874853", "0.5859655", "0.58487177", "0.5844039", "0.5801963", "0.5795371", "0.57897264", "0.57894087", "0.5784902", "0.5778654", "0.5729147", "0.57281744", "0.5725083", "0.57224596", "0.57169044", "0.5710089", "0.5701466", "0.5691546", "0.56717724", "0.566091", "0.5658882", "0.5644138", "0.5644138", "0.5644138", "0.5644138", "0.56416947", "0.5635411", "0.56294847", "0.5620674", "0.56159776", "0.56159776", "0.56145173", "0.5609999", "0.560614", "0.5605041", "0.55965203", "0.55887175", "0.55881345", "0.5585727", "0.557772", "0.5569735", "0.5569117", "0.5569117", "0.5563065", "0.5560332", "0.55522907", "0.5534617", "0.5512319", "0.55081296", "0.5507648", "0.5507648" ]
0.0
-1
use 'id' instead of 'index' for 'key' property in the loop:
render() { return ( <div className="todos-wrapper"> <ol> {this.props.todos.map(todo => { return !todo.deleted && <li key={todo.id} > <Todo todo={todo} todoId={todo.id} toggleTodo={this.handleToggle} deleteTodo={this.handleDelete} /> </li> })} </ol> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "for (let i = 0; i < props.data.length; i++) {\n // the data point\n const datum = props.data[i]\n\n // save the index of the key\n this._keyCache[datum.key] = i\n }", "getKey() {\n return container[idx]\n }", "key(i) { return this.#offset + this.#key[i]; }", "key() {\n return 'id';\n }", "@readOnly\n @computed('itemKey')\n _eachItemKey (itemKey) {\n return itemKey || '@index'\n }", "key(item) {\n return item;\n }", "getKey(value, index) {\n return index;\n }", "_keyExtractor(index) {\n return index.toString();\n }", "function keyIndexById (id) {\n return keys.findIndex(element => {return element.id === id});\n}", "function getID(array, key) {\n let index = array\n .map(function (e) {\n return e.name;\n })\n .indexOf(key);\n return array[index].id;\n}", "resetKeys() {\n let key = 0; //reset it\n this.collection.forEach((row) => {\n row[this.sgkey] = key;\n key++;\n });\n }", "function _index(objects) {\n var index = {};\n for (var i=0; i < objects.length; i++) {\n var n = objects[i];\n n.uuid = \"a\" + uuid();\n index[n.id] = n;\n }\n return index;\n }", "get (id) {\n return this.index[id] || null;\n }", "function getId(index){\n\treturn cachedPinInfo[index].id;\n}", "function _id(items, name) {\n for (var i = 0; i < items.length; i++) items[i].id = name + i; // TODO change to zid\n return items;\n }", "get index() { return this._index; }", "generateId() {\n let temp = this.state.pieData\n let id = 1;\n for(let i = 0; i < temp.length; i++ ){\n if(temp[i].id === id){\n id += 1\n } else {\n return id\n }\n }\n return id\n }", "function updateIndex(index, item) {\n\t\t\treturn $(item).children(\".key\").find(\":input.arrayKeyField\").val();\n\t\t}", "function ArraykeyID(array, key) {\n return array.reduce((acc, cur) => {\n acc[cur[key]] = cur;\n return acc;\n }, {});\n}", "renderMarkers() {\n return this.state.markers.map((marker, i) => {\n return <Marker\n onClick={this.onMarkerClick}\n title={marker.title}\n name={marker.name}\n id={i} //TODO: make this {marker.game.id}?\n key={i}\n position={marker.location}\n game={toGame(marker)}\n />\n })\n\n }", "get key() {\n return itKey;\n }", "render() {\n\n \n // key={todo.id} elimiates the warning in the console\n \n return this.props.todo.map((todo)=> <Todoitems key={todo.id} items={todo} delTodo={this.props.delTodo} markComplete={this.props.markComplete} /> )\n\n }", "function keyFunction(opts) {\n return opts._index;\n}", "function createListItems(ObjectKey) {\n for (i = 0; i < words[ObjectKey][1].length; i++) {\n $(\".each-letter\").append('<li id=\"' + i + '\"> _ </li>');\n }\n}", "function keyFunction(opts) {\n return opts._index;\n}", "function keyFunction(opts) {\n return opts._index;\n}", "_keyExtractor(item){\n return item.id\n}", "function metaKey(id) {\n return id+'_meta';\n}", "set(index, key) {\n let current = this.get(index);\n current.object = key;\n return true;\n }", "doTransaction() {\n this.todoList.items.splice(this.todoIndex, 1);\n for(let i = 0; i < this.todoList.items.length; i++){\n this.todoList.items[i].key = i;\n }\n }", "function getbyId (index, arr) {\n\t\t\tvar i = 0;\n\t\t\tindex = index.toString();\n\n\t\t\twhile (i < arr.length) {\n\t\t\t\tif (arr[i].id === index) {\n\t\t\t\t\treturn arr[i];\n\t\t\t\t}\n\n\t\t\t\ti += 1;\n\t\t\t}\n\n\t\t}", "get key() {\n return key;\n }", "get index() {\r\n return this.i.index;\r\n }", "getId() {\n this.currentIndex = this.currentIndex + 1;\n return this.currentIndex;\n }", "checkKeys() {\n // let key = 0; //reset it\n this.vGridCollection.forEach((row) => {\n if(!row[this.vGridRowKey] && row !== undefined && row !== null){\n row[this.vGridRowKey]= this.key;\n this.key++;\n }\n });\n }", "updateImageId(index, id) {\n this.setState({ [`image${index}`]: id });\n }", "function rowKey({ rowData }) {\n return rowData.id.title;\n}", "function keyFunction(d, i) {\n\t return d.source + i;\n\t }", "function gotStartIndex(err, index){\n var count = opts.count;\n var multi = c.multi();\n if(count > 0){\n for(var i = 0; i < count - 1 || i < 0; i++){\n indexes.push(+ index + i);\n multi.hgetall('c:r:' + room.id + ':m:' + (+index + i));\n }\n } else {\n for(var i = 0; i < (- count - 1) && (index - i) > 0; i++){\n indexes.push(+ index - i);\n multi.hgetall('c:r:' + room.id + ':m:' + (+index - i));\n }\n }\n multi.exec(function(err, results){\n if (err) return cb(err);\n results.forEach(function(val, i){\n results[i].id = indexes[i];\n });\n results.reverse();\n cb(null, results);\n })\n }", "function getResultId(id, index) {\n return id + \"-result-\" + (index + 1);\n}", "function newID() {\n for (var i = 0; i < notesArray.length; i++) {\n notesArray[i].id = i;\n }\n}", "function displayKeys(id){\n\tvar thekeys = $(\"#thekeys\");\n\tfor (var i = 0; i < recipes[id].elements_key.length; i++){\n\t\tvar container = $('<p>').html(\n\t\t\t'<button type=\"button\" id=\"_' + \n\t\t\trecipes[id].elements_key[i] +\n\t\t\t'\" class=\"input-key btn btn-default btn-lg\">' + \n\t\t\tgetKeyDisplayFormat(recipes[id].elements_key[i]) + \n\t\t\t'</button>');\n\t\tthekeys.append(container);\n\t}\n}", "function keyFunction(opts) {\n\t return opts._index;\n\t}", "function loopIterator() {\n for (var value of eachWithIndex($('div'))) {\n console.log(value);\n value.item.style.backgroundColor = value.item.id;\n value.item.textContent = value.index;\n }\n}", "function getKeyByIndex(props, index) {\n let children = props.children\n if (!children) return\n let arr = Children.toArray(children)\n let child = arr[index]\n if (!child) return\n return child.key\n}", "function ids(obj) {\n return sg.reduce(obj, {}, function(m, value, key) {\n if (key.match(/id$/i)) {\n return sg.kv(m, key, value);\n }\n\n return m;\n });\n}", "function updateID(array) {\n if (array.length != 0) {\n for (let i = 0; i < array.length; i++) {\n array[i].id = i;\n }\n }\n}", "get key() {\n return key;\n }", "addIndices() {\n const children = this.getAllChildren()\n children.each((index, item) => {\n $(item).attr('data-index', index)\n })\n }", "keyForRelationship(key) {\n return key; \n }", "getKey(arg) {\n return typeof arg === 'object'\n ? this.selectId(arg)\n : arg;\n }", "function mostraProductes(products){\n for(let i=0; i<products.length; i++) {\n products[i].id=1+i;\n console.log('Producte número '+(i+1));\n console.log(products[i]);\n }\n}", "function mostraProductes(products){\n for(let i=0; i<products.length; i++) {\n products[i].id=1+i;\n console.log('Producte número '+(i+1));\n console.log(products[i]);\n }\n}", "addNumberToSlides(){\n for(let i=0; i<this.list.length; i++){\n this.list[i].id = `${i + 1}`;\n }\n }", "key(index) {\n const key = Object.keys(this.store.store)[index];\n return key || null;\n }", "getIndex() {\nreturn this.index;\n}", "renderUpdateByKey() {\n\n }", "function SerachByID(id) {\n for (let key of EmpMap_1.EmpMap.keys()) {\n if (key == id) {\n console.log(EmpMap_1.EmpMap.get(key));\n }\n }\n}", "get id() { return this._id; }", "get id() { return this._id; }", "get id() { return this._id; }", "setFillItem(item , index){\n for(let field in this.originalData){\n\n if(field in item){\n this[field] = item[field];\n }else{\n // if is index\n if(field == 'index'){ this[field] = index; }\n\n }\n\n }\n\n }", "function initialize_id(){\n for (i = 0; i < persons.length; i++) {\n persons[i].id = i;\n }\n}", "objectedIndex(data, get) {\n let i = 0;\n\n for(let key in data) {\n // return int, search by key\n if(typeof get === 'string' && key == get) {\n return i;\n } // return object, search by index\n else if(typeof get === 'number' && i === get) {\n return data[key];\n }\n\n i++;\n }\n }", "function index(obj,i) {return obj[i]}", "function addID() {\n\tfor (let i = 0; i < gs; i++) {\n\t\tif (getGrid(i) != undefined) {\n\t\t\tgetGrid(i).id = i;\n\t\t}\t\t\n\t}\n}", "get key () {return this._p.key;}", "get key() {\n return this._key;\n }", "get key() {\n return this._key;\n }", "get key() {\n return this._key;\n }", "get key() {\n return this._key;\n }", "function replaceID(object) {\r\n //Iterate the array of todos\r\n object.forEach(function (key) {\r\n if (key.hasOwnProperty(\"id\")) {\r\n //Replace the occurrence of id to _id.\r\n key[\"_id\"] = key[\"id\"];\r\n //Remove the id key as no longer required\r\n delete key[\"id\"];\r\n }\r\n });\r\n return object;\r\n}", "function nextKey () {\n return (uniqueId++) + dataStoreKeyExpandoPropertyName\n }", "buscarIndex(id,array){\r\n return array.findIndex((elem) => elem.getId() === id);\r\n }", "get(idx) {\n\n }", "key(index) {\n return this._key(index) || this._keyPlus(index)\n }", "function vertexKeyGenerator( v ){\n\t\t//this will hold the ids consistently between vertex and vec3ds\n\t\treturn \"[ x: \"+format(v.x)+ \", y: \"+format(v.y)+ \", z: \"+format(v.z)+\"]\";\n\t}", "get key () {return this._p.key;}", "function dskVal(i) {\r\n return dsks[i].id;\r\n }", "function getIndexById(id){\r\n var index;\r\n for(var i = 0; i < shop.products.length; i++){\r\n if(shop.products[i].id == id){\r\n index = i;\r\n }\r\n };\r\n return index;\r\n }", "function itemAtIndex(index){\r\n return self[keyTable[index]];\r\n }", "function assignId() {\n let i;\n for (i = 0; i < notes.length; i++) {\n notes[i].id = i;\n }\n console.log(notes.length);\n}", "props (key) { return this.map((a) => a[key]) }", "function setTableId(index, id) {\n return $('table.table_lines').eq(index).attr('id', id);\n }", "function key_func(d) {\n return d.line_index;\n }", "function listIdentifier() {\n for (let i = 0; i <= DOM.$lists.length - 1; i++) {\n $(DOM.$lists[i]).attr({\n 'data-list-id': i + 1\n });;\n }\n }", "function keyOf (v, i) {\n return (v instanceof Array && v[1] && v[1].key) || i\n}", "get key() {\n return parseInt(this.getAttribute('key'));\n }", "indexOfId(id) {\n for (let index = 0; index < this.items.length; index++) {\n if (this.items[index].id === id) return index;\n }\n }", "function getUsersId(){\n users.forEach(function(user,index){\n user.id = index + 1\n })\n}", "function getIndexByID(id) {\n var index = posts.map(function(el) {\n return el.ids;\n }).indexOf(id);\n return index;\n}", "get key() { return `${this.v}:${this.hi}/${this.lo}`; }", "convert_list_to_dict(list_of_dicts, id){\n var new_dict = {}\n for (var i = 0; i < list_of_dicts.length; i++) {\n var dict_specs = {}\n for (var key in list_of_dicts[i]) {\n if (key !== id){\n dict_specs[key] = list_of_dicts[i][key]\n }\n }\n dict_specs[\"index\"] = i\n new_dict[list_of_dicts[i][id]] = dict_specs\n }\n return new_dict\n }", "function key() {\n\tvar hashName = _.result( this, 'hashAttribute' ) || _.result( this, 'idAttribute' ),\n\t\trangeNake = _.result( this, 'rangeAttribute' );\n\n\treturn this.pick( hashName, rangeNake );\n}", "key(kind, name) {\n if (kind instanceof StoreModel) {\n let arg = [];\n if (kind.parent) arg.push(kind.parent);\n arg.push(kind.code);\n if (name) arg.push(name); // acts as an ID\n return this[store].key(arg);\n }\n if (kind instanceof Array) {\n return this[store].key(kind);\n }\n return this[store].key([kind, name]);\n }", "E_Func (key) \n\t{\n\t\tvar NewTodo = this.state.TodoItems;\n\t\tvar keys = Object.keys(NewTodo);\n\t\tvar newkey = key.id;\n\t\tvar idloc = keys.lastIndexOf(newkey);\n\t\t\n\t\tthis.setState({ActiveKey: idloc});\n\t\tthis.setState({value: this.state.TodoItems[this.state.ActiveKey].Item});\n\t\talert(\"Now Editing.\");\n\t\tthis.setState({Mode: false});\n\t}", "keyForAttribute(key) { return key; }", "keyFromId(aItemId) {\n return this._itemIdKeyMap.get(aItemId);\n }", "function updateIndex() {\n var i,\n orders = $scope.orders.filter(function (n) { return n; }),\n max = orders.length;\n for (i = 0; i < max; i++) {\n orders[i].index = i;\n }\n $scope.orders = orders;\n }", "getKey() {\n return this.key;\n }", "index(key) {\n let initial;\n if (this._keyMap[key])\n initial = this._keyMap[key].index;\n else\n initial = ((Object.entries(this.value) || []).find(([index, item]) => this.keyfunc(item) == key)\n || [-1, undefined])[0];\n return group(value(initial), group(this.changes, this.reemit).to(map(() => (this._keyMap[key] || { index: -1 }).index))).to(pipe(distinctUntilKeyChanged('value')));\n }" ]
[ "0.66981316", "0.65497315", "0.64865094", "0.6399498", "0.6389417", "0.6234483", "0.61698127", "0.61501473", "0.6017312", "0.59804213", "0.5898025", "0.58880156", "0.5842643", "0.5836375", "0.5808706", "0.57528687", "0.5747172", "0.5745296", "0.57336533", "0.57308954", "0.5714295", "0.570296", "0.5702745", "0.56877166", "0.568194", "0.568194", "0.5681422", "0.56297016", "0.5622403", "0.5622192", "0.56183165", "0.5595826", "0.5579201", "0.55702513", "0.5568176", "0.55669564", "0.5566951", "0.5558015", "0.5557647", "0.55526924", "0.55474573", "0.55463696", "0.5545281", "0.5529401", "0.5528217", "0.5526621", "0.55258065", "0.5524927", "0.55204016", "0.5516957", "0.55100083", "0.5497548", "0.5497548", "0.5485535", "0.5480829", "0.5475799", "0.546578", "0.54651463", "0.54639965", "0.54639965", "0.54639965", "0.5446581", "0.5443206", "0.54406846", "0.54403704", "0.54374796", "0.5428822", "0.54260606", "0.54260606", "0.54260606", "0.54260606", "0.542309", "0.5419453", "0.5411276", "0.54087305", "0.53986996", "0.53907394", "0.538755", "0.5384347", "0.5381942", "0.5380854", "0.53687036", "0.53685033", "0.5368367", "0.5362054", "0.5331785", "0.53286326", "0.5325556", "0.53229034", "0.532269", "0.5319276", "0.53091663", "0.53082925", "0.53055215", "0.52995664", "0.52882165", "0.5286613", "0.5278836", "0.5276001", "0.52675533", "0.52673316" ]
0.0
-1
FUNCTION TO CHANGE SLIDES AUTOMATICALLY
function autoChange(){ setInterval(() => { slideNum++ if(slideNum > slides.length){ slideNum = 1 document.querySelector(`.slide-${slideNum}`).classList.add("fade-in") document.querySelector(`.slide-${slideNum}`).classList.remove("fade-out") document.querySelector(`.slide-${slides.length}`).classList.add("fade-out") document.querySelector(`.slide-${slides.length}`).classList.remove("fade-in") } else{ document.querySelector(`.slide-${slideNum}`).classList.add("fade-in") document.querySelector(`.slide-${slideNum}`).classList.remove("fade-out") document.querySelector(`.slide-${slideNum-1}`).classList.add("fade-out") document.querySelector(`.slide-${slideNum-1}`).classList.remove("fade-in") } }, 10000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeSlide(i) {\n //0;\n // if i == 0 then / deactivate slide 3 / activate slide 0\n if (i == 0) {\n activateSlide(i);\n deactivateSlide(3);\n }\n\n // if i == 1,2,3 then / deactivate i-1 / activate i\n if (i > 0) {\n activateSlide(i);\n deactivateSlide(i - 1);\n }\n}", "function swapSlide(container, opt) {\n\n\n opt.transition = 1;\n opt.videoplaying = false;\n\n try {\n var actli = container.find('li:eq(' + opt.act + ')');\n } catch (e) {\n var actli = container.find('li:eq(1)');\n }\n\n\n var nextli = container.find('li:eq(' + opt.next + ')');\n\n var actsh = actli.find('.slotholder');\n var nextsh = nextli.find('.slotholder');\n actli.css({ 'visibility': 'visible' });\n nextli.css({ 'visibility': 'visible' });\n\n if ($.browser.msie && $.browser.version < 9) {\n if (nextli.data('transition') == \"boxfade\") nextli.data('transition', \"boxslide\");\n if (nextli.data('transition') == \"slotfade-vertical\") nextli.data('transition', \"slotzoom-vertical\");\n if (nextli.data('transition') == \"slotfade-horizontal\") nextli.data('transition', \"slotzoom-horizontal\");\n }\n\n\n // IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE...\n if (nextli.data('delay') != undefined) {\n opt.cd = 0;\n opt.delay = nextli.data('delay');\n } else {\n opt.delay = opt.origcd;\n }\n\n // RESET POSITION AND FADES OF LI'S\n actli.css({ 'left': '0px', 'top': '0px' });\n nextli.css({ 'left': '0px', 'top': '0px' });\n\n ///////////////////////////////////////\n // TRANSITION CHOOSE - RANDOM EFFECTS//\n ///////////////////////////////////////\n var nexttrans = 0;\n\n\n\n\n if (nextli.data('transition') == \"boxslide\") nexttrans = 0\n else\n if (nextli.data('transition') == \"boxfade\") nexttrans = 1\n else\n if (nextli.data('transition') == \"slotslide-horizontal\") nexttrans = 2\n else\n if (nextli.data('transition') == \"slotslide-vertical\") nexttrans = 3\n else\n if (nextli.data('transition') == \"curtain-1\") nexttrans = 4\n else\n if (nextli.data('transition') == \"curtain-2\") nexttrans = 5\n else\n if (nextli.data('transition') == \"curtain-3\") nexttrans = 6\n else\n if (nextli.data('transition') == \"slotzoom-horizontal\") nexttrans = 7\n else\n if (nextli.data('transition') == \"slotzoom-vertical\") nexttrans = 8\n else\n if (nextli.data('transition') == \"slotfade-horizontal\") nexttrans = 9\n else\n if (nextli.data('transition') == \"slotfade-vertical\") nexttrans = 10\n else\n if (nextli.data('transition') == \"fade\") nexttrans = 11\n else\n if (nextli.data('transition') == \"slideleft\") nexttrans = 12\n else\n if (nextli.data('transition') == \"slideup\") nexttrans = 13\n else\n if (nextli.data('transition') == \"slidedown\") nexttrans = 14\n else\n if (nextli.data('transition') == \"slideright\") nexttrans = 15;\n else {\n nexttrans = Math.round(Math.random() * 16);\n nextli.data('slotamount', Math.round(Math.random() * 12 + 4));\n }\n\n if (nextli.data('transition') == \"slidehorizontal\") {\n if (opt.act < opt.next)\n nexttrans = 12\n else\n nexttrans = 15\n }\n\n if (nextli.data('transition') == \"slidevertical\") {\n if (opt.act < opt.next)\n nexttrans = 13\n else\n nexttrans = 14\n }\n\n\n if (nexttrans > 16) nexttrans = 15;\n if (nexttrans < 0) nexttrans = 0;\n\n // DEFINE THE MASTERSPEED FOR THE SLIDE //\n var masterspeed = 300;\n if (nextli.data('masterspeed') != undefined && nextli.data('masterspeed') > 99 && nextli.data('masterspeed') < 2001)\n masterspeed = nextli.data('masterspeed');\n\n\n\n /////////////////////////////////////////////\n // SET THE BULLETS SELECTED OR UNSELECTED //\n /////////////////////////////////////////////\n\n\n container.parent().find(\".bullet\").each(function() {\n var bul = $(this);\n bul.removeClass(\"selected\");\n if (bul.index() == opt.next) bul.addClass('selected');\n });\n\n\n //////////////////////////////////////////////////////////////////\n // \t\tSET THE NEXT CAPTION AND REMOVE THE LAST CAPTION\t\t//\n //////////////////////////////////////////////////////////////////\n\n container.find('li').each(function() {\n var li = $(this);\n if (li.index != opt.act && li.index != opt.next) li.css({ 'z-index': 16 });\n });\n\n actli.css({ 'z-index': 18 });\n nextli.css({ 'z-index': 20 });\n nextli.css({ 'opacity': 0 });\n\n\n ///////////////////////////\n //\tANIMATE THE CAPTIONS //\n ///////////////////////////\n removeTheCaptions(actli, opt);\n animateTheCaptions(nextli, opt);\n\n\n\n\n /////////////////////////////////////////////\n //\tSET THE ACTUAL AMOUNT OF SLIDES !! //\n // SET A RANDOM AMOUNT OF SLOTS //\n ///////////////////////////////////////////\n if (nextli.data('slotamount') == undefined || nextli.data('slotamount') < 1) {\n opt.slots = Math.round(Math.random() * 12 + 4);\n if (nextli.data('transition') == \"boxslide\")\n opt.slots = Math.round(Math.random() * 6 + 3);\n } else {\n opt.slots = nextli.data('slotamount');\n }\n\n\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 0) {\n\n\n\n masterspeed = masterspeed + 100;\n\n\n if (opt.slots > 15) opt.slots = 15;\n\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlideBox(actsh, opt, true);\n prepareOneSlideBox(nextsh, opt, false);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n //actsh.find('.defaultimg').css({'opacity':0});\n\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n\n nextsh.find('.slotslide').each(function(j) {\n var ss = $(this);\n ss.css({ 'top': (0 - opt.sloth) + \"px\", 'left': (0 - opt.slotw) + \"px\" });\n\n\n setTimeout(function() {\n\n if (opt.firefox13)\n ss.animate({ 'top': \"0px\", 'left': '0px' }, {\n duration: (masterspeed),\n queue: false,\n complete: function() {\n if (j == (opt.slots * opt.slots) - 1) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n\n else\n\n ss.cssAnimate({ 'top': \"0px\", 'left': '0px' }, {\n duration: (masterspeed),\n queue: false,\n complete: function() {\n if (j == (opt.slots * opt.slots) - 1) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n }, j * 15);\n });\n }\n\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 1) {\n\n\n if (opt.slots > 15) opt.slots = 15;\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n //prepareOneSlideBox(actsh,opt,true);\n prepareOneSlideBox(nextsh, opt, false);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n //actsh.find('.defaultimg').css({'opacity':0});\n\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n\n nextsh.find('.slotslide').each(function(j) {\n var ss = $(this);\n ss.css({ 'opacity': 0 });\n ss.find('img').css({ 'opacity': 0 });\n ss.find('img').css({ 'top': (Math.random() * opt.slotw - opt.slotw) + \"px\", 'left': (Math.random() * opt.slotw - opt.slotw) + \"px\" });\n\n\n var rand = Math.random() * 1000 + (masterspeed + 200);\n if (j == (opt.slots * opt.slots) - 1) rand = 1500;\n if (opt.firefox13) {\n ss.find('img').animate({ 'opacity': 1, 'top': (0 - ss.data('y')) + \"px\", 'left': (0 - ss.data('x')) + 'px' }, { duration: rand, queue: false });\n ss.animate({ 'opacity': 1 }, {\n duration: rand,\n queue: false,\n complete: function() {\n if (j == (opt.slots * opt.slots) - 1) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n } else {\n ss.find('img').animate({ 'opacity': 1, 'top': (0 - ss.data('y')) + \"px\", 'left': (0 - ss.data('x')) + 'px' }, { duration: rand, queue: false });\n ss.cssAnimate({ 'opacity': 1 }, {\n duration: rand,\n queue: false,\n complete: function() {\n if (j == (opt.slots * opt.slots) - 1) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n }\n\n });\n }\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 2) {\n\n\n masterspeed = masterspeed + 200;\n\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlide(actsh, opt, true);\n prepareOneSlide(nextsh, opt, false);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n //actsh.find('.defaultimg').css({'opacity':0});\n\n // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\n actsh.find('.slotslide').each(function() {\n var ss = $(this);\n if (opt.firefox13) {\n\n ss.animate({ 'left': opt.slotw + 'px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n } else {\n\n ss.cssAnimate({ 'left': opt.slotw + 'px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n }\n });\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function() {\n var ss = $(this);\n ss.css({ 'left': (0 - opt.slotw) + \"px\" });\n if (opt.firefox13) {\n\n ss.animate({ 'left': '0px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n } else {\n ss.cssAnimate({ 'left': '0px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n }\n });\n }\n\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 3) {\n\n\n masterspeed = masterspeed + 200;\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlideV(actsh, opt, true);\n prepareOneSlideV(nextsh, opt, false);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n //actsh.find('.defaultimg').css({'opacity':0});\n\n // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\n actsh.find('.slotslide').each(function() {\n var ss = $(this);\n if (opt.firefox13) {\n ss.animate({ 'top': opt.sloth + 'px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n } else {\n ss.cssAnimate({ 'top': opt.sloth + 'px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n }\n });\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function() {\n var ss = $(this);\n ss.css({ 'top': (0 - opt.sloth) + \"px\" });\n if (opt.firefox13) {\n ss.animate({ 'top': '0px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n } else {\n ss.cssAnimate({ 'top': '0px' }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n\n }\n });\n }\n });\n }\n\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 4) {\n\n\n\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlide(actsh, opt, true);\n prepareOneSlide(nextsh, opt, true);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n actsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n\n ss.cssAnimate({ 'top': (0 + (opt.height)) + \"px\", 'opacity': 1 }, {\n duration: masterspeed + (i * (70 - opt.slots)),\n queue: false,\n complete: function() {\n\n\n }\n });\n });\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n ss.css({ 'top': (0 - (opt.height)) + \"px\", 'opacity': 0 });\n if (opt.firefox13) {\n ss.animate({ 'top': '0px', 'opacity': 1 }, {\n duration: masterspeed + (i * (70 - opt.slots)),\n queue: false,\n complete: function() {\n if (i == opt.slots - 1) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n } else {\n ss.cssAnimate({ 'top': '0px', 'opacity': 1 }, {\n duration: masterspeed + (i * (70 - opt.slots)),\n queue: false,\n complete: function() {\n if (i == opt.slots - 1) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n }\n });\n }\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 5) {\n\n\n\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlide(actsh, opt, true);\n prepareOneSlide(nextsh, opt, true);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n actsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n if (opt.firefox13) {\n ss.animate({ 'top': (0 + (opt.height)) + \"px\", 'opacity': 1 }, {\n duration: masterspeed + ((opt.slots - i) * (70 - opt.slots)),\n queue: false,\n complete: function() {}\n });\n } else {\n ss.cssAnimate({ 'top': (0 + (opt.height)) + \"px\", 'opacity': 1 }, {\n duration: masterspeed + ((opt.slots - i) * (70 - opt.slots)),\n queue: false,\n complete: function() {}\n });\n }\n });\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n ss.css({ 'top': (0 - (opt.height)) + \"px\", 'opacity': 0 });\n if (opt.firefox13) {\n ss.animate({ 'top': '0px', 'opacity': 1 }, {\n duration: masterspeed + ((opt.slots - i) * (70 - opt.slots)),\n queue: false,\n complete: function() {\n if (i == 0) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n } else {\n ss.cssAnimate({ 'top': '0px', 'opacity': 1 }, {\n duration: masterspeed + ((opt.slots - i) * (70 - opt.slots)),\n queue: false,\n complete: function() {\n if (i == 0) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n }\n });\n }\n\n\n /////////////////////////////////////\n // THE SLOTSLIDE - TRANSITION I. //\n ////////////////////////////////////\n if (nexttrans == 6) {\n\n\n\n nextli.css({ 'opacity': 1 });\n if (opt.slots < 2) opt.slots = 2;\n // PREPARE THE SLOTS HERE\n prepareOneSlide(actsh, opt, true);\n prepareOneSlide(nextsh, opt, true);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n\n\n actsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n\n if (i < opt.slots / 2)\n var tempo = (i + 2) * 60;\n else\n var tempo = (2 + opt.slots - i) * 60;\n\n if (opt.firefox13) {\n ss.animate({ 'top': (0 + (opt.height)) + \"px\", 'opacity': 1 }, { duration: masterspeed + tempo, queue: false, complete: function() {} });\n } else {\n ss.cssAnimate({ 'top': (0 + (opt.height)) + \"px\", 'opacity': 1 }, { duration: masterspeed + tempo, queue: false, complete: function() {} });\n }\n });\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n ss.css({ 'top': (0 - (opt.height)) + \"px\", 'opacity': 0 });\n if (i < opt.slots / 2)\n var tempo = (i + 2) * 60;\n else\n var tempo = (2 + opt.slots - i) * 60;\n\n if (opt.firefox13) {\n ss.animate({ 'top': '0px', 'opacity': 1 }, {\n duration: masterspeed + tempo,\n queue: false,\n complete: function() {\n if (i == Math.round(opt.slots / 2)) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n } else {\n ss.cssAnimate({ 'top': '0px', 'opacity': 1 }, {\n duration: masterspeed + tempo,\n queue: false,\n complete: function() {\n if (i == Math.round(opt.slots / 2)) {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.act = opt.next;\n opt.transition = 0;\n moveSelectedThumb(container);\n }\n\n }\n });\n }\n });\n }\n\n\n ////////////////////////////////////\n // THE SLOTSZOOM - TRANSITION II. //\n ////////////////////////////////////\n if (nexttrans == 7) {\n\n masterspeed = masterspeed * 3;\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlide(actsh, opt, true);\n prepareOneSlide(nextsh, opt, true);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n //actsh.find('.defaultimg').css({'opacity':0});\n\n // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\n actsh.find('.slotslide').each(function() {\n var ss = $(this).find('img');\n if (opt.firefox13) {\n ss.animate({\n 'left': (0 - opt.slotw / 2) + 'px',\n 'top': (0 - opt.height / 2) + 'px',\n 'width': (opt.slotw * 2) + \"px\",\n 'height': (opt.height * 2) + \"px\",\n opacity: 0\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n } else {\n\n ss.cssAnimate({\n 'left': (0 - opt.slotw / 2) + 'px',\n 'top': (0 - opt.height / 2) + 'px',\n 'width': (opt.slotw * 2) + \"px\",\n 'height': (opt.height * 2) + \"px\",\n opacity: 0\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n }\n });\n\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //\n ///////////////////////////////////////////////////////////////\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this).find('img');\n ss.css({\n 'left': (0) + 'px',\n 'top': (0) + 'px',\n //'width':(opt.width*2)+\"px\",\n //'height':(opt.height*2)+\"px\",\n opacity: 0\n });\n if (opt.firefox13) {\n ss.animate({\n 'left': (0 - i * opt.slotw) + 'px',\n 'top': (0) + 'px',\n 'width': (nextsh.find('.defaultimg').data('neww')) + \"px\",\n 'height': (nextsh.find('.defaultimg').data('newh')) + \"px\",\n opacity: 1\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n\n } else {\n ss.cssAnimate({\n 'left': (0 - i * opt.slotw) + 'px',\n 'top': (0) + 'px',\n 'width': (nextsh.find('.defaultimg').data('neww')) + \"px\",\n 'height': (nextsh.find('.defaultimg').data('newh')) + \"px\",\n opacity: 1\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n\n }\n });\n }\n\n\n\n\n ////////////////////////////////////\n // THE SLOTSZOOM - TRANSITION II. //\n ////////////////////////////////////\n if (nexttrans == 8) {\n\n masterspeed = masterspeed * 3;\n nextli.css({ 'opacity': 1 });\n\n // PREPARE THE SLOTS HERE\n prepareOneSlideV(actsh, opt, true);\n prepareOneSlideV(nextsh, opt, true);\n\n //SET DEFAULT IMG UNVISIBLE\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n //actsh.find('.defaultimg').css({'opacity':0});\n\n // ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\n actsh.find('.slotslide').each(function() {\n var ss = $(this).find('img');\n if (opt.firefox13) {\n ss.animate({\n 'left': (0 - opt.width / 2) + 'px',\n 'top': (0 - opt.sloth / 2) + 'px',\n 'width': (opt.width * 2) + \"px\",\n 'height': (opt.sloth * 2) + \"px\",\n opacity: 0\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n } else {\n\n ss.cssAnimate({\n 'left': (0 - opt.width / 2) + 'px',\n 'top': (0 - opt.sloth / 2) + 'px',\n 'width': (opt.width * 2) + \"px\",\n 'height': (opt.sloth * 2) + \"px\",\n opacity: 0\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n }\n });\n\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //\n ///////////////////////////////////////////////////////////////\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this).find('img');\n ss.css({\n 'left': (0) + 'px',\n 'top': (0) + 'px',\n //'width':(opt.width*2)+\"px\",\n //'height':(opt.height*2)+\"px\",\n opacity: 0\n });\n if (opt.firefox13) {\n ss.animate({\n 'left': (0) + 'px',\n 'top': (0 - i * opt.sloth) + 'px',\n 'width': (nextsh.find('.defaultimg').data('neww')) + \"px\",\n 'height': (nextsh.find('.defaultimg').data('newh')) + \"px\",\n opacity: 1\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n } else {\n ss.cssAnimate({\n 'left': (0) + 'px',\n 'top': (0 - i * opt.sloth) + 'px',\n 'width': (nextsh.find('.defaultimg').data('neww')) + \"px\",\n 'height': (nextsh.find('.defaultimg').data('newh')) + \"px\",\n opacity: 1\n }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n\n }\n });\n }\n\n\n ////////////////////////////////////////\n // THE SLOTSFADE - TRANSITION III. //\n //////////////////////////////////////\n if (nexttrans == 9) {\n\n\n\n nextli.css({ 'opacity': 1 });\n\n opt.slots = opt.width / 20;\n\n prepareOneSlide(nextsh, opt, true);\n\n\n //actsh.find('.defaultimg').css({'opacity':0});\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n\n var ssamount = 0;\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n ssamount++;\n ss.css({ 'opacity': 0 });\n ss.data('tout', setTimeout(function() {\n ss.cssAnimate({ 'opacity': 1 }, { duration: masterspeed, queue: false });\n\n }, i * 4));\n\n });\n\n setTimeout(function() {\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }, (masterspeed + (ssamount * 4)));\n }\n\n\n\n\n ////////////////////////////////////////\n // THE SLOTSFADE - TRANSITION III. //\n //////////////////////////////////////\n if (nexttrans == 10) {\n\n\n\n nextli.css({ 'opacity': 1 });\n\n opt.slots = opt.height / 20;\n\n prepareOneSlideV(nextsh, opt, true);\n\n\n //actsh.find('.defaultimg').css({'opacity':0});\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n\n var ssamount = 0;\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n ssamount++;\n ss.css({ 'opacity': 0 });\n ss.data('tout', setTimeout(function() {\n ss.animate({ 'opacity': 1 }, { duration: masterspeed, queue: false });\n\n }, i * 4));\n\n });\n\n setTimeout(function() {\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }, (masterspeed + (ssamount * 4)));\n }\n\n\n ///////////////////////////\n // SIMPLE FADE ANIMATION //\n ///////////////////////////\n\n if (nexttrans == 11) {\n\n\n\n nextli.css({ 'opacity': 1 });\n\n opt.slots = 1;\n\n prepareOneSlide(nextsh, opt, true);\n\n\n //actsh.find('.defaultimg').css({'opacity':0});\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n\n var ssamount = 0;\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n nextsh.find('.slotslide').each(function(i) {\n var ss = $(this);\n ssamount++;\n ss.css({ 'opacity': 0 });\n ss.animate({ 'opacity': 1 }, { duration: masterspeed, queue: false });\n });\n\n setTimeout(function() {\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }, masterspeed);\n }\n\n\n\n\n\n if (nexttrans == 12 || nexttrans == 13 || nexttrans == 14 || nexttrans == 15) {\n\n masterspeed = masterspeed * 3;\n nextli.css({ 'opacity': 1 });\n\n opt.slots = 1;\n\n prepareOneSlide(nextsh, opt, true);\n prepareOneSlide(actsh, opt, true);\n\n\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n nextsh.find('.defaultimg').css({ 'opacity': 0 });\n\n var oow = opt.width;\n var ooh = opt.height;\n if (opt.fullWidth == \"on\") {\n oow = opt.container.parent().width();\n ooh = opt.container.parent().height();\n\n }\n\n // ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\n var ssn = nextsh.find('.slotslide')\n if (nexttrans == 12)\n ssn.css({ 'left': oow + \"px\" });\n else\n if (nexttrans == 15)\n ssn.css({ 'left': (0 - opt.width) + \"px\" });\n else\n if (nexttrans == 13)\n ssn.css({ 'top': (ooh) + \"px\" });\n else\n if (nexttrans == 14)\n ssn.css({ 'top': (0 - opt.height) + \"px\" });\n\n if (opt.firefox13) {\n ssn.animate({ 'left': '0px', 'top': '0px', opacity: 1 }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n } else {\n ssn.cssAnimate({ 'left': '0px', 'top': '0px', opacity: 1 }, {\n duration: masterspeed,\n queue: false,\n complete: function() {\n removeSlots(container);\n nextsh.find('.defaultimg').css({ 'opacity': 1 });\n actsh.find('.defaultimg').css({ 'opacity': 0 });\n if ($.browser.msie && $.browser.version < 9) actsh.find('.defaultimg').css({ 'opacity': 1 });\n opt.transition = 0;\n opt.act = opt.next;\n moveSelectedThumb(container);\n }\n });\n }\n\n\n var ssa = actsh.find('.slotslide');\n if (opt.firefox13) {\n if (nexttrans == 12)\n ssa.animate({ 'left': (0 - oow) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n else\n if (nexttrans == 15)\n ssa.animate({ 'left': (oow) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n else\n if (nexttrans == 13)\n ssa.animate({ 'top': (0 - ooh) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n else\n if (nexttrans == 14)\n ssa.animate({ 'top': (ooh) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n } else {\n if (nexttrans == 12)\n ssa.cssAnimate({ 'left': (0 - oow) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n else\n if (nexttrans == 15)\n ssa.cssAnimate({ 'left': (oow) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n else\n if (nexttrans == 13)\n ssa.cssAnimate({ 'top': (0 - ooh) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n else\n if (nexttrans == 14)\n ssa.cssAnimate({ 'top': (ooh) + 'px', opacity: 1 }, { duration: masterspeed, queue: false });\n }\n\n\n\n\n }\n\n\n\n }", "function _switchSlide(){\r\n\t\tif(slide > 0){\r\n\t\t\tfor(var i = 0; i<slide; i++){\r\n\t\t\t\tTweenMax.set($('#slide_'+i),{css:{top:'-100%'}});\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(slide>3){\r\n\t\t\t$('#fake_slide_1').hide();\r\n\t\t}\r\n\r\n\t\tTweenMax.to($('#slide_'+slide),1.6,{css:{top:'-100%'},ease:Expo.easeOut});\r\n\t\tTweenMax.to($('#slide_'+(slide+1)),1.6,{delay:0.2,css:{top:'0%'},ease:Expo.easeOut, onComplete: function(){\r\n\t\t\tslide +=1;\r\n\t\t\tconsole.log('slide: '+slide);\r\n\t\t}});\r\n\t}", "function changeSlide(d){\n //slide to next image\n if (d===\"n\"){\n $(\"#slides\").animate({\n top: \"-=42vh\"},1000); \n curr++;\n //slide to previous image\n } else if (d===\"p\") {\n $(\"#slides\").animate({\n top: \"+=41vh\"},1000); \n curr--; \n //slide to beginning \n } else {\n $(\"#slides\").animate({top: \"0\"},500);\n curr=0;\n }\n }", "function changeSlide(e) {\n // console.log(e);\n\n nextSlide = e.target.dataset.name;\n // if the statement is true\n if ( lastSlide == nextSlide) {\n // return exits (ends) the function\n // the code after (show, hide,..) doesn't get executed\n return;\n }\n\n // SHOW\n document.getElementById(nextSlide).style.display = 'grid';\n document.getElementById('btn-'+nextSlide).style.backgroundColor = \"#2896E0\";\n // HIDE\n document.getElementById(lastSlide).style.display = 'none';\n document.getElementById('btn-'+lastSlide).style.backgroundColor = \"#BEFCFE\";\n //SAVE\n lastSlide = nextSlide;\n \n \n playTimeLine(lastSlide);\n playTimeline(nextSlide);\n}", "function changeSlide() {\n\n mainSlide.setAttribute(\"src\", slideArray[slideIndex]['url']);\n slideIndex++;\n if (slideIndex >= slideArray.length) {\n slideIndex = 0;\n }\n }", "function slideShow(){\n for (let i = 0; i < slides.length; i++){\n slides[i].classList.remove(\"block\");\n slides[i].classList.add(\"none\");\n }\n slides[currentSlide-1].classList.remove(\"none\");\n slides[currentSlide-1].classList.add(\"block\");\n}", "function switchSlide () {\n grabNextSlide();\n loadSlide();\n }", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function after() {\r\n reset();\r\n slides[current + 1].style.display = \"block\";\r\n current++;\r\n}", "function changeSlide(change){\n slideIndex += change;\n\n updateCurrentSlide(slideIndex);\n}", "function changeDivs(d) {\n showDivs(slideDivNbr += d);\n}", "function switch_slides () {\n // Animate to next slide by facing opacity of foreground from 100% to 0%\n foreground_element.animate({ opacity: 0 }, that.options.speed, function () {\n load_slide(foreground_element, that.options.slides[current_slide_id]);\n foreground_element.css('opacity', 1); // turn foreground on full opacity\n load_slide(background_element, that.options.slides[next_slide_id]); // load next slide into background\n });\n\n // Update slide_id's\n current_slide_id += 1; //next_slide_id - 1;\n if (current_slide_id >= slide_count) {\n current_slide_id = 0;\n }\n next_slide_id = current_slide_id + 1;\n if (next_slide_id >= slide_count) {\n next_slide_id = 0;\n }\n }", "function changeCarousel() {\n $slider.find(\".show\").removeClass(\"show\").fadeOut();\n $slider\n .find(\"> div\")\n .eq(position)\n .fadeIn(set.fadeSpeed)\n .addClass(\"show\");\n // The Dots\n $slider.find(\"> ul\").find(\".showli\").removeClass(\"showli\");\n $slider.find(\"> ul > li\").eq(position).addClass(\"showli\");\n }", "function change_qs(i){\n $('.carousel').carousel(i);\n mrev(0);\n return false;\n}", "function currentSlide(n) {\r\n showSlides(slideInd = n);\r\n}", "function simpleslider(ssR, ssF, ssD, ssP) {\n // Setup variables\n var ss = document.getElementById('deviantART-gallery'),\n ssWrapper = document.getElementById('ss__wrapper'),\n ssControls = document.getElementById('ss__controls'),\n ssPrev = document.getElementById('ss__prev'),\n ssNext = document.getElementById('ss__next'),\n ssDots = document.getElementById('ss__dots'),\n ssImages = ssWrapper.getElementsByTagName('img'),\n ssFrames = ssF || ssImages.length,\n ssRatio = ssR,\n ssDirectory = ssD,\n ssPrefix = ssP,\n ssCurrentFrame = 0,\n ssDotsWidth = ssFrames * 20,\n ssWidth = 0,\n ssHeight = 0;\n\n // Calculate aspect ratio\n var ssRatioSplit = ssRatio.split(':');\n var ssRatioPercentage = ssRatioSplit[1] / ssRatioSplit[0] * 100;\n\n // Set dimensions\n ss.style.paddingBottom = ssWrapper.style.paddingBottom = ssRatioPercentage + '%';\n ssDots.style.width = ssDotsWidth + 'px';\n\n // Get pixel dimensions\n function getSSDimensions() {\n ssWidth = ssWrapper.offsetWidth;\n ssHeight = ssWrapper.offsetHeight;\n }\n\n getSSDimensions();\n\n // Generate navigation dots\n for(var i = 0; i < ssFrames; i++) {\n var ssDot = document.createElement('div');\n ssDot.className = 'ss__dot' + ' ss__frame' + [i];\n ssDots.appendChild(ssDot);\n }\n\n ssAllDots = ssDots.getElementsByTagName('div');\n\n // Create img elements if they don't already exist on the DOM\n if(ssImages.length == 0) {\n for(var i = 1; i <= ssFrames; i++) {\n var ssImg = new Image();\n ssImg.src = ssD + '/' + ssP + i + '.jpg'; // 'img/directory/prefix1.jpg'\n ssWrapper.innerHTML += ssImg.outerHTML;\n }\n ssImages = ssWrapper.getElementsByTagName('img');\n }\n\n for(var i = 0, l = ssImages.length; i < l; i++) {\n coverImages(ssImages[i]);\n }\n\n // Ensure each image fills the wrapper leaving no whitespace (background-size:cover)\n function coverImages(imgElem) {\n\n var img = new Image();\n img.src = imgElem.src;\n\n var wait = setInterval(function() {\n if(img.width != 0 && img.height != 0) {\n clearInterval(wait);\n\n // Stretch to fit\n if((img.width / img.height) < (ssWidth / ssHeight)) {\n imgElem.className += ' full-width';\n } else {\n imgElem.className += ' full-height';\n }\n\n calculateCentre();\n }\n }, 0);\n }\n\n function calculateCentre() {\n for(var i = 0, l = ssImages.length; i < l; i++) {\n if(ssImages[i].width >= ssWidth) {\n ssImages[i].style.left = (ssWidth - ssImages[i].width) / 2 + 'px';\n }\n\n if(ssImages[i].height >= ssHeight) {\n ssImages[i].style.top = (ssHeight - ssImages[i].height) / 2 + 'px';\n }\n }\n }\n\n // Add current class to first frame\n function addCurrent(n) {\n ssImages[n].className += ' current';\n ssAllDots[n].className += ' current';\n }\n\n // Clear all current classes\n function clearCurrent() {\n for(var i = 0; i < ssFrames; i++) {\n ssImages[i].className = ssImages[i].className.replace(/ current/, '');\n ssAllDots[i].className = ssAllDots[i].className.replace(/ current/, '');\n }\n }\n\n // Update current frame\n function goToFrame(n) {\n if(n >= ssFrames) {\n ssCurrentFrame = 0;\n } else if(n < 0) {\n ssCurrentFrame = ssFrames - 1;\n } else {\n ssCurrentFrame = n;\n }\n }\n\n // Always initialise first image as .current\n addCurrent(0);\n\n // Next and Previous click handlers\n if(window.addEventListener) {\n ssPrev.addEventListener('click', clickPrev);\n ssNext.addEventListener('click', clickNext);\n } else if(window.attachEvent) {\n ssPrev.attachEvent('onclick', clickPrev);\n ssNext.attachEvent('onclick', clickNext);\n }\n\n function clickPrev() {\n clearCurrent();\n goToFrame(ssCurrentFrame - 1);\n addCurrent(ssCurrentFrame);\n }\n\n function clickNext() {\n clearCurrent();\n goToFrame(ssCurrentFrame + 1);\n addCurrent(ssCurrentFrame);\n }\n\n // Navigation dots click handlers\n for(var i = 0; i < ssFrames; i++) {\n if(window.addEventListener) {\n ssAllDots[i].addEventListener('click', clickDots);\n } else if(window.attachEvent) {\n ssAllDots[i].attachEvent('onclick', clickDots);\n }\n }\n\n function clickDots(e) {\n if(e.target) {\n var dotClicked = e.target.className;\n } else if(e.srcElement) {\n var dotClicked = e.srcElement.className;\n }\n var n = dotClicked.match(/\\d+/);\n clearCurrent();\n goToFrame(parseInt(n[0]));\n addCurrent(n[0]);\n }\n\n document.onkeydown = function(e) {\n evt = e || window.event;\n switch(evt.keyCode) {\n case 37:\n clickPrev();\n break;\n case 39:\n clickNext();\n break;\n }\n };\n\n // Recalculate image centres on window resize\n if(window.addEventListener) {\n window.addEventListener('resize', windowResize);\n } else if(window.attachEvent) {\n window.attachEvent('onresize', windowResize);\n }\n\n function windowResize() {\n getSSDimensions();\n calculateCentre();\n }\n}", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function changeSlidesAutomatically() {\n if (indexOfCurrentSlide > maxNumberOfSlides) {\n indexOfCurrentSlide %= maxNumberOfSlides;\n }\n\n removeCurrentClass();\n\n switch (indexOfCurrentSlide) {\n case 1:\n createFirstSlide();\n break;\n case 2:\n createSecondSlide();\n break;\n case 3:\n createThirdSlide();\n break;\n case 4:\n createForthSlide();\n break;\n case 5:\n createFifthSlide();\n break;\n default:\n break;\n }\n\n setCurrentClass();\n indexOfCurrentSlide += 1;\n // resetTimer();\n }", "function currentslide(n)\n{\n\tshowDivs(slideIndex = n);\n}", "function slideLeft() {\n reset();\n sliderImages[current - 1].style.display = 'block';\n current--;\n}", "function goToSlide(n) {\n slides[currentSlide].className = 'slider-image';\n currentSlide = (n + slides.length) % slides.length;\n slides[currentSlide].className = 'slider-image showing';\n}", "function plusSlides(n){\r\n showSlides(slideInd += n - 1);\r\n}", "function changeSlide(index)\n{\n for(let i=0; i<slider.length; i++)\n {\n slider[i].classList.remove('active');\n }\n slider[index].classList.add('active');\n}", "function currentSlide(n) {\r\n showSlides(slideIndex = n);\r\n}", "function changeIndexNext() {\n if(index_prev == 4) {\n index_prev = 0;\n moveIndex(4);\n }\n else {\n disableClick();\n for(var iItem = 0 ; iItem < 5 ; iItem++){\n $(\".slideshow li\").eq(iItem).animate({\n left: \"-=\" + width \n }).promise().done(function () {\n enableClick();\n });\n }\n setOpacity(++index_prev);\n }\n}", "function changeSlides(n){\r\n\r\n // reset the timer\r\n\r\n clearInterval(timer);\r\n\r\n // if n is negative, then call showslides for index - 1, and if n isn't negative, call showslides for index + 1\r\n\r\n if (n < 0){\r\n showSlides(index -= 1);\r\n } else {\r\n showSlides(index += 1); \r\n }\r\n\r\n // if n is -1, then call change slides for n+2 and set to timer, otherwise call change slides for n+1 and set to timer\r\n\r\n if (n == -1){\r\n timer = setInterval(function(){changeSlides(n + 2)}, 2000);\r\n } else {\r\n timer = setInterval(function(){changeSlides(n + 1)}, 2000);\r\n }\r\n}", "function slideChange(i) {\n document.getElementById(\"stick\" + iSlide).style.color =\n \"rgb(243,243,243,0.6)\";\n iSlide += i;\n if (iSlide == 6) iSlide = 1;\n if (iSlide == 0) iSlide = 5;\n slideNumber(iSlide);\n}", "function slide(n) {\r\n $('.oblastPrava').hide();\r\n slides[n].style.display = 'block';\r\n}", "function Initialize2()\n{\n const Slides = document.querySelectorAll('.slides1');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function changeIndexPrev() {\n if(index_prev == 0) {\n index_prev = 4;\n moveIndex(4);\n }\n else {\n disableClick();\n for(var iItem = 4 ; iItem > 0 ; iItem--){\n $(\".slideshow li\").eq(iItem).animate({\n left: \"+=\" + width \n }).promise().done(function () {\n enableClick();\n });\n }\n setOpacity(--index_prev);\n }\n}", "function currentSlide(n){\n slideIndex = n;\n}", "function slidetweaks()\n{\n\tvar $ = jQuery;\n\n\t// Because of where this callback function is executed within \n\t// SlidesJS code I don't have access to sjs variable in here :(\n\n\t// put prev & next inside of main slide area so they can be positioned relative to it.\n\t$('.slidesjs-navigation').appendTo('.slidesjs-container');\n\n\t$('.slidesjs-slide').css('display','block');\n\t$('.slidesjs-slide img').each( function(index,element){ centerImage(element); } );\n\t$('.slidesjs-slide').css('display','none');\n\t$('.slidesjs-slide').first().css('display','block');\n}", "function slideRight() {\n reset();\n sliderImages[current + 1].style.display = 'block';\n current++;\n}", "function SlideChange(n) {\n const currId = parseInt($activeSlide.getAttribute('id'));\n let newId;\n \n if (n < 0) {\n (currId === 0 ? newId = $arrContent.length - 1 : newId = currId + n);\n }\n else {\n (currId === $arrContent.length - 1 ? newId = 0 : newId = currId + n);\n }\n\n const currSlide = document.getElementById(newId);\n $activeSlide.classList.remove('active');\n $activeSlide = currSlide;\n $activeSlide.classList.add('active');\n\n progressChange(newId);\n }", "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "function clickToChange() {\n for (let i = 0; i < 3; i++) {\n let dot = document.getElementsByClassName('dot')[i]\n let visual = document.getElementsByClassName('visual')[i]\n dot.addEventListener('click', () => {\n presetStyle()\n dot.style.backgroundColor = 'black'\n visual.style.zIndex = '100'\n visual.style.opacity = '1'\n if (slideIndex < 2) {\n slideIndex = i + 1\n } else {\n slideIndex = 0\n }\n })\n }\n}", "function currentSlide(n,p) {\r\n showSlides(slideIndex = n,p);\r\n \r\n}", "function showThisSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n}", "function constrolSlides(ele) {\n // select controls ul element\n const ul=controls.children;\n // select ul chidren li element\n const li=ul[0].children;\n var active;\n for(let i=0;i<li.length;i++){\n if(li[i].className==\"active\"){\n // find who is now active\n active=i;\n // remove active class from all li element\n li[i].className=\"\";\n }\n }\n // add active class ro current slide\n ele.className=\"active\";\n\n var numb=(ele.id-1)-active;\n jumpSlideWidth=jumpSlideWidth+(slicktrackWidth*numb);\n slicktrack.style.marginLeft=-jumpSlideWidth + \"px\";\n}", "function slide(){\n index = (index+1)%(bilder.length);\n imgTag.src = bilder[index];\n}", "function plusSlides(n) {\n\n}", "function changeSlide(slide){\n for(let i = 0; i < allSlides.length; i++){\n allSlides[i].classList.remove(\"opacityUp\");\n allSlides[i].classList.add(\"opacityDown\");\n allSlideButtons[i].style.opacity = 0.5;\n };\n allSlides[slide-1].classList.remove(\"opacityDown\");\n allSlides[slide-1].classList.add(\"opacityUp\");\n allSlideButtons[slide-1].style.opacity = 1;\n}", "function effectSnap () {\n pauseSlideshow();\n effect = 0;\n runSlideshow();\n }", "function showSlides(n) {\n for (let i = 0; i < slides.length; i++) {\n slides[i].classList.remove(\"first-div\");\n slides[i].classList.remove(\"second-div\");\n slides[i].classList.remove(\"third-div\");\n }\n if (slideIndex > previousIndex) {\n ascending(slides);\n } else {\n descending(slides);\n }\n}", "function effectSlide () {\n pauseSlideshow();\n effect = 2;\n runSlideshow();\n }", "changeSlide() {\n\t\tthis.activeSlide.fadeOut(this.fadeout);\n this.activeSlide = this.slide.eq(this.i);\n this.activeSlide.fadeIn(this.fadein);\n this.dot.removeClass('dot-active');\n this.activeDot = this.dot.eq(this.i);\n this.activeDot.addClass(\"dot-active\");\n\t}", "function plusSlides(n) {\n // Increment or decrement slideIndex and display\n showSlides(slideIndex += n);\n}", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "plusSlides(n){\n showSlides(this.state.slideIndex)\n }", "function carrousel(){\n\t//el objetivo es establecer inline nuestra imagen con la que queremos jugar.\n var i;\n var x = document.getElementsByClassName(\"slide1\");\n for(i=0; i<x.length; i++){\n x[i].style.display = \"none\";\n }\n myIndex1++;\n if ( myIndex1 > x.length){myIndex1=1};\n x[myIndex1-1].style.display = \"inline\";\n\n x = document.getElementsByClassName(\"slide2\");\n for(i=0; i<x.length; i++){\n x[i].style.display = \"none\";\n }\n myIndex2++;\n if ( myIndex2 > x.length){myIndex2=1};\n x[myIndex2-1].style.display = \"inline\";\n\n x = document.getElementsByClassName(\"slide3\");\n for(i=0; i<x.length; i++){\n x[i].style.dispaly = \"none\";\n }\n myIndex3++;\n if ( myIndex3 > x.length){myIndex3=1};\n x[myIndex3-1].style.display = \"inline\";\n}", "function rool(){\n\tsetInterval(function(){showSlides('card-body',1);\n\t\t\tshowSlides('card-body',2);},3000);\n\tsetInterval(function(){showSlides('card-body',3);\n\t\t\tshowSlides('card-body',4);},3000);\n\tsetInterval(function(){showSlides('card-body',5);\n\t\t\tshowSlides('card-body',6);},6000);\n}", "function currentSlide(n) { // parameter holds slideIndex\n showSlides(slideIndex = n);\n} // end function", "function js_startSlide() {\n reset();\n sliderImages[0].style.display = 'block'; // Show image 1.\n temporal[current].innerHTML = current + 1 + \"/\" + sliderImages.length; // Print number image is in current location.\n dots[current].classList.add(\"active\"); // Add class active dot current image.\n}", "function showSlides(n) {\n\t\tif (n > slidelength - 1) {\n\t\t\tn -= slidelength;\n\t\t}\n\t\tif (n < 0) {\n\t\t\tn += slidelength;\n\t\t}\n\t\t\n\t\tfor (i = 0; i < slidelength; i++) {\n\t\t\t$(\".archive-item\").removeClass(\"js-active\");\n\t\t}\n\n\t\t// var slides = $(\".archive-item\").removeClass(\"js-active\");\n\n\t\tvar slides = $(\".archive-item\");\n\t\tvar newSlide = slides.eq(n);\n\t\tnewSlide.addClass(\"js-active\");\n\t\tslideContent();\n\t\tslideIndex = n;\n\t}", "function slider_sucks(argument) {\n\n var nextButton = document.getElementById('next');\n var prevButton = document.getElementById('prev');\n\n var slides = document.getElementsByClassName('slide');\n var currentSlide = 0;\n slides[currentSlide].style.display = 'block';\n\n var prev = slides.length - 1;\n var next = currentSlide + 1;\n\n nextButton.onclick = function () {\n slides[currentSlide].style.display = 'none';\n\n prev = currentSlide;\n currentSlide = next;\n next++;\n\n if (next >= slides.length) {\n next = 0;\n }\n\n slides[currentSlide].style.display = 'block';\n }\n\n\n prevButton.onclick = function () {\n slides[currentSlide].style.display = 'none';\n\n next = currentSlide;\n currentSlide = prev;\n prev--;\n\n if (prev < 0) {\n prev = slides.length - 1;\n }\n\n slides[currentSlide].style.display = 'block';\n }\n}", "function setNewSlidesNumbers() {\n if (!slider.options.reverse) {\n nextSlide = increaseNumber(nextSlide);\n currentSlide = decreaseNumber(nextSlide);\n } else {\n nextSlide = decreaseNumber(nextSlide);\n currentSlide = increaseNumber(nextSlide);\n }\n }", "function navSlide(n) {\n // Calculate index of visible slide\n var idx = slideIndex + n;\n // Set all slides invisible\n setAllInvisible(slides);\n // Set all progBar images invisible\n setAllInvisible(progBars);\n // Display slide at index \"idx\"\n slides[idx - 1].style.display = \"block\";\n // Display progBar image at index \"idx\"\n progBars[idx - 1].style.display = \"block\";\n // Check if idx is greater than 0\n if ((idx - 1) <= 0) {\n slideIndex = 1;\n // Hide prevButton\n document.getElementById(\"prevButton\").style.display = \"none\";\n }\n else if ((idx) >= slides.length) {\n slideIndex = slides.length;\n // Show prevButton and hide nextButton\n document.getElementById(\"prevButton\").style.display = \"block\";\n document.getElementById(\"nextButton\").style.display = \"none\";\n }\n else {\n slideIndex = idx;\n // Show both buttons\n document.getElementById(\"prevButton\").style.display = \"block\";\n document.getElementById(\"nextButton\").style.display = \"block\";\n }\n}", "function showSlides(n) {\r\n var i;\r\n var slides = document.getElementsByClassName(\"item\");\r\n var dots = document.getElementsByClassName(\"slider-dots_item\");\r\n if (n > slides.length) {\r\n slideIndex = 1;\r\n }\r\n if (n < 1) {\r\n slideIndex = slides.length\r\n }\r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\"; //can use addclass\r\n }\r\n for (i = 0; i < dots.length; i++) {\r\n dots[i].className = dots[i].className.replace(\" active\", \"\");\r\n }\r\n slides[slideIndex - 1].style.display = \"block\"; //can use addclass\r\n dots[slideIndex - 1].className += \" active\";\r\n}", "function changeSlide(dir)\n{\n\tprocessingEffect = true;\n\teffectArray = new Array();\n\n\teffectArray[0] = new Object();\n\tif (dir == 1)\n\t{\n\t\teffectArray[0][\"effect\"] = slides[activeSlide][\"transitionOut\"][\"name\"];\n\t\teffectArray[0][\"options\"] = slides[activeSlide][\"transitionOut\"][\"options\"];\n\t\teffectArray[0][\"dir\"] = -1;\n\t}\n\telse if (dir == -1)\n\t{\n\t\teffectArray[0][\"effect\"] = slides[activeSlide][\"transitionIn\"][\"name\"];\n\t\teffectArray[0][\"options\"] = slides[activeSlide][\"transitionIn\"][\"options\"];\n\t\teffectArray[0][\"dir\"] = 1;\n\t}\n\teffectArray[0][\"element\"] = slides[activeSlide][\"element\"];\n\n\tactiveSlide += dir;\n\tsetProgressBarValue(activeSlide);\n\n\teffectArray[1] = new Object();\n\n\tif (dir == 1)\n\t{\n\t\teffectArray[1][\"effect\"] = slides[activeSlide][\"transitionIn\"][\"name\"];\n\t\teffectArray[1][\"options\"] = slides[activeSlide][\"transitionIn\"][\"options\"];\n\t\teffectArray[1][\"dir\"] = 1;\n\t}\n\telse if (dir == -1)\n\t{\n\t\teffectArray[1][\"effect\"] = slides[activeSlide][\"transitionOut\"][\"name\"];\n\t\teffectArray[1][\"options\"] = slides[activeSlide][\"transitionOut\"][\"options\"];\n\t\teffectArray[1][\"dir\"] = -1;\n\t}\n\n\teffectArray[1][\"element\"] = slides[activeSlide][\"element\"];\n\n\tif (slides[activeSlide][\"effects\"] && (dir == -1))\n\t\tactiveEffect = slides[activeSlide][\"effects\"].length;\n\telse\n\t\tactiveEffect = 0;\n\n\tif (dir == -1)\n\t\tsetSlideToState(activeSlide, STATE_END);\n\telse\n\t\tsetSlideToState(activeSlide, STATE_START);\n\n\ttransCounter = 0;\n\tstartTime = (new Date()).getTime();\n\tlastFrameTime = null;\n\teffect(dir);\n}", "function advanceSlide() {\n if (currentSlide < MAXSLIDES) {\n currentSlide += 1;\n updateSlide();\n } else {\n removeIntro();\n }\n}", "function prepareOneSlideV(slotholder, opt, visible) {\n\n var sh = slotholder;\n var img = sh.find('img')\n setSize(img, opt)\n var src = img.attr('src');\n var bgcolor = img.css('background-color');\n var w = img.data('neww');\n var h = img.data('newh');\n var fulloff = img.data(\"fxof\");\n if (fulloff == undefined)\n fulloff = 0;\n\n var fullyoff = img.data(\"fyof\");\n if (img.data('fullwidthcentering') != \"on\" || fullyoff == undefined)\n fullyoff = 0;\n\n var off = 0;\n\n\n\n if (!visible)\n var off = 0 - opt.sloth;\n\n //alert(fullyoff+\" \"+opt.sloth+\" \"opt.slots+\" \"+)\n\n for (var i = 0; i < opt.slots + 2; i++)\n sh.append('<div class=\"slot\" style=\"position:absolute;' +\n 'top:' + (fullyoff + (i * opt.sloth)) + 'px;' +\n 'left:' + (fulloff) + 'px;' +\n 'overflow:hidden;' +\n 'width:' + w + 'px;' +\n 'height:' + (opt.sloth) + 'px\"' +\n '><div class=\"slotslide\" style=\"position:absolute;' +\n 'top:' + (off) + 'px;' +\n 'left:0px;width:' + w + 'px;' +\n 'height:' + opt.sloth + 'px;' +\n 'overflow:hidden;\"><img style=\"position:absolute;' +\n 'background-color:' + bgcolor + ';' +\n 'top:' + (0 - (i * opt.sloth)) + 'px;' +\n 'left:0px;width:' + w + 'px;' +\n 'height:' + h + 'px\" src=\"' + src + '\"></div></div>');\n\n }", "function addSlide() {\r\n showSlides(slideIndex += 1);\r\n}", "function swapSlides() {\n var swappingSlide = $('.swapping');\n if (swappingSlide.length === 2) {\n var slideTextA = swappingSlide.eq(0).html();\n var slideTextB = swappingSlide.eq(1).html();\n var slideStyleA = swappingSlide.eq(0).css(\"font-size\");\n var slideStyleB = swappingSlide.eq(1).css(\"font-size\");\n swappingSlide.eq(0).html(slideTextB);\n swappingSlide.eq(1).html(slideTextA);\n swappingSlide.eq(0).css(\"font-size\", slideStyleB);\n swappingSlide.eq(1).css(\"font-size\", slideStyleA);\n $('.start-show').remove();\n $('.slide').eq(0).append($startShow);\n swappingSlide.removeClass(\"swapping\");\n $('.swap').siblings(\"img\").prop(\"disabled\", false);\n }\n }", "function moveToSlide(index) { // 3277\n // Wrap around indices. // 3278\n if (index >= $slides.length) index = 0; // 3279\n else if (index < 0) index = $slides.length -1; // 3280\n // 3281\n $active_index = $slider.find('.active').index(); // 3282\n // 3283\n // Only do if index changes // 3284\n if ($active_index != index) { // 3285\n $active = $slides.eq($active_index); // 3286\n $caption = $active.find('.caption'); // 3287\n // 3288\n $active.removeClass('active'); // 3289\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad', // 3290\n complete: function() { // 3291\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } }); // 3293\n captionTransition($caption, options.transition); // 3294\n // 3295\n // 3296\n // Update indicators // 3297\n if (options.indicators) { // 3298\n $indicators.eq($active_index).removeClass('active'); // 3299\n } // 3300\n // 3301\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active'); // 3304\n // 3305\n // 3306\n // Update indicators // 3307\n if (options.indicators) { // 3308\n $indicators.eq(index).addClass('active'); // 3309\n } // 3310\n } // 3311\n } // 3312", "function startSlide() {\n reset();\n slides[0].style.display = 'flex';\n }", "showSlides(n){\n var i;//the counter\n var index = this.state.slideIndex; //the state property\n var slides = document.querySelector(\".mySlide\"); //selecting the slide components\n if ( n > slides.length) {index = 1}//if the slide is the last one, go back to first\n if ( n < 1 ) {index = slides.length}//if slide is the first one, you can go to last\n for (i = 0; i < slides.length; i++){//for ever slide\n slides[i].style.display = \"none\";//make it invisible\n }\n slides[index-1].style.display = \"block\";//but for now, make visible\n }", "_correctIndexSettings() {\n this.options.slider.startIndex -= 1;\n this.options.thumbnailSlider.startIndex -= 1;\n this.options.slider.startIndex = (this.options.slider.startIndex < 0) ? 0 : this.options.slider.startIndex;\n this.options.thumbnailSlider.startIndex = (this.options.thumbnailSlider.startIndex < 0) ? 0 : this.options.thumbnailSlider.startIndex;\n }", "function setMoveForAccordionDivs(index)\r\n{\r\n // for every slided div we make the same\r\n for(var i = 0; i < g_slidedDivs.length; i++)\r\n {\r\n var context = $j(g_slidedDivs[i].name)[0];\r\n var object = $j(g_slidedDivs[i].name);\r\n $j(\".slideDesc\", context).stop().animate({opacity: 0.0}, 150);\r\n // if div lie on left we move it on left\r\n if(i < index)\r\n {\r\n // calculate new margin, this equal to calculate new position of div\r\n var newMargin = (i*ACCORDION_DRAW_ASIDE_WIDTH);\r\n // if new margin is diffrent from div destination margin the animation is set \r\n if(g_slidedDivs[i].dest != newMargin)\r\n {\r\n // first we stop the old animation\r\n object.stop();\r\n // animation time\r\n var animTime = ACCORDION_SLIDE_TIME;\r\n // save new margin \r\n g_slidedDivs[i].dest = newMargin;\r\n // set new animation\r\n object.animate(\r\n {marginLeft: newMargin+\"px\"}, \r\n {duration: animTime, easing: ACCORDION_EASING_METHOD});\r\n }\r\n // go to next iteraction of loop\r\n continue;\r\n }\r\n // if div is hovered, we move it max to the left, the code is identical,\r\n // but is separated for future to add maybe some special actions\r\n if(index == i)\r\n {\r\n // calculate new margin\r\n var newMargin = (i*ACCORDION_DRAW_ASIDE_WIDTH);\r\n // if new margin is diffrent from div destination margin the animation is set \r\n if(g_slidedDivs[i].dest != newMargin) \r\n { \r\n // first we stop old animation\r\n object.stop();\r\n // animation time\r\n var animTime = ACCORDION_SLIDE_TIME;\r\n // save new margin \r\n g_slidedDivs[i].dest = newMargin;\r\n // set new animation\r\n object.animate(\r\n {marginLeft: newMargin+\"px\"}, \r\n {duration: animTime, easing: ACCORDION_EASING_METHOD});\r\n }\r\n // go to next iteraction of loop \r\n continue;\r\n }\r\n // if div lie on right we move it on right, we must calculate\r\n // margin from right border of accordion container \r\n if(i > index)\r\n {\r\n // calculate new margin \r\n var newMargin = (ACCORDION_WIDTH - ((g_slidedDivs.length - i) * ACCORDION_DRAW_ASIDE_WIDTH));\r\n // if new margin is diffrent from div destination margin the animation is set \r\n if(g_slidedDivs[i].dest != newMargin) \r\n { \r\n // first we stop old animation \r\n object.stop();\r\n // animation time \r\n var animTime = ACCORDION_SLIDE_TIME;\r\n // save new margin \r\n g_slidedDivs[i].dest = newMargin;\r\n // set new animation \r\n object.animate({\"marginLeft\": newMargin+\"px\"}, {duration: animTime,\r\n easing: ACCORDION_EASING_METHOD});\r\n }\r\n // go to next iteraction of loop \r\n continue;\r\n }\r\n }\r\n} // end of function setMoveForAccordionDivs ", "function slideRest(){\n cpCmndTOCVisible = false;\n cp.show(pauseID);\n stayMute(); \n }", "function plusSlides(n) {\n showSlides(slideIndex += n)\n}", "function plusDivs(n) {\n slideIndex = slideIndex + n;\n showImage();\n}", "function plusSlides(n) {\r\n const slides = document.querySelectorAll(\".locSlide\");\r\n slideIndex += n;\r\n if (slideIndex > slides.length) {slideIndex = 1}\r\n else if (slideIndex<1){slideIndex = slides.length}\r\n\r\n for (i = 0; i<slides.length; i++){\r\n slides[i].style.display = \"none\";\r\n }\r\n \r\n slides[slideIndex-1].style.display = \"block\";\r\n}", "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "function slideLeft(){\r\n\t\treset();\r\n\t\tsliderImages[current - 1].style.display = 'block';\r\n\t\tcurrent--;\r\n\t}", "function slideRest () {\n cpCmndTOCVisible = false;\n hidePlay();\n }", "function changeSlider(index) {\n sliderItems[currentSlider].classList.remove('active');\n sliderItems[index].classList.add('active');\n\n dots[currentSlider].classList.remove('active');\n dots[index].classList.add('active');\n currentSlider = index;// điều kiện này có thể thay thế cho currentSlider++;\n number.innerHTML = (index + 1).toString().padStart(2, '0');\n\n}", "function slidestuff() {\n\t\tvar n=$('#mycarousel li').length; // number of list items\n\t\tcurrentPosition+=1; // variable increments each time function is called\n\t\tif (currentPosition >=n ) \n\t\t\t{\n\t\t\tcurrentPosition=1;\n\t\t\t}\t\n\t\tSliderules.slideactions();\t\n\t\t}", "function showSlide(number) {\n if (storyLength <= 0)\n return;\n \n number = number % storyLength;\n\n if (number < 0)\n number += storyLength;\n\n slideNumber = number;\n\n storyFrame.src = storyList[number];\n newtabLink.href = storyList[number];\n slideDropdown.selectedIndex = number;\n}", "function paneSlide(){\n\tswitch (currentImg) {\n\n\n\tcase 1:\n\timgPane.style.left = \"-100%\";\n\tbreak;\n\n\tcase 2:\n\timgPane.style.left = \"-200%\";\n\tbreak;\n\n\tcase 3:\n\timgPane.style.left = \"-300%\";\n\tbreak;\n\n\tcase 4:\n\timgPane.style.left = \"-400%\";\n\tbreak;\n\n\tdefault:\n\timgPane.style.left = \"0\";\n\n\t};\n}", "function plusSlides(n) {\n previousIndex = slideIndex;\n showSlides(slideIndex += n);\n}", "function plusSlides(n) { // parameter holds slideIndex\n showSlides(slideIndex += n);\n} // end function", "function plusSlides(n){\r\n\t\tshowSlide(slideIndex += n);\r\n\t}", "function nextSlide() { showSlide(slideNumber + 1); }", "function showSlides(item_type, slideIndex) {\n var i;\n // var trend_items = document.getElementsByClassName(\"item-trending\");\n // console.log({\"item_type\": item_type});\n var trend_items = document.getElementsByClassName(item_type);\n\n // var trend_itemset = document.getElementsById(\"trending\");\n // var trend_items = trend_itemset.getElementsByClassName(\"movie_item\");\n for (i = 0; i < trend_items.length; i++) {\n var test = trend_items[i].innerText;\n // console.log({\"Current item\" : test})\n trend_items[i].style.display = \"none\"; \n }\n slideIndex++;\n\n //Repeat over-and-over\n if (slideIndex > trend_items.length) {slideIndex = 1}\n\n trend_items[slideIndex-1].style.display = \"block\";\n // setTimeout(showSlides, 2000); // Change image every 2 secs\n setTimeout(showSlides.bind(null, item_type, slideIndex), 5000);\n\n // trend_items[0].style.display = \"block\";\n}", "function nextSlides() {\n presetStyle()\n visuals[slideIndex].style.zIndex = '100'\n visuals[slideIndex].style.opacity = '1'\n dots[slideIndex].style.backgroundColor = 'black'\n\n if (slideIndex >= dots.length - 1) {\n slideIndex = 0\n } else {\n slideIndex++\n }\n}", "function update(){\r\n if(currentIndex === 0){\r\n $nav.find(\".prev\").hide();\r\n }else{\r\n $nav.find(\".prev\").show();\r\n }\r\n\r\n\r\n\r\n if(currentIndex === $slides.length - 1 ){\r\n $nav.find(\".next\").hide();\r\n }else{\r\n $nav.find(\".next\").show();\r\n }\r\n }", "function nextSlide() {\n \n}", "function positionSlides(slides){\nfor (let index=0; index<slides.length;index++){\nslides[index].style.left=slideWidth * index +\"px\";\n}\n\n}", "function plusSlides(n) {\n showSlides(slideIndex += n);\n}", "function changeSlide(){\r\n if(numberOfSlide > 4) {\r\n numberOfSlide = 1;\r\n } else if(numberOfSlide < 1) {\r\n numberOfSlide = 4;\r\n }\r\n\r\n var headingImage = \"<img src=\\\"img/piano\" + numberOfSlide + \".png\\\">\";\r\n\r\n document.querySelector(\".heading-image\").innerHTML = headingImage;\r\n document.querySelector(\".heading-text\").innerHTML = headingText[numberOfSlide - 1] + headingButtons;\r\n $('.heading-image').fadeIn(500);\r\n $('.heading-text').fadeIn(500);\r\n}", "function Initialize()\n{\n const Slides = document.querySelectorAll('.slides');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function showSlides(n) {\n var am;\n var anmeld = document.getElementsByClassName(\"anmeldelse\");\n var prikkerne = document.getElementsByClassName(\"prik\");\n if (n > anmeld.length) {\n anmeldIndex = 1\n }\n if (n < 1) {\n anmeldIndex = anmeld.length\n }\n for (am = 0; am < anmeld.length; am++) {\n anmeld[am].style.display = \"none\";\n }\n for (am = 0; am < prikkerne.length; am++) {\n prikkerne[am].className = prikkerne[am].className.replace(\"aktive\", \"\");\n }\n // display:none i CSS ændres til display: block\n anmeld[anmeldIndex - 1].style.display = \"block\";\n // Giver farve på prikkens respektive slide\n prikkerne[anmeldIndex - 1].className += \" aktive\";\n}", "function changeSlide() {\n var active = $(\".full-screen-slider img.active\");\n var next = active.next();\n if(next.length == 0) {\n next = $(\".full-screen-slider img:first\");\n }\n setTimeout(function() {\n fadeInSlide(next);\n }, 1);\n setTimeout(function() {\n fadeOutSlide(active, next);\n }, 1);\n }", "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n //clearInterval(interval);\r\n}", "function lower() {\n d.getElementById('slide').style.webkitTransition = \"all 0.6s ease\";\n d.getElementById('slide').style.MozTransition = \"all 0.6s ease\";\n d.getElementById('slide').style.top = '-10px';\n}", "changeSlides(change) {\n window.clearTimeout(this.changeTO);\n const { length } = this.slides;\n const prevSlide = this.state.activeSlide;\n let activeSlide = prevSlide + change;\n if (activeSlide < 0) activeSlide = length - 1;\n if (activeSlide >= length) activeSlide = 0;\n this.setState({ activeSlide, prevSlide });\n }", "function displaySlide() {\n slideImages[currentIndex].style.display = \"block\";\n}", "function showSlides(n) {\n let i;\n if (n > slides.length) {\n slideIndex = 1\n }\n if (n < 1) {\n slideIndex = slides.length\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n}" ]
[ "0.6626485", "0.6557228", "0.64963454", "0.64846665", "0.64678144", "0.6386141", "0.63850635", "0.63388145", "0.6335285", "0.6328688", "0.6326049", "0.6307592", "0.630215", "0.6261143", "0.62419695", "0.6231625", "0.6203001", "0.61942214", "0.61914074", "0.6166216", "0.6164943", "0.6140712", "0.61104906", "0.6104006", "0.6090068", "0.60812616", "0.6077906", "0.6054307", "0.6054269", "0.60510916", "0.60479474", "0.60422224", "0.60363066", "0.6029058", "0.60263807", "0.6022624", "0.6022624", "0.60224104", "0.60165644", "0.6009392", "0.5997258", "0.5993956", "0.5992605", "0.5988516", "0.598722", "0.59862995", "0.59795076", "0.5975955", "0.5973781", "0.5973046", "0.59723866", "0.5969268", "0.59653735", "0.59613293", "0.5956528", "0.5954653", "0.59528583", "0.5947876", "0.59366703", "0.59359974", "0.5930738", "0.59214294", "0.5916269", "0.5913866", "0.5911842", "0.59088016", "0.5907679", "0.5906399", "0.5890963", "0.5887088", "0.5884876", "0.58835113", "0.58805966", "0.58790076", "0.5878946", "0.5878946", "0.5874195", "0.58733743", "0.5870014", "0.58682686", "0.58617926", "0.5857474", "0.58558536", "0.5853845", "0.58504033", "0.58436245", "0.58418906", "0.584071", "0.58378077", "0.5826973", "0.58140105", "0.58061457", "0.57933044", "0.5793112", "0.57928836", "0.5788448", "0.57880574", "0.5782989", "0.5780862", "0.57743216", "0.5773796" ]
0.0
-1
Update the form controls each time the user interacts with them.
handleChange(e, { name, value }) { this.setState({ [name]: value }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n controls.update();\n stats.update();\n }", "updateControl(){\n this._control.update();\n }", "function update() {\n resize();\n controls.update();\n }", "function update() {\n\n\tupdateFocus();\n\tupdateFamilyTooltip();\n\tupdateHighlights();\n}", "function update_controls_UI() {\r\n\r\n if (!error_state) {\r\n //Update UI.\r\n $(\"#track_time_position\").text(ms_to_string(local_track.position));\r\n $(\"#track_position_slider\").val(local_track.position);\r\n }\r\n\r\n }", "update() {\r\n this.draw();\r\n inputChange();\r\n }", "function updateUI() {\n updatePlayerComponents(['points', 'teenagers', 'kettles', 'theaters', 'cps'])\n updatePriceComponents(['teenagers', 'kettles', 'theaters'])\n updateDoublePowerButton()\n}", "function update_fields() {\n const mods = get_mods();\n document.getElementById(\"od-field\").value = mods.ez ? beatmap_data.od * 0.5 : beatmap_data.od;\n document.getElementById(\"n-field\").value = beatmap_data.note_count;\n document.getElementById(\"stars-field\").value = (mods.dt ? beatmap_data.stars_dt : (mods.ht ? beatmap_data.stars_ht : beatmap_data.stars_nt)).toFixed(2);\n // refresh their styles\n document.getElementById(\"od-field\").dispatchEvent(new Event(\"blur\"));\n document.getElementById(\"n-field\").dispatchEvent(new Event(\"blur\"));\n document.getElementById(\"stars-field\").dispatchEvent(new Event(\"blur\"));\n}", "function updateUI(){\n\t\t\t\tExt.each(toggleFields, function(fieldName){\n\t\t\t\t\t//var el = form.findField(fieldName).getEl().up('div.x-form-item');\n\t\t\t\t\t//el.setVisibilityMode(Ext.Element.DISPLAY).setVisible(rec.data['has_' + fieldName] == '1');\n\t\t\t\t\tform.findField(fieldName).setVisible(rec.data['has_' + fieldName] == '1');\n\t\t\t\t});\n\t\t\t\t// because imagePreview_image_id is not a formField but a button, we cannot find it with form.findField():\n\t\t\t\t[''].concat(LANGUAGES).forEach(function(lang) {\n\t\t\t\t\tvar key = 'ImagePreview_image_id' + (lang ? '_' + lang : '');\n\t\t\t\t\tif (formPanel[key]) {\n\t\t\t\t\t\tformPanel[key].setVisible(rec.data.has_image == 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (typeof rec.data.variables !== 'undefined' && form.findField('variables')) {\n\t\t\t\t\tform.findField('variables').setVisible(rec.data.variables && rec.data.variables.length);\n\t\t\t\t}\n\t\t\t}", "function onChange() {\n\n // hide and show input elements for which this is necessary\n setVisibility();\n\n // update preview considering the changed input value\n updatePreview();\n\n // perform change actions\n self.onchange && self.onchange( self );\n\n }", "function onChange() {\n\n // hide and show input elements for which this is necessary\n setVisibility();\n\n // update preview considering the changed input value\n updatePreview();\n\n // perform change actions\n self.onchange && self.onchange( self );\n\n }", "onComponentShow() {\n this.subcomponents.form.updateValues();\n }", "formChanged() {}", "function update() {\n type = textInput.value();\n shapeWidth = shapeSlider.value();\n density = densitySlider.value();\n shapeOpacity = opacitySlider.value();\n let size = fontSizeOptions.value();\n fontSize = int(size);\n fontStyle = fontStyleOptions.value();\n shape = radioShape.value();\n fillInitially = radioFill.value();\n shake = shakeCheckBox.checked();\n move = moveCheckBox.checked();\n colourInitially = radioColour.value();\n\n setUpText();\n}", "updateUI(){\n this.GUI.updateUI();\n }", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 5;\n this.$step.parentElement.hidden = this.currentStep >= 5;\n\n // TODO: get data from inputs and show them in summary\n }", "function updateInputs() {\r\n Inputang.setAttribute('value', Inputang.value);\r\n Inputvel.setAttribute('value', Inputvel.value);\r\n }", "function updateAll() {\n\t\n\t// Class view\n\t//updateVid();\n\t\n\t//updateClassChart();\n\tshowClassChart();\n\tupdateClassDataBackgroundLabel();\n\tupdateText();\n\tupdateButtonHighlights();\n\t\n\tupdateScrollCommand();\n\t// Focus view\n\t//focusp1=initfocusp1;\n\t//focusp2=initfocusp2;\n\tupdateFocus();\n\t\n\t// Context view\n\tupdateContext();\n\n}", "updateForm() {\n this.$step.innerText = this.currentStep;\n if (this.currentStep < 2) this.$prev.forEach(el => el.classList.add(\"hidden\"));\n if (this.currentStep === 2) this.$prev.forEach(el => el.classList.remove(\"hidden\"));\n if (this.currentStep > 4) this.$next.forEach(el => el.classList.add(\"hidden\"));\n if (this.currentStep === 4) this.$next.forEach(el => el.classList.remove(\"hidden\"));\n if (this.currentStep === 5) {\n this.updateSummary();\n this.$stepCounter.classList.add(\"hidden\");\n this.$agreeBtn.classList.remove(\"hidden\");\n\n }\n if (this.currentStep < 5) {\n this.$stepCounter.classList.remove(\"hidden\");\n this.$agreeBtn.classList.add(\"hidden\");\n }\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n }", "writeAfterUpdate() {\n\t\tthis.setFocus();\n\t}", "writeAfterUpdate() {\n\t\tthis.setFocus();\n\t}", "function updateDisplayedValues() {\n displayNameField.text(displayNameVal);\n emailField.text(emailVal);\n phoneField.text(phoneVal);\n zipcodeField.text(zipcodeVal);\n }", "updateForm() {\n this.$step.innerText = this.currentStep;\n\n // TODO: Validation\n\n this.slides.forEach(slide => {\n slide.classList.remove(\"active\");\n\n if (slide.dataset.step == this.currentStep) {\n slide.classList.add(\"active\");\n }\n });\n\n this.$stepInstructions[0].parentElement.parentElement.hidden = this.currentStep >= 6;\n this.$step.parentElement.hidden = this.currentStep >= 6;\n\n // TODO: get data from inputs and show them in summary\n }", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "update() {\n this._checkEvents();\n }", "function _update() {\r\n this.component[this.prop] = this.control[this.prop];\r\n }", "function updateControls(){\n controls.number_of_rooms = NUMBER_OF_ROOMS;\n controls.epsilon = EPSILON;\n controls.beta = BETA;\n controls.beta_start = BETA_START;\n controls.beta_limit = BETA_LIMIT;\n controls.door_size = DOOR_SIZE;\n controls.ka = KA;\n controls.kd = KD;\n controls.ks = KS;\n controls.kr = KR;\n controls.ko = KO;\n controls.kt = KT;\n var elem = document.getElementById('pause');\n elem.innerHTML = grid.paused ? \"Continue\" : \"Pause\";\n}", "function setChanged (){\n\tformModified = true;\n}", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function NumRecButtons_updateUI(whichControl) \r\n{\r\n \r\n var textFieldObj = this.textFieldObj;\r\n \r\n if (whichControl == \"allButton\")\r\n {\r\n textFieldObj.setAttribute(\"disabled\",\"true\");\r\n }\r\n else if (whichControl == \"countButton\")\r\n {\r\n textFieldObj.setAttribute(\"disabled\",\"false\");\r\n }\r\n else if (whichControl == \"numRecField\")\r\n {\r\n this.numRecs = this.textFieldObj.value;\r\n }\r\n}", "function updateUi(acc) {\n // ======= Display Movements ===============\n displayMovement(acc);\n\n // =========== Display Balance ==============\n displayBalance(acc);\n\n // ============== Display Summery ===============\n displaySummery(acc);\n\n // ===========Reseting inputs==================\n inputLoginPin.value = inputLoginUsername.value = \"\";\n}", "function guiLoop() {\n updateCustomButtons();\n}", "function updateFieldLabel (event) {\n lib.updateActiveFieldLabel(this.value);\n }", "update(){\n this.cameraControl.update();\n \n // Need to poll for gamepads. Because Chrome.\n this.checkGamepads();\n \n for (var j in this.controllers) {\n if(!(j in this.gpBtnCallbacks)){\n continue;\n }\n var controller = this.controllers[j];\n for (var i=0; i<controller.buttons.length; i++) {\n var val = controller.buttons[i];\n var pressed = val == 1.0;\n if (typeof(val) == \"object\") {\n pressed = val.pressed;\n val = val.value;\n }\n if(pressed && this.gpBtnCallbacks[j][i] !== undefined){\n this.gpBtnCallbacks[j][i](val, this.prevButtons[j][i]);\n }\n this.prevButtons[j][i] = pressed;\n }\n\n for (i = 0; i<controller.axes.length; i++) {\n var val = controller.axes[i];\n if(this.gpAxisCallbacks[j] !== undefined && this.gpAxisCallbacks[j][i] !== undefined){\n this.gpAxisCallbacks[j][i](val);\n }\n }\n }\n }", "function animate() {\n requestAnimationFrame( animate );\n controls.update();\n render();\n }", "function update() {\n ticking = false;\n for (var i = inViewEls.length; i--;) {\n inViewEls[i].update();\n }\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "function handleControls() {\n var hide = window.searchResultSlider.getSlideCount() <= config.slides;\n\n $(\".searchResults .sliderControls\").toggleClass(\"hidden\", hide);\n\n //Hide pager and refresh\n config.pager = !hide;\n window.searchResultSlider.reloadSlider(config);\n }", "updateInputs() {\n for (let [key, value] of Object.entries(this.settings)) {\n if (typeof value !== 'object')\n $(`[name=${key}]`)\n .val(this.settings[key])\n else {\n const elm = $(`.key-input[data-setting=${key}]`)\n elm.toggleClass('focused', this.editingBind === key)\n elm.find('.label')\n .html(formatAction(value))\n }\n }\n localStorage['settings'] = JSON.stringify(this.settings)\n this.updateTimeSlider()\n }", "function updateAll(){refreshSliderDimensions();ngModelRender();}", "function enableAllControls() {\n enableKeyPress();\n enableMouseMove();\n enableMouseClick();\n enableKeyRelease();\n enableMouseRelease();\n }", "function update() {\n // Get active pad.\n var activePad = getActivePad();\n\n // If any active do nothing.\n if (!activePad) {\n return;\n }\n\n handleJoysticks(activePad);\n handleArrows(activePad);\n handleShapes(activePad);\n handleSpecial(activePad);\n handleExtras(activePad);\n\n // Run as quick as browser can.\n // window.requestAnimationFrame(update, document.body);\n // window.requestAnimationFrame(update);\n }", "function updateControl(input) {\n console.log(`Update control to ${input}`);\n document.querySelector(\"#control\").innerText = input;\n}", "function updateControlsStatus () {\n if (!controls || rewind || loop) { return; }\n\n var prevDisabled = (prevIsButton) ? prevButton.disabled : isAriaDisabled(prevButton),\n nextDisabled = (nextIsButton) ? nextButton.disabled : isAriaDisabled(nextButton),\n disablePrev = (index <= indexMin) ? true : false,\n disableNext = (!rewind && index >= indexMax) ? true : false;\n\n if (disablePrev && !prevDisabled) {\n disEnableElement(prevIsButton, prevButton, true);\n }\n if (!disablePrev && prevDisabled) {\n disEnableElement(prevIsButton, prevButton, false);\n }\n if (disableNext && !nextDisabled) {\n disEnableElement(nextIsButton, nextButton, true);\n }\n if (!disableNext && nextDisabled) {\n disEnableElement(nextIsButton, nextButton, false);\n }\n }", "function refreshGui() {\n gui.__controllers.forEach(controller => controller.setValue(controller.initialValue));\n }", "function redrawControls () {\n requestAnimationFrame(function () {\n var final_value = 'translateY(' + controls_transform.y + 'px)';\n\n // Set position.\n controls.style.webkitTransform = final_value;\n controls.style.transform = final_value;\n\n // release frame\n controls_transform.ticking = false;\n });\n}", "function updateGUI () {\r\n // First slide\r\n if ( presentSlideNumber == 1 ){\r\n $('.leftButton').prop('disabled', true);\r\n\r\n // We are somewhere in the middle\r\n } else if ( presentSlideNumber > 1 && presentSlideNumber < slidesSize ){\r\n $('.leftButton').add('.rightButton').prop('disabled', false);\r\n\r\n // Last slide\r\n } else if ( presentSlideNumber == slidesSize ){\r\n // We have more then one slide, so we can go back to one\r\n // and move forward to pop sharing div\r\n $('.leftButton').add('.rightButton').prop('disabled', false);\r\n\r\n // We shouldn't get here, but if we do enable control\r\n } else {\r\n $('.leftButton').add('.rightButton').prop('disabled', false);\r\n }\r\n\r\n }", "function onUpdateReady() {\n ctrl.updateAvailable(true);\n m.redraw();\n }", "updateView() {\n const isLoggedIn = login.isLoggedIn();\n\n // If we're not logged in we disable this control\n if(!isLoggedIn) {\n this.searchBox.disabled = true;\n this.searchButton.disabled = true;\n this.results.innerHTML = \"\";\n\n return;\n }\n\n // If we are logged in we enable this control\n this.searchButton.disabled = false;\n this.searchBox.disabled = false;\n }", "function updateUI() {\n if (recorderReady && recognizerReady) startBtn.disabled = stopBtn.disabled = false;\n }", "function updateFocus() {\n\t// Draw the orders: a line and a label (show when there is room)\t\n\tfocusOrders();\n\t\n\t// Draw the families: a rect, a line, and a label (show when there is room)\n\tfocusFamilies();\n\t\n\t// Draw rectangles for each visible species in the focus view\n\tfocusSpecies();\n\t\n\n\t\t\n\t\t\n}", "function enableControls() {\r\n\tvar currentTab = tabs.getActiveTab();\r\n\tcurrentTab.getComponent(currentTab.title + 'inputField').enable();\r\n var btns = currentTab.getComponent(currentTab.title +'btns');\r\n btns.buttons[1].enable();\r\n btns.buttons[0].enable();\r\n}", "function refreshFormState() {\n refreshPlaceholderState();\n refreshSubmitButtonState();\n}", "_renderControls() {\n this._cardsContainer.append(this._prevController);\n this._cardsContainer.append(this._nextController);\n }", "function updateDevices() {\n // TODO controls: get values of all controls of the form and call updateDevice on each device\n for(i in devices){\n var value;\n switch(devices[i].type){\n case \"item-generator\":\n var x = document.getElementById(\"control-item-generator\");\n value = x.options[x.selectedIndex].value;\n devices[i].updateDevice(value);\n break;\n case \"conveyor\":\n value = document.getElementById(\"control-conveyor\").checked;\n break;\n case \"intelligent-conveyor\":\n value = document.getElementById(\"control-intelligent-conveyor\").checked;\n break;\n default:\n value = document.getElementById(\"control-\"+ devices[i].type).value;\n break;\n }\n devices[i].updateDevice(value);\n }\n }", "function updateControls() {\n\n if (config.controls && dom.controls) {\n\n var routes = availableRoutes();\n var fragments = availableFragments();\n\n // Remove the 'enabled' class from all directions\n dom.controlsLeft.concat(dom.controlsRight)\n .concat(dom.controlsUp)\n .concat(dom.controlsDown)\n .concat(dom.controlsPrev)\n .concat(dom.controlsNext).forEach(function (node) {\n node.classList.remove('enabled');\n node.classList.remove('fragmented');\n });\n\n // Add the 'enabled' class to the available routes\n if (routes.left) dom.controlsLeft.forEach(function (el) {\n el.classList.add('enabled');\n });\n if (routes.right) dom.controlsRight.forEach(function (el) {\n el.classList.add('enabled');\n });\n if (routes.up) dom.controlsUp.forEach(function (el) {\n el.classList.add('enabled');\n });\n if (routes.down) dom.controlsDown.forEach(function (el) {\n el.classList.add('enabled');\n });\n\n // Prev/next buttons\n if (routes.left || routes.up) dom.controlsPrev.forEach(function (el) {\n el.classList.add('enabled');\n });\n if (routes.right || routes.down) dom.controlsNext.forEach(function (el) {\n el.classList.add('enabled');\n });\n\n // Highlight fragment directions\n if (currentSlide) {\n\n // Always apply fragment decorator to prev/next buttons\n if (fragments.prev) dom.controlsPrev.forEach(function (el) {\n el.classList.add('fragmented', 'enabled');\n });\n if (fragments.next) dom.controlsNext.forEach(function (el) {\n el.classList.add('fragmented', 'enabled');\n });\n\n // Apply fragment decorators to directional buttons based on\n // what slide axis they are in\n if (isVerticalSlide(currentSlide)) {\n if (fragments.prev) dom.controlsUp.forEach(function (el) {\n el.classList.add('fragmented', 'enabled');\n });\n if (fragments.next) dom.controlsDown.forEach(function (el) {\n el.classList.add('fragmented', 'enabled');\n });\n }\n else {\n if (fragments.prev) dom.controlsLeft.forEach(function (el) {\n el.classList.add('fragmented', 'enabled');\n });\n if (fragments.next) dom.controlsRight.forEach(function (el) {\n el.classList.add('fragmented', 'enabled');\n });\n }\n }\n\n }\n\n }", "function animationLoop(){\n requestAnimationFrame(animationLoop);\n controls.update();\n}", "function update() {\n update_group();\n update_center();\n}", "function update_shown_Values(){\r\n document.getElementById(\"spfVal\").innerHTML = document.getElementById(\"spf_slider\").value;\r\n document.getElementById(\"tzVal\").innerHTML = document.getElementById(\"tz_slider\").value;\r\n document.getElementById(\"blVal\").innerHTML = document.getElementById(\"bl_slider\").value;\r\n document.getElementById(\"oriVal\").innerHTML = document.getElementById(\"origin_slider\").value;\r\n document.getElementById(\"apiVal\").innerHTML = document.getElementById(\"api_slider\").value;\r\n document.getElementById(\"neededScore\").innerHTML = document.getElementById(\"needed_score_slider\").value;\r\n}", "_revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }", "_revalidate() {\n if (this._startInput) {\n this._startInput._validatorOnChange();\n }\n if (this._endInput) {\n this._endInput._validatorOnChange();\n }\n }", "function updateDisplay(controlType, ctlNo) {\n if (controlType == controlEnum.gate) {\n\n // specific note picker\n var gateShow = document.getElementById(\"gType\" + ctlNo).value == gateEnum.specificNote ? \"block\" : \"none\";\n var gateControls = document.getElementById(\"gateCtl\" + ctlNo).getElementsByClassName(\"gateControl\");\n for (var i = 0; i < gateControls.length; i++) {\n gateControls[i].style.display = gateShow;\n }\n\n // channel picker\n var channelShow = document.getElementById(\"gType\" + ctlNo).value != gateEnum.clock ? \"block\" : \"none\";\n var channelControls = document.getElementById(\"gateCtl\" + ctlNo).getElementsByClassName(\"channelControl\");\n for (var i = 0; i < gateControls.length; i++) {\n channelControls[i].style.display = channelShow;\n }\n } else {\n // controller picker\n var controllerShow = document.getElementById(\"cType\" + ctlNo).value == cvEnum.controller ? \"block\" : \"none\";\n var controllerControls = document.getElementById(\"cvCtl\" + ctlNo).getElementsByClassName(\"controllerControl\");\n for (var i = 0; i < controllerControls.length; i++) {\n controllerControls[i].style.display = controllerShow;\n }\n\n }\n}", "function update() {\n getCurrentUIValues();\n calculateMonthlyPayment(UIValues);\n updateMonthly();\n}", "function StatesOfControls() {\n var self = this;\n\n var input = document.querySelectorAll([\n '.o-pltz-text-input',\n '.o-pltz-textarea'\n ]);\n\n self.init = function() {\n if(input) {\n var inputsArr = Array.prototype.slice.call(input);\n\n inputsArr.forEach(\n function(el) {\n var formGroup = el.parentNode;\n\n var isEmpty = function() {\n if(el.value.length === 0) {\n formGroup.classList.add('is-empty');\n }\n else {\n formGroup.classList.remove('is-empty');\n }\n };\n\n var isFocused = function() {\n isEmpty();\n\n formGroup.classList.add('is-focused');\n };\n\n var isBlured = function() {\n isEmpty();\n\n formGroup.classList.remove('is-focused');\n };\n\n isEmpty();\n el.addEventListener('focus', isFocused);\n el.addEventListener('blur', isBlured);\n }\n );\n }\n };\n\n\n}", "function updateDisplay() {\n\tshowValue(\".next-value\", nextValue);\n\tshowValue(\".held-value\", heldValue);\n}", "updateUI () {\n this.updateBorderRadius()\n this.updateBox()\n }", "function updateControlPanel() {\n let btn;\n console.log(\"updating control panel, stage:\", gameStage);\n switch (gameStage) {\n case \"pre-game\":\n btn = startButton;\n break;\n case \"in-game\":\n return;\n case \"results\":\n if (players.every((player) => player.guessed)) {\n waitingButton.style.display = \"none\";\n btn = continueButton;\n } else {\n continueButton.style.display = \"none\";\n btn = waitingButton;\n }\n break;\n case \"final-results\":\n if (players.every((player) => player.guessed)) {\n waitingButton.style.display = \"none\";\n btn = revealButton;\n } else {\n continueButton.style.display = \"none\";\n btn = waitingButton;\n }\n break;\n }\n if (!currentPlayer.leader) {\n startContainer.style.display = \"none\";\n if (btn) {\n btn.style.display = \"none\";\n }\n } else if (gameStage !== \"ads\") {\n startContainer.style.display = \"flex\";\n if (btn) {\n btn.style.display = \"unset\";\n }\n }\n}", "function UpdateGUI()\n{\n\t//Go through all structure buttons (the buttons in the build panel), and set them to \"off\"\n\tfor(var theBtnGraphic : UISlicedSprite in buildBtnGraphics)\n\t{\n\t\ttheBtnGraphic.color = offColor;\n\t}\n\t//set the selected build button to \"on\"\n\tbuildBtnGraphics[structureIndex].color = onColor;\n\t\n\twaveText.text = \"Wave: \"+waveLevel;\n\tscoreText.text = \"Score: \"+scoreCount;\n\thealthText.text = \"Shields: \"+healthCount;\n\tcashText.text = \"Cash: \"+cashCount;\n\t\n\tCheckTurretCosts();\n}", "updateUI() {\n document.getElementById(\"health\").innerHTML = this.currPlayerHealth;\n document.getElementById(\"food\").innerHTML = this.playerFood;\n document.getElementById(\"turn\").innerHTML = this.turnNum;\n document.getElementById(\"lvl\").innerHTML = this.currentLevel;\n document.getElementById(\"scr\").innerHTML = this.playerScore;\n\n }", "function updateViews(event) {\n manageContentObjectsByState(event.currentState);\n fillElements(event.currentState);\n setNavigationButtonsDisabledState(event.currentState);\n resetViews();\n }", "function update() {\n updateBodyCostDisplay();\n updateAddedComponentDisplay();\n updateBodyStringDisplay();\n updateComponentCountDisplay();\n updateComponentCountTable();\n updateProgressBar();\n }", "updateUI(){\n document.getElementById(\"theWord\").innerHTML = this._constructDisplayWord();\n document.getElementById(\"guessdLetter\").innerHTML = this._guessedLetter.toString().replace(/,/g, ' ');;\n document.getElementById(\"lives\").innerHTML = this._lives;\n document.getElementById(\"wins\").innerHTML = this._wins;\n }", "function connexionInscriptionFormControl(){\n\tpreInscripionGood();\n\tmdpControl();\n\tnickNameControl();\n\temailControl();\n}", "componentDidUpdate() {\n Materialize.updateTextFields()\n }", "function StatesOfControls() {\n var self = this;\n\n var input = document.querySelectorAll([\n '.js-text-input'\n ]);\n\n self.init = function() {\n if (input) {\n Array.prototype.slice.call(input).forEach(\n function(el) {\n var formGroup = el.parentNode;\n\n var isEmpty = function() {\n if (el.value.length === 0) {\n formGroup.classList.add('is-empty');\n } else {\n formGroup.classList.remove('is-empty');\n }\n };\n\n var isFocused = function() {\n isEmpty();\n\n formGroup.classList.add('is-focused');\n };\n\n var isBlured = function() {\n isEmpty();\n\n formGroup.classList.remove('is-focused');\n };\n\n isEmpty();\n el.addEventListener('focus', isFocused);\n el.addEventListener('blur', isBlured);\n }\n );\n }\n };\n\n\n }", "static updateUI() {\n\t\tUI.updateTemp();\n UI.updatePrecip();\n UI.updateIcons();\n Initialize.setDate();\n /* Weather.getWeather(); */\n document.querySelector(\".location\").innerText = city;\n }", "function updateUI () {\n $(\".wins\").text(wins);\n $(\".losses\").text(losses);\n $(\".score-report\").text(totalScore);\n }", "updateDisplay() {\n this.d1.value = this.twoDigitNum(this.app.t1);\n this.d2.value = this.twoDigitNum(this.app.t2);\n this.d3.value = this.twoDigitNum(this.app.t3);\n }", "function refresh(){\n toggleVisibility(\"information\", \"menu\");\n document.getElementById(\"userText\").value = \"\";\n document.getElementById(\"result\").value = \"Aquí se mostrará el resultado\";\n document.getElementById(\"offset\").value = 25;\n}", "update() {\n this.nameText.text = 'Submit Name to Leaderboard:\\n ' + this.userName + '\\n(Submits on New Game)';\n\n }", "function setControlValues() {\n document.getElementById('highlight1').value = Common.Settings.Highlight1;\n document.getElementById('highlight2').value = Common.Settings.Highlight2;\n document.getElementById('highlight3').value = Common.Settings.Highlight3;\n setOption(document.getElementById('menuState'), Common.Settings.Menu);\n setOption(document.getElementById('zoom'), Common.Settings.Zoom);\n setOption(document.getElementById('theme'), Common.Settings.Theme);\n}", "_setInputs(){\n\t\tthis.inputs = this.querySelectorAll(`input[name='${this.cName}'], select[name='${this.cName}'], textarea[name='${this.cName}']`);\n\t\tthis._setOnChanges();\n\t}", "function updateUI(whatChanged)\r\n{\r\n switch (whatChanged)\r\n {\r\n\r\n case \"masterFieldsLength\":\r\n var masterFieldsArr = _MasterPageFields.getValue();\r\n var linkFieldsArr = _LinkField.listControl.list;\r\n\r\n if (masterFieldsArr.length != linkFieldsArr.length)\r\n {\r\n _LinkField.listControl.setAll(masterFieldsArr,masterFieldsArr);\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n}", "_drawUi() {\n\t\tthis.elementReplyForm.reset()\n\t\tthis.elementEditForm.reset()\n\t\tif(this.commentJSON.removed)\n\t\t\tthis._drawRemoved()\n\t\telse if(getToken())\n\t\t\tthis._drawUiAuthenticated()\n\t\telse\n\t\t\tthis._drawUiAnonymous()\n\t}", "function toChangeValues(){\n currentClefIndex = 0;\n currentSyllableIndex = 0;\n currentNeumeIndex = 0;\n currentNeumeVariationIndex = 0;\n currentNeumeInVariationIndex = 0;\n currentPitchIndex = 0;\n currentVarPitchIndex = 0;\n currentVarSourceIndex = 0;\n \n document.getElementById(\"input\").innerHTML = changeValueForm();\n}", "function updateField(event) {\n const val = event.target.value;\n changeAct(val);\n }", "function resetControls() {\n controls.reset();\n if (!animating) {\n render();\n }\n}", "setupControls() {\n [\"shape\", \"rows\", \"cols\", \"bombs\"].forEach((i) => {\n this.controls[i].addEventListener(\"change\", this.setupBoard.bind(this));\n });\n this.controls.outcome.hidden = true;\n }", "bind() {\n this.updateUI();\n }", "function resetControls() {\n $(\"#function\").val(defCtrlState.hashFunct);\n $(\"#collision\").val(defCtrlState.collision);\n $(\"#tablesize\").val(defCtrlState.tableSize);\n $(\"#keyrange\").val(defCtrlState.keyrange);\n $(\"#M\").val(defCtrlState.m);\n if (defCtrlState.m === '') {\n $('#mValue').hide();\n }\n setFunction();\n\n // Clear input textbox and disable next button\n $(\"#input\").val(\"\");\n $('#next').attr(\"disabled\", \"disabled\");\n }", "function update () {\n\t\t\t$(\".wins\").html(\"Wins: \" + wins); // displays wins to page\n\t\t\t$(\".losses\").html(\"Losses: \" + losses); // displays losses to page\n\t\t}", "update() {\n const state = this.store.getState();\n\n if (this.isPresenting !== state.webvr.isPresenting) {\n this.vrEffect.setFullScreen(state.webvr.isPresenting);\n this.isPresenting = state.webvr.isPresenting;\n }\n\n if (this.isPresenting) {\n this.vrControls.update();\n } else {\n const dt = (state.app.timestamp - this.timestamp) || 0;\n this.timestamp = state.app.timestamp;\n\n this.flyControls.update(dt);\n }\n\n // update all components with their state\n const componentState = this.select(state);\n Object.keys(this.components)\n .forEach(id => this.components[id].update(componentState[id]));\n }", "function updateDisplay () {\n\n showValue('.held-value',heldValue);\n showValue('.next-Value',nextValue);\n}", "function updateUI(){\n currentEvent = $(\"#cEvent\").text().trim();\n console.log(\"Current Event: \" + currentEvent);\n toggleButtons(currentEvent);\n switch (currentEvent) {\n case \"none\":\n break;\n\n case \"open\":\n break;\n\n case \"start\":\n myTimer.isReloading = true;\n myTimer.startTimer();\n break;\n\n case \"freetime\":\n myTimer.isReloading = true;\n myTimer.startTimer();\n break;\n\n case \"freezeLeaderboard\":\n myTimer.isReloading = true;\n myTimer.startTimer();\n break;\n\n case \"stop\":\n myTimer.displayElapsedTime();\n break;\n\n case \"close\":\n myTimer.displayElapsedTime();\n break;\n }\n}", "function updateOnscreenVariables() {\n $('.input').html(input);\n $('.calculation').html(calculation);\n $('.onscreen').html(onscreen);\n $('.active').html(active);\n $('.operatorActive').html(operatorActive);\n $('.activeOperator').html(activeOperator);\n $('.decimalActive').html(decimalActive);\n $('.decimalPoints').html(decimalPoints);\n $('.digitPoints').html(digitPoints);\n $('.clearText').html(clearText);\n}", "function updateAll() {\n validate();\n calculate();\n updateDose();\n DrawDose();\n}", "update() {\n\n //Update the drag and drop system\n if (this.draggableSprites.length !== 0) this.updateDragAndDrop(this.draggableSprites);\n\n //Update the buttons and button-like interactive sprites\n if (this.buttons.length !== 0) this.updateButtons();\n }", "function updateInputFields() {\n let results = getResults();\n for (let i = 0; i < inputs.length; i++) {\n if (!inputs[i].locked) {\n inputs[i].value = results[i];\n document.getElementById(\"input\" + i).value = results[i];\n }\n }\n sumBonus();\n total();\n}", "function resetForm() {\n document.getElementById(\"age\").value = 0;\n document.getElementById(\"feet\").value = 0;\n document.getElementById(\"inches\").value = 0;\n document.getElementById(\"stones\").value = 0;\n document.getElementById(\"pounds\").value = 0;\n document.getElementById(\"cm\").value = 0;\n document.getElementById(\"kilos\").value = 0;\n createEventListeners();\n showImperial();\n}" ]
[ "0.6893606", "0.68622506", "0.6752346", "0.6496982", "0.64865994", "0.6481366", "0.63915396", "0.62272984", "0.6135622", "0.6135067", "0.6135067", "0.6086767", "0.6028141", "0.5995277", "0.599338", "0.5988231", "0.59881186", "0.59581953", "0.5920385", "0.5911577", "0.5911577", "0.591046", "0.590506", "0.5883385", "0.5874728", "0.5873722", "0.5837152", "0.58099824", "0.5809867", "0.5809867", "0.5809867", "0.57975143", "0.5783223", "0.578285", "0.57611746", "0.5752644", "0.5724072", "0.5720646", "0.5718806", "0.5700624", "0.5690494", "0.5669198", "0.5667167", "0.56613064", "0.56512076", "0.5640965", "0.5639784", "0.56303394", "0.5607551", "0.5600024", "0.5576121", "0.5565977", "0.55646443", "0.5556644", "0.5551065", "0.55436915", "0.55434597", "0.5540354", "0.5527699", "0.5507593", "0.5504135", "0.54995203", "0.54995203", "0.54793996", "0.5453502", "0.5445499", "0.5440787", "0.5436252", "0.54206604", "0.5420536", "0.54188985", "0.5417317", "0.54148453", "0.5413749", "0.54078156", "0.54040855", "0.5389981", "0.53881454", "0.53870755", "0.5386536", "0.5385676", "0.5376478", "0.5359571", "0.53564924", "0.5351989", "0.53491247", "0.5343616", "0.5341861", "0.53295696", "0.53197885", "0.5316107", "0.53154206", "0.53134024", "0.53124505", "0.53115207", "0.5310471", "0.53102285", "0.5305819", "0.530556", "0.530509", "0.53050333" ]
0.0
-1
Handle Signup submission using Meteor's account mechanism.
handleSubmit() { const { email, password } = this.state; Accounts.createUser({ email, username: email, password }, (err) => { if (err) { this.setState({ error: err.reason }); } else { this.setState({ signed: true }); this.props.history.push('/addprofile'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSignUp() {\n \n if (email.length < 4 || password.length < 4) {\n setFeedback({color: 'red', message: 'Mailadress/lösenord måste innehålla mer än 4 tecken.'})\n return\n }\n \n // Sign in with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(value) {\n \n setFeedback({color: 'green', message: \"Skapade ett konto för \" + email})\n create_db_user_doc()\n \n }).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code\n \n if (errorCode === 'auth/email-already-in-use')\n setFeedback({color: 'red', message: 'Ett konto med denna email finns redan.'})\n else if (errorCode === 'auth/weak-password')\n setFeedback({color: 'red', message: 'Lösenordet är för svagt.'})\n })\n }", "handleSignUp() {\n\n // Create a new user and save their information, THEN\n // - Update the display name of the user\n\n // - Return promise for chaining, THEN\n // - Set the state as the current (firebase) user\n\n }", "signUp(email, password, handle, avatar) {\n /* Create a new user and save their information */\n\n }", "function handleSignup(email, password) {\n // Check if the email exists\n\n // Save the user to the database\n db.saveUser({email, password}); // simple user object\n\n // Send the welcome email\n}", "signup() {\n\t\tconst URIs = AccountRouter.getURIs();\n\t\tthis.router.post(URIs.signup, (request, response) => {\n\t\t\tconst username = request.body.username,\n\t\t\t\t\t\tpassword = request.body.password;\n\n\t\t\t// Preventing send request to firebase, if you information is not valid.\n\t\t\tif (!username || !password) {\n\t\t\t\treturn response.json(AccountRouter.getSignedError('no username or password'));\n\t\t\t}\n\n\t\t\t// Try to login user in firebase.\n\t\t\tthis.users.child(username).once('value', (snapshot) => {\n\t\t\t\tif (snapshot.exists()) {\n\t\t\t\t\treturn response.json(AccountRouter.getSignedError('username already in use'));\n\t\t\t\t}\n\n\t\t\t\tconst userObject = {\n\t\t\t\t\t'username': username,\n\t\t\t\t\t'passwordHash': AccountRouter.hash(password)\n\t\t\t\t};\n\n\t\t\t\t// Add a new user to Firebase collection.\n\t\t\t\tthis.users.child(username).set(userObject);\n\n\t\t\t\trequest.session.user = userObject;\n\n\t\t\t\tresponse.json(AccountRouter.createUserSignObject(userObject));\n\t\t\t});\n\t\t});\n\t}", "async function onSignup(e) {\n if(!isEqual()) return;\n if(!hasSixUniqueChars()) return;\n await submitUserDetails('auth/signup').then(\n result => processResult(result)).catch(err => {\n console.log(err); e.preventDefault()})\n redirectToChat() ||\n redirect(`${HOME}`);\n}", "async function signup(evt) {\n evt.preventDefault();\n try {\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n currentUser = await User.signup(username, password);\n favTeam = await User.getPrefs(currentUser.userId);\n\n $signupForm.trigger(\"reset\");\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n } catch (err) {\n console.log(err.response.data.message);\n if (err.response.data.message == \"taken\") {\n $message.show();\n $message.text(\"That username is already taken\");\n } else {\n $message.show();\n $hint.show();\n $message.text(\"That username/password is invalid.\");\n }\n }\n}", "async function signup(evt) {\n try {\n console.debug('signup', evt);\n evt.preventDefault();\n\n const name = $('#signup-name').val();\n const username = $('#signup-username').val();\n const password = $('#signup-password').val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n currentUser = await User.signup(username, password, name);\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n\n $signupForm.trigger('reset');\n } catch (e) {\n if (e.response.status === 409) {\n $signupForm.trigger('reset');\n alert('Username has already been taken');\n }\n }\n}", "submitSignup({ Meteor, Store, Bert }, props) {\n const { dispatch } = Store;\n const { email, passwordCreate, firstName, lastName, token = null, role = 'user' } = props;\n\n // Change state to signup request\n dispatch(signupRequest());\n\n const user = {\n email,\n password: passwordCreate,\n profile: {\n name: {\n first: firstName,\n last: lastName,\n },\n },\n roles: [role], // TODO change role to roles array\n token,\n };\n\n Meteor.call(\n 'user.add',\n user, (error, response) => {\n if (error) {\n Bert.alert(error.reason, 'danger');\n // Change state to signup error\n dispatch(signupError());\n } else {\n // Change state to successful login\n dispatch(signupSuccess(response));\n\n // Announce success\n Bert.alert(`Welcome ${firstName}!`, 'success');\n\n // Redirect to home screen\n browserHistory.push('/');\n }\n },\n );\n }", "async submitFullSignup(){\n const {signupName, signupEmail, signupPw, signupBirthday, signupCPF, signupPhoneNumber} = this.state\n const data = {signupName, signupEmail, signupPw, signupBirthday, signupCPF, signupPhoneNumber}\n\n const createdAccount = await this.context.signup({...data})\n\n if(createdAccount){\n const logged = await this.context.login(signupEmail, signupPw)\n\n if(logged){\n const {base} = this.props.match.params\n if(base === 'login'){ this.props.history.push('/minhaconta') }\n return\n }\n\n // $('.form-signup').trigger('reset')\n // $('.form-full-signup').trigger('reset')\n\n // $('.form-login').show()\n // $('.form-recovery').hide()\n\n // $('.switcher-login').trigger('click')\n // $('#signup-back').trigger('click')\n\n // alert('Sua conta foi criada com sucesso.')\n }\n\n $('#full-signup .error-message').text(\"Ocorreu um erro. Tente mais tarde.\")\n\n return\n }", "async function signup(evt) {\n console.debug(\"signup\", evt);\n evt.preventDefault();\n\n const name = $(\"#signup-name\").val();\n const username = $(\"#signup-username\").val();\n const password = $(\"#signup-password\").val();\n\n // User.signup retrieves user info from API and returns User instance\n // which we'll make the globally-available, logged-in user.\n currentUser = await User.signup(username, password, name);\n\n saveUserCredentialsInLocalStorage();\n updateUIOnUserLogin();\n\n $signupForm.trigger(\"reset\");\n}", "function signupHandler(){\n\tif((usernameField.value != \"\") && (passwordField.value != \"\")){\n\t\tconsole.log(\"signing up...\");\n\t\tuser.set(\"username\", usernameField.value);\n\t\tuser.set(\"password\", passwordField.value);\n\t\tuser.signUp(null, {\n\t\t\tsuccess:function (user){\n\t\t\t\tconsole.log(\"signup worked\");\n\t\t\t\tcurrentUser = Parse.User.current();\n\t\t\t\tloggedIn();\n\t\t\t}, \n\t\t\terror: function (user, error){\n\t\t\t\tconsole.log(\"error \"+ error.message+\" \"+error.code);\n\t\t\t\tif (error.code ==202){\n\t\t\t\t\talert(error.message);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t} else if((usernameField.value == \"\") && (passwordField.value != \"\")) {\n\t\talert(\"Please enter a username\");\n\t} else if((usernameField.value != \"\") && (passwordField.value == \"\")) {\n\t\talert(\"Please enter a password\");\n\t} else {\n\t\talert(\"Error\");\n\t}\n}", "signUp(email, password, handle, avatar) {\n window.alert(\"Signing up:\", email, 'with handle', handle);\n }", "function handleSignUp() {\n console.log(\"signup\");\n var email = document.getElementById('email').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function (error) {\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n });\n }", "'submit .consent-form'(event) {\n event.preventDefault();\n\n if (!Meteor.userId()){\n let userSession = Session.get('username');\n\n //if there is no user, add a user\n if (!userSession){\n const random_username = Random.id();\n const random_password = Random.id();\n Session.setPersistent('password',random_password);\n //create a user in the user database to be tracked, then login, then redirect to instructions\n Meteor.call('users.createUser',random_username,random_password,()=>{\n Meteor.loginWithPassword(random_username,random_password, ()=>{\n FlowRouter.go('/instructions');\n });\n });\n } else {\n //if the user existed before without clearing the session\n Meteor.loginWithPassword(Session.get('username'),Session.get('password'), ()=>{\n FlowRouter.go('/exit');\n });\n }\n\n\n }\n\n }", "function signup(username, password) {\n // TODO: create new user\n}", "function goSignUp() {\n \n body.innerHTML = renderSignupDiv(first, \n last, email1, pass1, '', message1);\n assignListener('signup2');\n }", "function signUp() {\n const signupForm = document.querySelector(\"#regtab\");\n signupForm.addEventListener(\"submit\", (e) => {\n e.preventDefault();\n\n //get user info\n const email = signupForm[\"signup-email\"].value;\n const password = signupForm[\"signup-password\"].value;\n const confPassword = signupForm[\"confirm-signup-password\"].value;\n if (confPassword == password) {\n //signup the user\n auth.createUserWithEmailAndPassword(email, password).then((cred) => {\n signupForm.reset();\n });\n }\n else {\n alert(\"הסיסמאות לא תואמות, נסה שוב\");\n }\n });\n}", "function signup({ email, password, city, dateOfBirth, username }) {\n // create new user\n}", "async handleSignup() {\n \n try {\n \n await emailPassClient.registerWithEmail(this.state.email, this.state.password)\n this.setState({\n successMessage: '確認のメールを送りました。メールボックスをご確認の上、リンクをクリックして、登録完了です。'\n })\n\n } catch(e) {\n console.log('error message: ', e);\n \n this.setState({\n errorMessage: 'ユーザーは登録済みです。ログインして下さい。'\n })\n // handleError(e)\n }\n }", "function signup() {\r\n try {\r\n if (!dw.system.Site.getCurrent().getCustomPreferenceValue(\"emarsysEnabled\")) {\r\n emarsysDisabledTemplate();\r\n return;\r\n }\r\n // clear form\r\n app.getForm('emarsyssignup').clear();\r\n // render the Submit Form\r\n app.getView({\r\n ContinueURL: URLUtils.https('EmarsysNewsletter-SubmitForm')\r\n }).render('subscription/emarsyssignup');\r\n } catch(e) {\r\n errorPage(e);\r\n }\r\n}", "async function handleSubmit(evt) {\n evt.preventDefault();\n\n let formToSubmit = new FormData();\n for (let key in formData) {\n formToSubmit.append(key, formData[key]);\n }\n console.debug(\"signupform= \", formToSubmit);\n\n let result = await signup(formToSubmit);\n console.debug(\"Result: \", result);\n\n if (result.success) {\n history.push(\"/\");\n } else {\n // TODO: Add error local state to render error alerts\n console.error(\":( User already exists or pw too short\");\n }\n\n }", "function signup({ username, password, email, dateOfBirth, city }) {\n // TODO: create new user\n}", "signUpUser(data) {\n return this.post('signup', data);\n }", "function signUp(){\r\n var email = document.getElementById(\"email\");\r\n var password = document.getElementById(\"password\");\r\n //const promise = auth.createUserWithEmailAndPassword(email.value, password.value);\r\n //promise.catch(e => alert(e.message));\r\n\r\n alert(\"Signed Up\");\r\n\r\n\r\n \r\n}", "handleSubmit() {\n const { email, password } = this.state;\n Accounts.createUser({ email, username: email, password }, (err) => {\n if (err) {\n this.setState({ error: err.reason });\n } else {\n /** Landing.push('/login'); */\n }\n /** Need to add call to update roles for user based on role. */\n });\n Meteor.call('updatingRole', {\n role: this.state.role,\n }, (err) => {\n if (err) {\n // eslint-disable-next-line no-undef\n alert(err);\n } else {\n this.setState({ finished: true });\n }\n });\n }", "function handleSignUp(event) {\n event.preventDefault();\n var email = document.getElementById(\"email\").value;\n var password = document.getElementById(\"password\").value;\n if (email.length < 4) {\n alert(\"Please enter an email address.\");\n return;\n }\n if (password.length < 6) {\n alert(\"Please enter a password.\");\n return;\n }\n // Create user with email and pass.\n // [START createwithemail]\n firebase\n .auth()\n .createUserWithEmailAndPassword(email, password)\n .catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == \"auth/weak-password\") {\n alert(\"The password is too weak.\");\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n })\n .then(() => {\n let newEmployer = formObject;\n firebase.auth().currentUser.sendEmailVerification();\n let id = firebase.auth().currentUser.uid.toString();\n newEmployer.firebase_id = id;\n setFormObject(newEmployer);\n console.log(formObject);\n handleFormSubmit();\n });\n // [END createwithemail]\n }", "function signup(req, res) {\n return res.send('Post signUp');\n}", "onSubmit(newUserData) {\n signup(newUserData)\n .then(response => {\n generateSuccessDialog('Your account has been created!', 'Okay').then((result) => {\n // Log into the newly created account.\n (result.value) && this.handleSignIn();\n })\n }).catch(error => generateErrorDialog('There was a problem registering your account'))\n }", "function handleSignUp(event) {\r\n event.preventDefault();\r\n var email = document.getElementById('user-email').value;\r\n var password = document.getElementById('user-password').value;\r\n if (email.length < 4) {\r\n bootbox.alert('Please enter an email address.');\r\n return;\r\n }\r\n if (password.length < 4) {\r\n bootbox.alert('Please enter a valid password.');\r\n return;\r\n }\r\n // Sign in with email and pass.\r\n // [START createwithemail]\r\n \r\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\r\n \r\n // Handle Errors here.\r\n var errorCode = error.code;\r\n var errorMessage = error.message;\r\n // [START_EXCLUDE]\r\n if (errorCode == 'auth/weak-password') {\r\n bootbox.alert('The password is too weak.');\r\n } else {\r\n bootbox.alert(errorMessage);\r\n }\r\n // [END_EXCLUDE]\r\n });\r\n // [END createwithemail]\r\n }", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "function hook_signup_form() {\n console.log(\"hooking the signup form\")\n \n\t$(\"#signup-form\").submit(function(event) {\n\t\tevent.preventDefault();\n\t\tsignup_user();\n });\n}", "function signUp() {\r\n\t// Clear any previous server errors\r\n\tclear(\"sign-up-errors\");\r\n\r\n\t// Get the values from the form fields\r\n\tvar username = $(\"#newUsername\").val();\r\n\tvar password = $(\"#newPassword\").val();\r\n\tvar termsAccepted = $(\"#termsAccepted\").is(\":checked\");\r\n\r\n\t// Validate the business rules\r\n\tvalidateRequired(\"newUsername\", \"error.username\");\r\n\tvalidateRequired(\"newPassword\", \"error.password\");\r\n\r\n\tvalidateEmailFormat(\"newUsername\", \"error.username.format\");\r\n\r\n\t// Validate the acceptance of the terms for the \"Beta\" brand only\r\n\tif (brand == \"Beta\") {\r\n\t\tvalidateRequiredCheckbox(\"termsAccepted\", \"terms-error-msg\");\r\n\t}\r\n\r\n\t// Create the data model to be sent\r\n\tvar user = {\r\n\t\tusername : username,\r\n\t\tpassword : password,\r\n\t\ttermsAccepted : termsAccepted\r\n\t};\r\n\r\n\t// Post the request to the server\r\n\tpost(signUpUrl, user, signUpSuccess, signUpError);\r\n}", "handleSignUp() {\n const { username, password, email, phoneNumber, firstName, lastName } = this.state;\n this.props.attemptSignUp(Auth, username, password, email, ('+1' + phoneNumber), firstName, lastName)\n }", "static async signup() {\n let email = rl.questionEMail(chalk.bold(\"Email: \"));\n let password = rl.questionNewPassword(chalk.bold('Password: '), {\n mask: '', \n min: 6,\n confirmMessage: \"Enter the same password again: \",\n unmatchMessage: \"Passwords did not match. Try again. To re-enter the first password, input only Enter.\",\n limitMessage: \"Password must be at least 6 characters. Please try again.\"\n });\n let errorCode;\n let errorMessage;\n spinner = ora(\"Signing up...\").start();\n await firebase.auth().createUserWithEmailAndPassword(email, password).catch((error) => {\n errorCode = error.code;\n errorMessage = error.message;\n }).then(async () => {\n let checkUser = firebase.auth().currentUser;\n if(checkUser){\n let name = checkUser.email.substring(0, checkUser.email.indexOf(\"@\"));\n let newUser = await UserService.createUser(checkUser.uid, name, checkUser.email);\n spinner.succeed(chalk.green(\"New user created: \", newUser.name));\n }\n else {\n spinner.fail(chalk.red(\"Failed to create user...\"));\n if(errorCode == 'auth/email-already-in-use')\n console.log(chalk.red(\"Email in use\"));\n else \n console.log(chalk.red(errorMessage));\n }\n });\n }", "async function signup ({ message, reply }) {\n const data = validate(message.payload, schema)\n\n const user = {\n _id: Shortid.generate(),\n email: data.email\n }\n\n const session = {\n userId: user._id,\n email: user.email\n }\n\n const accessToken = Auth.createToken(session)\n\n reply({ topic: 'signup', payload: { user, accessToken }, session })\n}", "signup(e) {\n e.preventDefault();\n signupUser(this.state.email, this.state.password);\n }", "async function handleSubmit(event){\n event.preventDefault()\n await api.post('/signup', userData)\n .then(response =>{\n alert(\"Conta criada com sucesso!\")\n window.location.href = '/signin'\n })\n .catch(error =>{\n alert(\"Problema ao criar conta, tente novamente!\")\n }\n )\n\n }", "function activateSignup() {\n activateNewAccount(true)\n\n }", "function handleSignUp() {\n var handleSignUpResult = true;\n //\n checkSignUpForm();\n /*\n var email = document.getElementById('inputEmail').value;\n var password = document.getElementById('inputPassword').value;\n // Sign in with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n handleSignUpResult = false;\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n if (errorCode == 'auth/email-already-in-use') {\n showErrorModal(\"已經有相同帳號存在於資料庫中\");\n } else if (errorCode == 'auth/invalid-email') {\n showErrorModal(\"信箱位址不合法\");\n } else if (errorCode == 'auth/operation-not-allowed') {\n showErrorModal(\"帳號已經被停用\");\n } else if (errorCode == 'auth/weak-password') {\n showErrorModal(\"密碼強度太弱,請重新輸入\");\n }\n console.log(error);\n });\n */\n\n $('.ui.basic.modal.loadiinngg').modal('show');\n\n // 這邊要延遲一段時間之後再執行,要等到 firbase 那邊有回傳\n var delay = 2000; //1 second\n setTimeout(function() {\n if (handleSignUpResult == true) {\n registerSuccessful();\n }\n }, delay);\n}", "handleSignUp() {\n firebase.auth().createUserWithEmailAndPassword(this.state.email, this.state.password)\n .then(() => {\n this.props.setCurrUser(firebase.auth().currentUser);\n })\n .catch(err => this.setState({ errorMessage: err.message }));\n }", "function handleSignupAction(event) {\n event.preventDefault();\n\n // Grab all the fields on the login Card\n var $name = $($pt.signupCard.field.name);\n var $email = $($pt.signupCard.field.email);\n var $loginId = $($pt.signupCard.field.loginId);\n var $password = $($pt.signupCard.field.password);\n var $hidePass = $($pt.signupCard.field.hidePass);\n var $status = $($pt.signupCard.field.errorStatus);\n var signupData = {};\n\n $status.empty();\n\n // Formulate data to store\n signupData.name = $name.val().trim();\n signupData.email = $email.val().trim();\n signupData.loginId = $loginId.val().trim();\n signupData.password = $password.val().trim();\n\n // Check to make sure we don't have blank one\n if (signupData.name === \"\" ||\n signupData.email === \"\" ||\n signupData.loginId === \"\" ||\n signupData.password === \"\") {\n\n $status.append(alertBar + \"All fields are required !\" + alertEnd);\n return false;\n }\n\n // Add an empty avatar for now.\n signupData.avatar = \"\";\n signupData.notify = 0;\n\n // Build the JSON urlHost to check if loginId already exist\n var urlHost = $pt.server.db + \"/users\";\n urlHost += \"?loginId=\" + signupData.loginId;\n\n // TODO: Perform AJAX to check data here\n $.ajax({\n url: urlHost,\n dataType: \"json\",\n method: \"GET\",\n success: function (result) {\n // result is an array if it return\n if (result.length === 0) {\n // We have no duplicate, allow the user to signup\n // WS to add the user signup\n var urlHost = $pt.server.db + \"/users\";\n\n // Call ajax to save the signupData\n $.ajax({\n url: urlHost,\n dataType: \"json\",\n method: \"POST\",\n data: signupData,\n success: function (result) {\n // Clear up the signup form page data\n $status.empty();\n $name.val(\"\");\n $email.val(\"\");\n $loginId.val(\"\");\n $password.val(\"\").attr(\"type\", \"text\");\n $hidePass.prop(\"checked\", false);\n // Close the signup modal\n $($pt.signupCard.handle).modal(\"hide\");\n\n // Call processSuccessLogin to log the user in\n // result is an object, wrap it in array\n processSuccessLogin([result]);\n },\n error: function (result) {\n console.log(\"ajax error post signup \" + result.status);\n }\n });\n } else if (result.length >= 1) {\n // We have duplicate.\n $status.append(alertBar +\"LoginId existed. Choose a different loginId\" +alertEnd);\n return false;\n }\n },\n error: function (result) {\n console.log(\"ajax error \" + result.status);\n }\n });\n\n }", "function signUp(){\n auth.createUserWithEmailAndPassword(email, password)\n .then(() => {\n ToastAndroid.show(\"Account with email \" + email + \" created successfully!\", ToastAndroid.SHORT)\n navigation.navigate(\"Main\")\n }).catch(error => {\n alert(error.message)\n })\n }", "function userSignup(req, cb){\n var email = req.body['email'];\n log.info(\"user signup: \" + email);\n var name = req.body['name'];\n var pass = req.body['pass'];\n if(!email || !name || !pass) return cb(errorsList['parameter-missing']);\n email = email.toLowerCase();\n var logindata = {\n email : email,\n pass : pass,\n name : name\n };\n users.addNewAccount(logindata, function(err,data){\n log.info(\"account signup \" + (err?\"failed\":\"succeed\") + \": \" + email);\n cb(err,data);\n });\n}", "function signup(form, email, password) {\n\tvar emailValue = document.getElementById(email).value;\n\tvar passwordValue = document.getElementById(password).value;\n\t\n\tfirebase.auth().createUserWithEmailAndPassword(emailValue, passwordValue)\n\t\t.then(function() {\n\t\t\t// Redirect to home\n\t\t\twindow.location.href=\"/members/\"\n\t\t\t// form.submit()\n\t\t})\n\t\t.catch(function(error) {\n\t\t // Handle Errors here.\n\t\t var errorCode = error.code;\n\t\t var errorMessage = error.message;\n\t\t return errorCode;\n\t\t});\n}", "function signUp(req, res, data) {\n //extract form data\n var dataObj = querystring.parse(data),\n login = dataObj.login, pw = dataObj.pw\n //attempt to register new user\n queryDB.register(req, res, login, pw,\n function(success_msg, ct_pw){\n\t\t\t// cookieUtils.setLoginCookies(req, res, login, ct_pw) //this step will happen at login\n var context = {\n \"heading\" : success_msg,\n \"login\" : login,\n \"pw\" : ct_pw\n }\n loader.loadHTML(res, loginPath, context)\n }, function(failure_msg){\n var context = {\n \"heading\" : failure_msg\n }\n loader.loadHTML(res, loginPath, context)\n }, function(){\n console.log(\"database registration completed\")\n })\n}", "async register() {\n console.log('Register:', this.state.email, this.state.password);\n try {\n await firebase.auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password);\n AlertIOS.alert(\n 'Account created',\n // null,\n // [\n // {\n // text: 'OK',\n // onPress: this.tabHandler(2)\n // }\n // ]\n )\n } catch (error) {\n AlertIOS.alert(error.toString());\n }\n console.log('current user:', firebase.auth().currentUser);\n Keyboard.dismiss();\n }", "function signup() {\n\n if (usernameAvailabe && numberAvailabe && emailAvailable) {\n fetch('https://desolate-thicket-70111.herokuapp.com/v1/webapi/signup/', {\n method: 'POST', // or 'PUT'\n headers: {\n 'Content-Type': 'application/json',\n 'Access-Control-Allow-Origin' : '*'\n },\n body: JSON.stringify({\n username: username,\n email: email,\n telefoonnummer: telefoonnummer\n }),\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n router.push('/aangemeld')\n })\n .catch((error) => {\n console.error('Error:', error);\n });\n } else {\n console.log(\"Dit werkt niet\")\n }\n }", "handleSubmit() {\n const { email, password } = this.state;\n Accounts.createUser({ email, username: email, password }, (err) => {\n if (err) {\n this.setState({ error: err.reason });\n } else {\n // browserHistory.push('/login');\n }\n });\n }", "function signUpUser(email, username, password, emailable, profileUrl) {\n $.post(\"/api/signup\", {\n email: email,\n username: username,\n password: password,\n emailable: emailable,\n profileUrl: profileUrl\n })\n .then(function(data) {\n window.location.replace(\"/home\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "signUp() {\n const email = document.querySelector('.signup_form_mail').value;\n const password = document.querySelector('.signup_form_pass').value;\n auth.createUserWithEmailAndPassword(email, password).then(cred => {\n signupForm.reset();\n document.location.reload(true);\n })\n .catch(err => {\n console.log(err.message);\n });\n }", "function signup(db, enteredAccount, response) {\n const users = db.collection(userdbname);\n console.log(\"Searching database for accounts with this email or username.\");\n users.find({ $or : [{\"username\" : enteredAccount.username}, {\"email\" : enteredAccount.email}]}, {}, function(e, docs) {\n console.log(\"Sign up query completed.\\n\\tErrors: \", e,\n \"\\n\\tEntries found during signup: \\n\\t\" + ((JSON.stringify(docs, undefined, \"\\t\")).replace(/\\n/g, \"\\n\\t\")));\n if (docs.length === 0) {\n console.log(\"Putting record\", enteredAccount, \"into user database.\");\n users.insert(enteredAccount, null, function () {\n console.log(\"Completed user insertion.\");\n });\n //force login\n console.log(\"Force login for new account.\");\n login(enteredAccount, undefined, response, true);\n response.redirect('/landing');\n } else {\n console.log(\"Submitted record is a duplicate.\");\n logout(response);\n console.log(\"Redirecting to the signup page.\");\n response.redirect('/signup?r=d');\n }\n });\n}", "async function handleSubmit(e) {\n e.preventDefault()\n\n\n if (password.current.value !== passwordConfirm.current.value) {\n return setError(\"Passwords do not match\")\n }\n\n try {\n setError(\"\")\n setLoading(true)\n await signup(email.current.value, password.current.value)\n // history.push(\"/\")\n setMessage(\"you have successfully completed the registration\")\n\n\n } catch {\n setError(\"Failed to create an account\")\n }\n\n setLoading(false)\n\n }", "function signUp(name, username, password, code){\n\n if (typeof code == \"undefined\")\n code = \"none\";\n\n $.ajax({\n method: \"POST\",\n url: \"/api/account/create\",\n contentType: \"application/json\",\n data: JSON.stringify({ name: name, username: username, password: password, type : userType, code: code })\n }).done(function(response){\n // console.log(response);\n\n if (response.status == \"success\"){\n Cookies.set('token', response.data.token, { expires: 7 });\n window.location.href = '/dashboard';\n } else {\n handleError(response.error);\n }\n\n });\n\n }", "static async signup(req, res) {\n try {\n // find user\n const user = await User.findOne({\n status: 'pending',\n deleted: false,\n signupToken: req.params.token,\n signupExpires: {\n $gt: Date.now(),\n },\n });\n if (!user) {\n return res.error('Invalid token');\n }\n\n delete req.body._id; // eslint-disable-line no-underscore-dangle\n const updated = _.assign(\n user,\n req.body,\n {\n status: 'approved',\n signupToken: undefined,\n signupExpires: undefined,\n },\n );\n await updated.save();\n\n // send email notification\n const mailOptions = {\n to: updated.email,\n from: process.env.FROM_EMAIL,\n subject: 'Registration Successful',\n template: 'registration-success-email',\n context: {\n name: `${updated.first_name} ${updated.last_name}`,\n },\n };\n await mailer.sendMail(mailOptions);\n\n req.login(updated, { session: false }, (loginErr) => {\n if (loginErr) {\n return res.error(loginErr.message);\n }\n\n const token = generateToken(updated);\n return res.success({ token });\n });\n } catch (err) {\n return res.error(err.message);\n }\n }", "signUp(details, success, failure) {\n this.postCall(URI.SIGNUP, details, success, failure, false);\n }", "function _sign_up(){\n try{\n if(Ti.Network.online){\n Ti.Platform.openURL('http://fieldteam.com.au/signup/');\n }else{\n self.show_message(L('message_offline'),L('message_unable_to_connect'));\n return;\n }\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _sign_up');\n return;\n } \n }", "function signUp() {\n\tconsole.log(\"Sign Up Button Pressed.\");\n\t//grab the inputs\n\tvar name = $(\"input:text[name=signUpName]\").val().trim();\n\tvar pass = $(\"input:password[name=signUpPassword]\").val().trim();\n\tvar passConfirm = $(\"input:password[name=signUpPasswordConfirm]\").val().trim();\n\n\t// For testing\n\t//console.log(name, pass);\n\n\t// If the passwords match post to users API route\n\tif (pass === passConfirm){\n\n\t\tvar userInfo = {\n\t\t\tsignUpName: name,\n\t\t\tsignUpPassword: pass,\n\t\t\tsignUpPasswordConfirm: passConfirm\n\t\t}\n\t\t\n\t\t//=-=-=-=-=-=-=-=\n\t\t$.post(\"/api/user/signup\", userInfo)\n \t.then(function(data){\n \t\tconsole.log(\"Sent user info: \" + userInfo);\n \t\tif (data.error)\n \t\t\t$(\"input:text[name=signUpName]\").val(data.error);\n\n \t\tif (data.success)\n \t\t\twindow.location = data.redirectTo;\n \t\t\n \t});\n\t\t//=-=-=-=-=-=-=-=\n\t\n\t} else {\n\t\t$(\"input:text[name=signUpName]\").val(\"\");\n\t\t$(\"input:password[name=signUpPassword]\").val(\"\");\n\t\t$(\"input:password[name=signUpPasswordConfirm]\").val(\"\");\n\t\tconsole.log(\"Passwords do not match\");\n\t}\n}", "onFormSubmit(evt) {\n\t\tevt.preventDefault()\n\t\thttpClient.signUp(this.state.fields).then(user => {\n\t\t\tthis.setState({ fields: { name: '', email: '', password: '' } })\n\t\t\tif (user) {\n\t\t\t\tthis.props.onSignUpSuccess(user)\n\t\t\t\tthis.props.history.push('/')\n\t\t\t}\n\t\t})\n\t}", "function create_account(){\n\tverify_admin().then(function(res){\n\t\tvar usertype = (res===\"Valid admin key\") ? \"admin\" : \"gamer\";\n\t\tverify_user().then(function(){\n\t\t\tverify_email().then(function(){\n\t\t\t\tvalid_password().then(function(){\n\t\t\t\t\tregister_user(usertype).then(function(){\n\t\t\t\t\t\tvar input = {\n\t\t\t\t\t\t\t\t\t\t\tusername: $(\"#registeruser\").val()\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\tvar params = {\n\t\t\t\t\t\t\t\t\t\t\tmethod: \"PUT\",\n\t\t\t\t\t\t\t\t\t\t\turl: \"/api/stats/\",\n\t\t\t\t\t\t\t\t\t\t\tdata: input\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t$.ajax(params).done(function(data) {\n\t\t\t\t\t\t\tconsole.log($(\"#registeruser\").val()+\" registered into Warehouse Wars!\");\n\t\t\t\t\t\t\tset_local($(\"#registeruser\").val());\n\t\t\t\t\t\t\tset_update();\n\t\t\t\t\t\t\tcurrent_stage=\"stage\";\n\t\t\t\t\t\t\tswitch_stage();\n\t\t\t\t\t\t}).fail(function(err) {\n\t\t\t\t\t\t\tconsole.log($(\"#registeruser\").val()+\" failed to register into Warehouse Wars!\");\n\t\t\t\t\t\t});\n\t\t\t\t\t}).catch(function (err) {\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t})\n\t\t\t\t}).catch(function (err) {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t})\n\t\t\t}).catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t})\n\t\t}).catch(function (err) {\n\t\t\tconsole.log(err);\n\t\t})\n\t}).catch(function (err) {\n\t\tconsole.log(err);\n\t});\n}", "function signUpUser(userData) {\n $.post(\"/api/signup\", {\n email: userData.email,\n password: userData.password,\n minLength: userData.minLength,\n maxLength: userData.maxLength,\n maxAscent: userData.maxAscent\n })\n .then(() => {\n window.location.replace(\"/members\");\n })\n .catch(handleLoginErr);\n }", "function signUpSuccessfull() {\n console.log('No errors, submit callback called!');\n }", "function signUpSuccessfull() {\n console.log('No errors, submit callback called!');\n }", "async signup ({ request, auth, response }) {\n // get user data from signup form\n const userData = request.only(['username', 'email', 'password'])\n\n try {\n // save user to database\n const user = await User.create(userData);\n // generate JWT token for user\n const token = await auth.generate(user);\n\n return response.json({\n status: 'success',\n data: token\n })\n } catch (error) {\n return response.status(400).json({\n status: 'error',\n message: 'There was a problem creating the user, please try again later.'\n })\n }\n}", "function submit(ev) {\n api.create_user(props.form);\n }", "function submitHandler(e) {\n e.preventDefault();\n \n const validation = new Validation(form);\n validation.init();\n if (!validation.check()) return message.show({text: \"Fill in all marked fields correctly\", error: true});\n\n let newUser = {\n email: emailInput.value,\n password: passwordInput.value,\n nickname: nicknameInput.value,\n first_name: first_nameInput.value,\n last_name: last_nameInput.value,\n phone: phoneInput.value,\n gender_orientation: gender_orientationInput.value,\n city: cityInput.value,\n country: countryInput.value,\n date_of_birth_day: date_of_birth_dayInput.value,\n date_of_birth_month: date_of_birth_monthInput.value,\n date_of_birth_year: date_of_birth_yearInput.value\n }\n\n signUp.register(newUser)\n .then(res => {\n if(!res.error) {\n message.show({text: res.message, error: res.error});\n setTimeout(() => window.location = \"login.html\", 3000);\n } else {\n message.show({text: res.message, error: res.error});\n passwordInput.value = '';\n }\n })\n .catch((error) => {\n console.log(error);\n });\n }", "function signup() {\n // do something\n}", "function signup(req, res) {\n\t// Local DB variable\n\tvar db = req.db;\n\n\t// Get form values\n\tvar userName = req.body.username;\n\tvar userPass = req.body.userpass;\n\tvar userSteamId = req.body.steamid;\n\n\n\t// Confirm that the username doesn't already exist (should be checked already)\n\tdb.hexists(\"users\", userName, function(err, reply) {\n\t\tif (reply) {\n\t\t\t// Already exists, throw error\n\t\t\tconsole.log(\"User already exists\");\n\t\t\tres.render('index', {failSignup: \"Username is unavailable.\"});\n\n\t\t} else {\n\t\t\tconsole.log(\"Username is available\");\n\n\t\t\t// Add user\n\t\t\tdb.get(\"NEXT_USER_ID\", function(err, reply) {\n\t\t\t\tdb.incr(\"NEXT_USER_ID\");\n\t\t\t\tvar newUserId = reply;\n\t\t\t\tconsole.log(\"new user ID number is \"+newUserId);\n\t\t\t\tdb.hset(\"users\", userName, newUserId);\n\t\t\t\t\n\t\t\t\tvar currentTime = new Date().getTime();\n\t\t\t\tdb.hmset(\"user:\"+newUserId, {\n\t\t\t\t\t\"username\" : userName,\n\t\t\t\t\t\"steam_id\" : userSteamId,\n\t\t\t\t\t\"password\" : userPass,\n\t\t\t\t\t\"date_created\" : currentTime\n\t\t\t\t});\n\n\t\t\t\tlogin(req, res);\n\n\t\t\t});\n\t\t}\n\t\t\n\t});\n}", "function handleSubmit(event) {\n event.preventDefault();\n\n if (!checkForm()) {\n return false;\n }\n\n AuthService.register({\n lastName: lastnameInput.current.value,\n firstName: firstnameInput.current.value,\n email: emailInput.current.value,\n password: passwordInput.current.value,\n birthDate: birthdateInput.current.value,\n username: usernameInput.current.value,\n description: descInput.current.value,\n country: countryInput.current.value,\n }).then(response => {\n if (response.ok) {\n UIkit.modal(\"#signup\").hide();\n }\n return response.json().then(data => {\n UIkit.notification({\n message: data.message,\n status: (response.ok) ? 'success' : 'danger',\n pos: 'top-right',\n timeout: 5000\n });\n return true;\n });\n });\n }", "async function createAccount() {\n user.signUp()\n .then(response => {\n if (typeof document !== 'undefined') return document.write('Signed up successfully!');\n console.log('Signed up user', response);\n }).catch( error => {\n if (typeof document !== 'undefined') return document.write(`Error while signing up: ${JSON.stringify(error)}`);\n console.log('Error while signing up', error)\n });\n}", "signup(request, response) {\n\t\tlet user = new User({\n\t\t\tusername: request.body.username,\n\t\t\temail: request.body.email,\n\t\t\tpassword: request.body.password,\n\t\t\tprovider: 'local'\n\t\t});\n\n\t\tuser.save((err) => {\n\t\t\tif (err) {\n\t\t\t\trequest.flash('info', err.message);\n\t\t\t\tresponse.redirect('/auth/register');\n\t\t\t}else{\n\t\t\t\trequest.flash('info', 'You successfully signup');\n\t\t\t\tresponse.redirect('/auth/login');\n\t\t\t}\n\t\t});\n\t}", "function signup({userName, userPassword, userEmail, userCity}) {\n\t//do some logic\n}", "function signUpUser(email, password, car_make, name, car_model, license_plate) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n car_make: car_make,\n name: name,\n car_model: car_model,\n license_plate: license_plate\n })\n .then(() => {\n window.location.replace(\"/login\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "async function handleSubmit(event) {\n event.preventDefault();\n \n if(!validateEmail(emailRef.current.value)){\n return setError(\"The email address is badly formatted.\")\n }\n\n try {\n setError(\"\");\n setLoading(true);\n await signUpJG(emailRef.current.value, passwordRef.current.value, groupId, nameRef.current.value, image);\n } catch {\n setError(\"Failed to sign up\")\n console.log(error);\n }\n setLoading(false);\n history.push(\"/overview\")\n }", "function onSubmit() {\n\n\t\tif (submitButtonProcessing) {\n\t\t\treturn;\n\t\t}\n\n\t\t// set submit button to processing (prevent multiple clicks)\n\t\tsetSubmitButtonProcessing(true);\n\n\t\tconst userData = {\n\t\t\tusername: username,\n\t\t\tpassword: password,\n\t\t\temail: email,\n\t\t\tname: name\n\t\t};\n\n\t\tcreateUser(userData).then(function (response) {\n\n\t\t\tif (response.isAuthenticated) {\n\n\t\t\t\tconst authUserData = {\n\t\t\t\t\tusername: response.username,\n\t\t\t\t\temail: response.email,\n\t\t\t\t\tname: response.name,\n\t\t\t\t\tsignupDate: response.signupDate\n\t\t\t\t};\n\n\t\t\t\t// Save user data and authentication to the store\n\t\t\t\tdispatch(SET_USERDATA(authUserData));\n\t\t\t\tdispatch(SET_ISAUTH(true));\n\n\t\t\t\tauth.signin( () => {\n\t\t\t\t\thistory.push('/post-signup/rivals');\n\t\t\t\t});\n\n\t\t\t} else {\n\n\t\t\t\t// Login failed, reset processing\n\t\t\t\tsetSubmitButtonProcessing(false);\n\n\t\t\t\t// TODO: Show some type of error\n\t\t\t}\n\t\t});\n\t}", "function handleSubmit(event){\n event.preventDefault()\n \n //this is where I am calling the function above to submit the username/password\n registration()\n //setUserName(\"\")\n //setPassword(\"\")\n }", "function signUpSubmit () {\n $(\"#signup_submit\").on(\"click\", function(event) {\n event.preventDefault();\n console.log(\"button pressed\");\n console.log(\n $(\"#user_name_signup\")\n .val()\n .trim()\n );\n console.log($(\"#password_signup\").val());\n // create user object\n var signUp = {\n name: $(\"#user_name_signup\")\n .val()\n .trim(),\n password: $(\"#password_signup\")\n .val()\n .trim()\n };\n var confirm = $(\"#password_confirm\")\n .val()\n .trim();\n\n console.log(signUp.name + \" \" + signUp.password + \" \" + confirm);\n // check to make sure both inputs are present\n if (!(signUp.name && signUp.password)) {\n alert(\"You must enter an example text and description!\");\n return;\n } else if (signUp.password !== confirm) {\n alert(\"Password did not match\");\n } else {\n // Create permanent user\n if (localUser.name === \"temp\") {\n signUp.id = localUser.id;\n API.updateUser(signUp);\n } else {\n API.createUser(signUp);\n }\n }\n // What happens when you submit sign up\n // Right now, you are able to sign up with the same user name as someone else\n\n });\n}", "onSubmit() {\n this.attemptRegistration();\n }", "function signUp(userInfo) {\n\t\t\tvar user = new Parse.User();\n\n\t\t\t// Add username by concatening first and last name\n\t\t\t// Once the use links his twitter account the username should \n\t\t\t//be his twitter's handle\n\t\t\tuser.set('username', userInfo.email);\n\n\t\t\t// Then add all the fields\n\t\t\tfor(var key in userInfo){\n\t\t\t\tuser.set(key, userInfo[key]);\n\t\t\t}\n\n\t\t\tuser.signUp(null, {\n\t\t\t success: success,\n\t\t\t error: error\n\t\t\t});\n\n\t\t\treturn defer.promise;\n\t\t}", "function handleSignUp() {\n var email = document.getElementById('username').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n}", "function handleSignUp() {\n var email = document.getElementById('username').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n}", "function handleSignUp() {\n var email = document.getElementById('username').value;\n var password = document.getElementById('password').value;\n if (email.length < 4) {\n alert('Please enter an email address.');\n return;\n }\n if (password.length < 4) {\n alert('Please enter a password.');\n return;\n }\n // Sign in with email and pass.\n // [START createwithemail]\n firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // [START_EXCLUDE]\n if (errorCode == 'auth/weak-password') {\n alert('The password is too weak.');\n } else {\n alert(errorMessage);\n }\n console.log(error);\n // [END_EXCLUDE]\n });\n // [END createwithemail]\n}", "function signUp(){\n if (isEmpty() == false){\n messageReqiuered();\n return false\n }\n\n if (validateName() == false) {\n validationMessage();\n return false\n }\n\n if (validateEmail() == false) {\n validationMessage();\n return false\n }\n\n var user = {\n userName : signUpName.value ,\n userEmail : signUpEmail.value ,\n userPass : signUpPass.value\n }\n\n\n if (signUpContainer.length == 0) {\n \n addUser(user);\n\n return true ;\n\n }\n\n isEmailExist();\n\n if (isEmailExist() == false) {\n\n messageFailed();\n\n }else{\n \n addUser(user);\n\n }\n\n \n}", "function signUpUser(userInfo) {\n $.post(\"/api/signup\", {\n firstName: userInfo.firstName,\n lastName: userInfo.lastName,\n email: userInfo.email,\n password: userInfo.password\n }).then(function(data) {\n window.location.reload();\n console.log(\"signed up\");\n }).catch(handleLoginErr);\n }", "function handleSignUp(e) {\n setVisible(false);\n setSignUp('true');\n }", "async signUp({ request, auth, response }) {\n const email = request.input(\"email\"); \n let userCheck = await User.findBy(\"email\", email);\n \n if (userCheck) {\n return _RL.existConflict(response,Antl.formatMessage('messages.userExists'));\n }\n \n let user = new User();\n user.firstName = request.input(\"firstName\");\n user.lastName = request.input(\"lastName\");\n user.email = email;\n user.password = request.input(\"password\");; \n user.accountType = request.input(\"accountType\"); \n user.deviceToken = request.input('deviceToken'); \n \n let user1 = await user.save();\n let thisuser = await User.findBy(\"email\", email);\n let accessToken = await auth.generate(thisuser);\n let tokenStore = new Token();\n tokenStore.user_id = thisuser.id;\n tokenStore.token = accessToken.token;\n tokenStore.type = accessToken.type;\n tokenStore = await tokenStore.save();\n \n let data = {\n user: user,\n accessToken: accessToken\n };\n return _RL.recordCreated(response,Antl.formatMessage('messages.register'),data);\n }", "function handleSignUpBtnClick() {\n console.log(\"signup clicked\");\n }", "function signup (e) {\n e.preventDefault ();\n fire\n .auth ()\n .createUserWithEmailAndPassword (data.email, data.password)\n .then (data => {\n console.log (data);\n })\n .catch (err => {\n console.log (err);\n \n });\n\n var db = fire.firestore ();\n db.collection ('users')\n .add ({\n email: data.email,\n phoneNo: data.phoneNo,\n name: data.name,\n dob: data.dob,\n })\n .then (() => {\n setLoader (true);\n })\n .catch (e => {\n alert ('Error', e.message);\n setLoader (true);\n });\n }", "function signUpUser({\n firstName,\n lastName,\n email,\n password,\n intOne,\n intTwo,\n intThree\n }) {\n console.log(\"firstName:\", firstName);\n $.post(\"/api/signup\", {\n firstName: firstName,\n lastName: lastName,\n email: email,\n password: password,\n intOne: intOne,\n intTwo: intTwo,\n intThree: intThree\n })\n .then(res => {\n console.log(res);\n window.location.replace(\n \"/members/:\" + intOne + \"/:\" + intTwo + \"/:\" + intThree\n );\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function signUpUser(firstName, lastName, email, password) {\n\t\t$.post(\"/api/signup\",\n\t\t\t// userData{}\n\t\t\t{\n\t\t\t\tfirstName: firstName,\n\t\t\t\tlastName: lastName,\n\t\t\t\temail: email,\n\t\t\t\tpassword: password\n\t\t\t}\n\t\t)\n\t\t\t.then(function (data) {\n\t\t\t\twindow.location.replace(\"/createList\");\n\t\t\t\t// If there's an error, handle it by throwing up a bootstrap alert\n\t\t\t})\n\t\t\t.catch(handleLoginErr);\n\t}", "signUp() {\n I.fillField(this.signupLocators.fullName, 'SignUpOrgAdmin');\n I.fillField(this.signupLocators.email, '[email protected]');\n I.fillField(this.signupLocators.password, 'SECRET123');\n I.fillField(this.signupLocators.confirmPassword, 'SECRET123');\n I.click(this.signupLocators.toggleAgreeToTermsAndConditions);\n I.click(this.signupLocators.signUpRegistration);\n }", "function signUpUser(email, password, userName, location, interest, aboutMe, available) {\n $.post(\"/api/signup\", {\n email: email,\n password: password,\n username: userName,\n location: location,\n interest: interest,\n aboutMe: aboutMe,\n available: available\n })\n .then(function(data) {\n\n \n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(function(err){\n if(err.responseJSON.name === \"SequelizeUniqueConstraintError\"){\n handleLoginErr(\"E-mail already exists\");\n }\n else{\n handleLoginErr(\"Something went wrong. Please try later!\");\n }\n });\n }", "SignUp(email, password) {\n return this.afAuth.auth.createUserWithEmailAndPassword(email, password).then((result) => {\n /* Call the SendVerificaitonMail() function when new user sign\n up and returns promise */\n this.SendVerificationMail().then(r => { });\n this.SetUserData(result.user);\n }).catch((error) => {\n window.alert(error.message);\n });\n }", "async function handleSubmitUser(evt) {\n evt.preventDefault();\n let data = new FormData();\n for (let key in formData){\n data.append(key, formData[key]);\n }\n\n try {\n await signUp(data);\n // history.push(\"/FriendsFinder\");\n setStep(\"step2\")\n } catch (err) {\n setFormErrors(err);\n }\n }", "onSubmitSignup(event) {\n event.preventDefault();\n\n // Authentication for valid email address\n function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }\n\n // Running authentication based on app requirements\n if (this.state.username.length < 4) {\n this.alertModal(\"Username must be at least four characters long.\");\n } else if (!emailIsValid(this.state.email)) {\n this.alertModal(\"Invalid email. Please enter a valid email address.\");\n } else if (\n this.state.password === \"\" ||\n this.state.passwordValidation === \"\"\n ) {\n this.alertModal(\"Please enter a password and confirm it.\");\n } else if (this.state.passwordValidation !== this.state.password) {\n this.alertModal(\n \"Password confirmation does not match. Please make sure both password inputs match.\"\n );\n } else {\n axios\n .post(\"https://team6-news.herokuapp.com/user/signup\", {\n username: this.state.username,\n email: this.state.email,\n password: this.state.password,\n })\n .then((res) => {\n this.setState({ successfulLogin: true });\n })\n .catch((error) => {\n if (error) {\n this.alertModal(\"Account already exists for this email address.\");\n }\n });\n }\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function signUpUser(email, password) {\n $.post(\"/api/signup\", {\n email: email,\n password: password\n })\n .then(() => {\n window.location.replace(\"/members\");\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "onButtonPress() {\n\t\tconst {email, password} = this.state;\n\t\tfirebase.auth().createUserWithEmailAndPassword(email, password)\n\t\t\t.then(this.onSignUpSuccess.bind(this))\n\t\t\t.catch(this.onSignUpFailed.bind(this));\n\n\t}", "async signupUser(e, { username, password, passwordMatch, email }) {\n e.preventDefault();\n\n // if (!username) {\n // this.setState({ errorMessage: \"Please enter a username\" });\n // return;\n // }\n // if (username.length < 3) {\n // this.setState({ errorMessage: \"Please enter a longer username\" });\n // return;\n // }\n // if (!password) {\n // this.setState({ errorMessage: \"Please enter a password\" });\n // return;\n // }\n // if (password.length < 8) {\n // this.setState({\n // errorMessage: \"Please enter a password that is at least 8 characters\"\n // });\n // // TODO: check password strength\n // return;\n // }\n // if (!passwordMatch || password !== passwordMatch) {\n // this.setState({ errorMessage: \"Please enter matching password\" });\n // return;\n // }\n // if (!validateEmail(email)) {\n // this.setState({\n // errorMessage: \"Please check your entered email\"\n // });\n // return;\n // }\n\n if (this.state.errorMessage) {\n return;\n } else {\n try {\n let response = await fetch(\"/api/account/signup\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n username,\n password,\n passwordMatch,\n email\n })\n });\n const res = await response.json();\n\n if (res.signup === \"success\") {\n this.props.authenticateUser(true);\n this.props.history.push(\"/\");\n } else {\n this.props.authenticateUser(false);\n this.setState({ errorMessage: res.message });\n }\n } catch (err) {\n alert(err);\n }\n }\n }" ]
[ "0.73121166", "0.72460973", "0.716876", "0.71652585", "0.7161959", "0.711264", "0.7029215", "0.70280516", "0.70277226", "0.6965956", "0.6962865", "0.6938823", "0.6885949", "0.68830234", "0.6875263", "0.6871981", "0.68713", "0.68707484", "0.6859423", "0.683193", "0.68216926", "0.68022966", "0.6786525", "0.67753035", "0.6769296", "0.67649335", "0.672556", "0.6720693", "0.6713177", "0.66844994", "0.6678725", "0.6678725", "0.66561556", "0.66553146", "0.6634663", "0.6623442", "0.6613689", "0.6596318", "0.659039", "0.6587208", "0.6580389", "0.6578869", "0.6576656", "0.656805", "0.65632504", "0.6540371", "0.6534805", "0.65259165", "0.6521837", "0.65213764", "0.65124893", "0.6503924", "0.6500595", "0.64891934", "0.64880484", "0.6479017", "0.64716285", "0.64694047", "0.64548993", "0.644451", "0.64444774", "0.6442408", "0.64374036", "0.64374036", "0.64317006", "0.6429231", "0.6419561", "0.64177686", "0.6405691", "0.64050037", "0.6397608", "0.6397545", "0.63770145", "0.6376073", "0.6357443", "0.63465595", "0.63451743", "0.63406193", "0.6333388", "0.6332561", "0.6330772", "0.6330772", "0.6330772", "0.6325108", "0.63201", "0.6319217", "0.6316281", "0.6294667", "0.6294097", "0.6292646", "0.6287405", "0.6287054", "0.6286497", "0.62819606", "0.6273818", "0.6271621", "0.62677443", "0.62677443", "0.6267578", "0.62634826" ]
0.66821253
30
Busca estudiante por matricula
async function findByMatricula(matricula){ let estudiante = await db.Estudiante.findAll({ where: { matricula: matricula } }); return estudiante; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "isMat(color) {\n // this.mat permet de vérifier que la fonction n'a pas déjà été effectué dans le tour\n if (this.mat == undefined) {\n let pion;\n // parcours toutes les cases du plateau\n for (let j = 0; j < 8; ++j) {\n for (let i = 0; i < 8; ++i) {\n pion = this.getCaseState(i, j);\n if (pion != undefined) {\n // si le pion est un roi et de la même couleur que color\n if (pion.type == \"Roi\" && pion.color == color) {\n if (this.affiche(i, j).length == 0 && this.echec[0]) {\n this.mat = true;\n return [true, pion.color, i, j];\n }\n }\n }\n }\n }\n this.mat = false;\n }\n return [this.mat];\n }", "function simplificationSysteme()\n\t{\n\t var i = null; //variables de boucles\n\t var j = null;\n\t var premiere_ligne_ok = false; //variable indiquant si la premiere ligne de la matrice est bien traité (premier coeff egal à 1)\n\t var colonne_full_zero = false; //variable indiquant si la colonne en cours est uniquement constitué de 0\n\t var sous_systeme = null;\n\t \n\t for(i = 0; i < this.matrice_systeme.length; i++) //on parcourt la matrice du systeme\n\t {\n\t if(this.matrice_systeme[i][0] == 1) //si le premier coefficient de la ligne i vaut 1\n\t {\n\t this.P(i, 0); //on place la ligne i en premiere position\n\t premiere_ligne_ok = true; //on indique que la premiere ligne est bien traité\n\t break; //on casse la boucle\n\t }\n\t }\n\t \n\t if(premiere_ligne_ok == false) //si la premiere ligne n'a pas été bien traité\n\t {\n\t for(i = 0; i < this.matrice_systeme.length; i++) //on parcourt la matrice du systeme\n\t {\n\t if(this.matrice_systeme[i][0] != 0) //des que le premier coefficient d'une est non nul\n\t {\n\t this.P(i, 0); //on place cette ligne en premiere position\n\t\t this.M(0, 1/this.matrice_systeme[0][0]); //on divise cette ligne par le premier coefficient pour reduire celui ci à 1\n\t\t premiere_ligne_ok = true; //on indique que la premiere ligne est bien traité\n\t\t break; //on casse la boucle\n\t }\n\t else //si apres avoir parcouru la matrice aucun premier coefficient non nul n'a été trouvé\n\t {\n\t if(i == this.matrice_systeme.length - 1)\n\t\t{\n\t\t colonne_full_zero = true; //on indique que la colonne est rempli de 0\n\t\t}\n\t }\n\t }\n\t }\n\t \n\t if(this.matrice_systeme.length != 1) //si la matrice du systeme n'est pas une matrice ligne\n\t {\n\t for(i = 1; i < this.matrice_systeme.length; i++) //on parcourt toutes les lignes en dessous de la premiere\n\t {\n\t if(this.matrice_systeme[i][0] != 0) //si le premier coeff est non nul\n\t {\n\t this.S(0, i, -this.matrice_systeme[i][0]); //on lui ajoute/retire une combinaison lineaire de la premiere ligne pr reduire son premier coeff à 0\n\t }\n\t }\n\t \n\t sous_systeme = new Array(); //on crée la matrice du sous systeme de notre systeme\n\t sous_systeme[0] = new Array();\n\t sous_systeme[1] = new Array();\n\t \n\t for(i = 0; i < this.matrice_systeme.length - 1; i++) //on remplit les lignes du sous systeme \n\t {\n\t sous_systeme[0][i] = new Array(); //on crée une matrice ligne pr chaque ligne\n\t sous_systeme[1][i] = this.second_membre[i+1]; //on remplit le second membre\n\t \n\t for(j = 0; j < this.matrice_systeme[i].length - 1; j++) //on remplit chaque case de la matrice du systeme du sous systeme\n\t {\n\t sous_systeme[0][i][j] = this.matrice_systeme[i+1][j+1];\n\t }\n\t }\n\t \n\t sous_systeme = new systeme(sous_systeme); //on instance le sous systeme comme une instance de la classe systeme\n\t sous_systeme.simplificationSysteme(); //on simplifie le sous systeme\n\t \n\t for(i = 0; i < this.matrice_systeme.length - 1; i++) //on recupere le sous systeme simplifié dans notre systeme actuel\n\t {\n\t this.second_membre[i+1] = sous_systeme.second_membre[i];\n\t \n\t for(j = 0; j < this.matrice_systeme[i].length - 1; j++)\n\t {\n\t this.matrice_systeme[i+1][j+1] = sous_systeme.matrice_systeme[i][j];\n\t }\n\t }\n\t }\n\t \n\t this.systeme_simplifie = true;\n\t}", "function promedioFila(fila){\n var suma = 0;\n for (let index = 0; index < COLUMNAS; index++) {\n suma += matrix[fila][index];\n }\n return suma/COLUMNAS;\n}", "constructor(){\n super();\n // Cargar identidad\n this.matrix = mat4.identity(mat4.create());\n this.auxiliar = mat4.identity(mat4.create());\n this.inicial = mat4.identity(mat4.create());\n this.contador = 0; \n }", "function matriz (col, lin) {\n //A variável Matriz é a escolhida para receber os dados das colunas e linhas do tabuleiro\n let matriz = [];\n let i = 0;\n let j = 0;\n //Utilizando Nested For Loops - ou For Loops dentro de outors - vamos criar arrays que serão os números\n //de linhas e enviá-los para a Matriz, lembrando que cada vez que rodarmos o For loop para as linhas,\n //o loop entenderá que deve-se criar novamente um array linha vazio []\n for(i = 0; i < lin; i++){\n let linha = [];\n matriz.push(linha);\n for(j = 0; j < col; j++){\n //Já aqui, a variável coluna irá gerar aleatoriamente números entre 0 e 6\n //Para isso, usamos a função Math.floor que serve para arredondar os números\n //E a função Math.random que gera números aleatórios entre 0 e 1.\n //Multiplicamos por 7 para que os resultados sejam arredondados para 0 - o menor\n //E 6 - o maior\n let coluna = Math.floor((Math.random() * 7));\n matriz[i].push(coluna);\n }\n }\n //Aqui visualizamos como nosso tabuleiro está até então\n console.log(matriz);\n //para que seja feita a contagem de peças, criamos a variável pecas, sendo essa\n //um array vazio que irá receber o valor inicial 0 através do For Loop.\n //O usuário pode também declarar as variáveis por si só, caso queira\n let pecas = [];\n for (i = 0; i < 8; i++){\n pecas.push(0);\n }\n //Aqui utilizamos novamente Nested Loops para checarmos os valores de cada linha e coluna\n //Como os valores podem ir de 0 até 6 - em concordância com os valores do array pecas acima\n //Cada vez que o for loop retornar um valor, ele vai acrescentar 1 ao valor correspondente\n //do índice da variável pecas\n for (i = 0; i < matriz.length; i++){\n for (j = 0; j < matriz[i].length; j++){\n pecas[matriz[i][j]]++;\n }\n }\n //com isso, criamos variaveis representando as possibilidades de pecas\n //Associadas a um determinado indice no array. Por conta do For Loop acima\n //cada variável já tem um valor armazenado, será utilizado abaixo\n vazio = pecas[0];\n peao = pecas[1];\n bispo = pecas[2];\n cavalo = pecas[3];\n torre = pecas[4];\n rainha = pecas[5];\n rei = pecas[6];\n //Por fim, iremos retornar os valores das peças abaixo.\n console.log(\"Casas vazias: \" + vazio);\n console.log(\"Peões: \" + peao);\n console.log(\"Bispos: \" + bispo);\n console.log(\"Cavalos: \" + cavalo);\n console.log(\"Torres: \" + torre);\n console.log(\"Rainhas: \" + rainha);\n console.log(\"Reis: \" + rei);\n }", "function promedio_filas(matrix) {\n let arr_promedios = [];\n for (let i = 0; i < rows; i++){\n let sum_fila = 0;\n for (let j = 0; j < cols; j++){\n sum_fila += matrix[i][j];\n }\n arr_promedios[i] = sum_fila / cols;\n }\n return arr_promedios;\n}", "function Moto1(matricula, km=0){\n this.matricula = matricula;\n this.km = km;\n}", "function legeMatrix(accID){this.rekening=accID; this.naam=\"\"; this.soort=\"\", this.leadCode=\"\", this.aantBb=0; this.saldoBb=0.0; this.aantMut=0; this.debet=0.0; this.credit=0.0; this.saldoMut=0.0; this.saldoEind=0.0;}", "function affichageSysteme()\n\t{\n\t var i = null;\n\t var j = null;\n\t \n\t document.write('<br /><table>');\n\t \n\t for(i = 0; i < this.matrice_systeme.length; i++)\n\t {\n document.write('<tr>');\n\t for(j = 0; j <= this.matrice_systeme[i].length; j++)\n\t {\n\t document.write('<td>');\n\t if(j == this.matrice_systeme[i].length)\n\t {\n\t document.write(' = '+this.second_membre[i]);\n\t }\n\t else\n\t {\n\t if(this.matrice_systeme[i][j] != 0)\n\t\t{\n\t document.write(this.matrice_systeme[i][j] +'<span style=\"color:blue\">a'+ j +'</span>');\n\t\t \n\t\t if(j != this.matrice_systeme[i].length - 1)\n\t\t document.write(' + ');\n\t\t}\n }\n\t document.write('</td>');\n\t }\n\t document.write('</tr>');\n\t } \n\t document.write('</table>');\n\t}", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "function affichePlateauDeJeu(mat, sep) { \t// Prend une matrice et le rend sous forme de string imprimable dans alert et prompt.\n\t\t\t\t\t\t\t\t\t\t\t\t// Inscrit toujours les axes, mais le separateur doit être spécifié.\n var imp = \"\"; \t\t\t// Retourne une string.\n var axeX = \" \";\n\t\n for (var j = (mat[0].length - 1); j >= 0; j--)\n {\n for (var i = 0; i <= (mat.length - 1 ); i++)\n { \n if(i == (mat.length -1))\n {\n imp = imp + (sep + mat[i][j] + sep + \"\\n\"); // Si nous sommes rendu a la fin de la ligne, insert new line,\n } // et mettre en plus un separateur a la fin de la ligne.\n else if (i == 0)\n {\n imp = imp + (j+1) + \" \" + sep + (mat[i][j]);// Si nous sommes au debut de la ligne, ajouter le numero de la\n } // colonne\n else\n {\n imp = imp + (sep + mat[i][j]); // Pour tout les autres cases, simplement mettre le separateur \n }; // au debut de la case.\n };\n };\n\t\n for (var l = 0; l <= (mat.length - 1); l++) // Cette sous-routine ajoute tout les chiffres de l'axe X\n {\n axeX = axeX + \" \" + (l+1); // Les chiffres sont chacuns separes d'un espace\n }\n \n imp = imp + \" \" + (repeter(\" -\", (mat.length))) + \"\\n\"; // On cree une ligne de dash au nombre de colonnes\n imp = imp + axeX;\n\t \n return(imp);\t//Retourne une string contenant le tableau à imprimer.\n}", "function siguientePaso() {\n const nuevaMatriz = Array(w);\n for (let i = 0; i < w; i++) {\n nuevaMatriz[i] = Array(h);\n for(let j = 0; j < h; j++) {\n nuevaMatriz[i][j] = calcularCelula(i,j);\n }\n }\n\n matriz = nuevaMatriz;\n actualizarCanvas();\n}", "function fill3MatsOfResult(){\r\n let matMatsIndex = 0;\r\n let cellValue = 0;\r\n for(let row = 97; row <= 105 ; row++){\r\n for(let col = 1; col <= len; col++){\r\n cellValue = Number(document.getElementById(String.fromCharCode(row) + col).value);\r\n matRows[row-97][col-1] = cellValue;\r\n matCols[col-1][row-97] = cellValue;\r\n matMatsIndex = smallMatrixSelector(row,col);\r\n matMatsAfterFill[matMatsIndex].push(cellValue);\r\n }\r\n }\r\n}", "static moyenneNote(tableauNotes,idStagiaire = -1) {\n\n // sommes des notes*coef\n // sommes des coef\n\n let sommeNoteCoef = 0\n let sommeCoef = 0\n \n tableauNotes.forEach(function(element) {\n if (element.id === idStagiaire || idStagiaire === -1) {\n sommeNoteCoef += element.note * element.coef\n sommeCoef += element.coef\n }\n\n });\n\n if (sommeCoef != 0 && tableauNotes.length !=0) {\n return sommeNoteCoef /sommeCoef\n }\n else {\n return -1\n }\n\n\n }", "function exe04() {\n var matriz = [];\n var totalLinha = [];\n var total = 0;\n var maior = 0;\n var showMaior = 0;\n\n //Insere os números na matriz\n for (var i = 0; i < 5; i++) {\n matriz[i] = [];\n\n for (var x = 0; x < 5; x++) {\n matriz[i][x] = Math.floor(Math.random() * 4) + 10;\n }\n }\n\n // // Escreve a matriz na tela\n for (var i = 0; i < 5; i++) {\n for (var x = 0; x < 5; x++) {\n document.write(matriz[i][x] + \", \");\n }\n document.write(\"<br>\")\n }\n\n document.write(\"<br>\")\n\n // Faz a soma de cada linha da matriz e a soma total\n for (var i = 0; i < 5; i++) {\n total += matriz[i][i];\n }\n\n document.write(\"<br>\")\n document.write(\"Total da diagonal - \" + total);\n}", "function accionBuscar ()\n {\n configurarPaginado (mipgndo,'DTOBuscarMatricesDTOActivas','ConectorBuscarMatricesDTOActivas',\n 'es.indra.sicc.cmn.negocio.auditoria.DTOSiccPaginacion', armarArray());\n }", "predecir(arrayInputs) {\n //Crear una matriz de n filas y 1 columna del 'arrayInputs'\n let matrizInput = Matriz.fromArray(arrayInputs);\n let matrizOutput;\n\n for (let i = 1; i < this.capaw.length; i++) {\n matrizOutput = new Matriz(this.capaw[i].filas, 1);\n matrizOutput = Matriz.mmult(this.capaw[i], matrizInput);\n matrizOutput = Matriz.suma(matrizOutput, this.capab[i]);\n\n //Si no es la ultima capa aplicar la funcion de activacion\n if (i < this.capaw.length - 1) {\n matrizOutput = this.funcionActivacion(matrizOutput);\n } else {\n //Si es la ultima capa aplicar la funcion de activacion del output\n matrizOutput = this.funcionActivacionOutput(matrizOutput);\n }\n\n matrizInput = matrizOutput;\n }\n\n return Matriz.toArray(matrizOutput);\n }", "function colisaoObs(){\r\n\r\n\tfor(var j = 0 ; j < 10 ; j++){\r\n\r\n\t\tfor(var a = j + 1; a < 10 ; a++){\r\n\r\n\t\t\tif(mata_x[j] == mata_x[a] && mata_y[j] == mata_y[a]){\r\n\r\n\t\t\t\tvar NasceObsX = Math.floor(Math.random() * ALEATORIO_MAXIMO)\r\n\t\t\t\tvar NasceObsY = Math.floor(Math.random() * ALEATORIO_MAXIMO)\r\n\r\n\t\t\t\tmata_x[j] = NasceObsX * TAMANHO_PONTO\r\n\t\t\t\tmata_y[j] = NasceObsY * TAMANHO_PONTO\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}", "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "function RdatosLogistica(Material, Partidas, Destinos, Tiempo) {\n return { Material,Partidas, Destinos, Tiempo };\n}", "processData()\n\t{\n\t\tlet filas = this.controlFilas; // Filas\n\t\tlet columnas = this.controlColumnas; // Columnas\n\t\tlet sumaClase = 0; // Sumas del tamaño de la clase\n\t\tlet data = []; // Matriz para datos\n\t\tdata[0] = []; // Init\n\t\tdata[1] = []; // fin\n\t\tdata[2] = []; // marca clase\n\t\tdata[3] = []; // Unidades\n\n\t\t// Recogemos los datos\n\t\tfor(let i = 0; i < filas; i++){\n\t\t\tfor(let j = 0; j < columnas; j++){\n\t\t\t\t// Verificamos si hay un dato\n\t\t\t\tif(document.getElementById((i+1)+''+(j+1)).value.length > 0){\n\t\t\t\t\t// Verificamos que solo se sumen columnas 1 y 2\n\t\t\t\t\tif(j == 0 || j == 1){\n\t\t\t\t\t\tsumaClase += parseFloat(document.getElementById((i+1)+''+(j+1)).value);\n\t\t\t\t\t\tif(j == 0){\n\t\t\t\t\t\t\t// Guardamos datos\n\t\t\t\t\t\t\tdata[0].push(parseFloat(document.getElementById((i+1)+''+(j+1)).value));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Guardamos datos\n\t\t\t\t\t\t\tdata[1].push(parseFloat(document.getElementById((i+1)+''+(j+1)).value));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(j == 2){\n\t\t\t\t\t\t// Guardamos datos\n\t\t\t\t\t\tdata[3].push(parseFloat(document.getElementById((i+1)+''+(j+1)).value));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Inyectamos\n\t\t\t\t\tdocument.getElementById((i+1)+''+(j+1)).value = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdata[2].push(sumaClase / 2); // Guardamos datos\n\t\t\tsumaClase = 0; // Reseteamos\n\t\t}\n\n\t\t// Mostramos texto para resultados\n\t\tlet h = document.createElement('h2');\n\t\th.setAttribute('class', 'results-title');\n\t\tlet hText = document.createTextNode('Resultados:');\n\t\th.appendChild(hText);\n\t\tdocument.getElementById('main-content').appendChild(h);\n\n\t\t// Obtenem0s medidas de tendencia central\n\t\tlet table = document.createElement('table');\n\t\ttable.setAttribute('id', 'medidas');\n\t\tlet caption = document.createElement('caption');\n\t\tcaption.setAttribute('class', 'padding');\n\t\tlet text = document.createTextNode('Medidas de tendencia central');\n\t\tcaption.appendChild(text);\n\t\ttable.appendChild(caption);\n\t\tlet row = table.insertRow(0);\n\t\tlet cell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Media aritmética');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediaAritmetica(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(1);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Moda');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.moda(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(2);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Mediana');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediana(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(3);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Media armónica');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediaArmonica(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(4);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Media geométrica');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.mediaGeometrica(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\tdocument.getElementById('main-content').appendChild(table);\n\n\t\t// Obtenem0s medidas de dispersión\n\t\ttable = document.createElement('table');\n\t\ttable.setAttribute('id', 'medidas');\n\t\tcaption = document.createElement('caption');\n\t\tcaption.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Medidas de dispersión');\n\t\tcaption.appendChild(text);\n\t\ttable.appendChild(caption);\n\t\trow = table.insertRow(0);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Desviación media');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.desviacionMedia(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(1);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Desviación estandar');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.desviacionEstandar(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\trow = table.insertRow(2);\n\t\tcell = row.insertCell(0);\n\t\tcell.setAttribute('class', 'padding');\n\t\ttext = document.createTextNode('Varianza');\n\t\tcell.appendChild(text);\n\t\tcell = row.insertCell(1);\n\t\ttext = document.createTextNode(this.process.varianza(data).toFixed(2));\n\t\tcell.appendChild(text);\n\t\tdocument.getElementById('main-content').appendChild(table);\n\t}", "constructor(nodoPadre)\n {\n super(); \n \n //Creamos la matriz y le asignamos la matriz identidad\n this.matrixaux = mat4.create();\n mat4.identity(this.matrixaux);\n this.matrix=this.matrixaux; // Matriz camara\n this.padre = nodoPadre;\n this.posicion = [];\n\n this.perspectiva = mat4.create(); \n }", "function obtenerArregloFichas(item) {\r\n var arreglo = [];\r\n for(var x = 0; x < $scope.tam.fila;x++){\r\n for(var y = 0; y< $scope.tam.col;y++){\r\n if($scope.matrizLogica[x][y]==item){\r\n arreglo.push(x + \",\" + y)\r\n }\r\n }\r\n }\r\n return arreglo;\r\n }", "calc()\n\t{\n\t\tlet filas = this.controlFilas; // Obtenemos el control\n\t\tlet columnas = this.controlColumnas; // Obtenemos el control\n\t\tlet sumaClase = 0.0; // Suma para la frecuencia\n\t\tlet resClase = 0.0; // Resultado del porcentaje\n\t\tlet totalClase = 0.0;\n\t\tlet totalFrecuencia = 0.0;\n\n\t\t// Recorremos la tabla\n\t\tfor(let i = 0; i < filas; i++){\n\t\t\tfor(let j = 0; j < columnas; j++){\n\t\t\t\t// Verificamos si hay un dato\n\t\t\t\tif(document.getElementById((i+1)+''+(j+1)).value.length > 0){\n\t\t\t\t\t// Verificamos que solo se sumen columnas 1 y 2\n\t\t\t\t\tif(j == 0 || j == 1){\n\t\t\t\t\t\tsumaClase += parseFloat(document.getElementById((i+1)+''+(j+1)).value);\n\t\t\t\t\t} else if(j == 2){\n\t\t\t\t\t\ttotalFrecuencia += parseFloat(document.getElementById((i+1)+''+(j+1)).value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tresClase = sumaClase / 2;\n\t\t\tdocument.getElementById((i+1)+'f').innerHTML = resClase; // Intectamos\n\t\t\ttotalClase += resClase;\n\t\t\tsumaClase = 0; // Reseteamos la suma\n\t\t\tresClase = 0;\n\t\t}\n\n\t\t// Inyectamos los totales\n\t\tdocument.getElementById('suma1').innerHTML = totalClase;\n\t\tdocument.getElementById('suma2').innerHTML = totalFrecuencia;\n\t}", "function buscarObjetoArray(pCelda){\n \n for(let i=0;i<matrizInicial.length;i++){\n var aux = matrizInicial[i];\n if(aux.fila == pCelda.fila && aux.columna == pCelda.columna && aux.color == pCelda.color){\n coincidencias++;\n break;\n }\n }\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "function marijuana()\n{\n\t//Data taken from: http://www.infoplease.com/us/states/marijuana-legalization.html\n\tmarijuanaArray = [0,4,2,0,3,4,3,2,0,0,0,3,0,2,0,\n\t\t\t\t\t 0,0,0,0,3,1,3,2,2,1,0,2,1,3,\n\t\t\t\t\t 2,2,2,2,1,0,1,0,4,0,3,0,0,0,\n\t\t\t\t\t 0,0,3,0,4,0,0,0]\n\n //Checks the value for the state and assigns a color\n\tfor(var i = 0; i < 51; i++)\n\t{\n\t\tstateID = IDfromAbbrev(i);\n\n\t\tif(marijuanaArray[i] == 0)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#a0e5b9\";\n\t\t}\n\t\tif(marijuanaArray[i] == 1)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#8ce0aa\";\n\t\t}\n\t\tif(marijuanaArray[i] == 2)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#78db9b\";\n\t\t}\n\t\tif(marijuanaArray[i] == 3)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#64d58c\";\n\t\t}\n\t\tif(marijuanaArray[i] == 4)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#32ba62\";\n\t\t}\n\t}\n}", "cargarMatriz() {\n for(let x = 0; x < this.columna; x ++) {\n this.arregloDePosiciones[x] = new Array();\n this.llenarMatriz(x);\n }\n return this.arregloDePosiciones;\n }", "function niveau1() {\n\ttable = [\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n\t];\n}", "function getDiferencias(option){\r\n\tvar matriz=new Array();\r\n\tvar F=(2*n-3)+2; //Filas de la Matriz de Diferenciales\r\n\tvar C=(n-1);//Columnas de la Matriz de Diferenciales\r\n\tfor(var i=0;i<F;i++){\r\n\t\tmatriz[i]=new Array();\r\n\t\tfor(var j=0;j<C;j++){\r\n\t\t\tmatriz[i][j]=0;\r\n\t\t}\r\n\t}\r\n\r\n\tvar aux=0;\r\n\tfor(var j=0;j<C;j++){\r\n\t\taux=j;\r\n\t\tfor(var i=j+1;i<F-(j+1);i+=2){\r\n\t\t\tif(j==0){\r\n\t\t\t\tmatriz[i][j]=(ry[aux+1]-ry[aux]).toPrecision(pre);\r\n\t\t\t\taux++;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tmatriz[i][j]=(matriz[aux+2][j-1]-matriz[aux][j-1]).toPrecision(1);\r\n\t\t\t\taux=aux+2;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar flag=true;\r\n\tstringRespuesta = \"<center> <h2>Esquema de Diferenciales Con Operador Central</h2><table border=1><tr>\";\r\n\tfor(var i=0;i<n-1;i++){\r\n\t\tif(i==0){\r\n\t\t\tstringRespuesta+=\"<td>n</td><td>x</td><td>y</td><td>&delta;^\"+(i+1)+\"</td>\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstringRespuesta+=\"<td>&delta;^\"+(i+1)+\"</td>\";\r\n\t\t}\r\n\t}\r\n\tstringRespuesta+=\"</tr>\"\r\n\tvar c=0;\r\n\tfor(var i=0;i<F;i++){\r\n\r\n\t\tif(flag){\r\n\t\t\tstringRespuesta+=\"<tr><td>\"+c+\"</td><td>\"+rx[c]+\"</td><td>\"+ry[c]+\"</td>\";\r\n\t\t\tc++;\r\n\t\t\tflag=false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstringRespuesta+=\"<tr><td></td><td></td><td></td>\";\r\n\t\t\tflag=true;\r\n\t\t}\r\n\t\tfor(var j=0;j<C;j++){\r\n\t\t\tstringRespuesta+=\"<td>\"+matriz[i][j]+\"</td>\";\r\n\t\t}\r\n\t\tstringRespuesta+=\"</tr>\";\r\n\r\n\t}\r\n\tstringRespuesta+=\"</table><br><br>\";\r\n\tswitch(option){\r\n\t\tcase 1:{gauss1(matriz);break;}\r\n\t\tcase 2:{gauss2(matriz);break;}\r\n\t\tcase 3:{everett(matriz);break;}\r\n\t\tcase 4:{steffensen(matriz);break;}\r\n\t\tcase 10:{operadorCentral(matriz);break;}\r\n\t\tcase 11:{segundaDerivada(matriz);break;}\r\n\t\tcase 12:{everettDer(matriz);break;}\r\n\t\tdefault:{break;}\r\n\r\n\t}\r\n}", "function calcular_chi2_critico(tabla_de_contingencia, alpha) {\n let grado_de_libertad = calcular_grado_libertad(tabla_de_contingencia);\n if (grado_de_libertad > 5) {\n // si se quiere usar la tabla para calculo de chi completa deben ser agregados los valores en la tabla chi criticos\n alert(\"La tabla de chi critico actual, solo admite grado de libertad menores o iguales que 5\"); \n return 0;\n } else {\n return tabla_chi_criticos[alpha][grado_de_libertad];\n }\n}", "calculaIMC() {\n this.imc = (this.peso / (this.altura * this.altura)).toFixed(2);\n if (this.imc < 18.5) {\n this.resultado = \"Magreza, Obesidade 0\";\n } else if (this.imc >= 18.5 && this.imc <= 24.9) {\n this.resultado = \"Normal, Obsidade 0\";\n } else if (this.imc >= 25 && this.imc <= 29.9) {\n this.resultado = \"Sobrepeso, Obesidade I\";\n } else if (this.imc >= 30 && this.imc <= 39.9) {\n this.resultado = \"Obesidade II\";\n } else if (this.imc >= 40) {\n this.resultado = \"Obesidade Grave III\";\n }\n }", "function calculatorBMR(calorie){\n let a = calorie_calc(calorie)\n console.log(a[4]);\n if (a[4] == \"Female\"){\n let BMR = (655+(a[2]*9.6)+(a[1]*1.8)-(a[3]*4.7))\n console.log(BMR + \"IS\")\n return (BMR) \n }\n else if (a[4] == \"Male\"){\n let BMR = (66+(a[2]*13.8)+(a[1]*5)-(a[3]*6.8))\n return (BMR) \n } \n\n}", "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp.filter(BLUR, oggetto.Smooth);\n\n\n mappaTemp.loadPixels();\n let f = 0;\n let k = 0;\n for (let x = 0; x < mappaTemp.width-res; x+=res) {\n punti[f] = [];\n for (let y = 0; y < mappaTemp.height-res; y+=res) {\n let c = mappaTemp.get(x, y);\n let h = brightness(c);\n punti[f][k] = h;\n k++;\n }\n k=0;\n f++;\n }\n mappaTemp.updatePixels();\n\n // CARICA TEXTURE\n gino.loadPixels();\n let i = 0;\n let j = 0;\n for (let x = 1; x <= gino.width-res; x+=res) {\n voxel[i] = [];\n voxelBN[i] = [];\n for (let y = 1; y <= gino.height-res; y+=res) {\n let c = gino.get(x, y);\n let h = brightness(c);\n voxel[i][j] = c;\n voxelBN[i][j] = h;\n j++;\n }\n j=0;\n i++;\n }\n gino.updatePixels();\n}", "function marcar(referencia) {\n\tvar ide = soNumero(referencia);\n\tvar x = ide[0];\n\tvar y = ide[1];\n\t// Checamos se o campo ainda nao foi marcado\n\tif (matriz[x][y] == -1) {\n\t\t// Checamos qual o proximo elemento\n\t\tif (checarProximo() == \"X\") {\n\t\t\tdocument.getElementById(referencia).className = \"x_dourado\";\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"O\";\n\t\t} else {\n\t\t\tdocument.getElementById(referencia).className = \"o_dourado\";\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"X\";\n\t\t}\n\t\tmatriz[x][y] = proximo;\n\t\t// Checamos se alguem ganhou\n\t\tif (checarFinal()) {\n\t\t\tanterior = false;\n\t\t\tmatriz = createMatrix(true, 3, 3);\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = proximo;\n\t\t} else {\n\t\t\tanterior = false;\n\t\t\tmatriz = createMatrix(false, 3, 3);\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"?\";\n\t\t}\n\t} else {\n\t\talert(\"Este campo já foi marcado previamente.\");\n\t}\n}", "function info(cadena) {\n\n var resultado = \"La cadena \\\"\"+cadena+\"\\\" \";\n \n // Comprobar mayúsculas y minúsculas\n if(cadena == cadena.toUpperCase()) {\n resultado += \" está formada sólo por mayúsculas\";\n }\n else if(cadena == cadena.toLowerCase()) {\n resultado += \" está formada sólo por minúsculas\";\n }\n else {\n resultado += \" está formada por mayúsculas y minúsculas\";\n }\n \n return resultado;\n }", "function resolveMatriz(){\n\tvar matriz = \n\t\t\t\t[[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0],\n\t\t\t\t[0,0,0,0,0,0,0,0,0]];\n\n\tvar nivel = parseInt($(\"#nivel\").val());\n\tvar k = parseInt($(\"#k\").val());\n\tvar i,j;\n\n\tswitch(nivel){\n\t\tcase 1: //fácil\n\t\t\tif (k == 1)\n\t\t\t\tmatriz = \n\t\t\t\t\t[[1,9,5,4,6,7,2,3,8],\n\t\t\t\t\t[4,2,8,3,5,1,7,9,6],\n\t\t\t\t\t[6,3,7,9,2,8,1,4,5],\n\t\t\t\t\t[7,1,6,8,9,4,5,2,3],\n\t\t\t\t\t[9,4,3,5,1,2,6,8,7],\n\t\t\t\t\t[8,5,2,7,3,6,9,1,4],\n\t\t\t\t\t[2,7,4,1,8,5,3,6,9],\n\t\t\t\t\t[5,6,9,2,4,3,8,7,1],\n\t\t\t\t\t[3,8,1,6,7,9,4,5,2]];\n\t\t\tif (k == 2)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,5,3,7,6,9,2,4,1],\n\t\t\t\t\t[7,4,9,2,8,1,3,6,5],\n\t\t\t\t\t[6,2,1,5,3,4,8,7,9],\n\t\t\t\t\t[9,8,2,6,4,3,5,1,7],\n\t\t\t\t\t[4,6,7,1,5,2,9,3,8],\n\t\t\t\t\t[3,1,5,8,9,7,6,2,4],\n\t\t\t\t\t[2,9,4,3,1,5,7,8,6],\n\t\t\t\t\t[5,7,6,4,2,8,1,9,3],\n\t\t\t\t\t[1,3,8,9,7,6,4,5,2]];\n\t\t\tif (k == 3)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[9,1,4,2,3,8,6,5,7],\n\t\t\t\t\t[2,5,8,6,1,7,4,3,9],\n\t\t\t\t\t[3,7,6,5,4,9,2,1,8],\n\t\t\t\t\t[5,8,9,3,2,1,7,6,4],\n\t\t\t\t\t[6,2,7,9,5,4,3,8,1],\n\t\t\t\t\t[1,4,3,7,8,6,5,9,2],\n\t\t\t\t\t[8,6,2,1,7,3,9,4,5],\n\t\t\t\t\t[4,9,5,8,6,2,1,7,3],\n\t\t\t\t\t[7,3,1,4,9,5,8,2,6]];\n\t\t\tif (k == 4)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,3,6,8,1,2,4,7,9],\n\t\t\t\t\t[1,7,4,6,9,5,8,3,2],\n\t\t\t\t\t[9,2,8,3,7,4,6,5,1],\n\t\t\t\t\t[7,4,1,9,5,6,2,8,3],\n\t\t\t\t\t[3,9,2,7,8,1,5,6,4],\n\t\t\t\t\t[6,8,5,4,2,3,1,9,7],\n\t\t\t\t\t[2,1,9,5,6,7,3,4,8],\n\t\t\t\t\t[8,5,3,1,4,9,7,2,6],\n\t\t\t\t\t[4,6,7,2,3,8,9,1,5]];\n\t\t\tif (k == 5)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,3,4,6,2,7,9,8,1],\n\t\t\t\t\t[9,6,2,1,5,8,4,3,7],\n\t\t\t\t\t[7,8,1,9,3,4,2,6,5],\n\t\t\t\t\t[6,4,5,7,8,3,1,2,9],\n\t\t\t\t\t[3,1,7,2,6,9,8,5,4],\n\t\t\t\t\t[8,2,9,4,1,5,3,7,6],\n\t\t\t\t\t[4,9,3,5,7,2,6,1,8],\n\t\t\t\t\t[1,5,8,3,9,6,7,4,2],\n\t\t\t\t\t[2,7,6,8,4,1,5,9,3]];\n\t\t\tif (k == 6)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,1,4,7,8,6,3,5,9],\n\t\t\t\t\t[7,9,8,3,4,5,2,1,6],\n\t\t\t\t\t[6,3,5,2,9,1,4,7,8],\n\t\t\t\t\t[1,5,3,8,6,2,9,4,7],\n\t\t\t\t\t[4,2,7,9,1,3,8,6,5],\n\t\t\t\t\t[8,6,9,4,5,7,1,3,2],\n\t\t\t\t\t[9,7,6,1,2,4,5,8,3],\n\t\t\t\t\t[5,4,2,6,3,8,7,9,1],\n\t\t\t\t\t[3,8,1,5,7,9,6,2,4]];\n\t\t\tif (k == 7)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,3,1,8,5,7,6,9,4],\n\t\t\t\t\t[6,8,7,1,9,4,2,3,5],\n\t\t\t\t\t[9,4,5,6,3,2,1,8,7],\n\t\t\t\t\t[8,2,9,4,6,1,7,5,3],\n\t\t\t\t\t[1,6,4,5,7,3,8,2,9],\n\t\t\t\t\t[5,7,3,2,8,9,4,1,6],\n\t\t\t\t\t[4,9,6,3,1,8,5,7,2],\n\t\t\t\t\t[3,5,8,7,2,6,9,4,1],\n\t\t\t\t\t[7,1,2,9,4,5,3,6,8]];\n\t\t\tif (k == 8)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,7,2,9,4,1,5,6,3],\n\t\t\t\t\t[6,5,1,3,7,8,9,4,2],\n\t\t\t\t\t[3,9,4,2,5,6,7,8,1],\n\t\t\t\t\t[2,3,5,1,8,7,4,9,6],\n\t\t\t\t\t[9,6,8,4,3,5,1,2,7],\n\t\t\t\t\t[4,1,7,6,2,9,8,3,5],\n\t\t\t\t\t[5,8,9,7,6,3,2,1,4],\n\t\t\t\t\t[7,4,3,8,1,2,6,5,9],\n\t\t\t\t\t[1,2,6,5,9,4,3,7,8]];\n\t\t\tif (k == 9)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[6,7,1,3,8,4,2,9,5],\n\t\t\t\t\t[9,5,4,6,2,1,7,3,8],\n\t\t\t\t\t[8,2,3,9,5,7,1,6,4],\n\t\t\t\t\t[7,4,6,5,3,2,9,8,1],\n\t\t\t\t\t[2,9,5,1,4,8,6,7,3],\n\t\t\t\t\t[3,1,8,7,9,6,5,4,2],\n\t\t\t\t\t[1,3,9,8,6,5,4,2,7],\n\t\t\t\t\t[4,8,7,2,1,9,3,5,6],\n\t\t\t\t\t[5,6,2,4,7,3,8,1,9]];\n\t\t\tif (k == 10)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,1,9,8,7,5,6,3,4],\n\t\t\t\t\t[3,6,4,1,9,2,8,7,5],\n\t\t\t\t\t[7,8,5,6,3,4,9,2,1],\n\t\t\t\t\t[6,2,3,5,4,9,1,8,7],\n\t\t\t\t\t[8,4,1,2,6,7,5,9,3],\n\t\t\t\t\t[9,5,7,3,8,1,4,6,2],\n\t\t\t\t\t[5,7,8,4,2,6,3,1,9],\n\t\t\t\t\t[1,9,6,7,5,3,2,4,8],\n\t\t\t\t\t[4,3,2,9,1,8,7,5,6]];\n\t\t\tbreak;\n\t\tcase 2: //médio\n\t\t\tif (k == 1)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,5,9,7,3,6,1,2,4],\n\t\t\t\t\t[6,2,4,9,1,5,7,3,8],\n\t\t\t\t\t[3,1,7,4,2,8,9,5,6],\n\t\t\t\t\t[4,9,5,2,8,1,3,6,7],\n\t\t\t\t\t[7,6,3,5,4,9,2,8,1],\n\t\t\t\t\t[1,8,2,3,6,7,5,4,9],\n\t\t\t\t\t[9,3,6,8,7,2,4,1,5],\n\t\t\t\t\t[5,4,8,1,9,3,6,7,2],\n\t\t\t\t\t[2,7,1,6,5,4,8,9,3]];\n\t\t\tif (k == 2)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,1,7,9,2,8,3,6,4],\n\t\t\t\t\t[6,8,4,3,5,1,2,7,9],\n\t\t\t\t\t[9,2,3,4,7,6,5,1,8],\n\t\t\t\t\t[8,9,5,2,1,4,7,3,6],\n\t\t\t\t\t[3,7,2,6,8,5,4,9,1],\n\t\t\t\t\t[1,4,6,7,9,3,8,2,5],\n\t\t\t\t\t[2,5,8,1,3,9,6,4,7],\n\t\t\t\t\t[4,3,9,5,6,7,1,8,2],\n\t\t\t\t\t[7,6,1,8,4,2,9,5,3]];\n\t\t\tif (k == 3)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[8,2,7,1,6,5,9,3,4],\n\t\t\t\t\t[3,5,9,4,7,8,6,1,2],\n\t\t\t\t\t[1,6,4,9,3,2,7,5,8],\n\t\t\t\t\t[9,8,2,6,5,1,4,7,3],\n\t\t\t\t\t[5,7,1,3,2,4,8,9,6],\n\t\t\t\t\t[4,3,6,8,9,7,1,2,5],\n\t\t\t\t\t[6,4,3,5,1,9,2,8,7],\n\t\t\t\t\t[2,1,8,7,4,3,5,6,9],\n\t\t\t\t\t[7,9,5,2,8,6,3,4,1]];\n\t\t\tif (k == 4)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,6,9,5,3,2,8,1,7],\n\t\t\t\t\t[2,5,1,8,6,7,9,4,3],\n\t\t\t\t\t[7,8,3,9,4,1,6,2,5],\n\t\t\t\t\t[5,2,4,7,8,9,3,6,1],\n\t\t\t\t\t[8,3,6,4,1,5,7,9,2],\n\t\t\t\t\t[9,1,7,3,2,6,5,8,4],\n\t\t\t\t\t[6,7,8,2,5,4,1,3,9],\n\t\t\t\t\t[1,4,5,6,9,3,2,7,8],\n\t\t\t\t\t[3,9,2,1,7,8,4,5,6]];\n\t\t\tif (k == 5)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[6,5,1,9,7,4,3,8,2],\n\t\t\t\t\t[4,9,8,3,1,2,6,5,7],\n\t\t\t\t\t[3,7,2,5,8,6,9,4,1],\n\t\t\t\t\t[1,3,5,7,2,9,8,6,4],\n\t\t\t\t\t[8,4,6,1,3,5,7,2,9],\n\t\t\t\t\t[7,2,9,6,4,8,5,1,3],\n\t\t\t\t\t[9,8,4,2,5,3,1,7,6],\n\t\t\t\t\t[5,6,7,4,9,1,2,3,8],\n\t\t\t\t\t[2,1,3,8,6,7,4,9,5]];\n\t\t\tif (k == 6)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,7,9,1,6,8,5,3,2],\n\t\t\t\t\t[1,6,2,5,3,9,8,7,4],\n\t\t\t\t\t[3,5,8,7,2,4,9,6,1],\n\t\t\t\t\t[8,4,5,9,7,6,2,1,3],\n\t\t\t\t\t[2,9,6,3,4,1,7,5,8],\n\t\t\t\t\t[7,3,1,8,5,2,4,9,6],\n\t\t\t\t\t[9,2,4,6,1,5,3,8,7],\n\t\t\t\t\t[6,8,3,2,9,7,1,4,5],\n\t\t\t\t\t[5,1,7,4,8,3,6,2,9]];\n\t\t\tif (k == 7)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[7,4,9,1,2,5,3,8,6],\n\t\t\t\t\t[2,5,1,6,8,3,9,4,7],\n\t\t\t\t\t[3,8,6,4,9,7,1,5,2],\n\t\t\t\t\t[8,1,7,2,5,6,4,3,9],\n\t\t\t\t\t[5,2,4,7,3,9,8,6,1],\n\t\t\t\t\t[9,6,3,8,1,4,2,7,5],\n\t\t\t\t\t[4,3,2,5,6,1,7,9,8],\n\t\t\t\t\t[6,9,8,3,7,2,5,1,4],\n\t\t\t\t\t[1,7,5,9,4,8,6,2,3]];\n\t\t\tif (k == 8)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[2,6,4,5,9,8,1,7,3],\n\t\t\t\t\t[1,5,3,4,7,2,9,6,8],\n\t\t\t\t\t[8,9,7,1,6,3,2,4,5],\n\t\t\t\t\t[5,8,9,2,1,6,4,3,7],\n\t\t\t\t\t[4,3,6,7,5,9,8,1,2],\n\t\t\t\t\t[7,1,2,8,3,4,5,9,6],\n\t\t\t\t\t[9,7,1,3,8,5,6,2,4],\n\t\t\t\t\t[3,4,5,6,2,1,7,8,9],\n\t\t\t\t\t[6,2,8,9,4,7,3,5,1]];\n\t\t\tif (k == 9)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[7,9,5,4,8,2,3,6,1],\n\t\t\t\t\t[3,8,6,9,7,1,2,5,4],\n\t\t\t\t\t[4,1,2,3,6,5,8,7,9],\n\t\t\t\t\t[2,5,7,8,1,9,4,3,6],\n\t\t\t\t\t[8,3,4,7,5,6,9,1,2],\n\t\t\t\t\t[1,6,9,2,4,3,7,8,5],\n\t\t\t\t\t[5,4,3,1,2,8,6,9,7],\n\t\t\t\t\t[9,7,1,6,3,4,5,2,8],\n\t\t\t\t\t[6,2,8,5,9,7,1,4,3]];\n\t\t\tif (k == 10)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[5,2,9,1,8,3,6,4,7],\n\t\t\t\t\t[1,8,6,5,4,7,9,3,2],\n\t\t\t\t\t[3,7,4,9,6,2,1,5,8],\n\t\t\t\t\t[9,6,8,2,3,5,7,1,4],\n\t\t\t\t\t[7,5,1,8,9,4,2,6,3],\n\t\t\t\t\t[2,4,3,6,7,1,8,9,5],\n\t\t\t\t\t[8,3,2,4,1,9,5,7,6],\n\t\t\t\t\t[4,9,5,7,2,6,3,8,1],\n\t\t\t\t\t[6,1,7,3,5,8,4,2,9]];\n\n\t\t\tbreak;\n\t\tcase 3: //difícil\n\t\t\tif (k == 1)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[7,2,3,9,6,1,8,4,5],\n\t\t\t\t\t[1,4,8,7,5,2,6,9,3],\n\t\t\t\t\t[9,5,6,3,8,4,2,7,1],\n\t\t\t\t\t[5,8,2,4,3,7,9,1,6],\n\t\t\t\t\t[6,1,4,2,9,5,7,3,8],\n\t\t\t\t\t[3,9,7,8,1,6,4,5,2],\n\t\t\t\t\t[2,3,5,6,4,9,1,8,7],\n\t\t\t\t\t[4,6,1,5,7,8,3,2,9],\n\t\t\t\t\t[8,7,9,1,2,3,5,6,4]];\n\t\t\tif (k == 2)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,9,6,5,3,2,8,7,1],\n\t\t\t\t\t[2,5,1,8,6,7,3,4,9],\n\t\t\t\t\t[8,7,3,1,9,4,6,5,2],\n\t\t\t\t\t[9,1,2,6,4,3,5,8,7],\n\t\t\t\t\t[5,6,4,7,8,1,9,2,3],\n\t\t\t\t\t[7,3,8,2,5,9,4,1,6],\n\t\t\t\t\t[6,8,7,9,1,5,2,3,4],\n\t\t\t\t\t[3,2,9,4,7,8,1,6,5],\n\t\t\t\t\t[1,4,5,3,2,6,7,9,8]];\n\t\t\tif (k == 3)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,8,2,4,3,5,7,9,6],\n\t\t\t\t\t[4,9,7,6,2,8,1,3,5],\n\t\t\t\t\t[6,3,5,7,9,1,8,2,4],\n\t\t\t\t\t[5,4,1,3,8,6,9,7,2],\n\t\t\t\t\t[7,6,3,9,5,2,4,1,8],\n\t\t\t\t\t[8,2,9,1,4,7,6,5,3],\n\t\t\t\t\t[2,7,4,8,1,3,5,6,9],\n\t\t\t\t\t[9,5,6,2,7,4,3,8,1],\n\t\t\t\t\t[3,1,8,5,6,9,2,4,7]];\n\t\t\tif (k == 4)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,6,1,5,9,3,2,8,7],\n\t\t\t\t\t[9,7,2,8,4,1,6,3,5],\n\t\t\t\t\t[5,8,3,2,7,6,1,9,4],\n\t\t\t\t\t[6,4,9,7,5,2,8,1,3],\n\t\t\t\t\t[1,3,5,6,8,4,9,7,2],\n\t\t\t\t\t[7,2,8,3,1,9,4,5,6],\n\t\t\t\t\t[2,1,6,9,3,5,7,4,8],\n\t\t\t\t\t[3,9,7,4,2,8,5,6,1],\n\t\t\t\t\t[8,5,4,1,6,7,3,2,9]];\n\t\t\tif (k == 5)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[9,8,3,2,7,4,1,6,5],\n\t\t\t\t\t[1,6,4,8,5,9,3,7,2],\n\t\t\t\t\t[7,5,2,1,3,6,4,8,9],\n\t\t\t\t\t[5,9,7,6,4,2,8,3,1],\n\t\t\t\t\t[2,3,1,5,8,7,9,4,6],\n\t\t\t\t\t[6,4,8,9,1,3,5,2,7],\n\t\t\t\t\t[3,7,6,4,9,1,2,5,8],\n\t\t\t\t\t[8,2,9,3,6,5,7,1,4],\n\t\t\t\t\t[4,1,5,7,2,8,6,9,3]];\n\t\t\tif (k == 6)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,4,7,5,8,6,2,3,9],\n\t\t\t\t\t[6,8,3,2,7,9,5,1,4],\n\t\t\t\t\t[2,5,9,3,1,4,7,8,6],\n\t\t\t\t\t[4,1,5,6,9,3,8,7,2],\n\t\t\t\t\t[7,2,8,1,4,5,6,9,3],\n\t\t\t\t\t[3,9,6,7,2,8,4,5,1],\n\t\t\t\t\t[5,6,4,9,3,7,1,2,8],\n\t\t\t\t\t[9,7,1,8,6,2,3,4,5],\n\t\t\t\t\t[8,3,2,4,5,1,9,6,7]];\n\t\t\tif (k == 7)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,4,6,8,3,9,2,7,5],\n\t\t\t\t\t[3,7,5,4,2,6,9,8,1],\n\t\t\t\t\t[8,2,9,1,7,5,4,3,6],\n\t\t\t\t\t[9,6,2,5,4,8,3,1,7],\n\t\t\t\t\t[4,8,3,9,1,7,5,6,2],\n\t\t\t\t\t[5,1,7,3,6,2,8,9,4],\n\t\t\t\t\t[2,5,1,7,9,3,6,4,8],\n\t\t\t\t\t[6,9,4,2,8,1,7,5,3],\n\t\t\t\t\t[7,3,8,6,5,4,1,2,9]];\n\t\t\tif (k == 8)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[4,1,2,8,3,5,7,9,6],\n\t\t\t\t\t[9,7,8,4,6,2,3,1,5],\n\t\t\t\t\t[3,6,5,9,1,7,4,8,2],\n\t\t\t\t\t[5,9,3,1,4,6,2,7,8],\n\t\t\t\t\t[6,8,4,7,2,3,9,5,1],\n\t\t\t\t\t[7,2,1,5,8,9,6,3,4],\n\t\t\t\t\t[8,5,6,3,9,4,1,2,7],\n\t\t\t\t\t[2,3,7,6,5,1,8,4,9],\n\t\t\t\t\t[1,4,9,2,7,8,5,6,3]];\n\t\t\tif (k == 9)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[1,8,4,2,3,7,9,6,5],\n\t\t\t\t\t[3,5,2,9,4,6,1,8,7],\n\t\t\t\t\t[6,9,7,5,1,8,3,4,2],\n\t\t\t\t\t[9,6,8,7,5,3,4,2,1],\n\t\t\t\t\t[4,1,5,8,6,2,7,3,9],\n\t\t\t\t\t[2,7,3,1,9,4,6,5,8],\n\t\t\t\t\t[8,3,9,6,7,5,2,1,4],\n\t\t\t\t\t[5,4,1,3,2,9,8,7,6],\n\t\t\t\t\t[7,2,6,4,8,1,5,9,3]];\n\t\t\tif (k == 10)\n\t\t\t\tmatriz =\n\t\t\t\t\t[[3,7,9,5,1,8,6,2,4],\n\t\t\t\t\t[6,1,4,9,2,3,7,8,5],\n\t\t\t\t\t[2,5,8,6,7,4,3,1,9],\n\t\t\t\t\t[1,4,7,8,5,9,2,6,3],\n\t\t\t\t\t[8,2,6,3,4,1,9,5,7],\n\t\t\t\t\t[5,9,3,7,6,2,8,4,1],\n\t\t\t\t\t[4,6,1,2,9,7,5,3,8],\n\t\t\t\t\t[9,8,2,4,3,5,1,7,6],\n\t\t\t\t\t[7,3,5,1,8,6,4,9,2]];\n\t\t\tbreak;\n\t}\n\n\tfor (i = 1; i <= 9; i++){\n\t\tfor (j = 1; j <= 9; j++){\n\t\t\t$(\"#\" + i + \"x\" + j).val(matriz[i-1][j-1]);\n\t\t}\n\t}\n}", "calcularIMC() {\n const peso = this.peso;\n const altura = this.altura;\n return (peso / altura * altura)\n }", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function getAvailability() {\r\n for (var i = 0; i < numberOfProfessors; i++) {\r\n var availability = document.getElementById(\"inputP\" + i).value; // get the value of the input by id\r\n var availabilityArray = availability.split(\",\");\r\n for (var j = 0; j < availabilityArray.length; j++) {\r\n matrixAvail[i][Number(availabilityArray[j]) - 1] = 1;\r\n }\r\n }\r\n }", "getMatX( i, j,w)\n { \n return this.mats[i][j]%w;\n }", "function mostrarTabla() {\n //valor del rubro varas\n var varas = 0.25;\n\n //eliminar tabla\n maderaTabla.innerHTML = \"\";\n\n //encabezado de la tabla\n var tr = document.createElement(\"tr\");\n maderaTabla.appendChild(tr);\n maderaTabla.className = \"formatos1\";\n\n //centra la tabla\n maderaTabla.className = \"table\";\n\n //th es el elemento encabezado, tr es la fila\n var th = document.createElement(\"th\");\n th.innerHTML = \"Ancho\";\n th.className= \"centrado\";\n tr.appendChild(th);\n\n th = document.createElement(\"th\");\n th.innerHTML = \"Grueso\";\n tr.appendChild(th);\n\n th = document.createElement(\"th\");\n th.innerHTML = \"Varas\";\n tr.appendChild(th);\n\n th = document.createElement(\"th\");\n th.innerHTML = \"Precio\";\n tr.appendChild(th);\n\n th = document.createElement(\"th\");\n th.innerHTML = \"Total\";\n tr.appendChild(th);\n\n //ciclo que recorre todo el arreglo para mostrar la tabla\n for (var y = 0; y < datos[0].length; y++) {\n var tr = document.createElement(\"tr\");\n maderaTabla.appendChild(tr);\n\n //agrega el dato a la posición respectiva del arreglo\n var td = document.createElement(\"td\");\n td.innerHTML = datos[0][y];\n tr.appendChild(td);\n\n var td = document.createElement(\"td\");\n td.innerHTML = datos[1][y];\n tr.appendChild(td);\n\n var td = document.createElement(\"td\");\n td.innerHTML = datos[2][y];\n tr.appendChild(td);\n\n var td = document.createElement(\"td\");\n td.innerHTML = datos[3][y];\n tr.appendChild(td);\n\n //formula de resultado\n var td = document.createElement(\"td\");\n var total = datos[0][y] * datos[1][y] * (datos[2][y] * varas) * datos[3][y];\n td.innerHTML = total;\n tr.appendChild(td);\n }\n\n //Agregar la pos4 a la matriz usando la variable total, en la tabla y matriz agrega el dato\n datos[4].push(total);\n }", "function montaValorMes () {\r\n\t\t\t// laco de despesas\r\n\t\t\tfor (var x in $scope.despesas) {\r\n\t\t\t\t// separo a despesa\r\n\t\t\t\tvar despesa = $scope.despesas[x];\r\n\t\t\t\t// crio um atributo pres(array) na despesa\r\n\t\t\t\tdespesa.pres = [];\r\n\r\n\t\t\t\t// laco de meses até 8\r\n\t\t\t\t// for (var m=0; m<8; m++) {\r\n\t\t\t\tfor (var m=0; m<$scope.tlmeses; m++) {\r\n\t\t\t\t\tvar day = moment().add(m, \"M\").date(); // dia atual + 1\r\n\t\t\t\t\tvar month = moment().add(m, \"M\").month(); // mes atual + 1\r\n\t\t\t\t\tvar year = moment().add(m, \"M\").year(); // ano atual + 1\r\n\t\t\t\t\tvar data = ''; // variavel data\r\n\r\n\t\t\t\t\t// laco de prestacoes da despesa\r\n\t\t\t\t\tfor (var p=0; p<despesa.prestacoes; p++) {\r\n\t\t\t\t\t\tvar dia = moment(despesa.datavencimento).add(p, \"M\").date(); // dia da data despesa + index\r\n\t\t\t\t\t\tvar mes = moment(despesa.datavencimento).add(p, \"M\").month(); // mes data despesa + index\r\n\t\t\t\t\t\tvar ano = moment(despesa.datavencimento).add(p, \"M\").year(); // ano data despesa + index\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// caso o mes e ano da despesa seja = ao mes e ano atual \r\n\t\t\t\t\t\tif (mes === month && ano === year) {\r\n\t\t\t\t\t\t\tdata = {\"data\": mes+\"/\"+ano, \"valor\":despesa.valor};\r\n\t\t\t\t\t\t\t// pegando a prestação atual\r\n\t\t\t\t\t\t\tif (m === 0) { // m = o ( mes atual )\r\n\t\t\t\t\t\t\t\tdespesa.prestacao = (p+1)+\"/\"+despesa.prestacoes;\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\r\n\t\t\t\t\tif (!despesa.prestacao) {\r\n\t\t\t\t\t\t// se ano = atual mas mes menor ou ano menor\r\n\t\t\t\t\t\tif ( (ano === year && mes < month) || (ano < year) ) {\r\n\t\t\t\t\t\t\tdespesa.prestacao = despesa.prestacoes+\"/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tdespesa.prestacao = \"0/\"+despesa.prestacoes;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( data === '' ) {\r\n\t\t\t\t\t\tdespesa.pres.push({\"data\": \"00/0000\", \"valor\":\"xxxx\", \"color\":\"background:#f0f5f5; color:#ccc;\", \"icon\":\"fa-trophyx\"});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tdespesa.pres.push(data);\r\n\t\t\t\t\t\t$scope.totais[m].valor = $scope.totais[m].valor + parseInt(despesa.valor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($scope.totais[m-1] != undefined && $scope.totais[m].valor < $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-down\";\r\n\t\t\t\t\t\t}else if($scope.totais[m-1] != undefined && $scope.totais[m].valor > $scope.totais[m-1].valor) {\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-up\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$scope.totais[m].icon = \"fa-arrow-right\";\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$scope.totalgeral = $scope.totalgeral + parseFloat(despesa.valor);\r\n\t\t\t}\r\n\t\t}", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "function valoresAleatorios(){\n\tindiceCartas[0][0] = 1;\n\tindiceCartas[1][0] = 1;\n\tindiceCartas[2][0] = 4;\n\tindiceCartas[3][0] = 4;\n\tindiceCartas[4][0] = 7;\n\tindiceCartas[0][1] = 2;\n\tindiceCartas[1][1] = 2;\n\tindiceCartas[2][1] = 3;\n\tindiceCartas[3][1] = 3;\n\tindiceCartas[4][1] = 8;\n\tindiceCartas[0][2] = 5;\n\tindiceCartas[1][2] = 5;\n\tindiceCartas[2][2] = 6;\n\tindiceCartas[3][2] = 6;\n\tindiceCartas[4][2] = 7;\n\tindiceCartas[0][3] = 8;\n\tindiceCartas[1][3] = 9;\n\tindiceCartas[2][3] = 9;\n\tindiceCartas[3][3] = 10;\n\tindiceCartas[4][3] = 10;\n}", "function auxNaipes(promedio) {\n let simbolo;\n\n if(promedio > 0 && promedio <= 19) \n simbolo = 'A';\n else if(promedio >= 20 && promedio <= 38) \n simbolo = 'B';\n else if(promedio >= 39 && promedio <= 57) \n simbolo = 'C';\n else if(promedio >= 58 && promedio <= 76) \n simbolo = 'D';\n else if(promedio >= 77 && promedio <= 95) \n simbolo = 'E';\n else if(promedio >= 96 && promedio <= 114) \n simbolo = 'F';\n else if(promedio >= 115 && promedio <= 133) \n simbolo = 'G';\n else if(promedio >= 134 && promedio <= 152) \n simbolo = 'H';\n else if(promedio >= 153 && promedio <= 171) \n simbolo = 'I';\n else if(promedio >= 172 && promedio <= 190) \n simbolo = 'J';\n else if(promedio >= 191 && promedio <= 209) \n simbolo = 'K';\n else if(promedio >= 210 && promedio <= 228) \n simbolo = 'L';\n else if(promedio >= 229 && promedio <= 256) \n simbolo = 'M';\n return simbolo;\n\n}", "calculerPourUnelement(element,bacterie,col){\n\t\tlet glucose = element.glucose;//\n\t\tlet color = ['#000000','#800000','#008000','#cc99ff','#ccff99','#ffe699','#ff6384','#36a2eb','#cc65fe','#ffce56'];\n\t\tlet bacterieTab = new Array(this.nombreHeurs);\n\t\tbacterieTab[0] = this.bacteriesBase;\n\t\tfor(let i = 1 ; i < this.nombreHeurs ; i++){\n\t\t\tconsole.log(\"Etape : \"+i+\" glucose : \"+glucose+\"\\n\");\n\t\t\tif(glucose > 0){\n\t\t\t\tlet ajoutTemp = bacterieTab[i-1] * element.facteurMultiplication * bacterie.division * this.facteurTemperature(element,bacterie) * this.facteurPh(element,bacterie);\n\t\t\t\tbacterieTab[i] = ajoutTemp;\n\t\t\t\tif(glucose - GlucoseParDivision*ajoutTemp >= 0){\n\t\t\t\t\tglucose = glucose - GlucoseParDivision*ajoutTemp ;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tglucose = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbacterieTab[i] = bacterieTab[i-1]\n\t\t\t}\n\t\t\tif(i >= cycleBacterien ){\n\t\t\t\tif(bacterieTab[i] - bacterieTab[i-cycleBacterien] >= 0){\n\t\t\t\tbacterieTab[i] = bacterieTab[i] - bacterieTab[i-cycleBacterien];//mort de bacteries\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbacterieTab[i] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn {data : bacterieTab , label : element.nom ,borderColor : color[col],fill : false ,borderWidth : 1 };\n\t}", "function Oggetto(_id, _anni, _speranzav, _morti,/* _saturation, _brightness, _morti, _forma*/) {\r\n // DATI E COSTRUTTORE\r\n this.id = Number(_id); // < Number() converte in numero intero la stringa\r\n this.anni2015 = _anni;\r\n // < Number() converte in numero intero la stringa\r\n this.speranzadivita2015 = _speranzav;\r\n this.morti2015 =_morti;\r\n\r\n this.mostra = function() {\r\n\r\n noStroke();\r\n fill(255);\r\n textAlign(LEFT, CENTER);\r\n push();\r\n translate(grid + (this.id * grid),height/3);\r\n\r\n\r\n text(this.anni2015,-40,10,);\r\n\r\n rotate(PI/2);\r\n fill(255, 24, 10);\r\n text(this.morti2015,30,00);\r\n fill(25, 204, 100);\r\n text(this.speranzadivita2015,30,30);\r\n\r\n\r\n // disegna barrette\r\n rotate(3*PI/2);\r\n fill(25, 204, 100);\r\n rect(-38, 60, 10, this.speranzadivita2015);\r\n\r\n\r\n fill(255, 24, 10);\r\n rect(-8, 60, 10, this.morti2015);\r\n\r\n pop();\r\n\r\n }\r\n}", "function contrari(fantasma){\n var vContrari;\r\n if(fantasma[3] == 1) vContrari = 3;\n if(fantasma[3] == 2) vContrari = 4;\n if(fantasma[3] == 3) vContrari = 1;\n if(fantasma[3] == 4) vContrari = 2;\n return vContrari;\r\n}", "function ColunaMatriz(coluna, tabuleiro) {\n var x = new Array(MAX);\n for(var i = 0; i < MAX; i++){\n x[i]= tabuleiro[i][coluna];\n }\n return x;\n}// fim do colunaMatriz******************************************************************", "multiply(mat) {\n const m00 = this.v[0] * mat.v[0] + this.v[4] * mat.v[1] + this.v[8] * mat.v[2] + this.v[12] * mat.v[3];\n const m01 = this.v[0] * mat.v[4] + this.v[4] * mat.v[5] + this.v[8] * mat.v[6] + this.v[12] * mat.v[7];\n const m02 = this.v[0] * mat.v[8] + this.v[4] * mat.v[9] + this.v[8] * mat.v[10] + this.v[12] * mat.v[11];\n const m03 = this.v[0] * mat.v[12] + this.v[4] * mat.v[13] + this.v[8] * mat.v[14] + this.v[12] * mat.v[15];\n const m10 = this.v[1] * mat.v[0] + this.v[5] * mat.v[1] + this.v[9] * mat.v[2] + this.v[13] * mat.v[3];\n const m11 = this.v[1] * mat.v[4] + this.v[5] * mat.v[5] + this.v[9] * mat.v[6] + this.v[13] * mat.v[7];\n const m12 = this.v[1] * mat.v[8] + this.v[5] * mat.v[9] + this.v[9] * mat.v[10] + this.v[13] * mat.v[11];\n const m13 = this.v[1] * mat.v[12] + this.v[5] * mat.v[13] + this.v[9] * mat.v[14] + this.v[13] * mat.v[15];\n const m20 = this.v[2] * mat.v[0] + this.v[6] * mat.v[1] + this.v[10] * mat.v[2] + this.v[14] * mat.v[3];\n const m21 = this.v[2] * mat.v[4] + this.v[6] * mat.v[5] + this.v[10] * mat.v[6] + this.v[14] * mat.v[7];\n const m22 = this.v[2] * mat.v[8] + this.v[6] * mat.v[9] + this.v[10] * mat.v[10] + this.v[14] * mat.v[11];\n const m23 = this.v[2] * mat.v[12] + this.v[6] * mat.v[13] + this.v[10] * mat.v[14] + this.v[14] * mat.v[15];\n const m30 = this.v[3] * mat.v[0] + this.v[7] * mat.v[1] + this.v[11] * mat.v[2] + this.v[15] * mat.v[3];\n const m31 = this.v[3] * mat.v[4] + this.v[7] * mat.v[5] + this.v[11] * mat.v[6] + this.v[15] * mat.v[7];\n const m32 = this.v[3] * mat.v[8] + this.v[7] * mat.v[9] + this.v[11] * mat.v[10] + this.v[15] * mat.v[11];\n const m33 = this.v[3] * mat.v[12] + this.v[7] * mat.v[13] + this.v[11] * mat.v[14] + this.v[15] * mat.v[15];\n return this.setComponents(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33);\n }", "function adivinarSexoEstudiante(estudiantes) {\n //valor que se utilizará para comparar\n var resultado = 100000;\n //tupla que almacenará la posición más cercana \n var numeroTupla = 0;\n //for que recorre todos los datos como parámetro de la consulta \n //de la tabla de estudiantes\n for (var i = 0; i < estudiantes.length; i++) {\n var recintoTupla = 1;\n var estiloTupla = 0;\n \n \n //se le da valor a los recintos que pertenecen las personas en las\n //tuplas si es paraíso es 1 y turrialba es 2 \n if (estudiantes[i].recinto === 'Turrialba') {\n recintoTupla = 2;\n }\n //se elige el estilo de aprendizaje y se le asigna un valor\n //de 1 a 4\n switch (estudiantes[i].estilo) {\n case 'DIVERGENTE':\n estiloTupla = 1;\n break;\n case 'CONVERGENTE':\n estiloTupla = 2;\n break;\n case 'ASIMILADOR':\n estiloTupla = 3;\n break;\n case 'ACOMODADOR':\n estiloTupla = 4;\n break;\n }\n \n //distancia euclidiana aplicada a los valores de las tuplas para definir distancia\n var sumatoria = Math.pow((estiloTupla - (parseInt(document.getElementById('estilo').value))), 2) + Math.pow(recintoTupla - (parseInt(document.getElementById('recinto').value)), 2) + Math.pow((parseFloat(estudiantes[i].promedio)) - (parseFloat(document.getElementById('promedio').value)), 2);\n var distancia = Math.sqrt(sumatoria);\n \n //aquí comparan para mostrar el más cercano al que entra como parámetro\n //comparando los datos de la tupla y los ingresados\n if (resultado > distancia) {\n resultado = distancia;\n numeroTupla = i;\n } \n }\n \n //if para mostrar el sexo en la pantalla dependiendo de la tupla\n if(estudiantes[numeroTupla].sexo === 'M')\n document.getElementById('mensaje3').innerHTML = 'Su sexo es: Masculino y el número de tupla es: '+estudiantes[numeroTupla].id+'.';\n else\n document.getElementById('mensaje3').innerHTML = 'Su sexo es: Femenino y el número de tupla es: '+estudiantes[numeroTupla].id+'.';\n}", "function cfasi_lunari(mese,anno,fase){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Luglio 2010\n // funzione per il calcolo delle fasi lunari.\n // mese= numero del mese da 1 a 12.\n // anno=anno di riferimento.\n // k=0.00 per la luna nuova\n // k=0.25 per il primo quarto.\n // k=0.50 per la luna piena\n // k=0.75 per l'ultimo quarto.\n // fase= valore numerico per la fase 0 - 0.25 - 0.50 - 0.75 sono ammessi solo questi valori.\n \nvar anno_dec=anno+(mese/12);\nvar k=(anno_dec-1900)*12.3685; // calcolo della costante k. (parseInt) tronca la parte decimale\n k=parseInt(k)*1+fase*1;\n \nvar T=k/1236.85;\n\nvar fseno=166.56+132.87*T-0.009173*T*T;\n fseno=fseno/180*Math.PI;\n\nvar njd_fase =2415020.75933+29.53058868*k+0.0001178*T*T-0.000000155*T*T*T+0.00033*Math.sin(fseno);\n\n // calcolo anomalia media del sole.\n\nvar M=359.2242+29.10535608*k-0.0000333*T*T-0.00000347*T*T*T;\n M=gradi_360(M);\n M=M/180*Math.PI;\n\n // calcolo anomalia media della luna.\n\nvar M1=306.0253+385.81691806*k+0.0107306*T*T+0.00001236*T*T*T;\n M1=gradi_360(M1);\n M1=M1/180*Math.PI;\n\n // calcolo dell'argomento della latitudine della luna.\n\nvar F=21.2964+390.67050646*k-0.0016528*T*T-0.00000239*T*T*T;\n F=gradi_360(F);\n F=F/180*Math.PI;\n\n // calcolo correzioni per la luna nuova e piena.\n\nvar correzione1=0;\n\nif (fase==0 || fase==0.50) {\n \n correzione1= (0.1734-0.000393*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.4068*Math.sin(M1)\n +0.0161*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0104*Math.sin(2*F)\n -0.0051*Math.sin(M+M1)\n -0.0074*Math.sin(M-M1)\n +0.0004*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0010*Math.sin(2*F-M1)\n +0.0005*Math.sin(M+2*M1); \n}\n\nelse if (fase==0.25 || fase==0.75) {\n \n correzione1= (0.1721-0.0004*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.6280*Math.sin(M1)\n +0.0089*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0079*Math.sin(2*F)\n -0.0119*Math.sin(M+M1)\n -0.0047*Math.sin(M-M1)\n +0.0003*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0021*Math.sin(2*F-M1)\n +0.0003*Math.sin(M+2*M1)\n +0.0004*Math.sin(M-2*M1)\n -0.0003*Math.sin(2*M+M1); \n}\n\nelse {alert(\"Valore fase \"+fase+\" non valido!\");}\n\nvar njd_fase=njd_fase+correzione1; // per la luna nuova.\n\n // njd_fase= numero dei giorni giuliani.\nreturn njd_fase;\n\n}", "function sectie_Tabel(){\n\t\t\tvar somBB = 0.0;\n\t\t\tvar saldoMut = 0.0;\n\t\t\tvar saldoEind = 0.0;\n\t\t\tvar resultaat = '';\n\t\t\tvar tmpBedrag = 0.0\n\t\t\t// Header van de tabel\n\t\t\tresultaat +='<p></p><table class=\"sortable\" id=\"tabel_A000n\"><caption>A000n - Kolommenbalans/Saldibalans</caption><thead><tr>';\n\t\t\t[\"Rekening\", \"Naam\", \"Soort\", \"leadCode\", \"BeginBalans\", \"Aantal Mut\", \"ProefDebet\", \"ProefCredit\", \"Saldo Mut\", \"Eindsaldo\"].forEach(function(item) { resultaat += \"<th>\"+item+\"</th>\";});\n\n\t\t\tresultaat += \"</tr></thead> <tbody>\";\n\t\t\tfor (var i = 0; i < matrix.length; i++){\n\t\t\t\tsaldoMut = matrix[i].debet-matrix[i].credit;\n\t\t\t\tsaldoEind = matrix[i].saldoBb + saldoMut;\n\t\t\t\tresultaat += \"<tr>\";\n\t\t\t\tresultaat += \"<td>\"+matrix[i].rekening+\"</td>\";\n\t\t\t\tresultaat += \"<td>\"+matrix[i].naam+\"</td>\";\n\t\t\t\tresultaat += \"<td>\"+matrix[i].soort+\"</td>\";\n\t\t\t\tresultaat += \"<td>\"+matrix[i].leadCode+\"</td>\";\n\t\t\t\tif (matrix[i].aantBb>0){ // Beginbalans alleen weergeven indien er BB mutaties zijn.\n\t\t\t\t\tresultaat += \"<td class='num\"+(matrix[i].saldoBb<0 ? \" Neg\" : \"\")+\"'>\" +matrix[i].saldoBb.toFixed(2)+\"</td>\";\n\t\t\t\t} else {\n\t\t\t\t\tresultaat += \"<td></td>\";\n\t\t\t\t}\n\t\t\t\tif (matrix[i].aantMut>0){ // Mutatiegegevens alleen weergeven als er mutaties zijn.\n\t\t\t\t\tresultaat += \"<td class='num'>\"+matrix[i].aantMut+\"</td>\";\n\t\t\t\t\ttmpBedrag = matrix[i].debet;\n\t\t\t\t\tresultaat += \"<td class='num\"+(tmpBedrag<0 ? \" Neg\" : \"\")+(tmpBedrag==0 ? \" nul\" : \"\")+\"'>\" +tmpBedrag.toFixed(2)+\"</td>\";\n\t\t\t\t\ttmpBedrag = matrix[i].credit;\n\t\t\t\t\tresultaat += \"<td class='num\"+(tmpBedrag<0 ? \" Neg\" : \"\")+(tmpBedrag==0 ? \" nul\" : \"\")+\"'>\" +tmpBedrag.toFixed(2)+\"</td>\";\n\t\t\t\t} else {\n\t\t\t\t\tresultaat += \"<td></td><td></td><td></td>\";\n\t\t\t\t}\n\t\t\t\tresultaat += \"<td class='num\"+(saldoMut<0 ? \" Neg\" : \"\")+\"'>\"+saldoMut.toFixed(2)+\"</td>\";\n\t\t\t\tresultaat += \"<td class='num\"+(saldoEind<0 ? \" Neg\" : \"\")+\"'>\"+saldoEind.toFixed(2)+\"</td>\";\n\t\t\t\tresultaat += \"</tr>\";\n\t\t\t\tsomBB +=matrix[i].saldoBb;\n\t\t\t\tsomAantMut +=matrix[i].aantMut;\n\t\t\t\tsomDebet +=matrix[i].debet;\n\t\t\t\tsomCredit +=matrix[i].credit;\n\t\t\t}\n\t\t\tresultaat += \"</tbody><tfoot><tr>\";\n\t\t\tresultaat += \"<td>Totaal</td>\";\n\t\t\tresultaat += \"<td></td><td></td>\";\n\t\t\tresultaat += \"<td class='num\"+(Math.abs(somBB)>1 ? \" Verschil\" : \" Ok\")+\"'>\"+somBB.toFixed(2)+\"</td>\";\n\t\t\tresultaat += \"<td class='num'>\" +somAantMut.toFixed(0)+\"</td>\";\n\t\t\tresultaat += \"<td class='num\"+(somDebet<0 ? \" Neg\" : \"\")+\"'>\" +somDebet.toFixed(2)+\"</td>\";\n\t\t\tresultaat += \"<td class='num\"+(somCredit<0 ? \" Neg\" : \"\")+\"'>\"+somCredit.toFixed(2)+\"</td>\";\n\t\t\tsaldoMut = somDebet-somCredit;\n\t\t\tresultaat += \"<td class='num\"+(Math.abs(saldoMut)>1 ? \" Verschil\" : \" Ok\")+\"'>\"+saldoMut.toFixed(2)+\"</td>\";\n\t\t\tsaldoEind = somBB + saldoMut;\n\t\t\tresultaat += \"<td class='num\"+(Math.abs(saldoEind)>1 ? \" Verschil\" : \" Ok\")+\"'>\"+saldoEind.toFixed(2)+\"</td>\";\n\t\t\tresultaat += \"</tr></tfoot></table>\";\n\n\n\t\t\t// - Geef een oordeel: Debet-Credit in evenwicht ?\n\t\t\tif (Math.abs(somBB)>1){\n\t\t\t\tresultaat += '<p class=\"error\">\\u2A2F Fout: Debet-Credit in Beginbalans is NIET in evenwicht.</p>';\n\t\t\t} else {\n\t\t\t\tresultaat += '<p class=\"ok\">\\u2713 Ok: Debet-Credit in Beginbalans is in evenwicht.</p>';\n\t\t\t}\n\t\t\tif (Math.abs(saldoMut)>1){\n\t\t\t\tresultaat += '<p class=\"error\">\\u2A2F Fout: Debet-Credit in Mutaties is NIET in evenwicht.</p>';\n\t\t\t} else {\n\t\t\t\tresultaat += '<p class=\"ok\">\\u2713 Ok: Debet-Credit in Mutaties is in evenwicht.</p>';\n\t\t\t}\n\t\t\tif (Math.abs(saldoEind)>1){\n\t\t\t\tresultaat += '<p class=\"error\">\\u2A2F Fout: Debet-Credit in Eindsaldo is NIET in evenwicht.</p>';\n\t\t\t} else {\n\t\t\t\tresultaat += '<p class=\"ok\">\\u2713 Ok: Debet-Credit in Eindsaldo is in evenwicht.</p>';\n\t\t\t}\n\n\t\t\t// Hint voor handmatige vervolgactie:\n\t\t\tresultaat += '<p class=\"hint\">! Hint: Stel vast dat de saldilijst aansluit bij de gegevens in het bronsysteem.</p>';\n\t\t\treturn resultaat;\n\t\t} // einde maakTabel", "function mostraMercadoArmas(){\n let j = 0\n //let btn = criaElementos('button', 'Comprar',$tabelaMercado)\n $tabelaMercado.innerHTML = '';\n mercadoArmas.forEach((ma)=>{\n let b = ma.bonusArma//ma.forca + (jogador1.powerRS * (ma.pBonus));\n b = b.toFixed(0);\n\n criaTabela($tabelaMercado, ma.nome,\n `${ma.forca}+${jogador1.powerRS}*${ma.pBonus*100}% = ${b} Bônus`,\n ma.precoTxt,\n `<button onclick=\"compraArma(${j})\">Compar</button>`);\n j++;\n })\n}", "function cargarMat(mat) {\n for (let i = 0; i < fila; i++) {\n mat[i] = [];\n for (let j = 0; j < col; j++) {\n mat[i][j] = Math.floor(Math.random() * 100 + 1);\n\n }\n\n }\n}", "function calcularTasaMuerta(id) {\r\n //Obtener el valor de la Amortizacion\r\n var lista1 = document.getElementById(\"amortizacion1\");\r\n var amort_cf1 = lista1.options[lista1.selectedIndex].text;\r\n //Si el usuario ingresa el valor Efectivo anual\r\n if (id == \"EA1\") {\r\n \t\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n\t\t\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n //alert(document.getElementById(\"tasa_EA_cf1\").value);\r\n \r\n\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"NA1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 12);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 4);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"Ip1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 30)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 90)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n}", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "function calcular() {\r\n var NUMEROYSIGNO = document.micalcu.display.value; //ME CREO UNA VARIABLE QUE ES IGUAL=document.nombreformulario.dondesemuestra.value -->\r\n document.micalcu.display.value = eval(NUMEROYSIGNO); // y digo que los datos metidos me lo cualcule la funcion eval(NUMEROYSIGNO) -->\r\n}", "function spindulioReiksme () {\n// let ivedimoLaukas = document.querySelector('div input');\n let r = document.querySelector('div input').value;\n let plotas= Math.PI*r*r\n\n// console.log(plotas);\ndocument.querySelector(\".apskritimo-plotas\").innerHTML = plotas;\n}", "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral direita - 2\n if(esfera.posicao[0] + esfera.raio > parametrosMesa.xMax)\n {\n if(ultimaColisao != 2)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 2;\n } \n }\n\n //cima - 3\n if(esfera.posicao[1] - esfera.raio < parametrosMesa.zMax)\n {\n if(ultimaColisao != 3)\n {\n veloc[2] = -parametrosMesa.coeficienteRestituicao * veloc[2];\n ultimaColisao = 3; \n }\n \n }\n\n //corredor direito - 4\n if(esfera.posicao[1] - esfera.raio > -30)\n { \n if( ( (esfera.posicao[0] - esfera.raio < -19.75) && (esfera.posicao[0] + esfera.raio > -17.75) ) || \n ( (esfera.posicao[0] + esfera.raio > -18.75) && (esfera.posicao[0] - esfera.raio < -20.75) ) )\n {\n if(ultimaColisao != 4)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 4;\n } \n }\n \n\n //corredor esquerdo - 5\n if( (esfera.posicao[0] + esfera.raio > 19.04) && (esfera.posicao[0] - esfera.raio < 21.04) || \n (esfera.posicao[0] - esfera.raio < 20.04) && (esfera.posicao[0] + esfera.raio > 18.04) )\n {\n if(ultimaColisao != 5)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 5;\n } \n }\n }\n\n /*//corner direito - 6\n if(esfera.posicao[0] - esfera.posicao[1] >= 50)\n {\n if(ultimaColisao != 6)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 6;\n }\n }\n\n //corner esquerdo - 7\n if(-esfera.posicao[0] + esfera.posicao[1] >= 50){\n if(ultimaColisao != 7)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 7;\n }\n }*/\n}", "function readResult(e){\n\t piePerv = 0;\n\t for (var k in e){\n\t dataSetMun[e[k][\"municipio\"]] = e[k][\"perc\"];\n\t\tdataSetDetMun[parseInt(e[k][\"municipio\"])] = e[k][\"perc\"];\n\t\tvar ple = e[k][\"plessi\"];\n\t\tfor (var x in ple){\n\t\t\tvar sez = ple[x][\"sezioni\"];\n\t\t\tfor (var s in sez){\n\t\t\t var perv = false;\n\t\t\t if (sez[s][\"pervenuta\"] == \"SI\"){perv = true;piePerv++;}\n\n\t\t\t dataSetSez[parseInt(sez[s][\"numero\"])] = perv;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (name == 'Aff'){cambiaTitolo(statoAttuale);}else{\n\t\t\t\tvar tit = 'Scrutinio ';\n\t\t\t\tif (tipo == 0){tit += 'Camera';}\n\t\t\t\tif (tipo == 1){tit += 'Senato';}\n\t\t\t\tif (tipo == 2){tit += 'Regionali Lista';}\n\t\t\t\tif (tipo == 3){tit += 'Regionali Preferenze';}\n\t\t \tcambiaTitolo(tit);\n\t\t\t}\n\n\t\t\tremMarkerAll();\n\t\t\tif (map.getZoom() >= 14){addMarkerSez();}else{addMarkerMun();}\n\t\t\tjQuery('#nav-panel').panel('close');\n\t\t\tif (statusTimer == false){startTimer();}else{resetTimer();}\n\t\t\taddDataGraph();\n\t\t\tconsole.log(\"Dati Caricati: \",name+tipo+\"\");\n\t\t\tloadingCustom(1);\n\t\t\t\n}", "function sacarMDeUnaMatriz(matriz) {\n var m = matriz.length;\n return m;\n}", "FindMeter(clave) {\n this.limpiar();\n let conteo = 0;\n this.initMedidor();\n this.initRegistro();\n if (this.medidores) {\n for (let index = 0; index < this.medidores.length; index++) {\n const element = this.medidores[index];\n console.log(clave, '==', element.clave);\n if (clave == element.clave) {\n this.medidor = element;\n this.meterId = element._id;\n this.registro.meter = element._id;\n // this.loadRegisters(this.medidor._id);\n this.tarifa = element.rate;\n if (this.tarifa.percent_cost == true) {\n let costo;\n costo = this.extras[0].rmuv * (this.tarifa.base / 100);\n this.registro.base = costo;\n }\n else if (this.tarifa.percent_cost == false) {\n this.registro.base = this.tarifa.base;\n }\n console.log('dentro de find meter, Registro: ', this.registro, '. tarifa: ', this.tarifa);\n this.initLimits(this.tarifa._id);\n this.clave_medidor = element.clave;\n conteo++;\n this.loadRegisters(this.medidor._id);\n }\n }\n if (conteo === 1) {\n this.encontrado = true;\n this.launchAlert('success', 'Medidor Encontrado', null, null, false, 1500, false, 'top-end', 'row', true);\n }\n else if (conteo === 0 && clave.length > 5) {\n this.encontrado = false;\n this.launchAlert('error', 'Medidor Incorrecto', null, null, false, 1500, false, 'top-end', 'row', true);\n }\n else if (conteo === 0 && clave.length < 6) {\n this.encontrado = null;\n }\n }\n }", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "function promedioMatriz(x, y, imageData){\n //declaro en 0 cada valor RGB\n let r = 0;\n let b = 0;\n let g = 0;\n \n //Promedio las 9 combinaciones de ejes X e Y por cada pixel.\n r = (getRed(imageData, x-1, y-1) + getRed(imageData, x, y-1) + getRed(imageData, x+1, y-1)\n + getRed(imageData, x-1, y) + getRed(imageData, x, y) + getRed(imageData, x+1, y)\n + getRed(imageData, x-1, y+1) + getRed(imageData, x, y+1) + getRed(imageData, x+1, y+1))/9;\n \n g = (getGreen(imageData, x-1, y-1) + getGreen(imageData, x, y-1)+ getGreen(imageData, x+1, y-1) \n + getGreen(imageData, x-1, y) + getGreen(imageData, x, y) + getGreen(imageData, x+1, y)\n + getGreen(imageData, x-1, y+1) + getGreen(imageData, x, y+1) + getGreen(imageData, x+1, y+1))/9;\n \n b = (getBlue(imageData, x-1, y-1) + getBlue(imageData, x, y-1) + getBlue(imageData, x+1, y-1) \n + getBlue(imageData, x-1, y) + getBlue(imageData, x, y) + getBlue(imageData, x+1, y+1) \n + getBlue(imageData, x-1, y+1) + getBlue(imageData, x, y+1) + getBlue(imageData, x+1, y+1))/9;\n \n //los asigno y salgo de la funcion para volver al recorrio de la matriz.\n let index = (x + y * imageData.width) * 4;\n imageData.data[index + 0] = r;\n imageData.data[index + 1] = g;\n imageData.data[index + 2] = b;\n }", "constructor(){\n this.ju1 = new Jugador(1, 'X');\n this.ju2 = new Jugador(2, 'O');\n this.actual = this.ju1;\n this.tab = new Juego();\n this.ganador = 0;\n this.liGanad = [[0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]];\n }", "function convertGI() {\n //Cria copia da CTMC\n ctmcGI = [];\n for (var i = 0; i < ctmc.length; i++) {\n ctmcGI.push(ctmc[i].slice());\n }\n //Executa logica na diagonal principal da ctmcGI\n for (let i = 0; i < ctmcGI.length; i++) {\n let soma = 0;\n for (let j = 0; j < ctmcGI[i].length; j++) {\n soma += ctmcGI[i][j];\n }\n ctmcGI[i][i] = soma * (-1);\n }\n console.log(\"Gerador Infinitesimal:\");\n console.log(ctmcGI);\n}", "function HAMMING_MA(props, alg, stat, inReg) {\n // CONFIG DEFAULT PROPERTIES\n // GENERAL properties\n props.id = props.id || 'en';\n props.name = props.name || 'Hamming Encoder - Matrix Algorithm';\n props.position = props.position || {x: 0, y: 0};\n props.fill = props.fill || 'FloralWhite';\n props.labelSize = props.labelSize || 20;\n props.txtSize = props.txtSize || 16;\n props.labelDistance = props.labelDistance || 5;\n props.labelColor = props.labelColor || 'white';\n props.txtColor = props.txtColor || 'Navy';\n props.labelBgColor = props.labelBgColor || 'RoyalBlue';\n props.labelPadding = props.labelPadding || 4;\n props.pading = props.pading || 10;\n props.width = props.width || 600;\n props.height = props.height || 550;\n props.errDet = props.errDet || 1;\n props.checkBits = props.checkBits || 4;\n props.bitsNum = props.bitsNum || 11;\n props.draggable = props.draggable || false;\n props.process = props.process || 'enc';\n props.checkBits = props.checkBits || 4;\n\n let lang = props.lang;\n let mdl = new PANEL(props);\n mdl.size({width: props.width, height: props.height});\n mdl.dragmove(true);\n\n // Matrices panel\n mdl.mat = new PANEL({\n id: 'matPanel',\n name: lang.matrices,\n position: { x: 20, y:50},\n type: 2,\n labelSize: 18\n });\n mdl.add(mdl.mat);\n\n // H matrix set size Text\n mdl.HmatSize = new Konva.Group({id:'HmatSize'});\n mdl.mat.add(mdl.HmatSize);\n\n // Hmat label\n mdl.HmatSize.label = new Konva.Text({ id: 'HmatSizeLabel',\n x: 10, y: 15,\n text: lang.matSize+': ',\n fill: props.txtColor,\n fontSize: props.txtSize,\n });\n mdl.HmatSize.add(mdl.HmatSize.label);\n // Hmat value\n mdl.HmatSize.valTxt = new Konva.Text({ id: 'HmatSizeVal',\n x: mdl.HmatSize.label.x()+mdl.HmatSize.label.width(),\n y: mdl.HmatSize.label.y(),\n text: '? x ?',\n fill: 'red',\n fontStyle: 'bold',\n fontSize: props.txtSize\n });\n mdl.HmatSize.add(mdl.HmatSize.valTxt);\n mdl.HmatSize.valTxt = over(mdl.HmatSize.valTxt);\n mdl.HmatSize.valTxt.hoverTxt = lang.matSizeFormat;\n mdl.HmatSize.valTxt = hover1(mdl.HmatSize.valTxt, mdl.mat);\n mdl.HmatSize.valTxt.on('dblclick tap', function() {\n //check for set bits\n if(inReg.vals.includes(undefined) === true) {\n mdl.HmatSize.valTxt.hover.show('e',lang.setAllBit);\n return;\n };\n\n let thisObj = mdl.HmatSize.valTxt;\n let str = thisObj.text();\n let oldStr =thisObj.str;\n editable(thisObj, function(obj){\n if(alg.getCurrStep().name === 'setBits') alg.increment();\n alg.markCurrStep('curr');\n let s = obj.text();\n if(s === '') return obj.text(oldStr);\n s = s.replace(/\\s/g, ''); //clear spaces\n if(oldStr !== s){\n if(mdl.HmatSize.val === s){\n s = s.replace('x', ' x ');\n mdl.getLayer().batchDraw();\n thisObj.fill(props.txtColor);\n mdl.checkBtn.visible(true);\n mdl.Hmat.visible(true);\n thisObj.off();\n alg.increment();\n }\n else {\n thisObj.fill('red');\n s = s.replace('x', ' x ');\n mdl.getLayer().batchDraw();\n //error\n stat.error.add(lang.wrongMatSize);\n return thisObj.hover.show('e', lang.wrongMatSize);\n }\n }\n //else obj.text(s.substr(0,1)+'_'+s.substr(1));\n });\n });\n\n // column labels creating for H matrix\n let colLabels = [];\n let idxC, idxS = 1;\n let init, ln;\n if(props.errDet === 2) {\n init = 0;\n ln = props.bitsNum;\n idxC = 0\n }\n else{\n init = 1;\n ln = props.bitsNum + 1;\n idxC = 1;\n }\n for(let i=init; i<ln; i++){\n if(i === 0 || i === 1 || i === 2 || i === 4 || i === 8 || i === 16 || i === 32){\n colLabels.push('C_'+ idxC);\n idxC++;\n }\n else{\n colLabels.push('S_'+ idxS);\n idxS++;\n }\n }\n\n let rowLabels=[];\n ln = props.errDet === 2 ? (props.checkBits - 1) : props.checkBits;\n if(props.errDet === 2) rowLabels.push(0);\n for(let i=0; i<ln; i++) rowLabels.push(Math.pow(2, i));\n // H matrix creating\n mdl.Hmat = new MATRIX({ id: 'Hmat',\n title:'H',\n cols: props.bitsNum,\n rows: props.checkBits,\n firstColNum: props.errDet === 1 ? '1' : '0',\n colLabels: colLabels,\n rowLabels: rowLabels,\n randVals: false\n });\n mdl.mat.add(mdl.Hmat);\n // update matrices panel's height\n mdl.mat.size({height: mdl.Hmat.height()+60});\n mdl.Hmat.position({x: 10, y: mdl.mat.height()/2 - mdl.Hmat.height()/2 + mdl.HmatSize.label.height()+25});\n\n // get Hmat size\n mdl.HmatSize.val = mdl.Hmat.size().r+'x'+mdl.Hmat.size().c;\n\n // hide H matrix\n mdl.Hmat.visible(false);\n\n // set H matrix labels\n mdl.Hmat.colLabels.forEach(label =>{\n label.text('?');\n label.fill('red');\n label = over(label);\n label.hoverTxt = lang.dblclick;\n label = hover1(label, mdl.Hmat);\n label.on('dblclick tap', ()=>{\n let thisObj = label;\n let str = thisObj.text();\n if(thisObj.sub.text() !== '') str += thisObj.sub.text();\n thisObj.text(str);\n let oldStr =thisObj.str;\n editable(thisObj, function(obj){\n let s = obj.text().toUpperCase();\n if(s === '') return obj.text(oldStr);\n if(oldStr !== s){\n if(thisObj.id() === s){\n if(s.substr(0,1) === 'C') thisObj.fill('RoyalBlue');\n else thisObj.fill('RosyBrown');\n obj.text(s.substr(0,1)+'_'+s.substr(1));\n mdl.getLayer().batchDraw();\n thisObj.off();\n }\n else {\n thisObj.fill('red');\n obj.text(s.substr(0,1)+'_'+s.substr(1));\n mdl.getLayer().batchDraw();\n //error\n stat.error.add(lang.wrongLabelHmat);\n return thisObj.show('e', lang.wrongLabel);\n }\n }\n else obj.text(s.substr(0,1)+'_'+s.substr(1));\n });\n });\n });\n\n // calc H matrix values and H' empty matrix\n let size = mdl.Hmat.size();\n const Hvals = new Array(size.r);\n const H_vals = new Array(size.r);\n for(let i=0; i<size.r; i++) {\n Hvals[i] = new Array(size.c);\n H_vals[i] = new Array(size.c);\n }\n for(let i=0; i<size.c; i++) {\n let numDec = props.errDet === 1 ? (i+1) : i;\n let numStr = parseInt(numDec, 10).toString(2);\n ln = props.errDet === 1 ? (size.r-1) : (size.r-2);\n while(numStr.length < (ln+1)) numStr = '0'+numStr;\n for (let j=ln; j>=0; j--){\n Hvals[j][i] = Number(numStr[j]);\n }\n }\n // for C0 for H matrix\n if(props.errDet === 2){\n for(let i=0; i<size.c; i++){\n Hvals[size.r-1][i] = 1;\n }\n }\n\n // column labels creating for H' matrix\n let colLabels1 = [];\n for(let i=0; i<colLabels.length; i++){\n if(colLabels[i].substr(0,1) === 'S') colLabels1.push(colLabels[i]);\n }\n for(let i=colLabels.length-1; i>=0; i--){\n if(colLabels[i].substr(0,1) === 'C') colLabels1.push(colLabels[i]);\n }\n\n // check for correct H matrix labels place\n mdl.Hmat.colLabels.check = function(){\n for(let i=0; i<this.length; i++){\n let label = mdl.Hmat.colLabels[i];\n if(label.fill() === 'red') return false;\n }\n return true;\n };\n\n // H' matrix creating\n mdl.H_mat = new MATRIX({ id: 'H_mat',\n title:'H\\'',\n cols: props.bitsNum,\n rows: props.checkBits,\n //firstColNum: props.errDet === 1 ? '1' : '0',\n colLabels: colLabels1,\n randVals: false,\n layer: mdl.getLayer(),\n });\n mdl.mat.add(mdl.H_mat);\n mdl.H_mat.visible(false);\n mdl.H_mat.enable(false);\n mdl.H_mat.elmsVisible(false);\n mdl.H_mat.position({x: mdl.Hmat.x() + mdl.Hmat.width() + 20, y: mdl.Hmat.y()});\n\n // calculating H' matrix values\n size = mdl.Hmat.size();\n for(let i=0; i<size.c; i++){\n let colIdx = colLabels.indexOf(colLabels1[i]);\n let move = {x:8, y:0};\n for(let j=0; j<size.r; j++){\n H_vals[j][i] = Hvals[j][colIdx]; // by ordering columns\n\n // add distance for control bits columns\n if(colLabels1[i].substr(0,1) === 'C') {\n mdl.H_mat.elms[j][i].move(move);\n if(j===0) {\n mdl.H_mat.colLabels[i].move(move);\n }\n }\n }\n if(i===0){\n mdl.H_mat.closeB.move(move);\n }\n }\n let H_valsTemp = H_vals.map(function(arr) {\n return arr.slice();\n });\n\n //correcting model width according to the H' matrix width\n {\n let matsWidth = mdl.Hmat.width() + mdl.H_mat.width() + 90;\n //let minWidth = 645;\n let minWidth = 700;\n //console.log('matsWidth = '+matsWidth, '; minWidth = '+minWidth);\n if(matsWidth > minWidth){\n //mdl.size({width: matsWidth});\n // update matrices panel's width\n mdl.mat.size({width: matsWidth-40});\n mdl.size({width: mdl.mat.size().width +40});\n }\n else {\n mdl.size({width: minWidth});\n // update matrices panel's width\n mdl.mat.size({width: minWidth-40});\n }\n }\n // set H' matrix temp values\n mdl.H_mat.setVals(H_valsTemp);\n\n // set H matrix labels\n mdl.H_mat.colLabels.forEach(label =>{\n label.text('?');\n label.fill('red');\n label = over(label);\n label.hoverTxt = lang.dblclick;\n label = hover1(label, mdl.Hmat);\n label.on('dblclick tap', () => {\n alg.markCurrStep('curr');\n let thisObj = label;\n let str = thisObj.text();\n if (thisObj.sub.text() !== '') str += thisObj.sub.text();\n thisObj.text(str);\n let oldStr =thisObj.str;\n editable(thisObj, function (obj) {\n let s = obj.text().toUpperCase();\n if (s === '') return obj.text(oldStr);\n if (oldStr !== s) {\n if (thisObj.id() === s) {\n thisObj.fill(s.substr(0, 1) === 'C' ? 'RoyalBlue' : 'RosyBrown');\n obj.text(s.substr(0, 1) + '_' + s.substr(1));\n mdl.getLayer().batchDraw();\n thisObj.off();\n\n //check for labels\n if (mdl.H_mat.colLabels.check() === true) { // right\n mdl.H_mat.elmsVisible(true);\n // check for control bit C0\n if(props.errDet === 1){\n mdl.H_mat.enableRowHL();\n alg.increment();\n mdl.H_mat.enable(false);\n mdl.bitsPan.visible(true);\n }else{\n mdl.checkBtn.visible(true);\n mdl.checkBtn.x(mdl.H_mat.x()+mdl.H_mat.width()/2 - mdl.checkBtn.width()/2);\n mdl.checkMatrixId = 'H_mat';\n }\n mdl.getLayer().batchDraw();\n }\n } else { // error\n thisObj.fill('red');\n obj.text(s.substr(0, 1) + '_' + s.substr(1));\n mdl.getLayer().batchDraw();\n stat.error.add(lang.wrongLabelH_mat);\n return thisObj.show('e', lang.wrongLabelH_mat);\n }\n } else obj.text(s.substr(0, 1) + '_' + s.substr(1));\n }); // end of editable\n }); // end of dblclick tap\n });// end of forEach\n\n // check for correct H matrix labels place\n mdl.H_mat.colLabels.check = function(){\n for(let i=0; i<this.length; i++){\n if(mdl.H_mat.colLabels[i].fill() === 'red') return false;\n }\n return true;\n };\n\n //calculating last row for C0\n if(props.errDet === 2){\n for (let i = 0; i < size.c; i++) {\n let xor = 0;\n for (let j = 0; j < size.r; j++) xor ^= H_vals[j][i];\n H_vals[size.r - 1][i] = xor;\n }\n //enable H' matrix for editing\n mdl.H_mat.enable(true);\n }\n\n //check button\n mdl.checkBtn = new Button({\n id: 'checkBtn',\n height: 25,\n defVal: lang.checkMat,\n txtSize: props.txtSize,\n clickable: true,\n fill: 'LightGrey'\n });\n mdl.mat.add(mdl.checkBtn);\n mdl.checkBtn.normPos = {x: mdl.Hmat.x() + mdl.Hmat.width()/2 - mdl.checkBtn.width()/2,\n y: mdl.mat.height() - mdl.checkBtn.height() + 5};\n mdl.checkBtn.position(mdl.checkBtn.normPos);\n mdl.checkBtn.visible(false);\n\n // check button click event\n mdl.checkBtn.on('click touchstart', function(){\n if(inReg.vals.includes(undefined) === true) { // check for all info bits\n this.hover.show('e',lang.setAllBit);\n return;\n }\n // change check button text and show H matrix\n if(this.txt.text() === lang.showHmat){\n this.txt.text(lang.checkMat);\n mdl.Hmat.visible(true);\n //mdl.tLabelsVisible(true);\n this.position(mdl.checkBtn.normPos);\n alg.increment();\n mdl.getLayer().batchDraw();\n return;\n }\n\n let check = mdl.checkMatrix();\n if(check !== true) {\n stat.error.add(check);\n mdl.checkBtn.hover.show('e', check);\n return;\n }\n\n // increment step\n if(alg.getCurrStep().name === 'setHmat' || alg.getCurrStep().name === 'setH_mat') alg.increment();\n });\n\n // auto correct matix panel sizes\n mdl.mat.autoCorrSize();\n\n // current matrix's id for check\n mdl.checkMatrixId = 'Hmat';\n\n // check matrix function\n mdl.checkMatrix = function(obj){\n let cols = mdl.Hmat.size().c;\n let rows = mdl.Hmat.size().r;\n // H matrix check - labels and values\n if(mdl.checkMatrixId === 'Hmat'){\n // check for labels first\n if(mdl.Hmat.colLabels.check() === false){\n return lang.wrongLabelHmat;\n }\n\n // check for H matrix values\n for(let i=0; i<rows; i++)\n for(let j=0; j<cols; j++)\n if(mdl.Hmat.vals[i][j] !== Hvals[i][j]) return lang.wrongMat+' (H)';\n\n mdl.H_mat.visible(true);\n mdl.Hmat.enable(false);\n // change button position to H' matrix bellow\n mdl.checkBtn.x(mdl.H_mat.x() + mdl.H_mat.width()/2 - mdl.checkBtn.width()/2);\n mdl.checkMatrixId = 'H_mat';\n }\n // H' matrix check\n else if (mdl.checkMatrixId === 'H_mat'){\n for(let i=0; i<rows; i++)\n for(let j=0; j<cols; j++)\n if(mdl.H_mat.vals[i][j] !== H_vals[i][j]) return lang.wrongMat+' (H\\')';\n\n mdl.H_mat.enable(false);\n mdl.H_mat.enableRowHL();\n mdl.bitsPan.visible(true);\n //alg.increment();\n }\n else return console.error('Incorrect matrix ID');\n mdl.checkBtn.visible(false);\n mdl.getLayer().batchDraw();\n return true;\n };\n\n\n //input bits panel\n mdl.bitsPan = new PANEL({\n id: 'inputBits',\n name: lang.cwBits,\n position: {\n x: mdl.mat.x(),\n y: mdl.mat.y() + mdl.mat.height()+20\n },\n type: 2,\n labelSize: 18,\n });\n mdl.bitsPan.dragmove(false);\n mdl.bitsPan.visible(false);\n mdl.bitsPan.size({width: mdl.mat.width(), height: 70});\n mdl.add(mdl.bitsPan);\n\n //load bits button\n mdl.loadBtn = new Button({\n id: 'loadBtn',\n height: 25,\n defVal: lang.loadInfoBits,\n txtSize: 16,\n clickable: true,\n fill: 'LightGrey'\n });\n mdl.bitsPan.add(mdl.loadBtn);\n mdl.loadBtn.position({x: 20, y: 20});\n\n // load button click event\n mdl.loadBtn.on('click touchstart', function(){\n if(props.process ==='enc') mdl.loadInfo(inReg);\n else mdl.loadCW(inReg);\n });\n\n // required vals for bits objects and values\n mdl.selCbitId = '';\n mdl.bits = [];\n mdl.vals = [];\n\n //load codeword bits (decoding)\n mdl.loadCW = function(reg){\n mdl.bitsPan.visible(true);\n // increment step\n alg.increment();\n\n mdl.loadBtn.visible(false);\n let pos = [], relPos=[];\n let thisAbsPos = mdl.bitsPan.getAbsolutePosition();\n\n for(let i=0; i<mdl.Hmat.colLabels.length; i++) {\n if(i === 0){\n // first position\n relPos.push({x: 8, y: 29});\n pos.push({x:thisAbsPos.x + 8, y: thisAbsPos.y + 29});\n }else{\n pos.push({x: pos[pos.length-1].x + 26, y: pos[pos.length-1].y});\n relPos.push({x: relPos[relPos.length-1].x + 26, y: relPos[relPos.length-1].y});\n }\n\n //create bits\n let props = {};\n props.label = mdl.Hmat.colLabels[i].id().substr(0,1)+'_'+mdl.Hmat.colLabels[i].id().substr(1);\n props.name = 'Bit';\n props.id = mdl.Hmat.colLabels[i].id();\n props.fill = reg.bits[i].rect.fill();\n props.stroke = reg.bits[i].rect.stroke();\n props.txtColor = reg.bits[i].txt.fill();\n props.width = reg.bits[i].width();\n props.height = reg.bits[i].height();\n let bit = new Button(props);\n bit.text(reg.bits[i].text());\n bit.position(relPos[i]);\n bit.label.x(bit.rect.width()/2 - bit.label.width()/2);\n bit.label.y(bit.rect.y() - bit.label.height() - 0);\n\n //for control bits\n if(bit.id().substr(0,1) === 'C'){\n bit.fill('RoyalBlue');\n bit.hoverTxt = lang.selectCbit;\n bit = hover1(bit, mdl.bitsPan);\n\n bit.on('click touchstart', function(){\n //check for calculated/checked result\n let check = mdl.equ.konvaObjs.find(el => el.id === bit.id()).check;\n if(check.visible() === true && check.text().substr(check.text().length-1,1) !== '?'){\n //error\n return this.hover.show('e', lang.wasChecked);\n }\n\n // check for selected formula\n if(mdl.equ.konvaObjs.find(el => el.id === bit.id()).formula.visible() === false){\n // check for other selected control bit\n if(mdl.selCbitId === '') mdl.selectCbit(bit.id());\n else{\n // error\n stat.error.add(lang.аnotherSelCbit+' ('+bit.id()+')');\n return this.hover.show('e', lang.аnotherSelCbit);\n }\n return;\n }\n });\n\n }else\n {\n bit.enable(false);\n }\n\n //hide bit\n bit.visible(false);\n\n bit.scale({x:0.9,y:0.9});\n mdl.bitsPan.add(bit);\n mdl.bits.push(bit);\n mdl.vals.push(reg.vals[i]);\n\n //moving animation\n let cloneObj = reg.bits[i].clone();\n cloneObj.off();\n mdl.getLayer().add(cloneObj);\n cloneObj.position(reg.bits[i].getAbsolutePosition());\n cloneObj.moveToTop();\n mdl.getLayer().batchDraw();\n let movement = {};\n movement = new SmoothMovement(cloneObj.position(), pos[i]);\n movement.animate(\n 10,\n function (pos) { // update function\n cloneObj.position(pos);\n mdl.getLayer().batchDraw();\n },\n function () { // closure function\n cloneObj.scale({x:0.9,y:0.9});\n cloneObj.destroy();\n bit.txt.fontSize(bit.txt.fontSize()-2);\n bit.visible(true);\n if (i === reg.bits.length - 1) { // run its if it is last bit\n // display equation panela\n mdl.equ.visible(true);\n }\n }\n );\n\n // change register's bit status\n reg.bits[i].active(false);\n } // end of for loop\n\n // creting equations for auto mode\n mdl.equ.autoCreate();\n\n // run auto functions of error analysis\n mdl.err.synd.setVals(mdl.equ.cbits);\n mdl.err.setErrStatus(mdl.H_mat);\n mdl.err.setErrPos(mdl.Hmat);\n\n mdl.getLayer().batchDraw();\n reg.disable(); // disable the register\n };\n\n // load information bits (encoding)\n mdl.loadInfo = function(reg){\n // increment step\n alg.increment();\n\n mdl.loadBtn.visible(false);\n let pos = [], relPos=[];\n let thisAbsPos = mdl.bitsPan.getAbsolutePosition();\n relPos.push({x: 8, y: 28});\n pos.push({x:thisAbsPos.x + 8, y: thisAbsPos.y + 28}); // first position\n for(let i=1; i<mdl.Hmat.colLabels.length; i++) {\n pos.push({x: pos[pos.length-1].x + 27, y: pos[pos.length-1].y});\n relPos.push({x: relPos[relPos.length-1].x + 27, y: relPos[relPos.length-1].y});\n }\n\n let infoIdx=0, controlIdx = props.errDet === 2 ? 0 : 1;\n for (let i = 0; i < mdl.Hmat.colLabels.length; i++) {\n let cloneObj = new Button({defVal: reg.bits[infoIdx].txt.text(), label:reg.bits[infoIdx].label.text(),\n width:reg.bits[infoIdx].width(), height:reg.bits[infoIdx].height()});\n cloneObj.position(mdl.Hmat.colLabels[i].position());\n cloneObj.id(mdl.Hmat.colLabels[i].id());\n cloneObj.fill(reg.bits[infoIdx].fill());\n cloneObj.txt.fill(reg.bits[infoIdx].txt.fill());\n cloneObj.txt.fontSize(reg.bits[infoIdx].txt.fontSize());\n cloneObj.label.position(reg.bits[infoIdx].label.position());\n cloneObj.off();\n\n //control bits by cloning info bit\n if(mdl.Hmat.colLabels[i].id().substr(0,1) === 'C'){\n mdl.vals.push(null);\n cloneObj.fill('RoyalBlue');\n cloneObj.text('?');\n cloneObj.label.text('C_'+(controlIdx++).toString());\n cloneObj.label.fill('RoyalBlue');\n\n cloneObj.scale({x:0.9,y:0.9});\n cloneObj.moveTo(mdl.bitsPan);\n cloneObj.position(relPos[i]);\n\n cloneObj.enable = function(){\n cloneObj.hoverTxt = lang.selectCbit;\n cloneObj = over(cloneObj);\n cloneObj = hover1(cloneObj, mdl);\n cloneObj.on('click touchstart', function(){\n //check for calculated result\n if(this.text() !== '?'){\n //error\n return this.hover.show('e', lang.wasCalculated);\n }\n\n // check for displayed formula\n if(mdl.equ.konvaObjs.find(el => el.id === cloneObj.id()).formula.visible() === false){\n // check for other selected control bit\n if(mdl.selCbitId === '') mdl.selectCbit(cloneObj.id());\n else{\n // error\n stat.error.add(lang.аnotherSelCbit+' ('+cloneObj.id()+')');\n return this.hover.show('e', lang.аnotherSelCbit);\n }\n return;\n }\n // check for displayed bins\n if(mdl.equ.konvaObjs.find(el => el.id === cloneObj.id()).bin.visible() === false){\n //error\n stat.error.add(lang.noEqu+' ('+cloneObj.id()+')');\n return this.hover.show('e', lang.noEqu);\n }\n // check for correct result\n if(mdl.equ.checkRes(cloneObj.id()) !== true){\n // error\n stat.error.add(lang.wrongCval+' ('+cloneObj.id()+')');\n return this.hover.show('e',lang.wrongCval);\n }\n\n // mark selected cbit Id as empty\n mdl.selCbitId = cloneObj.id();\n\n // increment step for calc equation\n if(alg.getCurrStep().name === 'calcCbit') alg.increment();\n\n // write the control bit result\n mdl.writeCbit(cloneObj.id());\n });\n };\n cloneObj.enable();\n mdl.getLayer().batchDraw();\n }\n // moving animation for info bits\n else{\n mdl.vals.push(reg.vals[infoIdx]);\n mdl.getLayer().add(cloneObj);\n cloneObj.position(reg.bits[infoIdx].getAbsolutePosition());\n cloneObj.moveToTop();\n mdl.getLayer().batchDraw();\n reg.bits[infoIdx].active(false);\n infoIdx++;\n let movement = {};\n movement = new SmoothMovement(cloneObj.position(), pos[i]);\n movement.animate(\n 10,\n function (pos) { // update function\n cloneObj.position(pos);\n mdl.getLayer().batchDraw();\n },\n function () { // closure function\n cloneObj.scale({x:0.9,y:0.9});\n cloneObj.moveTo(mdl.bitsPan);\n cloneObj.position(relPos[i]);\n if (i === reg.bits.length - 1) { // run its if it is last bit\n // display equation panela\n mdl.equ.visible(true);\n }\n }\n );\n }\n //cloneObj.txt.fontSize(cloneObj.txt.fontSize()-2);\n mdl.bits.push(cloneObj);\n }\n\n reg.disable(); // disable the register\n\n // creting equations for auto mode\n mdl.equ.autoCreate();\n return true;\n };\n\n // Equation panel\n mdl.equ = new PANEL({\n id: 'equPanel',\n name: lang.equBtnTxt,\n position: {\n x: mdl.mat.x(),\n y: mdl.bitsPan.y() + mdl.bitsPan.size().height + 20\n },\n type: 2,\n labelSize: 18\n });\n mdl.equ.visible(false);\n mdl.equ.dragmove(false);\n mdl.equ.size({width: mdl.bitsPan.width(), height: 140});\n mdl.add(mdl.equ);\n\n //equation auto create cbits\n mdl.equ.autoCreate = function(){\n mdl.equ.cbits = [];\n let m = props.bitsNum - props.checkBits;\n let cbitIdx = m;\n for(let i=0; i<size.r; i++){\n let obj = {};\n obj.id = mdl.H_mat.colLabels[cbitIdx++].id();\n obj.mems = [];\n obj.bins = [];\n obj.res = 0;\n obj.formula = '';\n\n obj.mems.push(obj.id); //insert cbit id first\n if(props.process === 'dec'){\n obj.bins.push(mdl.vals[mdl.bits.findIndex(b => b.id() === obj.id)]); // insert cbit value in binary\n obj.res ^= mdl.vals[mdl.bits.findIndex(b => b.id() === obj.id)]; // xor cbit value\n }\n for(let j=0; j<m; j++) {\n if(H_vals[i][j] === 1) {\n obj.mems.push(mdl.H_mat.colLabels[j].id());\n let val = mdl.vals[mdl.Hmat.colLabels.findIndex(el => el.id() === mdl.H_mat.colLabels[j].id())];\n obj.bins.push(val);\n obj.res ^= val;\n }\n }\n\n // create the formula string\n obj.formula = obj.mems.toString().replace(/,/g,'\\u2295') + ' = 0';\n // append to cbit array\n mdl.equ.cbits.push(obj);\n }\n\n // show equation panel\n mdl.equ.visible(true);\n };\n\n // equation texts\n mdl.equ.konvaObjs=[];\n for(let i=props.checkBits-1; i>=0; i--){\n let txtColor = mdl.Hmat.title.fill();\n let bit = {};\n let n = props.errDet === 2 ? i : (i+1);\n bit.id = 'C'+n;\n\n //formula\n bit.formula = new Konva.Text({\n id: 'C'+n+'formula',\n fontSize: props.txtSize - 2,\n text: '?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295? = 0',\n fill: 'red',\n visible: false\n });\n mdl.equ.add(bit.formula);\n bit.formula = over(bit.formula);\n bit.formula.hoverTxt = lang.setEqu;\n bit.formula = hover1(bit.formula, mdl);\n if(i === props.checkBits-1) bit.formula.position({x:8, y:15});\n else {\n bit.formula.x(mdl.equ.konvaObjs[mdl.equ.konvaObjs.length-1].formula.x());\n bit.formula.y(mdl.equ.konvaObjs[mdl.equ.konvaObjs.length-1].formula.y()+25);\n }\n let width = bit.formula.width();\n bit.formula.on('dblclick tap', function(){\n let thisObj = bit.formula.text;\n alg.markCurrStep('curr');\n let str = this.text();\n let oldStr = thisObj.str;\n str = str.replace(/\\u2295/g, '+');\n this.text(str);\n\n editable(this, function(obj){\n let s = obj.text().toUpperCase();\n s = s.replace('=', '');\n s = s.replace('C0','C9');\n s = s.replace('0', '');\n s = s.replace(/\\s/g, ''); //clear spaces\n s = s.split(\"+\").sort().toString().replace(/,/g, '\\u2295') + ' = 0';\n s = s.replace('C9','C0');\n //s = s.replace(/\\+/g, '\\u2295');\n bit.formula.text(s);\n if(s === '') return obj.text(oldStr);\n if(oldStr !== s.replace(/\\u2295/g, '+')){\n bit.formula.text(s);\n if(mdl.equ.checkFormula(bit.id) === false){\n bit.formula.fill('red');\n bit.formula.hover.show('e',lang.wrongEqu);\n stat.error.add(lang.wrongEqu+'('+bit.id+')');\n return;\n }\n bit.formula.fill(txtColor);\n bit.formula.off();\n mdl.equ.showBins(bit.id);\n }\n else console.log('No change');\n }, width);\n });\n\n //bin\n if(props.process === 'enc'){\n text = 'C'+n+' = ?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295? = ?';\n }\n\n else\n text = '?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295?\\u2295? = ?';\n bit.bin = new Konva.Text({\n id: 'C'+n+'bin',\n fontSize: props.txtSize - 2,\n text: text,\n fill: 'red',\n visible: false\n });\n mdl.equ.add(bit.bin);\n bit.bin.position({x: mdl.equ.width()/2, y: bit.formula.y()});\n\n bit.bin = over(bit.bin);\n bit.bin.hoverTxt = lang.calcCbit;\n bit.bin = hover1(bit.bin, mdl);\n\n bit.bin.on('click touchstart', function(){\n let str = this.text();\n let lastStr = str.substr(str.length-1, 1);\n lastStr = lastStr === '1' ? '0' : '1';\n this.text(str.substr(0,str.length-1)+lastStr);\n alg.markCurrStep('curr');\n mdl.getLayer().batchDraw();\n });\n\n // creating check text of control bits for decoding process\n if(props.process === 'dec'){\n bit.check = new Konva.Text({\n id: 'C'+n+'check',\n fontSize: props.txtSize - 2,\n text: bit.id + ' \\u21D2 ?',\n fill: 'red',\n visible: false\n });\n mdl.equ.add(bit.check);\n bit.check.position({x: mdl.equ.width() - 70, y: bit.formula.y()});\n bit.check.hoverTxt = lang.writeCbitCheck;\n bit.check = over(bit.check);\n bit.check = hover1(bit.check, mdl.equ);\n bit.check.on('click touchstart', function(){\n if(mdl.selCbitId !== bit.id) return this.hover.show('e',lang.wasChecked);\n if(mdl.equ.checkRes(bit.id) !== true) {\n stat.error.add(lang.wrongCbitCheck+' ('+bit.id+')');\n this.fill('red');\n return this.hover.show('e',lang.wrongCbitCheck);\n }\n this.fill(txtColor);\n mdl.equ.konvaObjs.find(obj => obj.id === bit.id).bin.fill(txtColor);\n let str = bit.check.text().substr(0, bit.check.text().length-1) + mdl.equ.cbits.find(b => b.id === bit.id).res.toString();\n bit.check.text(str);\n\n mdl.bits.find(b => b.id() === bit.id).rect.stroke('');\n mdl.selCbitId = '';\n alg.increment(); // for control bit calculation\n alg.increment(); // for control bit write\n\n //if it's last control bit show the result analysis panel\n for(let i=0; i<mdl.equ.konvaObjs.length; i++) {\n if(mdl.equ.konvaObjs[i].check.visible() === false) break;\n if(i === mdl.equ.konvaObjs.length-1) mdl.err.visible(true);\n }\n\n mdl.getLayer().batchDraw();\n //bit.check.off();\n });\n }\n\n mdl.equ.konvaObjs.push(bit);\n if(i===0) {\n mdl.equ.size({height: 10 + (bit.formula.height()+12)*mdl.equ.konvaObjs.length});\n let bottomY = mdl.equ.y() + mdl.equ.height()+20;\n if(bottomY > mdl.height()) mdl.size({height: bottomY});\n }\n }// end of for loop\n\n // check formula\n mdl.equ.checkFormula = function(cbitId){\n let thisKonvaObj = mdl.equ.konvaObjs.find(elm => elm.id === cbitId);\n let thisCbit = mdl.equ.cbits.find(elm => elm.id === cbitId);\n let formula = thisKonvaObj.formula.text().toString().replace(/\\+/g,',');\n if(formula === thisCbit.formula) return true;\n return false;\n };\n\n mdl.equ.checkRes = function(cbitId){\n let thisKonvaObj = mdl.equ.konvaObjs.find(elm => elm.id === cbitId);\n let thisCbit = mdl.equ.cbits.find(elm => elm.id === cbitId);\n let res = Number(thisKonvaObj.bin.text().substr(thisKonvaObj.bin.text().length-1,1));\n if(res !== thisCbit.res) return false;\n return true;\n };\n\n mdl.equ.binsInsert = function(){\n let str='';\n let cbit = mdl.equ.cbits.find(elm => elm.id === mdl.selCbitId);\n str = cbit.bins.toString();\n str = str.replace(/,/g,'\\u2295');\n str += ' = ?';\n let thisKonvaObj = mdl.equ.konvaObjs.find(elm => elm.id === mdl.selCbitId);\n if(props.process === 'enc')\n thisKonvaObj.bin.text('\\u21D2 '+mdl.selCbitId+' = '+str); // for encoding process\n else{\n thisKonvaObj.bin.text('\\u21D2 '+str); // for decoding process\n thisKonvaObj.check.visible(true);\n }\n thisKonvaObj.bin.visible(true);\n };\n\n // display control bit formula\n mdl.equ.showBins = function(cbitId){\n let str = '', txtColor = '';\n let cbit = {};\n // for auto mode\n if(typeof cbitId === 'undefined') {\n cbitId = mdl.selCbitId;\n cbit = mdl.equ.cbits.find(elm => elm.id === cbitId);\n str = cbit.bins.toString();\n str = str.replace(/,/g,'\\u2295');\n str += ' = '+cbit.res;\n txtColor = props.txtColor;\n }\n\n let thisKonvaObj = mdl.equ.konvaObjs.find(elm => elm.id === cbitId);\n // for auto mode\n if(props.process === 'enc'){\n\n thisKonvaObj.bin.text('\\u21D2 '+cbitId+' = '+str);\n }\n else{ // for decoding\n thisKonvaObj.bin.text('\\u21D2 '+ str);\n //thisKonvaObj.bin.x(thisKonvaObj.formula.x() + thisKonvaObj.formula.width());\n thisKonvaObj.check.visible(true);\n }\n\n thisKonvaObj.bin.visible(true);\n if(txtColor !== '') thisKonvaObj.bin.fill(txtColor);\n\n //for auto mode\n if(str.substr(str.length-1, 1) !== '?') thisKonvaObj.bin.off();\n\n alg.increment(); // increment step\n mdl.getLayer().batchDraw();\n };\n\n // display control bit formula\n mdl.equ.showFormula = function(cbitId){\n let str = '', txtColor = '';\n // for auto mode\n if(typeof cbitId === 'undefined') {\n cbitId = mdl.selCbitId;\n let cbit = mdl.equ.cbits.find(elm => elm.id === cbitId);\n // str = cbit.mems.toString() + ' = 0';\n // str = str.replace(/,/g,'\\u2295');\n str = cbit.formula;\n txtColor = props.txtColor;\n //mdl.equ.showBins(mdl.selCbitId);\n mdl.equ.binsInsert();\n }\n\n let thisKonvaObj = mdl.equ.konvaObjs.find(elm => elm.id === cbitId);\n if(str !== '') { //check for auto mode\n // if(props.process === 'enc') thisKonvaObj.formula.text(cbitId+' = '+str);\n // else thisKonvaObj.formula.text(str);\n thisKonvaObj.formula.text(str);\n thisKonvaObj.formula.off();\n }\n thisKonvaObj.formula.visible(true);\n if(txtColor !== '') thisKonvaObj.formula.fill(txtColor);\n\n if(str.substr(str.length-1, 1) !== '?') {\n alg.increment(); // increment step for auto mode\n }\n\n mdl.getLayer().batchDraw();\n };\n\n //create control bit order for auto mode\n mdl.cbitOrder = [];\n mdl.cbitIdx=0;\n mdl.H_mat.colLabels.forEach(label =>{\n if(label.id().substr(0,1) === 'C') mdl.cbitOrder.push(label.id());\n });\n\n // select control bit\n mdl.selectCbit = function(cbitId){\n // for auto mode\n if(typeof cbitId === 'undefined'){\n cbitId = mdl.cbitOrder[mdl.cbitIdx++];\n mdl.selCbitId = cbitId;\n }\n\n mdl.bits.find(bit => bit.id() === cbitId).rect.stroke('red');\n\n mdl.equ.showFormula(cbitId); //display formula for writing\n mdl.selCbitId = cbitId; // set this cbit as selected\n\n // change hover text only for encoding\n if(props.process === 'enc')mdl.bits.find(e => e.id() === cbitId).hoverTxt = lang.writeCbitVal;\n //step incremented in showFormula()\n };\n\n // write control bit result\n mdl.writeCbit = function(cbitId){\n // for auto mode\n if(typeof cbitId === 'undefined') {\n cbitId = mdl.selCbitId;\n }\n\n let konvaObj = mdl.equ.konvaObjs.find(e => e.id === cbitId);\n\n let res = mdl.equ.cbits.find(el => el.id === cbitId).res;\n if(props.process === 'enc'){\n let thisCbit = mdl.bits.find(el => el.id() === cbitId);\n thisCbit.txt.text(res.toString());\n //write the result in val array\n mdl.vals[mdl.bits.findIndex(e => e.id() === cbitId)] = res;\n konvaObj.bin.fill(props.txtColor);\n }\n else{ // for decoding\n\n let str = konvaObj.check.text().substr(0, konvaObj.check.text().length-1) + mdl.equ.cbits.find(b => b.id === cbitId).res.toString();\n konvaObj.check.fill(props.txtColor);\n konvaObj.check.text(str);\n konvaObj.check.off();\n\n //if it's last control bit show the result analysis panel\n if(mdl.equ.cbits[mdl.equ.cbits.length-1].id === cbitId) mdl.err.visible(true);\n }\n\n // turn off konva events\n mdl.equ.konvaObjs.find(el => el.id === cbitId).bin.off();\n\n // clear last selected control bit\n mdl.bits.find(bit => bit.id() === cbitId).rect.stroke('');\n\n // mark selected cbitId as empty\n mdl.selCbitId = '';\n\n // increment step\n alg.increment();\n\n mdl.getLayer().batchDraw();\n };\n\n // change Z index order\n mdl.equ.setZIndex(7);\n mdl.bitsPan.setZIndex(8);\n\n // show H_mat column labels\n mdl.showH_columns = function(){\n mdl.H_mat.colLabels.forEach(l =>{\n l.fill(l.id().substr(0,1) === 'C' ? 'RoyalBlue' : 'RosyBrown');\n l.text(l.id().substr(0,1)+'_'+l.id().substr(1))\n });\n mdl.getLayer().batchDraw();\n };\n\n // show H matrix columns\n mdl.showHcolumns = function(){\n mdl.checkBtn.position(mdl.checkBtn.normPos);\n mdl.Hmat.colLabels.forEach(l =>{\n l.fill(l.id().substr(0,1) === 'C' ? 'RoyalBlue' : 'RosyBrown');\n l.text(l.id().substr(0,1)+'_'+l.id().substr(1))\n });\n mdl.getLayer().batchDraw();\n };\n\n // show H_mat\n mdl.H_mat.show = function(){\n // increment step\n alg.increment();\n mdl.showH_columns();\n mdl.H_mat.setVals(H_vals);\n mdl.H_mat.update();\n mdl.H_mat.visible(true);\n mdl.H_mat.elmsVisible(true);\n mdl.H_mat.enableRowHL();\n mdl.bitsPan.visible(true);\n // change button position to H' matrix bellow\n //mdl.checkBtn.x(mdl.H_mat.x() + mdl.H_mat.width()/2 - mdl.checkBtn.width()/2);\n mdl.checkBtn.visible(false);\n mdl.checkMatrixId = 'H_mat';\n mdl.getLayer().batchDraw();\n };\n\n // show Hmat\n mdl.HmatSize.show = function(){\n mdl.HmatSize.valTxt.text(props.checkBits+' x '+props.bitsNum);\n mdl.HmatSize.valTxt.fill(props.txtColor);\n mdl.HmatSize.valTxt.off();\n alg.increment();\n mdl.Hmat.visible(true);\n mdl.checkBtn.visible(true);\n mdl.getLayer().batchDraw();\n };\n\n\n // show Hmat\n mdl.Hmat.show = function(){\n // increment step\n alg.increment();\n //mdl.HmatSize.visible(false);\n mdl.showHcolumns();\n mdl.Hmat.enable(false);\n mdl.Hmat.setVals(Hvals);\n mdl.Hmat.update();\n mdl.Hmat.visible(true);\n mdl.checkBtn.visible(false);\n mdl.checkBtn.txt.text(lang.checkMat);\n // show H' matrix\n mdl.H_mat.visible(true);\n mdl.getLayer().batchDraw();\n };\n\n // Result analysis panel for decoding process\n if(props.process === 'dec'){\n mdl.err = new PANEL({\n id: 'error panel',\n name: lang.resultAnalysis,\n position: {\n x: mdl.equ.x(),\n y: mdl.equ.y() + mdl.equ.height() + 20\n },\n type: 2,\n labelSize: 18\n });\n mdl.err.visible(false);\n mdl.err.dragmove(false);\n mdl.err.size({width: mdl.equ.width(), height: 140});\n mdl.add(mdl.err);\n // increase mdl height\n mdl.size({height: mdl.err.y()+mdl.err.height() + 20});\n\n // SYNDROME\n mdl.err.synd= new Konva.Group({x: 5, y: 5});\n mdl.err.add(mdl.err.synd);\n // syndrome title\n mdl.err.synd.title = new Konva.Text({\n id: 'sindTitle',\n fontSize: props.txtSize - 2,\n text: lang.errSyndrome+' \\u21D2 ',\n fill: props.txtColor,\n visible: true\n });\n mdl.err.synd.add(mdl.err.synd.title);\n mdl.err.synd.title.position({x:8, y: 0});\n\n // syndrome values\n mdl.err.synd.vals = [];\n mdl.err.synd.setVals = function(cbits){\n cbits.forEach(cbit => {\n mdl.err.synd.vals.push(cbit.res);\n });\n };\n\n // syndrome column\n mdl.err.synd.cbits = [];\n let pos = {x: mdl.err.synd.title.x() + mdl.err.synd.title.width()+12, y:15};\n let m = props.bitsNum-props.checkBits;\n for(let i=m; i<colLabels1.length; i++){\n let cbit = new Konva.Text({\n id:colLabels1[i],\n fontSize: props.txtSize,\n text: '?',\n fill: 'red'\n });\n cbit.position(pos);\n mdl.err.synd.add(cbit);\n pos.y += cbit.height() + 3;\n cbit = over(cbit);\n cbit.hoverTxt = lang.setVal;\n cbit = hover1(cbit, mdl.err);\n cbit.on('click touchstart', function(){\n this.text(this.text() === '0' ? '1':'0');\n mdl.getLayer().batchDraw();\n alg.markCurrStep('curr');\n });\n mdl.err.synd.cbits.push(cbit);\n }\n\n // put title in the middle\n let y = mdl.err.synd.cbits[mdl.err.synd.cbits.length-1].y() + mdl.err.synd.cbits[mdl.err.synd.cbits.length-1].height() - mdl.err.synd.cbits[0].y();\n y /= 2;\n mdl.err.synd.title.y(y+mdl.err.synd.title.height()/2);\n\n // CHECK BUTTON\n mdl.err.checkBtn = new Button({\n id: 'checkBtn',\n height: 25,\n defVal: lang.check,\n txtSize: 16,\n clickable: true,\n fill: 'LightGrey'\n });\n //mdl.err.checkBtn.visible(false);\n mdl.err.add(mdl.err.checkBtn);\n mdl.err.checkBtn.position({x: mdl.err.synd.cbits[0].x()+30, y: mdl.err.synd.title.y()});\n mdl.err.checkBtn.on('click touchstart', function(){\n if(mdl.err.checkSynd() === true){\n mdl.err.synd.cbits.forEach(cbit => {\n cbit.fill(mdl.err.synd.title.fill());\n cbit.off();\n mdl.err.status.visible(true);\n });\n this.visible(false);\n }\n else{\n mdl.err.synd.cbits.forEach(cbit => {cbit.fill('red');});\n stat.error.add(lang.wrongSyndrome);\n return this.hover.show('e',lang.wrongSyndrome);\n }\n\n mdl.getLayer().batchDraw();\n });\n\n // open brackets\n mdl.err.synd.openB = new Konva.Line({ // open bracket\n id:'openB',\n stroke: mdl.err.synd.title.fill(),\n strokeWidth: 2\n });\n mdl.err.synd.add(mdl.err.synd.openB);\n let bP = mdl.err.synd.cbits[0].position(); // begin point\n let eP = mdl.err.synd.cbits[mdl.err.synd.cbits.length-1].position(); // end point\n bP.x -= 4;\n bP.y -= 2;\n eP.x = bP.x;\n eP.y += 2 + mdl.err.synd.cbits[mdl.err.synd.cbits.length-1].height();\n mdl.err.synd.openB.points([bP.x,bP.y, bP.x-8,bP.y, eP.x-8,eP.y, eP.x,eP.y]);\n\n // close bracket\n mdl.err.synd.closeB = mdl.err.synd.openB.clone();\n mdl.err.synd.closeB.id(mdl.err.synd.id()+'closeB');\n mdl.err.synd.add(mdl.err.synd.closeB);\n bP.x += 8 + mdl.err.synd.cbits[0].width();\n eP.x = bP.x;\n mdl.err.synd.closeB.points([bP.x,bP.y, bP.x+8,bP.y, eP.x+8,eP.y, eP.x,eP.y]);\n\n // ERROR STATUS\n mdl.err.status = new Konva.Group({x: mdl.err.synd.cbits[0].x()+40, y: 20});\n mdl.err.add(mdl.err.status);\n mdl.err.status.visible(false);\n\n // error status val\n mdl.err.status.val = -1;\n // error status - no error\n mdl.err.status.noError = new Konva.Text({ fontSize: props.txtSize-1, text: lang.noErr, fill: 'grey'});\n mdl.err.status.add(mdl.err.status.noError);\n mdl.err.status.noError = over(mdl.err.status.noError);\n mdl.err.status.noError.hoverTxt = lang.selectErr;\n mdl.err.status.noError = hover1(mdl.err.status.noError, mdl.err);\n mdl.err.status.noError.on('click touchstart', function(){\n if(mdl.err.status.val === '0'){\n this.fill(mdl.err.synd.title.fill());\n mdl.err.setDecMessage();\n mdl.err.decMessage.visible(true);\n mdl.getLayer().batchDraw();\n }\n else{\n stat.error.add(lang.wrongErrStatus);\n this.hover.show('e', lang.wrongErrStatus);\n }\n });\n\n // error status - single error\n mdl.err.status.sError = new Konva.Text({ fontSize: props.txtSize-1, text: lang.singleErr, fill: 'grey'});\n mdl.err.status.add(mdl.err.status.sError);\n mdl.err.status.sError.y(mdl.err.status.noError.y() + mdl.err.status.noError.height() + 20);\n mdl.err.status.sError = over(mdl.err.status.sError);\n mdl.err.status.sError.hoverTxt = lang.selectErr;\n mdl.err.status.sError = hover1(mdl.err.status.sError, mdl.err);\n mdl.err.status.sError.on('click touchstart', function(){\n if(mdl.err.status.val !== '0' && mdl.err.status.val !== '2'){\n this.fill(mdl.err.synd.title.fill());\n mdl.err.pos.visible(true);\n mdl.getLayer().batchDraw();\n }\n else{\n stat.error.add(lang.wrongErrStatus);\n this.hover.show('e', lang.wrongErrStatus);\n }\n });\n\n // error status - double error\n mdl.err.status.dError = new Konva.Text({ fontSize: props.txtSize-1, text: lang.doubleErr, fill: 'grey'});\n mdl.err.status.add(mdl.err.status.dError);\n mdl.err.status.dError.y(mdl.err.status.sError.y() + mdl.err.status.sError.height() + 20);\n mdl.err.status.dError = over(mdl.err.status.dError);\n mdl.err.status.dError.hoverTxt = lang.selectErr;\n mdl.err.status.dError = hover1(mdl.err.status.dError, mdl.err);\n mdl.err.status.dError.on('click touchstart', function(){\n if(mdl.err.status.val === '2'){\n this.fill(mdl.err.synd.title.fill());\n mdl.getLayer().batchDraw();\n alg.increment();\n }\n else{\n stat.error.add(lang.wrongErrStatus);\n this.hover.show('e', lang.wrongErrStatus);\n }\n });\n\n // error position\n mdl.err.pos = new Konva.Group({x: mdl.err.status.x()+mdl.err.status.noError.width()+60, y: mdl.err.status.y()});\n mdl.err.add(mdl.err.pos);\n mdl.err.pos.visible(false);\n // error position value\n mdl.err.pos.val = -1;\n // error position title\n mdl.err.pos.title = new Konva.Text({ fontSize: props.txtSize-1, text: lang.errorPos+': ', fill: mdl.err.synd.title.fill()});\n mdl.err.pos.add(mdl.err.pos.title);\n // error position text\n mdl.err.pos.txt = new Konva.Text({ fontSize: props.txtSize-1, text: '??', fill: 'red'});\n mdl.err.pos.add(mdl.err.pos.txt);\n mdl.err.pos.txt.x(mdl.err.pos.title.width()+5);\n mdl.err.pos.txt = over(mdl.err.pos.txt);\n mdl.err.pos.txt.hoverTxt = lang.setDecCode;\n mdl.err.pos.txt = hover1(mdl.err.pos.txt, mdl.err.pos);\n mdl.err.pos.txt.on('dblclick tap', function(){\n let thisObj = this;\n let str = this.text();\n let oldStr =thisObj.str;\n editable(thisObj, function(obj){\n let s = obj.text().toUpperCase();\n if(s === '') return obj.text(oldStr);\n if(oldStr !== s){\n if(mdl.err.pos.val === s){\n thisObj.fill(mdl.err.pos.title.fill());\n mdl.getLayer().batchDraw();\n thisObj.off();\n mdl.err.correctCW();\n mdl.err.setDecMessage();\n }\n else {\n stat.error.add(lang.wrongDecCode);\n thisObj.fill('red');\n return thisObj.hover.show('e', lang.wrongDecCode);\n }\n }\n else console.log('No change');\n });\n });\n\n // DECODED MESSAGE PANEL\n mdl.err.decMessage = new PANEL({\n id: 'decMsg panel',\n name: lang.decodedMsg,\n position: {\n x: mdl.err.pos.x(),\n y:mdl.err.pos.y() + mdl.err.pos.txt.height() + 35\n },\n type: 2,\n labelSize: 18\n });\n mdl.err.add(mdl.err.decMessage);\n mdl.err.decMessage.visible(false);\n mdl.err.decMessage.dragmove(false);\n mdl.err.decMessage.size({ height: 50});\n mdl.err.decMessage.size({width: mdl.err.width() - mdl.err.decMessage.x() - 10});\n // decoded message txt\n mdl.err.decMessage.txt = new Konva.Text({ fontSize: props.txtSize+2, text: '?????????????????', fill: 'red',\n width: mdl.err.decMessage.width()-40,\n // height: mdl.err.decMessage.height(),\n align: 'center', verticalAlign: 'middle'\n });\n\n mdl.err.decMessage.add(mdl.err.decMessage.txt);\n mdl.err.decMessage.val ='';\n mdl.err.decMessage.txt.position({x:20, y: 20});\n mdl.err.decMessage.txt.hoverTxt = lang.writeDecMsg;\n mdl.err.decMessage.txt = over(mdl.err.decMessage.txt);\n mdl.err.decMessage.txt = hover1(mdl.err.decMessage.txt, mdl.err);\n mdl.err.decMessage.txt.on('dblclick tap', function(){\n let thisObj = this;\n let str = this.text();\n let oldStr =thisObj.str;\n editable(thisObj, function(obj){\n let s = obj.text().toUpperCase();\n if(s === '') return obj.text(oldStr);\n if(oldStr === s) return console.log('No change');\n // check\n if(mdl.err.decMessage.val === s){\n thisObj.fill(mdl.err.pos.title.fill());\n mdl.getLayer().batchDraw();\n thisObj.off();\n alg.increment();\n }\n else {\n stat.error.add(lang.wrongDecMsg);\n thisObj.fill('red');\n return thisObj.hover.show('e', lang.wrongDecMsg);\n }\n });\n });\n\n // set decoded message\n mdl.err.setDecMessage = function(){\n let vals = [];\n mdl.bits.forEach(b => {\n if(b.id().substr(0,1) === 'S') vals.push(b.text());\n });\n vals = vals.toString();\n vals = vals.replace(/,/g, '');\n mdl.err.decMessage.val = vals;\n mdl.err.decMessage.visible(true);\n };\n\n // check syndrome\n mdl.err.checkSynd = function(){\n for(let i=0; i<mdl.err.synd.vals.length; i++){\n if(mdl.err.synd.vals[i].toString() !== mdl.err.synd.cbits[i].text()) return false;\n }\n return true;\n };\n\n // set error syndrome for auto mode\n mdl.err.setSynd = function(){\n for(let i=0; i<mdl.err.synd.vals.length; i++){\n mdl.err.synd.cbits[i].text(mdl.err.synd.vals[i].toString());\n mdl.err.synd.cbits[i].fill(mdl.err.synd.title.fill());\n mdl.err.synd.cbits[i].off();\n }\n };\n\n //correct the codeword\n mdl.err.correctCW = function(){\n let idx = mdl.Hmat.colNums.findIndex(n => n.text() === mdl.err.pos.val);\n let bit = mdl.bits[idx];\n mdl.vals[idx] = mdl.vals[idx] === 0 ? 1 : 0;\n bit.text(mdl.vals[idx].toString());\n bit.rect.fill('green');\n mdl.getLayer().batchDraw();\n };\n\n // set error status\n mdl.err.setErrStatus = function(H_mat){\n if(typeof H_mat === 'undefined') return console.error('There is no H\\' matrix');\n // check for no error\n if(Math.max(...mdl.err.synd.vals) === 0){\n mdl.err.status.val = '0';\n return;\n }\n\n let rows = H_mat.vals.length;\n let cols = H_mat.vals[0].length;\n for(let i=0; i<cols; i++)\n for(let j=0; j<rows; j++){\n if(H_mat.vals[j][i] !== mdl.err.synd.vals[j]) break;\n if(j === rows-1) {\n mdl.err.status.val = H_mat.colLabels[i].id();\n return;\n }\n }\n mdl.err.status.val = '2';\n };\n\n // set error position\n mdl.err.setErrPos = function(Hmat){\n if(mdl.err.status.val === '0' || mdl.err.status.val === '2') return ;\n let idx = Hmat.colLabels.findIndex(label => label.id() === mdl.err.status.val);\n mdl.err.pos.val = Hmat.colNums[idx].text();\n };\n\n // show result analysis for auto mode\n mdl.err.showAnalysis = function(){\n // show syndrome\n mdl.err.setSynd();\n mdl.err.checkBtn.visible(false);\n mdl.err.status.visible(true);\n //console.log('mdl.err.status.val',mdl.err.status.val);\n // show error status and the decoded message\n if(mdl.err.status.val === '0'){\n mdl.err.status.noError.fill(mdl.err.synd.title.fill());\n mdl.err.setDecMessage();\n mdl.err.decMessage.visible(true);\n mdl.err.decMessage.txt.text(mdl.err.decMessage.val);\n mdl.err.decMessage.txt.fill(mdl.err.synd.title.fill());\n }\n else if(mdl.err.status.val !== '1' && mdl.err.status.val !== '2'){\n mdl.err.status.sError.fill(mdl.err.synd.title.fill());\n mdl.err.pos.visible(true);\n mdl.err.pos.txt.text(mdl.err.pos.val.toString());\n mdl.err.pos.txt.fill(mdl.err.synd.title.fill());\n mdl.err.correctCW();\n mdl.err.setDecMessage();\n mdl.err.decMessage.visible(true);\n mdl.err.decMessage.txt.text(mdl.err.decMessage.val);\n mdl.err.decMessage.txt.fill(mdl.err.synd.title.fill());\n }\n else if(mdl.err.status.val === '2'){\n mdl.err.status.dError.fill(mdl.err.synd.title.fill());\n }\n\n mdl.err.status.noError.off();\n mdl.err.status.sError.off();\n mdl.err.status.dError.off();\n mdl.err.pos.txt.off();\n mdl.err.decMessage.txt.off();\n\n mdl.getLayer().batchDraw();\n alg.increment();\n };\n }\n\n return mdl;\n}// END of HAMMING MATRIX ALGORITHM", "_showMonedas () {\n // rescato el state transformado con los datos de bpi del objeto}\n const { bpi } = this.props\n const transform = Object.keys(bpi) // aqui sacan todas las monedas disponibles dentro de bpi {} \n \n return transform.map(moneda =>(\n <p key={moneda}>Bitcoin en: {moneda} <strong>Equivale a: {bpi[moneda].rate}</strong></p>\n ))\n }", "function plasserUtMat() {\n for (let i = 0; i < 5; i++) {\n const x = Math.trunc(Math.random() * 60);\n const y = Math.trunc(Math.random() * 60);\n ruter[x][y] = 1;\n const div = document.createElement(\"div\");\n div.className = \"gul ting\";\n divBrett.append(div);\n const banan = new Ting(div, x, y);\n banan.render();\n mat.push(banan);\n }\n for (let i = 0; i < 5; i++) {\n let ledig = false;\n let x; let y;\n while (!ledig) {\n x = Math.trunc(Math.random() * 60);\n y = Math.trunc(Math.random() * 60);\n ledig = ruter[x][y] === 0;\n }\n ruter[x][y] = 1;\n const div = document.createElement(\"div\");\n div.className = \"roed ting\";\n divBrett.append(div);\n const banan = new Ting(div, x, y);\n banan.render();\n mat.push(banan);\n }\n }", "function obtenerResultadosTeoricos(imc) {\n \"use strict\";\n var resultado;\n \n if (imc < 16) {\n resultado = \"Delgadez Severa\";\n } else if (imc >= 16 && imc < 18.5) {\n resultado = \"Delgadez\";\n } else if (imc >= 18.5 && imc < 30) {\n resultado = \"Complexión Normal\";\n } else if (imc >= 30 && imc < 40) {\n resultado = \"Obesidad\";\n } else if (imc >= 40) {\n resultado = \"Obesidad Severa\";\n }\n \n return resultado;\n}", "function MathRecognitionData() {\n }", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function printData(numRig, numCol){\n\t// input\n\tvar tdId=document.getElementById(3*numRig+numCol);\n\tif(matr[numRig][numCol]!=0) return; // valore casella già assegnato\n\tnumMosse++\n\tconsole.log(\"================ \" +numMosse+ \" ================\");\n\tconsole.log(\"coordinate riga colonna : (\"+numRig+\",\"+numCol+\")\");\n\tif(turno==1){\n\t\ttdId.innerHTML=\"X\";\n\t\tturno=-1;\n\t}else{\n\t\ttdId.innerHTML=\"O\";\n\t\tturno=1;\n\t}\n\tmatr[numRig][numCol]=giocatore;\n\t\n\t//main\n\tconsole.log(\"giocatore: \" + giocatore);\n\t// calcolo numeri determinante\n\trig[numRig]+=giocatore; \n\tcol[numCol]+=giocatore;\n\tif(numRig==numCol) dig[0]+=giocatore;\n\tif(numRig+numCol==2) dig[1]+=giocatore;\n\t// calcolo determinante\n\tdet=Math.max(0,Math.max(rig[numRig],col[numCol],dig[0],dig[1])-2) +\n\tMath.min(0,Math.min(rig[numRig],col[numCol],dig[0],dig[1])+2);\n\tconsole.log(\"numeri determinante:\");\n\tconsole.log(\"\\trighe: (\"+rig[0]+\",\"+rig[1]+\",\"+rig[2]+\")\");\n\tconsole.log(\"\\tcolonne: (\"+col[0]+\",\"+col[1]+\",\"+col[2]+\")\");\n\tconsole.log(\"\\tdiagonali: (\"+dig[0]+\",\"+dig[1]+\")\");\n\tconsole.log(\"determinante: \"+ det);\n\t// determina risultato\n\tif(det>0) resultString=\"Ha vinto X\";\n\tif(det<0) resultString=\"Ha vinto O\";\n\tif(det==0) if(numMosse<9){\n\t\tgiocatore=turno;\n\t\treturn;\n\t}else resultString=\"Patta\"; // finito le mosse\n\tconsole.log(\"risultato: \" + resultString);\n\n\t// output\n\talert(resultString);\n\tconsole.log(\" *** END ***\");\n\trestart();\n}", "function leyes_vida(){\n\tcelulas_x2= new Array(50);\n\tfor(i=0;i<50;i++){\n\t\tcelulas_y2= new Array(50);\n\t\tfor(j=0;j<50;j++){\n\t\t\tsum=0;\n\t\t\tcelulas_y2[j]=evaluar(i,j,celulas_x,celulas_x[i][j],sum);\n\t\t\t//alert(\"resultado: \"+celulas_y2[j]);\n\t\t\t\n\t\t}//for j\n\t\tcelulas_x2[i]=celulas_y2;\n\t\t\n\t}//for i\n\tcelulas_x=celulas_x2;\n\t\n\timprimir_celulas(celulas_x);\n\t\n}", "multiply(mat) {\n const m00 = this.v[0] * mat.v[0] + this.v[3] * mat.v[1] + this.v[6] * mat.v[2];\n const m01 = this.v[0] * mat.v[3] + this.v[3] * mat.v[4] + this.v[6] * mat.v[5];\n const m02 = this.v[0] * mat.v[6] + this.v[3] * mat.v[7] + this.v[6] * mat.v[8];\n const m10 = this.v[1] * mat.v[0] + this.v[4] * mat.v[1] + this.v[7] * mat.v[2];\n const m11 = this.v[1] * mat.v[3] + this.v[4] * mat.v[4] + this.v[7] * mat.v[5];\n const m12 = this.v[1] * mat.v[6] + this.v[4] * mat.v[7] + this.v[7] * mat.v[8];\n const m20 = this.v[2] * mat.v[0] + this.v[5] * mat.v[1] + this.v[8] * mat.v[2];\n const m21 = this.v[2] * mat.v[3] + this.v[5] * mat.v[4] + this.v[8] * mat.v[5];\n const m22 = this.v[2] * mat.v[6] + this.v[5] * mat.v[7] + this.v[8] * mat.v[8];\n return this.setComponents(m00, m01, m02, m10, m11, m12, m20, m21, m22);\n }", "function obtenerMovimientoAdecuado(datosEsenciales){\n var estadisticos = [0,0,0,0];\n var valormax = 0;\n var movimiento;\n var sumatoria = 0;\n //Buscamos el valor valor de los pesos de los primeros 4 caminos\n for(var i = 0; i<datosEsenciales.length; i++){\n sumatoria += datosEsenciales[i][1];\n valormax = obtenerMaximo(valormax, datosEsenciales[i][1]);\n }\n\n //Obtenemos el indice o camino que contiene el valor mayor de los pesos\n for(var i = 0; i<datosEsenciales.length; i++){\n if(datosEsenciales[i][1] == valormax){\n movimiento = datosEsenciales[i][0];\n break;\n }\n }\n //Calculamos los porcentajes de exito por cada uno de los primeros 4 caminos\n for(var i = 0; i<datosEsenciales.length; i++){\n if(datosEsenciales[i][1] != undefined)\n estadisticos[datosEsenciales[i][0]] = Math.round((datosEsenciales[i][1]/sumatoria)*100);\n }\n if(movimiento == undefined)\n movimiento = (Math.floor(Math.random() * (4 - 0) + 0));\n return {movimientoAdecuado: movimiento, estadisticos: estadisticos}\n }", "function Tablas(numero, rango){\n // aqui iran los numeros por los cuales se va a multiplicar las tablas\n var indiceGeneral = 0;\n var tablas = [];\n var ejemplos = [];\n var respuestas = [];\n // this converts the input to an integral\n var rangoReal = parseInt(rango) + 1\n\n for (var i = 0; i < rangoReal ; i++) {\n tablas.push(indiceGeneral)\n indiceGeneral++\n }\n\n\n for (var i = 0; i < tablas.length; i++) {\n ejemplos.push(`${numero} times ${tablas[i]} equals?`);\n respuestas.push(numero * tablas[i]);\n }\n\n return {ejemplos, respuestas, indiceGeneral, rango};\n\n\n }", "function inicializar(){var v=document.getElementById(\"comprobacion\"); v.innerHTML=\"\"; nota=0.0;}", "function calcola_jddata(giorno,mese,anno,ora,minuti,secondi){\n\n // funzione per il calcolo del giorno giuliano per una data qualsiasi. \n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // restituisce il valore numerico dataGiuliana_annox\n// ATTENZIONE! inserire i valori dei tempi come T.U. di GREENWICH\n \nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi); // valore del giorno giuliano per una data qualsiasi.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana;\n\n}", "function IndicadorGradoAcademico () {}", "function cuentaVecinos(row, col) {\n let count = 0;\n let nrow=Number(row);\n let ncol=Number(col);\n \n // Asegurando que el vecino no esta arriba\n if (nrow - 1 >= 0) {\n if (aGen[nrow - 1][ncol] == 1) \n count++;\n}\n // Asegurando que el vecino no esta en la fila de arriba a la izquierda\n if (nrow - 1 >= 0 && ncol - 1 >= 0) {\n if (aGen[nrow - 1][ncol - 1] == 1) \n count++;\n}\n // Asegurando que el vecino no esta en la fila de arriba a la derecha\n if (nrow - 1 >= 0 && ncol + 1 < cols) {\n if (aGen[nrow - 1][ncol + 1] == 1) \n count++;\n }\n // // Asegurando que el vecino no esta en la columna a la izquierda\n if (ncol - 1 >= 0) {\n if (aGen[nrow][ncol - 1] == 1) \n count++;\n}\n // Asegurando que el vecino no esta en la columna a la derecha\n if (ncol + 1 < cols) {\n if (aGen[nrow][ncol + 1] == 1) \n count++;\n}\n // Asegurando que el vecino no esta en la fila de abajo a la izquierda\n if (nrow + 1 < rows && ncol - 1 >= 0) {\n if (aGen[nrow + 1][ncol - 1] == 1) \n count++;\n}\n //Asegurando que el vecino no esta en la fila de abajo a la derecha\n if (nrow + 1 < rows && ncol + 1 < cols) {\n if (aGen[nrow + 1][ncol + 1] == 1) \n count++;\n}\n // Asegurando que el vecino no esta abajo\n if (nrow + 1 < rows) {\n if (aGen[nrow + 1][ncol] == 1) \n count++;\n}\nreturn count;\n}", "function auxLetras(promedio) {\n let simbolo;\n\n if (promedio > 0 && promedio <= 15)\n simbolo = 'M';\n else if (promedio >= 16 && promedio <= 31)\n simbolo = 'N';\n else if (promedio >= 32 && promedio <= 47)\n simbolo = 'H';\n else if (promedio >= 48 && promedio <= 63)\n simbolo = '#';\n else if (promedio >= 64 && promedio <= 79)\n simbolo = 'Q';\n else if (promedio >= 80 && promedio <= 95)\n simbolo = 'U';\n else if (promedio >= 96 && promedio <= 111)\n simbolo = 'A';\n else if (promedio >= 112 && promedio <= 127)\n simbolo = 'D';\n else if (promedio >= 128 && promedio <= 143)\n simbolo = '0';\n else if (promedio >= 144 && promedio <= 159)\n simbolo = 'Y';\n else if (promedio >= 160 && promedio <= 175)\n simbolo = '2';\n else if (promedio >= 176 && promedio <= 191)\n simbolo = '$';\n else if (promedio >= 192 && promedio <= 209)\n simbolo = '%';\n else if (promedio >= 210 && promedio <= 225)\n simbolo = '+';\n else if (promedio >= 226 && promedio <= 239)\n simbolo = '.';\n else if (promedio >= 240 && rgbPromedio <= 255)\n simbolo = ' ';\n return simbolo;\n\n}", "function montaConjuntos(){\r\n\treturn quantidadeDeLinha() / valorDeN();\r\n}", "nuevoCiclo() {\n let suma = 0;\n for (let i = 0; i < this.vecinos.length; i++) {\n if (this.vecinos[i].estado === 1) {\n suma++;\n }\n }\n\n // Aplicamos las normas\n this.estadoProx = this.estado; // Por defecto queda igual\n\n // Vida: tiene 3 vecinos\n if (this.estado === 0 && suma === 3) {\n this.estadoProx = 1;\n }\n\n // Muerte: menos de 2(soledad) o mas de 3 (inanicion)\n if (this.estado == 1 && (suma < 2 || suma > 3)) {\n this.estadoProx = 0;\n }\n }", "function mostrarDatosCompra() {\n //Tomo los datos que pasé en la funcion navegar\n const unaCompra = this.data;\n if (unaCompra) {\n const idProd = unaCompra.idProducto;\n const productoComprado = obtenerProductoPorID(idProd);\n const subTotal = unaCompra.cantidad * productoComprado.precio;\n //Escribo el mensaje a mostrar\n const mensaje = `Producto <strong>${productoComprado.nombre}</strong>.\n <br> Cantidad comprada: <strong>${unaCompra.cantidad}</strong>.<br>\n Sub Total: <strong> $${subTotal}</strong>`;\n //Muestro el mensaje\n $(\"#pDetalleCompraMensaje\").html(mensaje);\n } else {\n ons.notification.alert(\"Ocurrió un error, por favor contacte al administrador\", { title: 'Oops!' });\n }\n}", "function calculadora() {\n for (let i = 0; i < resultados.length; i++) {\n if (num.length > 1) {\n switch (i) {\n case 0:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 + num[j] * 1;\n }\n // Suma\n console.log(`El valor de la suma es: ${resultados[i]}`);\n break;\n case 1:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] = resultados[i] * 1 - num[j] * 1;\n }\n // Resta\n console.log(`El valor de la resta es ${resultados[i]}`);\n break;\n case 2:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] *= num[j];\n }\n // Multiplicación\n console.log(`El valor de la multiplicación es ${resultados[i]}`);\n break;\n case 3:\n resultados[i] = num[0] * 1;\n for (let j = 1; j < num.length; j++) {\n resultados[i] /= num[j];\n }\n // División\n console.log(`El valor de la división es ${resultados[i].toFixed(2)}`);\n break;\n case 4:\n resultados[i] = \"Sin Raiz cuadrada.\";\n // Sin raiz cuadrada\n console.log(\n `Al introducir dos o más valores numericos correctos la Raiz cuadrada no se ha calculado`\n );\n break;\n default:\n break;\n }\n } else if (num.length === 1) {\n resultados[4] = Math.sqrt(num[0]);\n // Raiz cuadrada\n console.log(`Solo se ha introducido un valor valido.`);\n console.log(\n `El valor de la raiz cuadrada es ${resultados[4].toFixed(2)}`\n );\n\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n } else {\n console.log(`No se han introducido numeros validos`);\n // desbordo la i para que no lo printe n veces.\n i = resultados.length;\n }\n }\n}", "function matrixAnalyzer(){\r\n\t\tcellValue_1 = dataSample(className,\"data-cell-value\",1).length;\r\n\t\tcellValue_0 = dataSample(className,\"data-cell-value\",0).length;\r\n\t\tcellEven = Math.floor(amountCells / 2); //amount cells Even\r\n\t\tcellOdd = amountCells - cellEven; //amount cells Odd\r\n\t\t\r\n\t\t$(\"\"+className+\"\").click(function(){\r\n\t\t\t$(\"\"+className+\"\").removeAttr(\"data-flag\");\r\n\t\t\t$(this).attr('data-flag','flag');\r\n\t\t\t$(\"\"+className+\"\").css({'background':'#FFE4B5'});\r\n\t\t\tdataSample(className,\"data-flag\",\"flag\").css({'background':'blue'});\r\n\t\t\tcellNumber = $(this).data('cell-number');\r\n\t\t\tcellValue = $(this).data('cell-value');\r\n\t\t\tx = parseFloat($(this).data('x'));\r\n\t\t\ty = parseFloat($(this).data('y'));\r\n\t\t\tcellContent = $(this).data('cell-content');\r\n\t\t\tcellContent = $(this).data('cell-content');\r\n\t\t\tcellValueRnd = $(this).data('rnd');\r\n\t\t\tactionBorders(x,y);\r\n\t\t\tshowConsoleInfo();\r\n\t\t\t});\r\n\r\n\t\tfunction showConsoleInfo(){\r\n\t\t\t$(\"#info-size-matrix\").html('Size of matrix: '+sizeX+'x'+sizeY);\r\n\t\t\t$(\"#info-cells-amount\").html(amountCells);\r\n\t\t\t$(\"#info-cells-even\").html(cellEven);\r\n\t\t\t$(\"#info-cells-odd\").html(cellOdd);\r\n\t\t\t$(\"#info-cells-value0\").html(cellValue_0);\r\n\t\t\t$(\"#info-cells-value1\").html(cellValue_1);\r\n\t\t\t$(\"#info-number\").html(cellNumber);\r\n\t\t\t$(\"#info-value\").html(cellValue);\r\n\t\t\t$(\"#info-x\").html(x);\r\n\t\t\t$(\"#info-y\").html(y);\r\n\t\t\t$(\"#info-content\").html(cellContent);\r\n\t\t\t$(\"#info-rnd\").html(cellValueRnd);\r\n\t\t\t\r\n\t\t};\r\n\t\tshowConsoleInfo();\r\n\t}", "function formulaCos() {\n objetoA = Object.values(selected).slice(1);\n\n for (let index = 0; index < newArray.length; index++) {\n objetoB = Object.values(newArray[index]).slice(1);\n\n var numerador = 0;\n var denominadorA = 0;\n var denominadorB = 0;\n\n for (let index = 1; index < objetoA.length; index++) {\n numerador += (parseInt(objetoA[index]) * parseInt(objetoB[index]));\n denominadorA += (parseInt(objetoA[index]) * parseInt(objetoA[index]));\n denominadorB += (parseInt(objetoB[index]) * parseInt(objetoB[index]));\n }\n\n denominadorA = Math.sqrt(denominadorA);\n denominadorB = Math.sqrt(denominadorB);\n var valorK = numerador / (denominadorA * denominadorB);\n var valorFinalK = parseInt(valorK * 100);\n\n if (valorFinalK < 99) {\n nuevosK.push({\n foto: newArray[index].foto,\n persona: newArray[index].nombres,\n valorK: valorFinalK + \"%\",\n info: objetoB,\n });\n }\n\n }\n setListaOrdenados(nuevosK.sort((a, b) => (a.valorK > b.valorK) ? - 1 : 1).slice(0, indexLista));\n console.log(listaOrdenados);\n }", "function calcul_Omegar(h, c, k, t0, H0parsec) {\r\n \r\n // Matière et Lambda\r\n var Or = 0;\r\n sigma = (2 * Math.pow(Math.PI, 5) * Math.pow(k, 4)) / (15 * Math.pow(h, 3) * Math.pow(c, 2)); //OK\r\n\r\n // Matière Lambda, RFC et neutrinos\r\n if (document.getElementById(\"liste\").options[0].selected) {\r\n rho_r = (4 * sigma * Math.pow(t0, 4)) / (Math.pow(c, 3));\r\n Or = (8 * Math.PI * G * rho_r) / (3 * Math.pow(H0parsec, 2));\r\n Or = 1.68 * Or; // neutrinos\r\n Or = Or.toExponential(4);\r\n \r\n // Matière Lambda & RFC\r\n } else if (document.getElementById(\"liste\").options[1].selected) {\r\n rho_r = (4 * sigma * Math.pow(t0, 4)) / (Math.pow(c, 3));\r\n Or = (8 * Math.PI * G * rho_r) / (3 * Math.pow(H0parsec, 2));\r\n Or = Or.toExponential(4);\r\n }\r\n return Or;\r\n}", "function staciakampioReiksme () {\n// let ivedimoLaukas = document.querySelector('div input');\n let x = document.querySelector('#iksas').value;\n let y = document.querySelector('#ygrikas').value;\n let plotas= x*y;\n //console.log(plotas);\n document.querySelector(\".staciakampio-plotas\").innerHTML = plotas;\n}", "function detailMunicipio(){\n munD = '';\n if (map.getZoom() >= 14){\n\t var latDet = roundNumber(targetCoordMun.lat(),7); while (latDet.length != 10){latDet = latDet + \"0\" + \"\";}\n\t\tvar lngDet = roundNumber(targetCoordMun.lng(),7); while (lngDet.length != 10){lngDet = lngDet + \"0\" + \"\";}\n\t\t\n\t\tvar plesso = coordPless['\"'+lngDet+','+latDet+'\"'][0];\n\t\t\n\t for (var x in plesso){\n\t\t\tmunD = plesso[x][\"M\"];\n\n\t\t}\n }\n\n}", "function Aviao() {\n this.matricula = Utils.getRandomMatricula();\n this.selecionado = true;\n }", "function calculo() {\r\n\r\n let peso = document.dados.peso.value;\r\n let altura = document.dados.altura.value;\r\n if ((validacao(peso) && validacao(altura) && isNumber(peso) && isNumber(altura)) == true) {\r\n\r\n \t//IMC\r\n\r\n imc = parseFloat(peso) / (parseFloat(altura) * parseFloat(altura));\r\n\r\n if (imc < 0.00185) {\r\n document.dados.res.value = \" Subnutrido\";\r\n } else if (imc >= 0.00185 && imc <= 0.00249) {\r\n document.dados.res.value = \" Saudável\";\r\n } else if (imc > 0.00249 && imc <= 0.00299) {\r\n document.dados.res.value = \" Sobrepeso\";\r\n } else if (imc > 0.00299 && imc <= 0.00349) {\r\n document.dados.res.value = \" Obesidade grau 1\";\r\n } else if (imc > 0.00349 && imc <= 0.00399) {\r\n document.dados.res.value = \" Obesidade grau 2\";\r\n } else {\r\n document.dados.res.value = \" Obesidade grau 3\";\r\n }\r\n\r\n //Intervalo\r\n\r\nlet inter_1=parseFloat( 0.00185)*parseFloat(altura)*parseFloat(altura);\r\nlet inter_2 = parseFloat(0.00249)*parseFloat(altura)*parseFloat(altura);\r\n\r\n\r\n document.dados.inter.value = \" Entre \" + inter_1 + \" KG e \" + inter_2 + \" KG\"; \r\n\r\n\r\n\r\n \r\n}\r\n\r\ndocument.dados.peso.value = \"\";\r\ndocument.dados.altura.value=\"\";\r\n}", "function calcola_data(lingua){\n\n // parametri lingua= \"ITA\" - \"ING\" - \"FRA\" - \"TED\" - \"SAR\" - \"SPA\" - \"POR\" - \"ESP\"\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009.\n // utilizzo caratteri speciali ANSI.\n // restituisce la stringa DataIns.\n\n\t \n\tvar DataIns=\".\";\n var it_giorni=new Array(\"Domenica\",\"Luned&#236\",\"Marted&#236\",\"Mercoled&#236\",\"Gioved&#236\",\"Venerd&#236\",\"Sabato\");\n var it_mesi=new Array(\"Gennaio\",\"Febbraio\",\"Marzo\",\"Aprile\",\"Maggio\",\"Giugno\",\"Luglio\",\"Agosto\",\"Settembre\",\"Ottobre\",\"Novembre\",\"Dicembre\");\n\n var en_giorni=new Array(\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\");\n var en_mesi=new Array(\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n\n var fr_giorni=new Array(\"Dimanche\",\"Lundi\",\"Mardi\",\"Mercredi\",\"Jeudi\",\"Vendredi\",\"Samedi\");\n var fr_mesi=new Array(\"Janvier\",\"F&#233vrier\",\"Mars\",\"Avril\",\"Mai\",\"Juin\",\"Juillet\",\"Ao&#251t\",\"Septembre\",\"Octobre\",\"Novembre\",\"D&#233cembre\");\n \n var te_giorni=new Array(\"Sonntag\",\"Montag\",\"Dienstag\",\"Mittwoch\",\"Donnerstag\",\"Freitag\",\"Samstag\");\n var te_mesi=new Array(\"Januar\",\"Februar\",\"M&#228rz\",\"April\",\"Mai\",\"Juni\",\"Juli\",\"August\",\"September\",\"Oktober\",\"November\",\"Dezember\");\n\n var sr_giorni=new Array(\"Dom&#236niga\",\"Lunis\",\"Martis\",\"M&#232;rcuris\",\"Gi&#242;bia\",\"Chen&#224;bura\",\"S&#224;badu\");\n var sr_mesi=new Array(\"Ghenn&#224rgiu\",\"Fre&#224rgiu\",\"Martzu\",\"Abrile\",\"Maju\",\"L&#224mpadas\",\"Tr&#236ulas\",\"Austu\",\"Cabudanni\",\"Santugaine\",\"Santandria\",\"Nadale\");\n\n var sp_giorni=new Array(\"Domingo\",\"Lunes\",\"Martes\",\"Mi&#233;rcoles\",\"Jueves\",\"Viernes\",\"S&#225;bado\");\n var sp_mesi=new Array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\n\n var pr_giorni=new Array(\"Domingo\",\"Segunda-feira\",\"Ter&#231;a-feira\",\"Quarta-feira\",\"Quinta-feira\",\"Sexta-feira\",\"S&#225;bado\");\n var pr_mesi=new Array(\"Janeiro\",\"Fevereiro\",\"Mar&#231;o\",\"Abril\",\"Maio\",\"Junho\",\"Julho\",\"Agosto\",\"Setembro\",\"Outubro\",\"Novembro\",\"Dezembro\");\n\n var es_giorni=new Array(\"Dimanco\",\"Lundo\",\"Mardo\",\"Merkredo\",\"Ja&#249;do\",\"Vendredo\",\"Sabato\");\n var es_mesi=new Array(\"Januaro\",\"Februaro\",\"Marto\",\"Aprilo\",\"Majo\",\"Junio\",\"Julio\",\"A&#249;gusto\",\"Septembro\",\"Oktobro\",\"Novembro\",\"Decembro\");\n\n var data=new Date();\n\n var anno =data.getYear(); // anno\n var mese =data.getMonth(); // mese 0 a 11 \n var giorno=data.getDate(); // numero del giorno da 1 a 31\n var giorno_settimana=data.getDay(); // giorno della settimana 0 a 6\n var ora =data.getHours(); // ora del giorno da 0 a 23\n var minuti=data.getMinutes(); // minuti da 0 a 59\n var secondi=data.getSeconds(); // secondi da 0 a 59\n \n if (anno<1900) { anno=anno+1900; } // correzione anno\n\n if (ora<10){ ora='0'+ora;}\n \n if (minuti<10){minuti='0'+minuti;}\n\n if (secondi<10) {secondi='0'+secondi;}\n \n if (lingua==\"ING\") { DataIns=ora+':'+minuti+':'+secondi+' '+en_giorni[giorno_settimana]+\", \"+giorno+\" \"+en_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"FRA\") { DataIns=ora+':'+minuti+':'+secondi+' '+fr_giorni[giorno_settimana]+\", \"+giorno+\" \"+fr_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"TED\") { DataIns=ora+':'+minuti+':'+secondi+' '+te_giorni[giorno_settimana]+\", \"+giorno+\" \"+te_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"SAR\") { DataIns=ora+':'+minuti+':'+secondi+' '+sr_giorni[giorno_settimana]+\", \"+giorno+\" \"+sr_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"SPA\") { DataIns=ora+':'+minuti+':'+secondi+' '+sp_giorni[giorno_settimana]+\", \"+giorno+\" \"+sp_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"POR\") { DataIns=ora+':'+minuti+':'+secondi+' '+pr_giorni[giorno_settimana]+\", \"+giorno+\" \"+pr_mesi[mese]+\" \"+anno; }\n\n else if (lingua==\"ESP\") { DataIns=ora+':'+minuti+':'+secondi+' '+es_giorni[giorno_settimana]+\", \"+giorno+\" \"+es_mesi[mese]+\" \"+anno; }\n\n else { DataIns=ora+':'+minuti+':'+secondi+' '+it_giorni[giorno_settimana]+\", \"+giorno+\" \"+it_mesi[mese]+\" \"+anno; }\n \n\treturn DataIns;\n }", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function contaMedaglie(array, n) {\n var somma = d3.sum(array, function(d,i){\n // conta tutti\n if (n=='athletes') return 1\n if (n=='gold') return (d.gold_medals > 0) ? 1 : 0\n if (n=='silver') return (d.silver_medals > 0) ? 1 : 0\n if (n=='bronze') return (d.bronze_medals > 0) ? 1 : 0\n if (n=='any') return (d.total_medals > 0) ? 1 : 0\n if (n=='none') return (d.total_medals == 0) ? 1 : 0\n })\n return somma\n }", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "function marks() \n{\n\tvar m = testObjekat.ocenePolaznika;\n\n\tfor (var i = 0; i < m.length; i++)\n\t{\n\t\tm[i] = m[i] + '/10';\n\t}\n\treturn m;\n\n}" ]
[ "0.6209102", "0.598249", "0.59235054", "0.5839722", "0.5777203", "0.57393456", "0.57326937", "0.57200927", "0.57190186", "0.57020307", "0.57008684", "0.56675166", "0.5646028", "0.5577797", "0.55736595", "0.5567458", "0.55451494", "0.55431575", "0.55427456", "0.5537339", "0.5514532", "0.5511816", "0.5510184", "0.5506368", "0.54975325", "0.54734105", "0.5459694", "0.54353416", "0.5413598", "0.5411866", "0.54093486", "0.5401043", "0.5397753", "0.53889436", "0.5375332", "0.53732675", "0.5371324", "0.5357461", "0.53493375", "0.53391206", "0.53344977", "0.5326466", "0.5311075", "0.53050375", "0.5298801", "0.52966034", "0.5294356", "0.52932084", "0.5280811", "0.52771497", "0.5274232", "0.5263641", "0.5260876", "0.5253101", "0.5239811", "0.5225718", "0.5224518", "0.52149856", "0.52098703", "0.5203928", "0.5200296", "0.5194552", "0.5194041", "0.5193997", "0.51925224", "0.51908267", "0.51798755", "0.5176859", "0.517546", "0.5172108", "0.5168433", "0.51676685", "0.5166422", "0.51659155", "0.51633066", "0.51632714", "0.5163258", "0.51563346", "0.5155233", "0.51520264", "0.51511794", "0.51502675", "0.5143866", "0.5142366", "0.51405644", "0.51392275", "0.5138698", "0.51374626", "0.51313424", "0.5121482", "0.5118254", "0.5116779", "0.5115112", "0.51143223", "0.5113657", "0.5111637", "0.51107323", "0.51024044", "0.51021236", "0.5101494", "0.5099184" ]
0.0
-1
borra estudiante por MATRICULA
async function eraseMatricula(matricula) { let estudiante = await db.Estudiante.destroy({ where: { matricula: matricula } }); return estudiante; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp.filter(BLUR, oggetto.Smooth);\n\n\n mappaTemp.loadPixels();\n let f = 0;\n let k = 0;\n for (let x = 0; x < mappaTemp.width-res; x+=res) {\n punti[f] = [];\n for (let y = 0; y < mappaTemp.height-res; y+=res) {\n let c = mappaTemp.get(x, y);\n let h = brightness(c);\n punti[f][k] = h;\n k++;\n }\n k=0;\n f++;\n }\n mappaTemp.updatePixels();\n\n // CARICA TEXTURE\n gino.loadPixels();\n let i = 0;\n let j = 0;\n for (let x = 1; x <= gino.width-res; x+=res) {\n voxel[i] = [];\n voxelBN[i] = [];\n for (let y = 1; y <= gino.height-res; y+=res) {\n let c = gino.get(x, y);\n let h = brightness(c);\n voxel[i][j] = c;\n voxelBN[i][j] = h;\n j++;\n }\n j=0;\n i++;\n }\n gino.updatePixels();\n}", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "function calcul_Omegar(h, c, k, t0, H0parsec) {\r\n \r\n // Matière et Lambda\r\n var Or = 0;\r\n sigma = (2 * Math.pow(Math.PI, 5) * Math.pow(k, 4)) / (15 * Math.pow(h, 3) * Math.pow(c, 2)); //OK\r\n\r\n // Matière Lambda, RFC et neutrinos\r\n if (document.getElementById(\"liste\").options[0].selected) {\r\n rho_r = (4 * sigma * Math.pow(t0, 4)) / (Math.pow(c, 3));\r\n Or = (8 * Math.PI * G * rho_r) / (3 * Math.pow(H0parsec, 2));\r\n Or = 1.68 * Or; // neutrinos\r\n Or = Or.toExponential(4);\r\n \r\n // Matière Lambda & RFC\r\n } else if (document.getElementById(\"liste\").options[1].selected) {\r\n rho_r = (4 * sigma * Math.pow(t0, 4)) / (Math.pow(c, 3));\r\n Or = (8 * Math.PI * G * rho_r) / (3 * Math.pow(H0parsec, 2));\r\n Or = Or.toExponential(4);\r\n }\r\n return Or;\r\n}", "calcularIMC() {\n const peso = this.peso;\n const altura = this.altura;\n return (peso / altura * altura)\n }", "function cfasi_lunari(mese,anno,fase){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Luglio 2010\n // funzione per il calcolo delle fasi lunari.\n // mese= numero del mese da 1 a 12.\n // anno=anno di riferimento.\n // k=0.00 per la luna nuova\n // k=0.25 per il primo quarto.\n // k=0.50 per la luna piena\n // k=0.75 per l'ultimo quarto.\n // fase= valore numerico per la fase 0 - 0.25 - 0.50 - 0.75 sono ammessi solo questi valori.\n \nvar anno_dec=anno+(mese/12);\nvar k=(anno_dec-1900)*12.3685; // calcolo della costante k. (parseInt) tronca la parte decimale\n k=parseInt(k)*1+fase*1;\n \nvar T=k/1236.85;\n\nvar fseno=166.56+132.87*T-0.009173*T*T;\n fseno=fseno/180*Math.PI;\n\nvar njd_fase =2415020.75933+29.53058868*k+0.0001178*T*T-0.000000155*T*T*T+0.00033*Math.sin(fseno);\n\n // calcolo anomalia media del sole.\n\nvar M=359.2242+29.10535608*k-0.0000333*T*T-0.00000347*T*T*T;\n M=gradi_360(M);\n M=M/180*Math.PI;\n\n // calcolo anomalia media della luna.\n\nvar M1=306.0253+385.81691806*k+0.0107306*T*T+0.00001236*T*T*T;\n M1=gradi_360(M1);\n M1=M1/180*Math.PI;\n\n // calcolo dell'argomento della latitudine della luna.\n\nvar F=21.2964+390.67050646*k-0.0016528*T*T-0.00000239*T*T*T;\n F=gradi_360(F);\n F=F/180*Math.PI;\n\n // calcolo correzioni per la luna nuova e piena.\n\nvar correzione1=0;\n\nif (fase==0 || fase==0.50) {\n \n correzione1= (0.1734-0.000393*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.4068*Math.sin(M1)\n +0.0161*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0104*Math.sin(2*F)\n -0.0051*Math.sin(M+M1)\n -0.0074*Math.sin(M-M1)\n +0.0004*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0010*Math.sin(2*F-M1)\n +0.0005*Math.sin(M+2*M1); \n}\n\nelse if (fase==0.25 || fase==0.75) {\n \n correzione1= (0.1721-0.0004*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.6280*Math.sin(M1)\n +0.0089*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0079*Math.sin(2*F)\n -0.0119*Math.sin(M+M1)\n -0.0047*Math.sin(M-M1)\n +0.0003*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0021*Math.sin(2*F-M1)\n +0.0003*Math.sin(M+2*M1)\n +0.0004*Math.sin(M-2*M1)\n -0.0003*Math.sin(2*M+M1); \n}\n\nelse {alert(\"Valore fase \"+fase+\" non valido!\");}\n\nvar njd_fase=njd_fase+correzione1; // per la luna nuova.\n\n // njd_fase= numero dei giorni giuliani.\nreturn njd_fase;\n\n}", "Cr(){\n return 0.721 + 0.00725*(this.Lj*12/this.Dj)\n }", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function CalculMélangeRGB() {\n \n //valeurs des curseurs\n valCurseurR = document.querySelector(\"#curseurRouge\").getElementsByTagName('input')[0].value;\n valCurseurG = document.querySelector(\"#curseurVert\").getElementsByTagName('input')[0].value;\n valCurseurB = document.querySelector(\"#curseurBleu\").getElementsByTagName('input')[0].value;\n //valeurs des curseurs en %\n pCurseurR = valCurseurR / 100;\n pCurseurB = valCurseurB / 100;\n pCurseurG = valCurseurG / 100;\n\n //recuperer les valeurs X Y Z\n XBleu = data.XYZ.B.X;\n YBleu = data.XYZ.B.Y;\n ZBleu = data.XYZ.B.Z;\n //XYZ du Vert\n XVert = data.XYZ.G.X;\n YVert = data.XYZ.G.Y;\n ZVert = data.XYZ.G.Z;\n //XYZ du rouge\n XRouge = data.XYZ.R.X;\n YRouge = data.XYZ.R.Y;\n ZRouge = data.XYZ.R.Z;\n\n //calcul du X,Y,Z pour le mélange\n\n Xmelange = (XBleu * pCurseurB) + (XVert * pCurseurG) + (XRouge * pCurseurR);\n Ymelange = (YBleu * pCurseurB) + (YVert * pCurseurG) + (YRouge * pCurseurR);\n Zmelange = (ZBleu * pCurseurB) + (ZVert * pCurseurG) + (ZRouge * pCurseurR);\n\n //calcul du melange du x et y\n xMelange = Xmelange / (Xmelange + Ymelange + Zmelange);\n yMelange = Ymelange / (Xmelange + Ymelange + Zmelange);\n\n const cieChart = document.querySelector('cie-xy-chart'); // Tu récupère le premier diagramme de ton DOM (par exemple.)\n cieChart.inputs.xy.x.value = xMelange; // Tu définis la valeur du champ x.\n cieChart.inputs.xy.x.dispatchEvent(new InputEvent('input')); // Tu déclenches l'événement \"input\" correspondant à x.\n cieChart.inputs.xy.y.value = yMelange; // Tu définis la valeur du champ y.\n cieChart.inputs.xy.y.dispatchEvent(new InputEvent('input')); // Tu déclenches l'événement \"input\" correspondant à y.\n // Déclencher les événements input devrait rafraîchir le diagramme.\n \n}", "function siguientePaso() {\n const nuevaMatriz = Array(w);\n for (let i = 0; i < w; i++) {\n nuevaMatriz[i] = Array(h);\n for(let j = 0; j < h; j++) {\n nuevaMatriz[i][j] = calcularCelula(i,j);\n }\n }\n\n matriz = nuevaMatriz;\n actualizarCanvas();\n}", "function nuevoFin(){\n let previo = fin;\n fin = mapa[inputFinalX.value()][inputFinalY.value()];\n fin.obstaculo = false;\n fin.corrienteFuerte = false;\n fin.corriente = false;\n fin.pintar(0);\n previo.pintar(255);\n}", "function Moto1(matricula, km=0){\n this.matricula = matricula;\n this.km = km;\n}", "function arretNumber() {\n if (this.enCours) {\n this.sonMatricule.stop();\n this.sonAmbiance.fade(0.8 , 1) //Volume son ambiance\n this.sonAmbiance.loop();\n numPrecedent = 10;\n this.enCours = false;\n clearInterval(this.changeNumber);\n // On se bloque sur un matricule connu\n selectMatricule = (this.recupererMatriculeAlea()).toString();\n ordre = (tabMatricule.indexOf(selectMatricule))+1;\n afficherMatricule(selectMatricule);\n }\n}", "function AtrazoBoco (mês, valorAnuidade) {\n switch(mês) {\n case 1:\n return `Valor da Anuidade: ${valorAnuidade}`\n break\n\n case 2:\n const juroscomposto1 = valorAnuidade * ((1 + 0.05)**1)\n return `Valor da Anuidade com Juros: ${juroscomposto1.toFixed(2)}`\n break\n\n case 3:\n const juroscomposto2 = valorAnuidade * ((1 + 0.05)**2)\n return `Valor da Anuidade com Juros: ${juroscomposto2.toFixed(2)}`\n break\n\n case 4:\n const juroscomposto3 = valorAnuidade * ((1 + 0.05)**3)\n return `Valor da Anuidade com Juros: ${juroscomposto3.toFixed(2)}`\n break\n\n case 5:\n const juroscomposto4 = valorAnuidade * ((1 + 0.05)**4)\n return `Valor da Anuidade com Juros: ${juroscomposto4.toFixed(2)}`\n break\n\n case 6:\n const juroscomposto5 = valorAnuidade * ((1 + 0.05)**5)\n return `Valor da Anuidade com Juros: ${juroscomposto5.toFixed(2)}`\n break\n\n case 7:\n const juroscomposto6 = valorAnuidade * ((1 + 0.05)**6)\n return `Valor da Anuidade com Juros: ${juroscomposto6.toFixed(2)}`\n break\n\n case 8:\n const juroscomposto7 = valorAnuidade * ((1 + 0.05)**7)\n return `Valor da Anuidade com Juros: ${juroscomposto7.toFixed(2)}`\n break\n\n case 9:\n const juroscomposto8 = valorAnuidade * ((1 + 0.05)**8)\n return `Valor da Anuidade com Juros: ${juroscomposto8.toFixed(2)}`\n break\n\n case 10:\n const juroscomposto9 = valorAnuidade * ((1 + 0.05)**9)\n return `Valor da Anuidade com Juros: ${juroscomposto9.toFixed(2)}` \n break\n\n case 11:\n const juroscomposto10 = valorAnuidade * ((1 + 0.05)**10)\n return `Valor da Anuidade com Juros: ${juroscomposto10.toFixed(2)}`\n break\n\n case 12:\n const juroscomposto11 = valorAnuidade * ((1 + 0.05)**11)\n return `Valor da Anuidade com Juros: ${juroscomposto11.toFixed(2)}`\n break\n }\n }", "isMat(color) {\n // this.mat permet de vérifier que la fonction n'a pas déjà été effectué dans le tour\n if (this.mat == undefined) {\n let pion;\n // parcours toutes les cases du plateau\n for (let j = 0; j < 8; ++j) {\n for (let i = 0; i < 8; ++i) {\n pion = this.getCaseState(i, j);\n if (pion != undefined) {\n // si le pion est un roi et de la même couleur que color\n if (pion.type == \"Roi\" && pion.color == color) {\n if (this.affiche(i, j).length == 0 && this.echec[0]) {\n this.mat = true;\n return [true, pion.color, i, j];\n }\n }\n }\n }\n }\n this.mat = false;\n }\n return [this.mat];\n }", "function borrar_fun()\n{\n\testado_material = 2;\n}", "function marijuana()\n{\n\t//Data taken from: http://www.infoplease.com/us/states/marijuana-legalization.html\n\tmarijuanaArray = [0,4,2,0,3,4,3,2,0,0,0,3,0,2,0,\n\t\t\t\t\t 0,0,0,0,3,1,3,2,2,1,0,2,1,3,\n\t\t\t\t\t 2,2,2,2,1,0,1,0,4,0,3,0,0,0,\n\t\t\t\t\t 0,0,3,0,4,0,0,0]\n\n //Checks the value for the state and assigns a color\n\tfor(var i = 0; i < 51; i++)\n\t{\n\t\tstateID = IDfromAbbrev(i);\n\n\t\tif(marijuanaArray[i] == 0)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#a0e5b9\";\n\t\t}\n\t\tif(marijuanaArray[i] == 1)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#8ce0aa\";\n\t\t}\n\t\tif(marijuanaArray[i] == 2)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#78db9b\";\n\t\t}\n\t\tif(marijuanaArray[i] == 3)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#64d58c\";\n\t\t}\n\t\tif(marijuanaArray[i] == 4)\n\t\t{\n\t\t\tdocument.getElementById(stateID).style.fill = \"#32ba62\";\n\t\t}\n\t}\n}", "function Maisons(){\n \n }", "function IndicadorGradoAcademico () {}", "function prepararejerciciorandom() {\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n var elegido = [];\n var valores = [-40,-30,-20,-10,10,20,30,40];\n var valoresespeciales = [0,0,0,0,0,10,0,0,0,0,0];\n brilloejercicio = valores[Math.floor(Math.random()*(valores.length))];\n contrasteejercicio = valores[Math.floor(Math.random()*(valores.length))];\n saturacionejercicio = valores[Math.floor(Math.random()*(valores.length))];\n exposicionejercicio = valores[Math.floor(Math.random()*(valores.length))];\n ruidoejercicio = valoresespeciales[Math.floor(Math.random()*(valores.length))];\n difuminacionejercicio = valoresespeciales[Math.floor(Math.random()*(valores.length))];\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(brilloejercicio);\n this.contrast(contrasteejercicio);\n this.saturation(saturacionejercicio); \n this.exposure(exposicionejercicio);\n this.noise(ruidoejercicio);\n this.stackBlur(difuminacionejercicio); \n this.render();\n });\n elegido = [brilloejercicio,contrasteejercicio,saturacionejercicio,exposicionejercicio,ruidoejercicio,difuminacionejercicio]\n return elegido;\n}", "function montaConjuntos(){\r\n\treturn quantidadeDeLinha() / valorDeN();\r\n}", "function fl_outToMaza ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function orb_plan(njd,np){\n\n // elementi orbitali dei pianeti per l'equinozio della data.\n\n\n var T=(njd-2415020.0)/36525;\n \n var L=new Array (); // Longitudine media dei pianeti.\n\n L[0]=178.179078+149474.07078*T+0.0003011*T*T; // Mercurio.\n L[1]=342.767053+58519.211910*T+0.0003097*T*T; // Venere.\n L[2]= 99.696680+36000.768920*T+0.0003025*T*T; // Terra.\n L[3]=293.737334+19141.695510*T+0.0003107*T*T; // Marte.\n L[4]=238.049257+3036.3019860*T+0.0003347*T*T-0.00000165*T*T*T; // Giove.\n L[5]=266.564377+1223.5098840*T+0.0003245*T*T-0.00000580*T*T*T; // Saturno.\n L[6]=244.197470+429.86354600*T+0.0003160*T*T-0.00000060*T*T*T; // Urano.\n L[7]= 84.457994+219.88591400*T+0.0003205*T*T-0.00000060*T*T*T; // Nettuno.\n L[8]= 93.48+144.96*T; // Plutone.\n\n\n\n var M=new Array (); // Anomalia media dei pianeti.\n\n M[0]=102.27938+149472.51529*T+0.000007*T*T; // Mercurio.\n M[1]=212.60322+ 58517.80387*T+0.001286*T*T; // Venere.\n M[2]=178.47583+35999.049750*T-0.000150*T*T-0.0000033*T*T*T; // Terra.\n M[3]=319.51913+ 19139.85475*T+0.000181*T*T; // Marte.\n M[4]=225.32829+ 3034.69202*T-0.000722*T*T; // Giove.\n M[5]=175.46616+ 1221.55147*T-0.000502*T*T; // Saturno.\n M[6]= 72.64878+ 428.37911*T+0.000079*T*T; // Urano.\n M[7]= 37.73063+ 218.46134*T-0.000070*T*T; // Nettuno.\n M[8]=0; // Plutone.\n\n\n var a= new Array( 0.3870986, 0.7233316, 0.999996, 1.523688300, 5.20256100, 9.5547470, 19.2181400, 30.1095700, 39.48168677); // \n var p= new Array(0.24085000, 0.6152100, 1.000040, 1.8808900, 11.8622400, 29.457710, 84.0124700, 164.7955800, 248.09);\n var m= new Array(0.000001918, 0.00001721, 0.0000000, 0.000004539, 0.000199400, 0.000174000, 0.00007768, 0.000075970, 0.000004073);\n var d= new Array( 6.74, 16.92, 0, 9.36, 196.74, 165.60, 65.80, 62.20, 3.20); \n \n var e= new Array(); // Eccentricità delle orbite planetarie.\n\n e[0]=0.20561421+0.00002046*T-0.000000030*T*T; // Mercurio. \n e[1]=0.00682069-0.00004774*T+0.000000091*T*T; // Venere.\n e[2]=0.01675104-0.00004180*T-0.000000126*T*T; // Terra. \n e[3]=0.09331290+0.000092064*T-0.000000077*T*T; // Marte. \n e[4]=0.04833475+0.000164180*T-0.0000004676*T*T-0.00000000170*T*T*T; // Giove.\n e[5]=0.05589232-0.000345500*T-0.0000007280*T*T+0.00000000074*T*T*T; // Saturno.\n e[6]=0.04634440-0.000026580*T+0.0000000770*T*T; // Urano.\n e[7]=0.00899704+0.000006330*T-0.0000000020*T*T; // Nettuno. \n e[8]=0.24880766; // Plutone. \n\n var i= new Array(); // Inclinazione dell'orbita\n\n i[0]=7.002881+0.0018608*T-0.0000183*T*T;\n i[1]=3.393631+0.0010058*T-0.0000010*T*T;\n i[2]=0;\n i[3]=1.850333-0.0006750*T+0.0000126*T*T;\n i[4]=1.308736-0.0056961*T+0.0000039*T*T;\n i[5]=2.492519-0.0039189*T-0.00001549*T*T+0.00000004*T*T*T;\n i[6]=0.772464+0.0006253*T+0.0000395*T*T;\n i[7]=1.779242-0.0095436*T-0.0000091*T*T;\n i[8]=17.14175;\n\n var ap= new Array(); // Argomento del perielio.\n\n ap[0]=28.753753+0.3702806*T+0.0001208*T*T; // Mercurio\n ap[1]=54.384186+0.5081861*T-0.0013864*T*T;\n ap[2]=gradi_360(L[2]-M[2]+180); // Terra\n ap[3]=285.431761+1.0697667*T+0.0001313*T*T+0.00000414*T*T*T;\n ap[4]=273.277558+0.5994317*T+0.00070405*T*T+0.00000508*T*T*T;\n ap[5]=338.307800+1.0852207*T+0.00097854*T*T+0.00000992*T*T*T;\n ap[6]=98.071581+0.9857650*T-0.0010745*T*T-0.00000061*T*T*T;\n ap[7]=276.045975+0.3256394*T+0.00014095*T*T+0.000004113*T*T*T;\n ap[8]=113.76329; // Plutone\n\n \n var nd= new Array(); // Longitudine del nodo.\n\n nd[0]=47.145944+1.1852083*T+0.0001739*T*T; // Mercurio. \n nd[1]=75.779647+0.8998500*T+0.0004100*T*T; // Venere.\n nd[2]=0; // Terra\n nd[3]=48.786442+0.7709917*T-0.0000014*T*T-0.00000533*T*T*T; // Marte.\n nd[4]=99.443414+1.0105300*T+0.00035222*T*T-0.00000851*T*T*T; // Giove.\n nd[5]=112.790414+0.8731951*T-0.00015218*T*T-0.00000531*T*T*T; // Saturno.\n nd[6]=73.477111+0.4986678*T+0.0013117*T*T; // Urano.\n nd[7]=130.681389+1.0989350*T+0.00024987*T*T-0.000004718*T*T*T; // Nettuno.\n nd[8]=110.30347; // Plutone.\n\n\n\n var Long_media=gradi_360(L[np]);\n var Anomalia_media=gradi_360(M[np]);\n var Semiasse=a[np];\n var Periodo=p[np];\n var Inclinazione=i[np];\n var Long_perielio=gradi_360(ap[np]+nd[np]);\n var Long_nodo=nd[np];\n var eccentr=e[np];\n var dim_ang=d[np];\n var magnitudine=m[np];\n\n if(np==8) {Anomalia_media=gradi_360(Long_media-ap[8]-nd[8]); }\n\n\n var elem_orb=new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n\nreturn elem_orb;\n\n}", "calculRebond(hauteur){\n\t\t//rebond sur les bords du plateau\n\t\tif (hauteur){\n\t\t\tthis.angle = 2*Math.PI - this.angle;\n\t\t\tthis.compteur += 1;\n\t\t\tif (compteur == 5 ){\n\t\t\t\tcompteur = 0;\n\t\t\t\tif(this.vitesse <= this.vitesseMax){\n\t\t\t\t\tthis.vitesse = this.vitesse * 1.2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//rebond sur une raquette\n\t\telse {\n\t\t\t//augmentation de la vitesse pour plus de difficultee\n\t\t\tthis.angle = Math.PI - this.angle;\n\t\t\tif(this.vitesse <= this.vitesseMax){\n\t\t\t\tthis.vitesse = this.vitesse * 1.2;\n\t\t\t}\n\t\t}\n\t}", "function fl_outToMamtak ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function calculatorBMR(calorie){\n let a = calorie_calc(calorie)\n console.log(a[4]);\n if (a[4] == \"Female\"){\n let BMR = (655+(a[2]*9.6)+(a[1]*1.8)-(a[3]*4.7))\n console.log(BMR + \"IS\")\n return (BMR) \n }\n else if (a[4] == \"Male\"){\n let BMR = (66+(a[2]*13.8)+(a[1]*5)-(a[3]*6.8))\n return (BMR) \n } \n\n}", "function simplificationSysteme()\n\t{\n\t var i = null; //variables de boucles\n\t var j = null;\n\t var premiere_ligne_ok = false; //variable indiquant si la premiere ligne de la matrice est bien traité (premier coeff egal à 1)\n\t var colonne_full_zero = false; //variable indiquant si la colonne en cours est uniquement constitué de 0\n\t var sous_systeme = null;\n\t \n\t for(i = 0; i < this.matrice_systeme.length; i++) //on parcourt la matrice du systeme\n\t {\n\t if(this.matrice_systeme[i][0] == 1) //si le premier coefficient de la ligne i vaut 1\n\t {\n\t this.P(i, 0); //on place la ligne i en premiere position\n\t premiere_ligne_ok = true; //on indique que la premiere ligne est bien traité\n\t break; //on casse la boucle\n\t }\n\t }\n\t \n\t if(premiere_ligne_ok == false) //si la premiere ligne n'a pas été bien traité\n\t {\n\t for(i = 0; i < this.matrice_systeme.length; i++) //on parcourt la matrice du systeme\n\t {\n\t if(this.matrice_systeme[i][0] != 0) //des que le premier coefficient d'une est non nul\n\t {\n\t this.P(i, 0); //on place cette ligne en premiere position\n\t\t this.M(0, 1/this.matrice_systeme[0][0]); //on divise cette ligne par le premier coefficient pour reduire celui ci à 1\n\t\t premiere_ligne_ok = true; //on indique que la premiere ligne est bien traité\n\t\t break; //on casse la boucle\n\t }\n\t else //si apres avoir parcouru la matrice aucun premier coefficient non nul n'a été trouvé\n\t {\n\t if(i == this.matrice_systeme.length - 1)\n\t\t{\n\t\t colonne_full_zero = true; //on indique que la colonne est rempli de 0\n\t\t}\n\t }\n\t }\n\t }\n\t \n\t if(this.matrice_systeme.length != 1) //si la matrice du systeme n'est pas une matrice ligne\n\t {\n\t for(i = 1; i < this.matrice_systeme.length; i++) //on parcourt toutes les lignes en dessous de la premiere\n\t {\n\t if(this.matrice_systeme[i][0] != 0) //si le premier coeff est non nul\n\t {\n\t this.S(0, i, -this.matrice_systeme[i][0]); //on lui ajoute/retire une combinaison lineaire de la premiere ligne pr reduire son premier coeff à 0\n\t }\n\t }\n\t \n\t sous_systeme = new Array(); //on crée la matrice du sous systeme de notre systeme\n\t sous_systeme[0] = new Array();\n\t sous_systeme[1] = new Array();\n\t \n\t for(i = 0; i < this.matrice_systeme.length - 1; i++) //on remplit les lignes du sous systeme \n\t {\n\t sous_systeme[0][i] = new Array(); //on crée une matrice ligne pr chaque ligne\n\t sous_systeme[1][i] = this.second_membre[i+1]; //on remplit le second membre\n\t \n\t for(j = 0; j < this.matrice_systeme[i].length - 1; j++) //on remplit chaque case de la matrice du systeme du sous systeme\n\t {\n\t sous_systeme[0][i][j] = this.matrice_systeme[i+1][j+1];\n\t }\n\t }\n\t \n\t sous_systeme = new systeme(sous_systeme); //on instance le sous systeme comme une instance de la classe systeme\n\t sous_systeme.simplificationSysteme(); //on simplifie le sous systeme\n\t \n\t for(i = 0; i < this.matrice_systeme.length - 1; i++) //on recupere le sous systeme simplifié dans notre systeme actuel\n\t {\n\t this.second_membre[i+1] = sous_systeme.second_membre[i];\n\t \n\t for(j = 0; j < this.matrice_systeme[i].length - 1; j++)\n\t {\n\t this.matrice_systeme[i+1][j+1] = sous_systeme.matrice_systeme[i][j];\n\t }\n\t }\n\t }\n\t \n\t this.systeme_simplifie = true;\n\t}", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function marcar(referencia) {\n\tvar ide = soNumero(referencia);\n\tvar x = ide[0];\n\tvar y = ide[1];\n\t// Checamos se o campo ainda nao foi marcado\n\tif (matriz[x][y] == -1) {\n\t\t// Checamos qual o proximo elemento\n\t\tif (checarProximo() == \"X\") {\n\t\t\tdocument.getElementById(referencia).className = \"x_dourado\";\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"O\";\n\t\t} else {\n\t\t\tdocument.getElementById(referencia).className = \"o_dourado\";\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"X\";\n\t\t}\n\t\tmatriz[x][y] = proximo;\n\t\t// Checamos se alguem ganhou\n\t\tif (checarFinal()) {\n\t\t\tanterior = false;\n\t\t\tmatriz = createMatrix(true, 3, 3);\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = proximo;\n\t\t} else {\n\t\t\tanterior = false;\n\t\t\tmatriz = createMatrix(false, 3, 3);\n\t\t\tdocument.getElementById(\"fundo\").innerHTML = \"?\";\n\t\t}\n\t} else {\n\t\talert(\"Este campo já foi marcado previamente.\");\n\t}\n}", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "function estiloE1(){\n //var local\n var anchoBorde = 1;\n //background\n //background(0,255,0);\n //tamaño borde\n strokeWeight(anchoBorde);\n //color stroke\n stroke(20,200,160);\n //relleno\n fill(0,68,42);\n}", "function colisaoObs(){\r\n\r\n\tfor(var j = 0 ; j < 10 ; j++){\r\n\r\n\t\tfor(var a = j + 1; a < 10 ; a++){\r\n\r\n\t\t\tif(mata_x[j] == mata_x[a] && mata_y[j] == mata_y[a]){\r\n\r\n\t\t\t\tvar NasceObsX = Math.floor(Math.random() * ALEATORIO_MAXIMO)\r\n\t\t\t\tvar NasceObsY = Math.floor(Math.random() * ALEATORIO_MAXIMO)\r\n\r\n\t\t\t\tmata_x[j] = NasceObsX * TAMANHO_PONTO\r\n\t\t\t\tmata_y[j] = NasceObsY * TAMANHO_PONTO\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n}", "function escogerValorMasGrande(elemetos){\n\n}", "bouton_centrage_pos() {}", "constructor(nodoPadre)\n {\n super(); \n \n //Creamos la matriz y le asignamos la matriz identidad\n this.matrixaux = mat4.create();\n mat4.identity(this.matrixaux);\n this.matrix=this.matrixaux; // Matriz camara\n this.padre = nodoPadre;\n this.posicion = [];\n\n this.perspectiva = mat4.create(); \n }", "function areaCuadrado(lado) {\n return lado * lado;\n}", "function couleur()\n {\n\treturn 25000 * (0|pos_actuelle()/5 + 1);\n }", "get m(){ return this.density * this.volume;}", "function getBrillo(valor){\n if(valor<0)\n return 0;\n if(valor>255)\n return 255;\n else\n return valor;\n }", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "setMatrixes (F = [0, 0, 0], yaw = 0) {\n\t\t// this.M_RB = numeric.add(this.M, this.I)\n let mvr = this.mvr\n let h = mvr.hydroCoeff\n let u = this.states.V.u\n\n // In this case the M_A is constant and the value ws left as it is\n const M_A = [\n\t\t\t[ 0, 0, 0 ],\n\t\t\t[ 0, -h.Yvacc, -h.Yracc ],\n\t\t\t[ 0, -h.Yvacc, -h.Nracc ]\n\t\t]; \n\n\t const M = numeric.add(mvr.M_RB, M_A)\n\t mvr.INVM = numeric.inv(M)\n\n const {Cl, Cll, Clll}\t = mvr.dn;\n\n const N = this.manoeuvring.N || [\n\t\t\t[ 0, 0, 0 ],\n\t\t\t[ 0, -Cl * h.Yvdn, (this.manoeuvring.m * u - Cll * h.Yrdn) ],\n\t\t\t[ 0, (-h.Yvacc * u - Cll * h.Nvdn), -h.Yracc * u - Clll * h.Nrdn ]\n\t\t];\n\n \tmvr.INVMN = numeric.dot(numeric.neg(mvr.INVM), N) \n \n\t\tmvr.R = this.parseR(yaw)\n mvr.A = this.parseA(mvr.R, mvr.INVMN)\n const INVMF = numeric.dot(mvr.INVM, F)\n mvr.B = this.parseB(INVMF)\n }", "function inicializar(){var v=document.getElementById(\"comprobacion\"); v.innerHTML=\"\"; nota=0.0;}", "calculerPourUnelement(element,bacterie,col){\n\t\tlet glucose = element.glucose;//\n\t\tlet color = ['#000000','#800000','#008000','#cc99ff','#ccff99','#ffe699','#ff6384','#36a2eb','#cc65fe','#ffce56'];\n\t\tlet bacterieTab = new Array(this.nombreHeurs);\n\t\tbacterieTab[0] = this.bacteriesBase;\n\t\tfor(let i = 1 ; i < this.nombreHeurs ; i++){\n\t\t\tconsole.log(\"Etape : \"+i+\" glucose : \"+glucose+\"\\n\");\n\t\t\tif(glucose > 0){\n\t\t\t\tlet ajoutTemp = bacterieTab[i-1] * element.facteurMultiplication * bacterie.division * this.facteurTemperature(element,bacterie) * this.facteurPh(element,bacterie);\n\t\t\t\tbacterieTab[i] = ajoutTemp;\n\t\t\t\tif(glucose - GlucoseParDivision*ajoutTemp >= 0){\n\t\t\t\t\tglucose = glucose - GlucoseParDivision*ajoutTemp ;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tglucose = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tbacterieTab[i] = bacterieTab[i-1]\n\t\t\t}\n\t\t\tif(i >= cycleBacterien ){\n\t\t\t\tif(bacterieTab[i] - bacterieTab[i-cycleBacterien] >= 0){\n\t\t\t\tbacterieTab[i] = bacterieTab[i] - bacterieTab[i-cycleBacterien];//mort de bacteries\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbacterieTab[i] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn {data : bacterieTab , label : element.nom ,borderColor : color[col],fill : false ,borderWidth : 1 };\n\t}", "fRn(){\n return 0.25*this.fm*this.b*this.Lbrg\n }", "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral direita - 2\n if(esfera.posicao[0] + esfera.raio > parametrosMesa.xMax)\n {\n if(ultimaColisao != 2)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 2;\n } \n }\n\n //cima - 3\n if(esfera.posicao[1] - esfera.raio < parametrosMesa.zMax)\n {\n if(ultimaColisao != 3)\n {\n veloc[2] = -parametrosMesa.coeficienteRestituicao * veloc[2];\n ultimaColisao = 3; \n }\n \n }\n\n //corredor direito - 4\n if(esfera.posicao[1] - esfera.raio > -30)\n { \n if( ( (esfera.posicao[0] - esfera.raio < -19.75) && (esfera.posicao[0] + esfera.raio > -17.75) ) || \n ( (esfera.posicao[0] + esfera.raio > -18.75) && (esfera.posicao[0] - esfera.raio < -20.75) ) )\n {\n if(ultimaColisao != 4)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 4;\n } \n }\n \n\n //corredor esquerdo - 5\n if( (esfera.posicao[0] + esfera.raio > 19.04) && (esfera.posicao[0] - esfera.raio < 21.04) || \n (esfera.posicao[0] - esfera.raio < 20.04) && (esfera.posicao[0] + esfera.raio > 18.04) )\n {\n if(ultimaColisao != 5)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 5;\n } \n }\n }\n\n /*//corner direito - 6\n if(esfera.posicao[0] - esfera.posicao[1] >= 50)\n {\n if(ultimaColisao != 6)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 6;\n }\n }\n\n //corner esquerdo - 7\n if(-esfera.posicao[0] + esfera.posicao[1] >= 50){\n if(ultimaColisao != 7)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 7;\n }\n }*/\n}", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "function fl_outToRimon ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\n\t\t}}", "function areaCuadrado(lado) {\n return lado * lado;\n}", "function metropolisInit ()\n {\n data.metropolis = Object();\n data.metropolis.x = Object();\n data.metropolis.y = Object();\n\t// define initial values\n data.metropolis.x.val = targetMuX;\n data.metropolis.y.val = targetMuY;\n // define arrays that will store all values\n data.metropolis.x.vals = [];\n data.metropolis.y.vals = [];\n // define array that will store if proposal was accepted at each iteration\n data.metropolis.accepted = [];\n data.metropolis.currentIteration = 0;\n\n\t// set acceptance rate in legend equal to blank (useful for when \"refresh\" plot) \n var acceptRate = d3.selectAll(\".acceptRate\");\n\tacceptRate.html(\"Acceptance Rate of Proposals: - %\");;\n\t\t\n return 0;\n }", "function estiloE1(){\n //var local\n var anchoBorde = 10;\n //background\n //background(0,255,0);\n //tamaño borde\n strokeWeight(anchoBorde);\n //color stroke\n stroke(210,0,100);\n //relleno\n fill(0,68,42);\n}", "function crepuscolo(njd,tempo_rif,longitudine,latitudine,altitudine){\n\n // funzione per il calcolo del crepuscolo astronomico.\n // FUNZIONE DA ELIMINARE e sostituire con crepuscolo_UT\n \n var tempo_rifst=0; // tempo di riferimento per il sorgere e il tramonto.\n // \nif (tempo_rif==\"TL\") { tempo_rifst=-fuso_loc(); } // riferimento al tempo locale.\nelse if (tempo_rif==\"TU\") { tempo_rifst=0 ;} // il riferimento rimane il TU\n\n\n var ps_sole=pos_sole(njd);\n var DEs=ps_sole[1];\n\n var LATr=latitudine/180*Math.PI;\n var DEr=DEs/180*Math.PI;\n\n var H=Math.acos(-Math.tan(LATr)*Math.tan(DEr));\n\n var H1=Math.acos((Math.cos(1.88495556)-Math.sin(LATr)*Math.sin(DEr))/(Math.cos(LATr)*Math.cos(DEr)));\n\n var H= H*180/Math.PI;\n var H1=H1*180/Math.PI;\n\n var T=((H1-H)/15)*0.9973;\n\n// new Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n// 0 1 2 3 4\n\n var p_sole=ST_ASTRO_DATA(njd,ps_sole[0],ps_sole[1],longitudine,latitudine,altitudine,0.25);\n\n var crep_m=ore_24(p_sole[2]-T+tempo_rifst); // crepuscolo del mattino.\n var crep_s=ore_24(p_sole[4]+T+tempo_rifst); // crepuscolo serale\n\n crep_m=sc_ore_hm(crep_m); // crepuscolo del mattino.\n crep_s=sc_ore_hm(crep_s); // crepuscolo serale\n\n var tempi_crep= new Array(crep_m,crep_s);\n\n return tempi_crep;\n \n}", "function moons_jup(jd){\n\n // funzione per il calcolo della posizione dei satelliti medicei di Giove\n // by Salvatore Ruiu -05-2012 Irgoli (Sardegna)\n // jd= numero del giorno giuliano per la data.\n\n var d=jd-2415020; // numero di giorni dal 31-12-1899 \n var V=134.63+0.00111587*d; // argomento del termine a lungo periodo.\n var M=358.476+0.9856003*d;\n var N=225.328+0.0830853*d+0.33*Math.sin(Rad(V));\n\n var J=221.647+0.9025179*d-0.33*Math.sin(Rad(V));\n\n var A=1.916*Math.sin(Rad(M))+0.020*Math.sin(Rad(2*M));\n var B=5.552*Math.sin(Rad(N))+0.167*Math.sin(Rad(2*N));\n\n var K=J+A-B;\n\n var R=1.00014-0.01672*Math.cos(Rad(M))-0.00014*Math.cos(Rad(2*M)); // raggio vettore della Terra.\n\n var RJ=5.20867-0.25192*Math.cos(Rad(N))-0.00610*Math.cos(Rad(2*N)); // raggio vettore di Giove.\n\n var dist=Math.sqrt(RJ*RJ+R*R-2*RJ*R*Math.cos(Rad(K))); // distanza Terra-Giove.\n\n // phi=angolo di fase in radianti.\n\n var phi=Math.asin(R*Math.sin(Rad(K))/dist); \n\n phi=Rda(phi); // angolo di fase in gradi.\n\n var LON_ELIOC=238.05+0.083091*d+0.33*Math.sin(Rad(V))+B;\n\n var Ds=3.07*Math.sin(Rad(LON_ELIOC+44.5));\n var De=Ds-2.15*Math.sin(Rad(phi))*Math.cos(Rad(LON_ELIOC+24))-1.31*((RJ-dist)/dist)*Math.sin(Rad(LON_ELIOC-99.4));\n\n // *** posizione dei satelliti di Giove - inizio.\n\n var u1= 84.5506+203.4058630*(d-dist/173)+phi-B; // Io.\n var u2= 41.5015+101.2916323*(d-dist/173)+phi-B; // Europa.\n var u3=109.9770+ 50.2345169*(d-dist/173)+phi-B; // Ganimede.\n var u4=176.3586+ 21.4879802*(d-dist/173)+phi-B; // Callisto.\n\n var G=187.3+50.310674*(d-dist/173);\n var H=311.1+21.569229*(d-dist/173);\n\n // correzioni\n\n var delta_u1=0.472*Math.sin(Rad(2*(u1-u2)));\n var delta_u2=1.073*Math.sin(Rad(2*(u2-u3)));\n var delta_u3=0.174*Math.sin(Rad(G));\n var delta_u4=0.845*Math.sin(Rad(H));\n\n // distanze dei satelliti dal centro di Giove, in unità del raggio equatoriale di Giove.\n\n var r1= 5.9061-0.0244*Math.cos(Rad(2*(u1-u2)));\n var r2= 9.3972-0.0889*Math.cos(Rad(2*(u2-u3)));\n var r3=14.9894-0.0227*Math.cos(Rad(G));\n var r4=26.3649-0.1944*Math.cos(Rad(H));\n\n // u1,u2,u3,u4 corretti\n\n u1=gradi_360(u1+delta_u1);\n u2=gradi_360(u2+delta_u2);\n u3=gradi_360(u3+delta_u3);\n u4=gradi_360(u4+delta_u4);\n\n // coordinate apparenti rettangolari dei satelliti di Giove\n\n X1=r1*Math.sin(Rad(u1)); Y1=-r1*Math.cos(Rad(u1))*Math.sin(Rad(De));\n X2=r2*Math.sin(Rad(u2)); Y2=-r2*Math.cos(Rad(u2))*Math.sin(Rad(De));\n X3=r3*Math.sin(Rad(u3)); Y3=-r3*Math.cos(Rad(u3))*Math.sin(Rad(De));\n X4=r4*Math.sin(Rad(u4)); Y4=-r4*Math.cos(Rad(u4))*Math.sin(Rad(De));\n \n// Meridiano centrale di Giove: sistema II\n\n var long_m2=290.28+870.1869088*(d-dist/173)+phi-B;\n\n long_m2=gradi_360(long_m2);\n\n // *** posizione dei satelliti di Giove - fine. \n // \n // u=0-360 corrisponde alla congiunzione inferiore del satellite (transita sul disco del pianeta se X,Y<1).\n // u= 90 corrisponde all'elongazione massima occidentale.\n // u= 180 corriponde alla congiunzione superiore.\n // u= 270 corriponde all'elongazione massima orintale.\n\nvar pos_sat= new Array(X1,Y1,u1,X2,Y2,u2,X3,Y3,u3,X4,Y4,u4,long_m2,De);\n\nreturn pos_sat;\n\n}", "constructor(){\n super();\n // Cargar identidad\n this.matrix = mat4.identity(mat4.create());\n this.auxiliar = mat4.identity(mat4.create());\n this.inicial = mat4.identity(mat4.create());\n this.contador = 0; \n }", "function areaCuadrado(lado) {\n return lado * lado;\n}", "function areaCuadrado(lado) {\n return lado * lado;\n}", "function areaCuadrado(lado) {\n return lado * lado;\n}", "function mortal() {\n Object.defineProperty(this,\"raza\",{value:\"\",writable:true});\n Object.defineProperty(this,\"origen\",{value:\"\",writable:true});\n Object.defineProperty(this,\"inteligencia\",{value:false,writable:true});\n\n Object.defineProperties(this,{\n \"obtenRaza\":{get: function(){return this.raza;}},\n \"obtenOrigen\":{get: function(){return this.origen;}},\n \"obtenInteligencia\":{get: function(){return this.inteligencia;}},\n \"setRaza\":{set: function(raza){this.raza = raza;}},\n \"setOrigen\":{set: function(origen){this.origen = origen;}},\n \"setInteligencia\":{set: function(intel){this.inteligencia = intel;}}\n });\n\n this.muerto = function(){\n if(this.obtenEdad == 0){\n return \"Muerto\";\n } else {\n return \"Vivo\";\n }\n };\n}", "function crystal () {\"use strict\"; \n var antenna = Calc.calc ({\n name: \"antenna_loop\",\n input : {\n f : [1e3],\n d : [1e0],\n s : [1e0],\n w : [1e0],\n b : [1e-3],\n h : [1e0],\n N : [],\n design: [\"O\", \"[]\", \"[ ]\", \"[N]\"],\n wire_d : [1e-3],\n material : [\"Perfect\", \"Cu\", \"Al\"]\n },\n output : { \n // part 1\n lambda : [1e+0, 3],\n mu : [1e0, 1],\n g : [1e0, 2, \"exp\"], \n l : [1e0, 2],\n ll : [1e0, 2],\n ll0 : [1e0, 2],\n p : [1e0, 2],\n pl : [1e0, 2],\n S : [1e0, 2],\n \n W : [1e0, 2],\n\n D : [1e0, 2],\n G : [1e-1, 2],\n hg : [1e0, 2],\n RS : [1e0, 2, \"exp\"],\n R1 : [1e0, 2],\n Rl : [1e0, 2],\n Qa : [1e0, 2],\n C : [1e-12, 2],\n C0 : [1e-12, 2],\n L0 : [1e-6, 2],\n eta : [1e0, 2, \"exp\"], \n Za : [1e0, 2, \"complex\"],\n f0 : [1e6, 2],\n lambda0 : [1e0, 2]\n }\n }, function () { \n var KWH = 10;\n var KL = 0.14;\n \n this.check (this.f >= 1e3 && this.f <= 30e6, \"f\"); \n this.check ((this.w > this.h && this.w / this.h <= KWH) || (this.h > this.w && this.h / this.w <= KWH) || (this.h == this.w), \"wh\");\n this.check (this.wire_d > 0, \"wire_d\");\n \n this.lambda = Phys.C / this.f;\n \n // характеристики материала проводника\n var material = Materials [this.material];\n this.g = material.g;\n this.mu = material.mu;\n \n // непосредственно рамка\n if (this.design === \"O\") {\n \tthis.check (this.d > 0, \"d\");\n \t\n this.S = Math.PI * Math.pow (this.d / 2, 2);\n this.p = Math.PI * this.d;\n this.w = 0;\n this.h = 0;\n this.N = 1;\n } else if (this.design === \"[]\") {\n\t\t\tthis.check (this.s > 0, \"s\");\n\t\t\t\n this.S = Math.pow (this.s, 2);\n this.p = this.s * 4;\n this.w = this.s;\n this.h = this.s;\n this.d = 0;\n this.N = 1;\n } else if (this.design === \"[N]\") {\n this.check (this.N >= 2 && this.N <= 60, \"N\");\n this.check (this.b >= 5 * this.wire_d && this.b <= this.s / (5 * this.N), \"b\");\n this.check (this.s > 0, \"s\");\n \n this.S = Math.pow (this.s, 2);\n this.p = this.s * 4;\n this.w = this.s;\n this.h = this.s;\n this.d = 0;\n } else {\n \tthis.check (this.w > 0, \"w\");\n\t\t\tthis.check (this.h > 0, \"h\");\n\t\t\t\n this.S = this.h * this.w;\n this.p = (this.h + this.w) * 2;\n this.d = 0;\n this.N = 1;\n }\n \n var antenna = new MagneticLoop (this.d, this.w, this.h, this.wire_d, this.b, this.N, this.g, this.mu);\n this.antenna = antenna;\n \n var antennaAtLambda = this.antenna.fn (this.lambda);\n this.antennaAtLambda = antennaAtLambda;\n \n this.R1 = antennaAtLambda.R1;\n this.eta = antennaAtLambda.eta;\n this.RS = antennaAtLambda.RS;\n this.Rl = antennaAtLambda.Rl;\n this.Za = antennaAtLambda.Z;\n this.hg = antennaAtLambda.lg;\n this.D = antennaAtLambda.D; \n this.W = antennaAtLambda.W; \n this.Qa = antennaAtLambda.Q;\n this.S = antennaAtLambda.S;\n this.p = antennaAtLambda.p;\n this.l = antennaAtLambda.l;\n this.ll = this.l / this.lambda;\n this.pl = this.p / this.lambda;\n this.f0 = antennaAtLambda.f0;\n this.C0 = antennaAtLambda.C0;\n this.L0 = antennaAtLambda.L0;\n this.lambda0 = antennaAtLambda.lambda0;\n this.ll0 = this.lambda / this.lambda0;\n\n // ограничение на периметр 0,14 lambda (Кочержевский)\n this.suggest (this.p <= this.lambda * KL, \"pL\"); \n this.suggest (!isNaN (this.f0), \"f0\"); \n\n this.check (this.l <= this.lambda * KL || this.N === 1, \"lL\");\n this.check (this.p <= this.lambda, \"pl\"); \n this.check (this.wire_d <= this.p / 20, \"wire_d\"); \n \n // http://www.chipinfo.ru/literature/radio/200404/p67.html\n // this.Q = 3 * Math.log (this.d / this.wire_d) * Math.pow (this.lambda / this.p, 3) / Math.PI * this.eta; \n this.G = Math.log10 (this.D * this.eta);\n\n // fmax ограничиваем l = 0.14 * lambda\n this.band = Plots.band (this.f, KL * Phys.C / this.l);\n this.fnZ = function (freq) {\n return antenna.fn (Phys.C / freq).Z;\n };\n \n this.plot (Plots.impedanceResponseData (this.fnZ, this.band, 200), Plots.impedanceResponseAxes (this.band), 0);\n });\n \n var circuit = Calc.calc ({\n name: \"circuit\",\n input : {\n E : [1e-3],\n Ctype : [\"A12-495x1\", \"A12-495x2\", \"A12-495x3\", \"A12-365x1\", \"A12-365x2\", \"A12-365x3\", \n \"A4-15x1\", \"A4-15x2\", \n \"S5-270x1\", \"S5-270x2\", \"S5-180x1\", \"S5-180x2\"],\n R : [1e3],\n Cx : [1e-12],\n f : antenna.f\n },\n output : { \n C : [1e-12, 2],\n \n // part 2\n Pn : [1e0, 1, \"exp\"],\n Ea : [1e-3, 2],\n Ee : [1e-3, 2],\n Cmin : [1e-12, 2],\n Cmax : [1e-12, 2],\n Ct : [1e-12, 2],\n QC : [1e0, 3],\n rC : [1e0, 2],\n etaF : [1e0, 2, \"exp\"],\n Rn : [1e3, 2],\n KU : [1e-1, 2],\n Un : [1e-3, 2],\n Qn : [1e0, 2],\n dF : [1e3, 2]\n }\n }, function () { \n this.check (this.E <= 10 && this.E > 0, \"E\"); \n this.check (this.R > 0, \"R\");\n \n // -------------------------------------------------------\n var capacitor = Capacitors [this.Ctype];\n \n this.Ea = antenna.antennaAtLambda.fnE (this.E);\n this.QC = capacitor.Q;\n \n this.C = 1 / (2 * Math.PI * this.f * antenna.antennaAtLambda.Z.y); \n this.check (this.C >= 0, \"C\");\n this.C = this.C < 0 ? 0 : this.C;\n \n this.check (this.Cx >= 0, \"Cx\"); \n this.Ct = this.C - this.Cx;\n\n this.Cmin = capacitor.Cmin * capacitor.N + this.Cx;\n this.Cmax = capacitor.Cmax * capacitor.N + this.Cx;\n this.check (this.C >= this.Cmin, \"Cmin\");\n this.check (this.C <= this.Cmax, \"Cmax\");\n \n this.Ct = Math.clamp (this.Ct, this.Cmin - this.Cx, this.Cmax - this.Cx);\n this.CC = this.Ct + this.Cx;\n \n function fnCircuit (f, aerial, C, QC, R) {\n var result = [];\n \n result.zC = Phys.fnCapacitor (f, C, QC).Z;\n result.zRC = result.zC.par (new Complex (R, 0));\n result.z = aerial.Z.sum (result.zRC);\n result.fnU = function (E) {\n return new Complex (aerial.fnE (E), 0).div (result.z).mul (result.zRC);\n };\n \n return result;\n };\n\n this.fnCircuit = function (f) {\n var aerial = antenna.antenna.fn (Phys.C / f);\n return {\n x : fnCircuit (f, aerial, this.CC, this.QC, this.R),\n min : fnCircuit (f, aerial, this.Cmax, this.QC, this.R),\n max : fnCircuit (f, aerial, this.Cmin, this.QC, this.R)\n };\n }; \n \n var p0 = Math.pow (antenna.lambda * this.E / (2 * Math.PI), 2) / (4 * Phys.Z0 / Math.PI);\n var circuit = fnCircuit (this.f, antenna.antennaAtLambda, this.CC, this.QC, this.R);\n \n this.Ee = fnCircuit (this.f, antenna.antennaAtLambda, this.CC, this.QC, 1e12).fnU (this.E).mod ();\n this.rC = circuit.zC.x;\n // TODO: Точный расчет\n this.Qn = -circuit.zC.y / circuit.z.x;\n this.dF = this.f / this.Qn;\n this.Un = circuit.fnU (this.E).mod ();\n this.Rn = antenna.Za.par (circuit.zC).mod ();\n this.Pn = this.Un * this.Un / this.R;\n this.etaF = this.RS / (this.rC + antenna.Za.x);\n this.KU = Math.log10 (this.Pn / p0);\n \n var Ux = [];\n var Umin = [];\n var Umax = [];\n \n var fmin = antenna.band [0];\n var fmax = antenna.band [1];\n\n if (fmax > fmin) {\n for (var freq = fmin; freq <= fmax; freq += (fmax - fmin) / 200) {\n \tvar p0 = Math.pow (Phys.C / freq * this.E / (2 * Math.PI), 2) / (4 * Phys.Z0 / Math.PI);\n\n var circuit = this.fnCircuit (freq);\n \n\t\t\t\tvar px = Math.pow (circuit.x.fnU (this.E).mod (), 2) / this.R;\n\t\t\t\tvar pmin = Math.pow (circuit.min.fnU (this.E).mod (), 2) / this.R;\n\t\t\t\tvar pmax = Math.pow (circuit.max.fnU (this.E).mod (), 2) / this.R;\n \n\t\t\t\tUx.push ( [freq, 10 * Math.log10 (px / p0)]);\n\t\t\t\tUmin.push ( [freq, 10 * Math.log10 (pmin / p0)]);\n\t\t\t\tUmax.push ( [freq, 10 * Math.log10 (pmax / p0)]); \n }\n \n\t\t\tvar options1;\n\t\t\toptions1 = {\n\t\t\t\tseries : {\n\t\t\t\t\tlines : {\n\t\t\t\t\t\tshow : true,\n\t\t\t\t\t\tlineWidth : 2,\n\t\t\t\t\t\tzero : false\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\txaxis : Plots.linFx (),\n\t\t\t\tyaxes : [Plots.logDB ()],\n\t\t\t\tlegend : {\n\t\t\t\t\tshow : true,\n\t\t\t\t\tnoColumns : 1,\n\t\t\t\t\tposition : \"se\"\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.plot ( [{\n\t\t\t\tdata : Ux,\n\t\t\t\tcolor : \"#030\",\n\t\t\t\tlabel : \"При настройке на расчетную частоту\",\n\t\t\t\tshadowSize : 0\n\t\t\t}, {\n\t\t\t\tdata : Umin,\n\t\t\t\tcolor : \"#F00\",\n\t\t\t\tlabel : \"При максимальной ёмкости КПЕ\",\n\t\t\t\tshadowSize : 0\n\t\t\t}, {\n\t\t\t\tdata : Umax,\n\t\t\t\tcolor : \"#00F\",\n\t\t\t\tlabel : \"При минимальной ёмкости КПЕ\",\n\t\t\t\tshadowSize : 0\n\t\t\t}], options1, 0);\n } \n });\n}", "function spindulioReiksme () {\n// let ivedimoLaukas = document.querySelector('div input');\n let r = document.querySelector('div input').value;\n let plotas= Math.PI*r*r\n\n// console.log(plotas);\ndocument.querySelector(\".apskritimo-plotas\").innerHTML = plotas;\n}", "function mostraMercadoArmas(){\n let j = 0\n //let btn = criaElementos('button', 'Comprar',$tabelaMercado)\n $tabelaMercado.innerHTML = '';\n mercadoArmas.forEach((ma)=>{\n let b = ma.bonusArma//ma.forca + (jogador1.powerRS * (ma.pBonus));\n b = b.toFixed(0);\n\n criaTabela($tabelaMercado, ma.nome,\n `${ma.forca}+${jogador1.powerRS}*${ma.pBonus*100}% = ${b} Bônus`,\n ma.precoTxt,\n `<button onclick=\"compraArma(${j})\">Compar</button>`);\n j++;\n })\n}", "function f_matricula(agent) {\n const p_imatricula = agent.parameters.p_matricula;\n\n return admin.database().ref('siniestro').transaction((siniestro) => {\n if(siniestro !== null) {\n siniestro.matricula_titular = p_imatricula;\n }\n return siniestro;\n }, function(error, isSuccess) {\n console.log('Update matricula titular success: ' + isSuccess);\n });\n\n }", "predecir(arrayInputs) {\n //Crear una matriz de n filas y 1 columna del 'arrayInputs'\n let matrizInput = Matriz.fromArray(arrayInputs);\n let matrizOutput;\n\n for (let i = 1; i < this.capaw.length; i++) {\n matrizOutput = new Matriz(this.capaw[i].filas, 1);\n matrizOutput = Matriz.mmult(this.capaw[i], matrizInput);\n matrizOutput = Matriz.suma(matrizOutput, this.capab[i]);\n\n //Si no es la ultima capa aplicar la funcion de activacion\n if (i < this.capaw.length - 1) {\n matrizOutput = this.funcionActivacion(matrizOutput);\n } else {\n //Si es la ultima capa aplicar la funcion de activacion del output\n matrizOutput = this.funcionActivacionOutput(matrizOutput);\n }\n\n matrizInput = matrizOutput;\n }\n\n return Matriz.toArray(matrizOutput);\n }", "function fl_outToSumsum ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "calculaIMC() {\n this.imc = (this.peso / (this.altura * this.altura)).toFixed(2);\n if (this.imc < 18.5) {\n this.resultado = \"Magreza, Obesidade 0\";\n } else if (this.imc >= 18.5 && this.imc <= 24.9) {\n this.resultado = \"Normal, Obsidade 0\";\n } else if (this.imc >= 25 && this.imc <= 29.9) {\n this.resultado = \"Sobrepeso, Obesidade I\";\n } else if (this.imc >= 30 && this.imc <= 39.9) {\n this.resultado = \"Obesidade II\";\n } else if (this.imc >= 40) {\n this.resultado = \"Obesidade Grave III\";\n }\n }", "function nota_mayor(){\n\t\tvar mayor = notas.indexOf(Math.max.apply(null, notas ));\n\t\tdocument.getElementById(\"mayor\").innerHTML = \"La nota mayor del estudiante: <b>\" + nombre_alumno(mayor) + \"</b>\";\n\t}", "function ClickVisualizacaoModoMestre() {\n gEntradas.modo_mestre = Dom('input-modo-mestre').checked;\n AtualizaGeralSemLerEntradas();\n}", "function fl_outToOznei_aman ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function valueReset(){\n miContador.valueInit = 0;\n miContador.valueMax = 1000;\n miContador.valueActual = 0;\n miContador.valueMin = -1000;\n alert(miContador.valueActual);\n}", "function resetValOrden() {\n entra = false;\n sale = false;\n tray = false;\n trayLin = false;\n initIn = false;\n initMul = false;\n idLineTray = -1;\n idTray = -1;\n valTLF = false;\n valMovTF = false;\n elimEF = false;\n elimSI = false;\n elimSF = false;\n elimTR = false;\n elimTLF = false;\n elimTLI = false;\n elimTM = false;\n}", "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "function obli_ecli(njd){\n\n // calcola l'obliquità dell'eclittica.\n // per l'equinozio della data.\n // T= numero di secoli giuliani dallo 0.5 gennaio 1900.\n\n var T=(njd-2415020.0)/36525;\n\n var obli_eclittica=23.452294-0.0130125*T-0.00000164*T*T+0.000000503*T*T*T;\n\nreturn obli_eclittica; //obliquità in gradi\n\n}", "function RdatosLogistica(Material, Partidas, Destinos, Tiempo) {\n return { Material,Partidas, Destinos, Tiempo };\n}", "function turis(r) { // funkicja, funkcijos pavadinimas () skliausteliuose duomenys, {} aprasoma ka funkcija turi daryti // r kintamasis\nlet t = 4 * 3.14 * r * r * r / 3;\nreturn t; // grazinimas\n}", "function promedioFila(fila){\n var suma = 0;\n for (let index = 0; index < COLUMNAS; index++) {\n suma += matrix[fila][index];\n }\n return suma/COLUMNAS;\n}", "function fl_outToBeiza ()\n\t\t{\n\t\t\tif (freez=='false'){\n\t\t console.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\t\t }\n\t\t\n\t\t}", "getMasechta() {\n return Daf.masechtosBavli[this.masechtaNumber];\n }", "calcolaArea() {\n\n return (this.base * this.altezza) / 2; \n }", "function sumatorioBombas(coordX, coordY) {\n var sumatorio = 0;\n if (coordX < 0 || coordX >= longitud || coordY < 0 || coordY >= longitud) {\n sumatorio = 0;\n\n } else {\n if (minas[coordX][coordY] == \"*\") {\n sumatorio = 1;\n\n }\n }\n return sumatorio;\n\n }", "function areacuadrado (lado){\n return lado * lado;\n}", "function esMayor05(){\n if (obtenerAleatorio()> 0.5) {\n return true;\n }else {\n return false;\n }\n}", "function hitungMBS() {\n\t\tvar MASKCp = document.getElementById(\"mbs1\").value;\n\t\tvar MASKCtb= document.getElementById(\"mbs2\").value;\n\t\tvar MASKCwb= document.getElementById(\"mbs3\").value;\n\n\t\tvar Cp = MASKCp.split(',').join('');\n\t\tvar Ctb = MASKCtb.split(',').join('');\n\t\tvar Cwb = MASKCwb.split(',').join('');\n\n\t\tvar Ctb = Ctb / 100;\n\t\tvar Cbs = Math.round(Cp * Ctb * Cwb);\n\t\tdocument.getElementById(\"outputMBS\").innerHTML = \n\t\t\"Metode Bunga Sederhananya (Si) : \\n\"+\n\t\t\"\t\t= Po x i x n \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKCp +\" x \"+ Ctb +\" x \"+ Cwb + \" periode \\n\" +\n\t\t\"\t\t= \"+ uang(Cbs, \"Rp.\");\n\t}", "function getDiferencias(option){\r\n\tvar matriz=new Array();\r\n\tvar F=(2*n-3)+2; //Filas de la Matriz de Diferenciales\r\n\tvar C=(n-1);//Columnas de la Matriz de Diferenciales\r\n\tfor(var i=0;i<F;i++){\r\n\t\tmatriz[i]=new Array();\r\n\t\tfor(var j=0;j<C;j++){\r\n\t\t\tmatriz[i][j]=0;\r\n\t\t}\r\n\t}\r\n\r\n\tvar aux=0;\r\n\tfor(var j=0;j<C;j++){\r\n\t\taux=j;\r\n\t\tfor(var i=j+1;i<F-(j+1);i+=2){\r\n\t\t\tif(j==0){\r\n\t\t\t\tmatriz[i][j]=(ry[aux+1]-ry[aux]).toPrecision(pre);\r\n\t\t\t\taux++;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tmatriz[i][j]=(matriz[aux+2][j-1]-matriz[aux][j-1]).toPrecision(1);\r\n\t\t\t\taux=aux+2;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar flag=true;\r\n\tstringRespuesta = \"<center> <h2>Esquema de Diferenciales Con Operador Central</h2><table border=1><tr>\";\r\n\tfor(var i=0;i<n-1;i++){\r\n\t\tif(i==0){\r\n\t\t\tstringRespuesta+=\"<td>n</td><td>x</td><td>y</td><td>&delta;^\"+(i+1)+\"</td>\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstringRespuesta+=\"<td>&delta;^\"+(i+1)+\"</td>\";\r\n\t\t}\r\n\t}\r\n\tstringRespuesta+=\"</tr>\"\r\n\tvar c=0;\r\n\tfor(var i=0;i<F;i++){\r\n\r\n\t\tif(flag){\r\n\t\t\tstringRespuesta+=\"<tr><td>\"+c+\"</td><td>\"+rx[c]+\"</td><td>\"+ry[c]+\"</td>\";\r\n\t\t\tc++;\r\n\t\t\tflag=false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tstringRespuesta+=\"<tr><td></td><td></td><td></td>\";\r\n\t\t\tflag=true;\r\n\t\t}\r\n\t\tfor(var j=0;j<C;j++){\r\n\t\t\tstringRespuesta+=\"<td>\"+matriz[i][j]+\"</td>\";\r\n\t\t}\r\n\t\tstringRespuesta+=\"</tr>\";\r\n\r\n\t}\r\n\tstringRespuesta+=\"</table><br><br>\";\r\n\tswitch(option){\r\n\t\tcase 1:{gauss1(matriz);break;}\r\n\t\tcase 2:{gauss2(matriz);break;}\r\n\t\tcase 3:{everett(matriz);break;}\r\n\t\tcase 4:{steffensen(matriz);break;}\r\n\t\tcase 10:{operadorCentral(matriz);break;}\r\n\t\tcase 11:{segundaDerivada(matriz);break;}\r\n\t\tcase 12:{everettDer(matriz);break;}\r\n\t\tdefault:{break;}\r\n\r\n\t}\r\n}", "function cambiarBrillo(){\n ctx.putImageData(imageOrigin,0,0);\n let densidad;\n let index;\n let canvas = document.querySelector(\"#myCanvas\");\n let imageData = ctx.getImageData(0,0,canvas.width,canvas.height);\n\n //recorro la imagen y seteo los pixeles\n for(let y = 0; y < canvas.height; y++){\n for(let x = 0; x < canvas.width; x++){\n index = (x + y * imageData.width) * 4;\n densidad = (document.querySelector(\"#brillo\").value)/0.5;\n //llamo a la funcion getBrillo por cada indice de color\n //con el valor de indice que trabajo sumado a la densidad del brillo elegida.\n imageData.data[index+0] = getBrillo(imageData.data[index+0] + densidad);\n imageData.data[index+1] = getBrillo(imageData.data[index+1] + densidad);\n imageData.data[index+2] = getBrillo(imageData.data[index+2] + densidad); \n }\n }\n \n\n //Retorno el valor del brillo.\n function getBrillo(valor){\n if(valor<0)\n return 0;\n if(valor>255)\n return 255;\n else\n return valor;\n }\n //Muestra la imagen con el filtro aplicado.\n ctx.putImageData(imageData,0,0);\n }", "function bodoAmat(){\r\n console.log(\"Ini result Function Bodo Amat\");\r\n}", "function calcola_jddata(giorno,mese,anno,ora,minuti,secondi){\n\n // funzione per il calcolo del giorno giuliano per una data qualsiasi. \n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // restituisce il valore numerico dataGiuliana_annox\n// ATTENZIONE! inserire i valori dei tempi come T.U. di GREENWICH\n \nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi); // valore del giorno giuliano per una data qualsiasi.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana;\n\n}", "static get PERSPECTIVE() { return 0; }", "function hitungVolumedanLuasPermukaanBalok(panjang, lebar, tinggi) {\n luasPermukaanBalok = 2 * ( (panjang * lebar) + (panjang * tinggi) + (lebar * tinggi) );\n volumeBalok = panjang * lebar * tinggi;\n document.write(\"Panjang : \" + panjang + \"<br/>\");\n document.write(\"Lebar : \" + lebar + \"<br/>\");\n document.write(\"Tinggi : \" + tinggi + \"<br/>\" + \"<br/>\");\n document.write(\"Volume Balok : \" + volumeBalok + \"<br/>\");\n document.write(\"Luas Permukaan Balok : \" + luasPermukaanBalok + \"<br/>\");\n}", "function getBaseCalculo() {\n var pfaEng = config_isEng && isEng ? Number($('#pct-pfa-eng').html()) : 0;\n var pfaDes = config_isDes && isDes ? Number($('#pct-pfa-des').html()) : 0;\n var pfaImp = config_isImp && isImp ? Number($('#pct-pfa-imp').html()) : 0;\n var pfaTes = config_isTes && isTes ? Number($('#pct-pfa-tes').html()) : 0;\n var pfaHom = config_isHom && isHom ? Number($('#pct-pfa-hom').html()) : 0;\n var pfaImpl = config_isImpl && isImpl ? Number($('#pct-pfa-impl').html()) : 0;\n var V = Number((pfaEng + pfaDes + pfaImp + pfaTes + pfaHom + pfaImpl) * config_aumentoEsforco).toFixed(4);\n return V;\n}", "function prepararejercicio(){\n resetearimagenejercicio();\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n elegido = prepararejerciciorandom();\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(elegido[0]);\n this.contrast(elegido[1]);\n this.saturation(elegido[2]); \n this.exposure(elegido[3]);\n this.noise(elegido[4]);\n this.stackBlur(elegido[5]); \n this.render();\n });\n}", "function start(){\n\tconsole.log(\"************** START ***************\");\n\tmatr=[[0,0,0],[0,0,0],[0,0,0]];\n\tgiocatore=1;\n\tturno=1;\n\tnumMosse=0;\n\tresultString=\"\";\n\tcol=[0,0,0];\n\trig=[0,0,0];\n\tdig=[0,0];\n\tdet=0;\n}", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "function Oggetto(_id, _anni, _speranzav, _morti,/* _saturation, _brightness, _morti, _forma*/) {\r\n // DATI E COSTRUTTORE\r\n this.id = Number(_id); // < Number() converte in numero intero la stringa\r\n this.anni2015 = _anni;\r\n // < Number() converte in numero intero la stringa\r\n this.speranzadivita2015 = _speranzav;\r\n this.morti2015 =_morti;\r\n\r\n this.mostra = function() {\r\n\r\n noStroke();\r\n fill(255);\r\n textAlign(LEFT, CENTER);\r\n push();\r\n translate(grid + (this.id * grid),height/3);\r\n\r\n\r\n text(this.anni2015,-40,10,);\r\n\r\n rotate(PI/2);\r\n fill(255, 24, 10);\r\n text(this.morti2015,30,00);\r\n fill(25, 204, 100);\r\n text(this.speranzadivita2015,30,30);\r\n\r\n\r\n // disegna barrette\r\n rotate(3*PI/2);\r\n fill(25, 204, 100);\r\n rect(-38, 60, 10, this.speranzadivita2015);\r\n\r\n\r\n fill(255, 24, 10);\r\n rect(-8, 60, 10, this.morti2015);\r\n\r\n pop();\r\n\r\n }\r\n}", "function Metallic() {\n var a = [\n 0, -0.7, -0.4, -0.6,\n -0.45, -0.1, -0.3, -0.35,\n 0.4, 0.6, 0.7, 0.5,\n 0.3, 0.2, -0.13, -0.07,\n 0, -0.06, -0.12, -0.18\n\n -0.2, -0.18, -0.1, -0.03,\n 0.25, 1, 0, -0.05,\n -0.15, -0.2, -0.25, -0.3,\n -0.32, -0.33, -0.33, -0.32,\n -0.25, -0.2, -0.15, -0.1\n ];\n var b = [\n 0, -0.1, -0.2, -0.3,\n 0, 0.5, 1, 0.5,\n -0.4, -0.6, -0.7, -0.6,\n -0.4, -0.6, -0.7, -0.8,\n -0.9, -0.6, -0.2, -0.1,\n\n 0, 0.1, 0.2, 0.3,\n 0, -0.5, -1, -0.5,\n 0.4, 0.6, 0.7, 0.6,\n 0.4, 0.6, 0.7, 0.6,\n 0.25, 0.2, 0.15, 0.1\n ];\n var c = [\n 0, 0.1, -0.05, 0.08,\n -0.12, 0, -0.12, 0,\n -0.15, -0.4, -0.9, -0.95,\n -1, -1, -0.5, -0.4,\n -0.1, -0.3, -0.2, -0.3,\n -0.65, -0.6, -0.7, -0.3,\n -0.1, -0.2, 0, 0.2,\n 0.1, 0.2, 0.16, 0.7,\n 0.6, 0.3, 0.3, 0.05,\n 0.3, 0.6, 1, 0.95,\n 0.9, 0.7, 0.8, 0.1\n ];\n this.waveforms = [b, c];\n}", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function zerarTransformacao () {\n botaoT = 0; \n botaoS = 0;\n botaoR = 0;\n}", "function promedioMatriz(x, y, imageData){\n //declaro en 0 cada valor RGB\n let r = 0;\n let b = 0;\n let g = 0;\n \n //Promedio las 9 combinaciones de ejes X e Y por cada pixel.\n r = (getRed(imageData, x-1, y-1) + getRed(imageData, x, y-1) + getRed(imageData, x+1, y-1)\n + getRed(imageData, x-1, y) + getRed(imageData, x, y) + getRed(imageData, x+1, y)\n + getRed(imageData, x-1, y+1) + getRed(imageData, x, y+1) + getRed(imageData, x+1, y+1))/9;\n \n g = (getGreen(imageData, x-1, y-1) + getGreen(imageData, x, y-1)+ getGreen(imageData, x+1, y-1) \n + getGreen(imageData, x-1, y) + getGreen(imageData, x, y) + getGreen(imageData, x+1, y)\n + getGreen(imageData, x-1, y+1) + getGreen(imageData, x, y+1) + getGreen(imageData, x+1, y+1))/9;\n \n b = (getBlue(imageData, x-1, y-1) + getBlue(imageData, x, y-1) + getBlue(imageData, x+1, y-1) \n + getBlue(imageData, x-1, y) + getBlue(imageData, x, y) + getBlue(imageData, x+1, y+1) \n + getBlue(imageData, x-1, y+1) + getBlue(imageData, x, y+1) + getBlue(imageData, x+1, y+1))/9;\n \n //los asigno y salgo de la funcion para volver al recorrio de la matriz.\n let index = (x + y * imageData.width) * 4;\n imageData.data[index + 0] = r;\n imageData.data[index + 1] = g;\n imageData.data[index + 2] = b;\n }", "function convertGI() {\n //Cria copia da CTMC\n ctmcGI = [];\n for (var i = 0; i < ctmc.length; i++) {\n ctmcGI.push(ctmc[i].slice());\n }\n //Executa logica na diagonal principal da ctmcGI\n for (let i = 0; i < ctmcGI.length; i++) {\n let soma = 0;\n for (let j = 0; j < ctmcGI[i].length; j++) {\n soma += ctmcGI[i][j];\n }\n ctmcGI[i][i] = soma * (-1);\n }\n console.log(\"Gerador Infinitesimal:\");\n console.log(ctmcGI);\n}", "function calcularCirculo(){\n\n document.getElementById(\"formulario2\").classList.add(\"was-validated\")\n\n\n \n const radio = parseInt(document.getElementById(\"inputRadio\").value) \n\n const diametro = diametrocirculo(radio)\n const perimetro = perimetroCirculo(radio)\n const area = areaCirculo(radio)\n\n \n \n \n if (radio){\n\n document.getElementById(\"RespuestaAreaCirculo\").innerHTML=`${area.toFixed(1)} cm`\n document.getElementById(\"RespuestaperimetroCirculo\").innerHTML=`${perimetro.toFixed(1)} cm`\n document.getElementById(\"RespuestaDiametroCirculo\").innerHTML=`${diametro.toFixed(1)} cm`\n \n }else if (!radio) {\n document.getElementById(\"RespuestaAreaCirculo\").innerHTML=`0 cm`\n document.getElementById(\"RespuestaperimetroCirculo\").innerHTML=`0 cm`\n document.getElementById(\"RespuestaDiametroCirculo\").innerHTML=`0 cm`\n }\n\n}", "_proximaImgVivo() {\n\t\t//mudar index (como vetor circular)\n\t\tthis._indexImgVivo = (this._indexImgVivo + 1) % this._vetorImgsVivo.length;\n\t\t//mudar img em formaGeometrica\n\t\tthis._colocarImgVivoAtual();\n\t}" ]
[ "0.6519", "0.6048538", "0.5991316", "0.5858125", "0.5839421", "0.5836711", "0.5829012", "0.582076", "0.58188117", "0.57817715", "0.5744801", "0.5721798", "0.57147866", "0.57030535", "0.5702282", "0.5678489", "0.56706405", "0.5659324", "0.5648584", "0.56459934", "0.563017", "0.56252676", "0.55982757", "0.5598151", "0.55961466", "0.55854386", "0.5581779", "0.55768764", "0.55668646", "0.5559951", "0.5542611", "0.5537092", "0.5535325", "0.55337393", "0.55301076", "0.55297285", "0.55223936", "0.55010116", "0.5496863", "0.5495654", "0.54936624", "0.5484504", "0.54837954", "0.5481906", "0.54774445", "0.547714", "0.54717535", "0.547007", "0.54601663", "0.5449562", "0.5449265", "0.54489297", "0.54473203", "0.5439794", "0.5439794", "0.5439794", "0.543192", "0.54312193", "0.5429809", "0.54292643", "0.541926", "0.5418488", "0.54166067", "0.5410578", "0.54098994", "0.54074746", "0.54073423", "0.54052895", "0.5404426", "0.5403537", "0.5401059", "0.53992534", "0.53941387", "0.539047", "0.5384531", "0.53770286", "0.53748447", "0.5368785", "0.53643847", "0.53599143", "0.53592026", "0.5357493", "0.5351273", "0.5350576", "0.5348829", "0.5347106", "0.53417075", "0.5340225", "0.533928", "0.53384614", "0.5333633", "0.5331212", "0.5326719", "0.5325724", "0.5322369", "0.532184", "0.53215384", "0.53212726", "0.5318792", "0.5314878", "0.5313398" ]
0.0
-1
to login like manager user name and pass manager/manager
function login() { if (location.href.indexOf('login.php') !== -1) { document.getElementById('loginA').addEventListener('click', function () { var name = document.getElementById('username').value; var pass = document.getElementById('password').value; if ((name === 'user') && (pass === 'user')) { alert('Logged Successfully'); location.href = 'home.php'; } else if ((name === 'manager') && (pass === 'manager')) { alert('Logged Successfully'); location.href = 'managerhome.html'; } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doLogin(userName, password){\n\n}", "static async getLogin(ctx) {\n const context = ctx.flash.formdata || {};\n\n // user=email querystring?\n if (ctx.request.query.user) context.username = ctx.request.query.user;\n\n if (context.username) {\n // if username set & user has access to more than one org'n, show list of them\n const [ usr ] = await User.getBy('email', context.username);\n if (usr && usr.databases.length>1) context.databases = usr.databases;\n }\n\n await ctx.render('login', context);\n }", "function login() {}", "login (state, user_info) {\n state.user_info.user_name = user_info.user_name;\n state.user_info.user_id = user_info.user_id.toString();\n }", "function u_login(ctx, email, password, uh, permanent) {\n ctx.result = u_login2;\n ctx.permanent = permanent;\n api_getsid(ctx, email, prepare_key_pw(password), uh);\n}", "function gotoServer(email, name, type) {\n $http.post(RestURL.baseURL + 'j_spring_social_security_check?email=' + email + '&username=' + name + '&socialtype=' + type)\n .success(function (data) {\n $log.log(\"Valid login: \", JSON.stringify(data));\n if (data.status == \"failed\") {\n $scope.errormessage = \" Your user name or password is wrong. Please try again!\";\n loginform['email'].$dirty = true;\n loginform['password'].$dirty = true;\n } else {\n var user = data;\n authFactory.setUser(user);\n $location.url(\"/en-US/projects\");\n }\n }).error(function () {\n console.log(\"ERROR WITH SOCIAL SIGNIN\");\n });\n }", "function login(){\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Login\",\n name: \"username\"\n },\n {\n type: \"password\",\n message: \"Password\",\n name: \"password\"\n }\n ]).then(function(res) {\n // If the inquirerResponse confirms, we displays the inquirerResponse's username and pokemon from the answers.\n if (res.username === keys.login && res.password === keys.password) {\n console.log(\"\\nWelcome \",res.username,\"\\n\");\n let manager = require(\"./bb_manager.js\");\n }\n else {\n console.log(\"\\nInvalid credentials. Please try again later.\\n\");\n }\n });\n }", "function managerAuthenticated(req, res, next){\n\tif(req.isAuthenticated() && req.user.manager){\n\t\treturn next();\n\t} else {\n\t\treq.flash('error_msg', 'You must be logged in as manager to access this page.');\n\t\tres.redirect('/users/login');\n\t}\n}", "function login0(){\n\treturn \"/uadmin\";\n}", "function login(data,response)\n{\n var q = querystring.parse(data);\n var user = q[USERID];\n var pwd = q[PASSWD];\n login0(user,pwd,response);\n}", "async login() {}", "initLogin() {\n this.send({\n id: 10000,\n magic: '0x1234',\n method: 'global.login',\n params: {\n clientType: '',\n ipAddr: '(null)',\n loginType: 'Direct',\n password: '',\n userName: this.dahua_username,\n },\n session: 0,\n });\n }", "function loginClick() {\n\t username = $(\"#userName\").val();\n\t password = $(\"#password\").val();\n\t getRememberMestatus();\n\t var params = {\"username\":username,\"password\":password};\n\t var callerId = \"login\";\n\t var url = \"/logon\";\n\t reqManager.sendPost(callerId, url, params, loginSuccessHandler, loginErrorHandler, null);\n\t}", "function login() {\n User.login(self.user, handleLogin);\n }", "function localLogin() {\n Message.loading();\n User.login({}, LoginModel.form).$promise\n .then(function(userWrapper) {\n Message.hide();\n console.log(\"---------- userWrapper ----------\");\n console.log(userWrapper);\n AppStorage.user = userWrapper.user;\n AppStorage.token = userWrapper.token;\n AppStorage.isFirstTime = false;\n U.goToState('Main.MainTab.PostList.PostListRecent', null, 'forward');\n })\n .catch(function(err) {\n console.log(\"---------- err ----------\");\n console.log(err);\n if (err.status === 403) {\n return Message.alert('로그인 알림', '비밀번호/이메일이 틀렸습니다. 다시 입력해주세요');\n } else {\n return Message.alert();\n }\n });\n }", "orderAccess() {\n loginPage.open();\n loginPage.username.setValue('[email protected]');\n loginPage.password.setValue('pepito');\n loginPage.submit();\n }", "function onChangeLogin() {}", "function login_from_params(usr, pwd) {\n if (isMobileDevice()) {\n setUnsupportedDevice();\n } else {\n USER_NAME = usr;\n USER_PWD = pwd;\n send(json_get_login_message(usr, pwd));\n }\n}", "function dummyLogin() {\n// loginAs( dummyFilters );\n loginAs(memberSearchFilters);\n }", "function viewByManager() {\n inquirer\n .prompt({\n name: \"choice\",\n message: \"Select one manager\",\n type: \"list\",\n choices: [\n \"Anil Kumar\",\n \"Barbara Corcoran\",\n \"Ray Dalio\"],\n }).then((result)=>{\n var manager = result.choice;\n connection.query(\n \"SELECT * FROM employee WHERE manager=?\", [manager],\n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n })\n\n }", "async login({name = '', pass = ''} = {}) {\n await this.enterUserName(name);\n await this.enterPassword(pass);\n return this.clickLoginButton();\n }", "function login() {\n var user = null;\n command_line.prompt('login:');\n // don't stor logins in history\n if (settings.history) {\n command_line.history().disable();\n }\n command_line.commands(function(command) {\n try {\n echo_command(command);\n if (!user) {\n user = command;\n command_line.prompt('password:');\n command_line.mask(true);\n } else {\n command_line.mask(false);\n self.pause();\n if (typeof settings.login != 'function') {\n throw \"Value of login property must be a function\";\n }\n settings.login(user, command, function(user_data) {\n if (user_data) {\n var name = settings.name;\n name = (name ? '_' + name : '');\n $.Storage.set('token' + name, user_data);\n $.Storage.set('login' + name, user);\n //restore commands and run interpreter\n command_line.commands(commands);\n // move this to one function init.\n initialize();\n } else {\n self.error('Wrong password try again');\n command_line.prompt('login:');\n user = null;\n }\n self.resume();\n if (settings.history) {\n command_line.history().enable();\n }\n });\n }\n } catch (e) {\n display_exception(e, 'LOGIN', self);\n throw e;\n }\n });\n }", "function login(name) {\n console.log('logging in as', name);\n\n var msg = {\n type: 'login',\n from: name\n }\n conn.send(JSON.stringify(msg));\n}", "function login(){\n\tfetch(config.server+'/user/login', {\n method: 'post',\n body: JSON.stringify({\n \"token\":token,\n \"code\":get(\"code\")\n\t\t\t})\n\t})\n\t.then(function(response) {\n\t\treturn response.json();\n\t})\n\t.then(function(json){\n\t\tif(json.code==0){\n\t\t\t//save new token\n\t\t\tugenLocalStorage.set(config.CONST_USERINFO_KEY, {\n\t\t\t token: json.token,\n\t\t\t\tsex:json.data.sex,\n\t\t\t\tage:json.data.age,\n\t\t\t\theight:json.data.height,\n\t\t\t\ttoWeight:json.data.toWeight\n\t\t });\n\t\t\ttoken=json.token;\n\t\t\t//userinfo init\n\t\t\tuserInfo.init(json);\n\t\t\t//devicelist init\n\t\t\tlist.init();\n\t\t\t//jssdk init\n\t\t\tjslib();\n\t\t} else {//if token false token=null\n\t\t ugenLocalStorage.set(config.CONST_USERINFO_KEY, {\n\t token: \"\"\n\t });\n\t\t \talert(\"系统错误\")\n\t\t}\n\t})\n\t.catch(function(err){\n\t\tconsole.log(err)\n\t});\n}", "function beginLogin() {\n\treturn { type: types.MANUAL_LOGIN_USER };\n}", "loginIntoAdminBackend() {\n cy.goToPage(this.AdminUrl);\n cy.loginIntoAccount('input[name=email]', 'input[name=passwd]', 'admin');\n }", "function genericLogin(serv) {\n ref.authWithOAuthPopup(serv, function (error, authData) {\n if (error) {\n console.log('Log in to ' + serv + ' Failed', error);\n lc.message = 'Log in to ' + serv + ' Failed ' + error;\n } else {\n console.log('Logged in to ' + serv);\n lc.message = 'Logged in to ' + serv;\n lc.loginHide = true;\n lc.loginHideGoogle = true;\n lc.loginData = authData;\n brandon(authData);\n lc.loginName = \"Logout\";\n }\n });\n }", "login(pwd){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"LOGIN\",\n\t\t\tparams: pwd\n\t\t});\n\t}", "function main() {\r\n // user.userLogin(\"[email protected]\", \"sporks\");\r\n}", "demoLogIn() {\n const demoUser = {email: \"[email protected]\", password: \"password\"};\n this.props.login(demoUser).then(() => this.props.history.push('/feed'));\n }", "function me_login(page) {\n me_ip({run:me_login_,page:page});\n}", "handleDemoLogin(e) {\n e.preventDefault();\n\n let user = {\n email: '[email protected]',\n password: 'password123'\n }\n\n this.props.login(user)\n }", "loginBasic() {\n this.open();\n this.login('[email protected]', 'PotterMalfoy22');\n this.clickLoginButton();\n }", "function Login({ setUser }) {\n // const loginUser = async () => {\n // try {\n // const user = await app.logIn(credentials);\n // console.log(\"Successfully logged in!\", user.id);\n //return user;\n // return <button onClick={loginUser}>Log In</button>;\n // } catch (err) {\n // console.error(\"Failed to log in\", err.message);\n // }\n // }\n \n const loginAnonymous = async () => {\n const user = await app.logIn(Realm.Credentials.anonymous());\n setUser(user);\n };\n return <button onClick={loginAnonymous}>Log In</button>;\n \n}", "function findCurrentUser() {\n return \"stefan\"\n }", "static loginByCredential(cred, password) {\n console.log(cred + \" : \" + password);\n if (validator.isEmail(cred)) {\n console.log(\"email\");\n return User.loginByEmail(cred, password);\n }\n else {\n console.log(\"username\");\n return User.loginByUsername(cred, password);\n }\n }", "function loginCmd( proj ) {\n\tvar user = document.getElementById( 'loginUser' ).value; \n\tvar pass = document.getElementById( 'loginPass' ).value; \n\twindow.location.href=\"plus.php?action=2&user=\" + user + \n\t\"&pass=\"+ pass + \"&project=\" + proj ;\n}", "function u_checklogin(ctx, force, passwordkey, invitecode, invitename, uh) {\n if (u_sid = u_storage.sid) {\n api_setsid(u_sid);\n u_checklogin3(ctx);\n } else {\n if (!force) ctx.checkloginresult(ctx, false);\n else {\n u_logout();\n api_create_u_k();\n ctx.createanonuserresult = u_checklogin2;\n createanonuser(ctx, passwordkey, invitecode, invitename, uh);\n }\n }\n}", "function loginAdmin(email, password, success, failure) {\n self.loggedInUser = null;\n self.accessToken = null;\n localStorage.removeItem('usergrid_user');\n localStorage.removeItem('usergrid_access_token');\n var formdata = {\n grant_type: \"password\",\n username: email,\n password: password\n };\n apiRequest(\"POST\", \"/management/token\", formdata, null, function (response) {\n if (response && response.access_token && response.user) {\n self.loggedInUser = response.user;\n self.accessToken = response.access_token;\n if (self.loggedInUser.organizations) {\n for (first in self.loggedInUser.organizations) break;\n if (first) {\n self.currentOrganization = self.loggedInUser.organizations[first].uuid;\n }\n }\n localStorage.setObject('usergrid_user', self.loggedInUser);\n localStorage.setObject('usergrid_access_token', self.accessToken);\n if (success) {\n success();\n }\n } else if (failure) {\n failure();\n }\n }, function (XMLHttpRequest, textStatus, errorThrown) {\n if (failure) {\n failure();\n }\n });\n }", "function login() {\n var loginWin = createLoginWin();\n loginWin.open();\n }", "function login() {\n if (ctrl.remember) {\n $window.localStorage.setItem('ldap_username', ctrl.username);\n $window.localStorage.setItem('ldap_password', ctrl.password);\n }\n ctrl.loading = true;\n ipcRenderer.send('do-log-in', ctrl.username, ctrl.password);\n }", "function userLogin() {\n /**-----------------------------------------------------------------------*/\n /** Get the user's name and password as entered into the login form: */\n /**-----------------------------------------------------------------------*/\n var name = document.querySelector('[name=\"username\"]').value;\n var password = document.querySelector('[name=\"password\"]').value;\n\n /**-----------------------------------------------------------------------*/\n /** Check if the user is authorized to use the application: */\n /**-----------------------------------------------------------------------*/\n authenticateUser(name, password, userIsAuthorised);\n}", "function logEditorIn(login, password, doOnSuccess, doOnFailure){\n\tmakeJsonRequest('atomics/log_editor_in.php', 'l=' + login + '&p=' + password, {\n\t\tsuccess: function(response){\n\t\t\tswitch(response.status){\n\t\t\t\tcase 'success' :\n\t\t\t\t\tdoOnSuccess(response.editor_name)\n\t\t\t\t\tbreak\n\t\t\t\tcase 'failure' :\n\t\t\t\t\tif(doOnFailure){\n\t\t\t\t\t\tdoOnFailure()\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t})\n}", "function login (){\n var nome = prompt(\"Digite seu nickname : \");\n //var rodadas = +prompt(\"Quantas rodadas deseja jogar ?\");\n var regras = prompt(\"Gostaria de ler as regras ? \");\n if (regras === \"sim\"){\n console.log(\"\\nRegras : Você tem três opcões para jogar : ↳ pedra (0) \\n\\n ↳ papel (1) \\n\\n ↳ tesoura (2)\\n==================================================\\n • Pedra ganha da tesoura\\n • Tesoura ganha do papel\\n • Papel ganha da pedra\\n==================================================\");\n }else {\n console.log(\"Que pena , ler as regras é muito importante!\");\n return login('');\n }\n console.log();\n console.log(\"Para iniciar ,tecle ENTER :\");\n prompt(\" \");\n console.log();\n console.log(\"Seja bem-vindo (a) : \" + nome + \"\\nVocê jogará 5 rodadas contra o pc\\n\");\n}", "function user_signin(m_list, param_name)\n {\n //check that sign-in is not empty\n if(param_name == \"\")\n {\n doc_alert(\"Please enter a user name to sign in\");\n return false;\n }\n \n //check if list exists in list names arr\n if(!m_list.to_dos_lists.includes(param_name))\n { //no list found\n //ask if want to create a new list\n if(confirm(\"No list found for \" + param_name \n + \". Create a new list?\"))\n {\n //create the new entry in masters list\n m_list.to_dos_lists.push(param_name);\n //update master list\n update_list(m_list);\n //create/save a new list\n let tmp_new_list = {list_id:param_name, todos: []};\n save_list(tmp_new_list);\n return tmp_new_list;\n }\n return false;\n }\n else\n { //list exists\n //load list\n let tmp_list = load_list(param_name)\n return tmp_list;\n }\n }", "function login(user, password) {\n if (user === \"userName\" && password === \"password1\") {\n return \"Logged in with regular callback\";\n } else {\n return \"wrong credentials\";\n }\n}", "function login() {\n Auth.login(authCtrl.user).then(function(){\n $state.go('home');\n });\n }", "function requestLogin() {\n return {\n type: 'REQUEST_LOGIN'\n }\n}", "login(params){\r\n return Api().post('/login',params)\r\n }", "function managerLogin(username, password, cb){\n try{\n Models.Manager.findOne({ where: { UsernameMa: username }})\n .then(manager => {\n if(manager){\n //Check if there are already 5 connected managers, if so, then don't let this manager connects\n Models.Manager.findAndCountAll({ where: { ConnectionStatusMa: true }}).then(countM => {\n if (countM.count < 5 ){\n bcrypt.compare(password, manager.PasswordMa, (err, isMatch) => {\n if (err) throw err\n if (isMatch){ \n cb(null,manager)\n } else {\n cb(null, false)\n }\n })\n }\n else {\n cb(null, false) \n }\n })\n \n } else {\n cb(null, false)\n }\n }).catch(err=>{cb(err,null)})\n }catch{\n cb(error)\n }\n}", "function login(){\n dispatch(findUser(document.getElementById('email').value,document.getElementById('password').value));\n }", "function api_login(user, pass){\n\t\tif(!isBlank(main_data.login.un) && !isBlank(main_data.login.pass)){\n\t\t\tvar myJSON = {\"_object\":\"auth\",\"_action\":\"login\",\"_source\":main_data.login.method,\"email\":main_data.login.un,\"password\":main_data.login.pass};\n\t\t\tapi_get(myJSON,api_login_callback);\n\t\t}\n\t}", "function goLogin(obj){\r\n\t//mark inactive on server\r\n\tcheckLogout();\r\n\r\n\t//display home controllers\r\n\tmain();\r\n}", "static authenticateUserTemp(username, password) {\n if ((username === \"Menuka\" || username === \"Renuka\") && password === \"admin\") {\n let user = new User(username);\n user.type = (username === \"Menuka\") ? User.CONST.ADMIN : User.CONST.CLIENT;\n AuthManager.setUser(user);\n\n console.log(`Authentication Success: User - ${user.name}`);\n }\n console.error('Authentication Error:');\n }", "function login(network){\n\thello.login(network, { scope: \"\" }, function(e){\n\t\tconsole.info(\"callback\",e);\n\t\tupdateAuthStatus();\n\t});\n}", "function login() {\n var userName = document.getElementById(\"username\");\n var password = document.getElementById(\"password\");\n\n var logonForm = document.getElementById(\"logonForm\");\n logonForm.setAttribute(\"class\", \"hiddenPage\");\n\n request.userName = userName.value;\n\n // the password has not been protected / encyrpted - please change if required.\n request.password = password.value;\n\n // retry the call to the Epicor API\n makeServiceRequest();\n }", "function managerOverride(req, res) {\n var companyId = req.params.companyId;\n passport.authenticate('local', function (err, user) {\n if (err) {\n return res.status(401).json(err);\n }\n if (!user) {\n return res.status(401).json({ message: 'Incorrect credentials' });\n }\n if (user.role === 'admin') {\n return res.json({\n admin: true\n });\n }\n // Check we're on the right company\n if (user.company.toString() === companyId && ['corporate-admin', 'manager', 'admin'].indexOf(user.role) !== -1) {\n return res.json();\n }\n return res.status(401).json();\n })(req, res);\n}", "function getLoginUser() {\n\t\tlet getUserDetails = localStorageService.getLoggedInUserInfo();\n\t\tlet userDetails = JSON.parse(getUserDetails);\n\t\tlet loginUserGroup = userDetails.userGroup;\n\t\tif (loginUserGroup !== 'Administrator') {\n\t\t\tvm.reporter = userDetails.userId;\n\t\t\tvm.reporterList = []; // If User not admin than hide reporter list dropdown\n\t\t} else {\n\t\t\t/* Get reporters list */\n\t\t\tgetUsers();\n\t\t}\n\t}", "_parseAuthInfo(){\n if(this.authInfo){\n const authCode = this.authInfo.split(/\\s+/)[1]\n const authDecode = new Buffer(authCode, 'base64').toString()\n const creds = authDecode.split(':')\n this.login = creds[0]\n this.password = creds[1]\n this.user = User.find_by_login(this.login)\n }\n if(!this.user){\n this.login = 'guest'\n this.password = ''\n this.user = User.find_by_login('guest')\n }\n // TODO: maintain log of user and actions\n // console.info(`authenticated as ${this.user.name}`)\n }", "function login() {\n\n}", "function login() {\n // We give username and password to log the user in\n // In case there is something wrong with the credentials\n // we use the setError to display it\n // If the user logs in successfully then the loginCallback is called.\n setLoading(true);\n databaseLogin(username, password, loginCallback, showError);\n }", "async handleLogin () {\n\t\tconst { email, password, teamId } = this.request.body;\n\t\tthis.user = await new LoginCore({\n\t\t\trequest: this\n\t\t}).login(email, password, teamId);\n\t}", "async function viewByManager() {\n\n // Prompts\n const { manager } = await prompt({\n name: \"manager\",\n message: \"What manager would you like to chose?\",\n choices: [\"John Doe\", \"Mary Smith\", \"Gary Stone\"],\n type: \"list\",\n });\n let manID;\n if (manager === \"John Doe\") {\n manID = 1;\n }\n if (manager === \"Mary Smith\") {\n manID = 3;\n }\n if (manager === \"Gary Stone\") {\n manID = 7;\n }\n \n const query = `SELECT first_name, last_name, title, salary\n FROM employee\n INNER JOIN role ON employee.role_id = role.id \n WHERE manager_id = ?`;\n // Send request to database\n const data = await connection.query(query, manID);\n console.table(data);\n \n }", "function login() {\n\n\t\t// Check for arguments. The first argument, could be a callback\n\t\t// Because some actions need login first\n\t\tvar args = slice.call(arguments, 0), callback = args.shift();\n\n\t\t// Handle the response of login\n\t\tfunction handleLogin(response) {\n\t\t\t// error handling\n\t\t\tif (response && response.error) {\n\t\t\t\tconsole.log('Error on UserModule', 'Can\\'t login', response);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// if there's any callback there, just call him\n\t\t\tif (typeof callback === 'function') { callback(args); }\n\t\t}\n\n\t\t// Login with facebook\n\t\tFB.login(handleLogin, { scope: u.SCOPE });\n\n\t}", "loginRequest (username, password) {\n this.props.logIn(username, password);\n }", "function onLoginSubmit() {\n var select = document.getElementById(\"currentUsersList\");\n var userId = select.options[select.selectedIndex].value;\n var role = select.options[select.selectedIndex].innerHTML;\n \n logIn(userId,role);\n }", "login (userField, passField)\n {\n var json = this.loginLogic(document.getElementById(userField).value, document.getElementById(passField).value);\n if (json.error_code!=200) {\n alert(\"Las credenciales ingresadas son incorrectas\");\n }\n // setCookie(\"idSesion\", json.usuario.idSesion);\n if (json.usuario.rol==\"administrador\") {\n window.location.href = 'perfilAdministrador.html';\n }\n else if (json.usuario.rol==\"alumno\") {\n window.location.href = 'perfilAlumno.html';\n }\n else if (json.usuario.rol==\"profesor\") {\n window.location.href = 'perfilProfesor.html';\n }\n else {\n console.log(\"Error\");\n }\n }", "function login(req, res){\n let requestUser = {\n username: req.body.username,\n passwd: req.body.passwd\n };\n User.findOne({name: requestUser.username})\n .exec((err, user) => {\n if(err){\n console.error(err);\n return res.status(500).json({error: \"Something wrong\"});\n }\n\n if(!user){\n return res.render('pages/index', { error: 'Usuario no encontrado' });\n }\n\n user.comparePassword(requestUser.passwd, (err, isMatch) => {\n if(isMatch && !err){\n req.session.user = user;\n return res.redirect('/admin');\n }else return res.render('pages/index', { error: 'Usuario no encontrado.' });\n });\n });\n}", "loginByToken({ commit }, obj) {\n commit(consts.LOGIN_SUCCESS, obj);\n }", "function setUserCredential (nodeName, nodePwd, nameLabel, pwdLabel) {\n if (navigator.credentials) {\n navigator.credentials.get({ password: true }).then((cred) => {\n if (cred && cred.type === 'password') {\n // console.log('get credential OK.', cred)\n nodeName.value = cred.id\n nodePwd.value = cred.password\n if(nodeName.value){\n nameLabel.classList.add('mdc-text-field__label--float-above')\n nameLabel.innerText = '帐号:'\n }\n if(nodePwd.value){\n pwdLabel.classList.add('mdc-text-field__label--float-above')\n pwdLabel.innerText = '密码:'\n }\n } else {\n console.warn('Get credential ERROR. ', cred)\n }\n })\n }else {\n console.warn('Handle sign-in the way you did before.')\n }\n}", "function onLogin() {}", "function path() {\n return \"/admin/performLogin\";\n}", "function handleLogin() {\r\n if ((!assetEmpty(email) && !assetEmpty(password))\r\n && assertEquals(email, registeredState.email)\r\n && assertEquals(password, registeredState.password)\r\n ) {\r\n setPassword('');\r\n global.nameLogin = registeredState.name;\r\n navigation.replace('BottomStack');\r\n } else {\r\n Alert.alert(\r\n 'Não foi possível entrar:',\r\n 'E-mail/senha incorretos!'\r\n );\r\n }\r\n }", "async function doLogin(userInfo) {\n const userDetailsObj = await authService.login(userInfo.username, userInfo.password);\n console.log(userDetailsObj);\n if (userDetailsObj){\n setUserState({isLoggedIn: true, roles: userDetailsObj.roles, username: userDetailsObj.username});\n const path = \"/\";\n history.push(path);\n }\n else {\n const errors = {};\n errors.invalidCredentials = \"Invalid username or password.\";\n setErrors(errors);\n }\n }", "async function viewByManager() {\n clear();\n const managers = await connection.query(\"SELECT * FROM employee\");\n const managerOptions = managers.map(({ id, first_name, last_name }) => ({\n name: first_name.concat(\" \", last_name),\n value: id,\n }));\n\n const { userManagerId } = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which manager's employees would you like to view?\",\n name: \"userManagerId\",\n choices: managerOptions,\n },\n ]);\n\n const employees = await connection.query(\n employeesSQL + \" WHERE manager.id = ?;\", userManagerId\n );\n\n log(\"\\n\");\n console.table(employees);\n mainMenu();\n}", "function _check_username_and_password(){\n try{\n if(_selected_host_index >= _new_host_list.length){//if check finish all host, but still can't pass verified, then return false;'\n _selected_host_index = 0;\n //if fail to login all server, then\n var db = Titanium.Database.open(self.get_db_name());\n var my_table_name = \"my_manager_user\";\n var rows = db.execute('SELECT type,name FROM sqlite_master WHERE type=? AND name=? LIMIT 1', 'table', my_table_name);\n var manager_row_count = rows.getRowCount(); \n if(manager_row_count > 0){\n db.execute('delete from '+my_table_name);// login fail, then remove all users from manager_user table, user can't login evenif in offliine status'\n db.execute('delete from sqlite_sequence where name=\\''+my_table_name+'\\'');//set sequence number is 0\n }\n rows.close();\n db.close(); \n self.hide_indicator();\n self.show_message(L('message_login_failure')); \n //focus on username field when open login page¬\n if((win.children[0] != undefined) && (win.children[0] != null)){\n win.children[0].focus();\n } \n return;\n }\n var tempURL = _new_host_list[_selected_host_index]+self.base_backend_url;\n var xhr = null;\n if(self.set_enable_keep_alive){\n xhr = Ti.Network.createHTTPClient({\n enableKeepAlive:false\n });\n }else{\n xhr = Ti.Network.createHTTPClient();\n }\n xhr.onload = function(){\n try{\n if((xhr.readyState === 4)&&(this.status === 200)){ \n if(this.responseText === null){//return false in backend's beforeAction'\n self.hide_indicator();\n self.show_message(L('message_login_failure')); \n return; \n }\n if(this.responseText === '[]'){ \n _selected_host_index++;\n _check_username_and_password();\n }else{ \n var result = JSON.parse(this.responseText);\n if(!result.access_allowed){\n _selected_host_index++;\n _check_username_and_password(); \n }else{\n var db = null;\n if((self.get_host() != _new_host_list[_selected_host_index])){\n db = Titanium.Database.open(self.get_db_name()); \n db.remove();\n db = Titanium.Database.open(self.get_db_name()); \n db.execute('BEGIN');\n db.execute('CREATE TABLE IF NOT EXISTS my_login_info('+\n 'id INTEGER,'+\n 'name TEXT,'+\n 'value TEXT)');\n _init_all_tables(db);\n db.execute('COMMIT');\n db.close();\n }\n db = Titanium.Database.open(self.get_db_name());\n var data_rows = db.execute('SELECT * FROM my_frontend_config_setting WHERE name=?','host');\n if((data_rows != null) && (data_rows.getRowCount() > 0)){\n db.execute('UPDATE my_frontend_config_setting SET value=? WHERE name=?',\n _new_host_list[_selected_host_index],\n 'host' \n ); \n }else{\n db.execute('INSERT INTO my_frontend_config_setting (name,value)VALUES(?,?)',\n 'host',_new_host_list[_selected_host_index]\n );\n } \n var selected_host_media_index = 0;\n for(var i=0,j=self.host_list.length;i<j;i++){ \n if(self.host_list[i] == _new_host_list[_selected_host_index]){\n selected_host_media_index = i;\n break;\n }\n } \n \n var data_rows2 = db.execute('SELECT * FROM my_frontend_config_setting WHERE name=?','host_media');\n if((data_rows2 != null) && (data_rows2.getRowCount() > 0)){\n db.execute('UPDATE my_frontend_config_setting SET value=? WHERE name=?',\n self.host_media_list[selected_host_media_index],\n 'host_media' \n ); \n }else{\n db.execute('INSERT INTO my_frontend_config_setting (name,value)VALUES(?,?)',\n 'host_media',self.host_media_list[selected_host_media_index]\n );\n } \n data_rows2.close();\n db.close(); \n \n _selected_host_index++; \n _refresh_library_tables(this.responseText); \n //self.hide_indicator();\n db = Titanium.Database.open(self.get_db_name());\n var rows = db.execute('SELECT * FROM my_manager_user WHERE username=? and password=? and status_code=1',(_user_name).toLowerCase(),_sha1_password);\n var rows_count = rows.getRowCount();\n\n if(rows_count > 0){\n self.update_message('Loading My Calendar ...');\n Ti.App.Properties.setString('current_login_user_id',rows.fieldByName('id'));\n Ti.App.Properties.setString('current_login_user_name',rows.fieldByName('display_name'));\n Ti.App.Properties.setString('current_company_id',rows.fieldByName('company_id')); \n _user_id = rows.fieldByName('id');\n _company_id = rows.fieldByName('company_id'); \n rows.close();\n \n //set properties: active_material_location\n rows = db.execute('SELECT * FROM my_company WHERE id=?',_company_id);\n if(rows.isValidRow()){\n Ti.App.Properties.setString('current_company_active_material_location',rows.fieldByName('active_material_location')); \n }\n rows.close();\n \n rows = db.execute('SELECT * FROM my_login_info where id=1');\n if((rows.getRowCount() > 0) && (rows.isValidRow())){\n db.execute('UPDATE my_login_info SET name=?,value=? WHERE id=1','username',_user_name);\n }else{\n db.execute('INSERT INTO my_login_info (id,name,value)VALUES(?,?,?)',1,'username',_user_name);\n }\n rows.close();\n //SAVE LOGIN USER STATUS,SET STATUS IS 1,THEN IF CRASH OR SOMETHING ,CAN LOGIN AUTO\n db.execute('UPDATE my_manager_user SET local_login_status=1 WHERE id=?',_user_id);\n db.close();\n if(Ti.Network.online){\n _download_basic_table_data();\n _download_my_jobs(_first_login);\n }else{\n self.hide_indicator();\n if(_first_login){\n if(_tab_group_obj == undefined || _tab_group_obj == null){\n \n }else{\n //_tab_group_obj.open();\n }\n win.close({\n transition:Titanium.UI.iPhone.AnimationStyle.CURL_UP\n });\n }else{\n win.close({\n transition:Titanium.UI.iPhone.AnimationStyle.CURL_UP\n });\n Ti.App.fireEvent('pop_gps_turn_off_alert');\n } \n }\n }else{ \n rows.close();\n db.close();\n self.hide_indicator();\n self.show_message(L('message_login_failure'));\n } \n }\n }\n }else{\n _selected_host_index++;\n _check_username_and_password();\n }\n }catch(e){\n _selected_host_index++;\n _check_username_and_password(); \n }\n };\n xhr.onerror = function(e){\n _selected_host_index++;\n _check_username_and_password();\n }; \n xhr.setTimeout(self.default_time_out);\n xhr.open('POST',tempURL+'update',false);\n xhr.send({\n 'type':'verify_login',\n 'username':(_user_name).toLowerCase(),\n 'password':_sha1_password,\n 'refresh_num':(self.get_host() != _new_host_list[_selected_host_index])?0:_current_basic_table_version, \n 'app_security_session':self.is_simulator()?self.default_udid:Titanium.Platform.id,\n 'device_platform':Ti.Platform.name,\n 'device_model':Ti.Platform.model,\n 'device_version':Ti.Platform.version,\n 'device_type':self.default_device_type, \n 'app_version_increment':self.version_increment,\n 'app_version':self.version,\n 'app_platform':self.get_platform_info()\n }); \n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_username_and_password');\n return;\n } \n }", "function handleLogin(request, response) {\r\n\tvar result = {success: false};\r\n\r\n\t// We should do better error checking here to make sure the parameters are present\r\n\tif (request.body.username == \"admin\" && request.body.password == \"password\") {\r\n\t\trequest.session.user = request.body.username;\r\n\t\tresult = {success: true};\r\n\t}\r\n\r\n\tresponse.json(result);\r\n}", "login(login) {\n return apiClient.post('users/login', login)\n }", "function login(assistant) {\n biteFunctions.biteUser(assistant);\n //biteFunctions.getUserOrders(assistant);\n }", "login(state, { username, token }) {\n state.currentUser = {\n username: username,\n token: token,\n };\n\n localStorage.trckrCurrentUser = JSON.stringify(state.currentUser);\n }", "function LoginHandler (request, reply) {\n var username = request.payload.user;\n var password = request.payload.password;\n\n db.query(\"SELECT * FROM persona where username = :username and password = :password\", {\n params: {username: username, password: password}}).then(function (data) {\n if(data.length == 0){\n reply().code(401)\n }else{\n\n var authToken = {\n sessionId: uuid.v4(),\n store: {\n user: data[0]\n },\n userAgent: request.headers['user-agent'],\n remoteAddress: request.info.remoteAddress,\n host: request.info.host\n }\n\n fs.writeFile(__dirname + '/../storage/session/' + authToken.sessionId, JSON.stringify(authToken));\n \n reply({\n sessionId: authToken.sessionId,\n store: _.pick(data[0], '@rid', 'username', 'nombre')\n });\n }\n });\n}", "login(event){\n // const { username, password, errors} = this.state\n event.preventDefault();\n if(!this.handleValidation()){\n console.log('Form has error')\n }else{\n const userData = JSON.parse(localStorage.getItem(\"user\"));\n // const userDetail = userData.find(item => item.user == this.state.username);\n if (userData.username != this.state.username) {\n console.log('User Not Found')\n }\n if (userData.password != this.state.password) {\n console.log('Invalid Credential');\n }\n localStorage.setItem('token', 'res.data.token');\n window.open('http://localhost:3000/home', '_self')\n }\n\n }", "async function login(logobj) {\n const {username,password} = logobj;\n let obj = {username:`${username}`,password:`${password}`}\n let log= await APIpage.login(obj);\n localStorage.setItem('_token', log.token);\n setUserinfo(username);\n return log;\n }", "function login(user, pass, callback) {\n\tsendRequest({ request: 'login', username: user, password: pass }, callback);\n}", "function loginUser(password)\n{\n\tvar transaction = pimsDB.transaction(\"users\");\n\tvar objectStore = transaction.objectStore(\"users\");\n\tvar request = objectStore.get(password);\n\trequest.onsuccess = function(e)\n\t{\n\t\tif (e.target.result == null)\n\t\t{\n\t\t\t$(\"#login_password\").val(\"\");\n\t\t\tshowUserMessage(\"INVALID PASSWORD\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tuserInitials = e.target.result.initials;\n\t\t\thideUserMessage();\n\t\t\t$(\"#login_password\").css(\"display\", \"none\");\n\t\t\tinitMenu();\n\t\t}\n\t};\t\n}", "login (userField, passField)\n {\n this.loginLogic(document.getElementById(userField).value, document.getElementById(passField).value);\n }", "handleLogin(req, res) {\n self.services.getUser(req.validBody.username)\n .then(data => {\n if (!data) {\n self.sendError(res, self.CODES.UNAUTHORIZED, \"No such username: \" + req.validBody.username);\n } else if (data.password !== req.validBody.password) {\n self.sendError(res, self.CODES.UNAUTHORIZED, \"Invalid password given: \" + req.validBody.password);\n } else {\n self.sendData(res, data);\n }\n })\n .catch(error => {\n self.sendError(res, self.CODES.INTERNAL_ERROR, \"An error occured trying to login\");\n });\n }", "manager(context) {\n axios.get('/api/manager/login/session/check')\n .then(resp => {\n //when session running\n if (resp.data.session == \"running\") {\n context.commit('manager', resp.data.manager);\n }\n\n //when session expired\n if (resp.data.session == 'expired') {\n localStorage.removeItem('manager_token');\n router.push({ name: 'manager_login' });\n }\n\n\n\n })\n }", "function loginn(){\n // localStorage.setItem('user-pizza', 'Paul');\n setLog(!log)\n }", "function login() {\n $state.go('app.login');\n }", "function detectLogin()\n {\n $.when(api.whoami()).done(function(user)\n {\n // update the UI to reflect the currently logged in user.\n topnav.update(user.firstName + ' ' + user.lastName);\n }).fail(function()\n {\n topnav.clear();\n });\n }", "loginAction({\n commit\n }, userlikeObj) {\n commit(\"userStatus\", true)\n commit(\"saveUserInfo\", userlikeObj)\n }", "loginIntoClientAccount() {\n /**\n * Note\n * \"/index.php?controller=authentication&back=my-account\" may be an old uri\n * On Prestashop newer versions it redirect to \"/login?&back=my-account\"\n */\n cy.goToPage(this.StoreUrl + '/index.php?controller=authentication&back=my-account');\n cy.loginIntoAccount('input[id=field-email]', 'input[name=password]', 'client');\n }", "async loginUser() {\n await this.userName.sendKeys(browser.params.loginData.login.login_set_1.username);\n await this.password.sendKeys(browser.params.loginData.login.login_set_1.password);\n await this.loginButton.click();\n }", "onLoginClick(event) {\n this.props.signinUser(this.state.userName, this.state.password, this.props.history);\n }", "function login(username, password, success, failure) {\n if (username === 'admin' && password === 'admin') {\n success('Login success')\n } else {\n failure('Login failed')\n }\n}", "loginWithPassword(password) {\n this.open();\n this.login('[email protected]', password);\n }", "function performLogin(cy){\ncy.get(usernameTxtField).type('jp')\ncy.get(passwordTxtFIeld).type('1010')\ncy.get(submitButtonLogin).click()\n}", "function loginUserData(data) {\n var flag = \"active\";\n sessionStorage.setItem(\"LoginJson\", flag);\n sessionStorage.setItem(\"FullName\", data.fname + \" \" + data.mname);//for fname\n sessionStorage.setItem(\"MiddleName\", data.mname);//for mname\n sessionStorage.setItem(\"LastName\", data.lname);//for lname\n sessionStorage.setItem(\"LoginId\", data.loginid);//for loginid\n sessionStorage.setItem(\"CurrentUserId\", data._id.$oid); //for Current User \n sessionStorage.setItem(\"OrgId\", data.orgid);\n// sessionStorage.setItem(\"Privileges\", privileges);\n sessionStorage.setItem(\"RoleNames\", data.roles);\n sessionStorage.setItem(\"UserType\", data.type);\n getOrgName();\n}", "function loginSuccess(res) {\n $state.go('users.routes', {\n username: res.user.username\n });\n }", "function doLogin(username, password, callback) {\n\tmagic(\n\t\t\t\"GetUserAuthentication\",\n\t\t\tusername,\n\t\t\tappname,\n\t\t\t\"\",\n\t\t\ttoken,\n\t\t\tpassword,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t\"\",\n\n\t\t\tfunction(res) {\n\t\t\t\tif (res.status == \"error\") {\n\t\t\t\t\tconsole.log(\"error logging in: \" + res.data);\n\n\t\t\t\t\tcallback(\"error\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvar data = JSON.parse(res[\"data\"]);\n\n\t\t\t\t\tvar validUser = data[0][\"getuserauthenticationinfo\"][0][\"ValidUser\"];\n\t\t\t\t\tif (validUser.indexOf(\"YES\") != -1) {\n\t\t\t\t\t\twindow.ehrUsername = username;\n\t\t\t\t\t\twindow.ehrPassword = password;\n\n\t\t\t\t\t\tcallback(\"success\");\n\n\t\t\t\t\t} else\n\t\t\t\t\t\tcallback(\"invalid\");\n\t\t\t\t}\n\t\t\t});\n}" ]
[ "0.6678683", "0.66650367", "0.65721667", "0.65551937", "0.63741463", "0.63050944", "0.62986374", "0.6262497", "0.624804", "0.62280893", "0.62198144", "0.61914164", "0.6184897", "0.61746424", "0.61737317", "0.61231035", "0.61044204", "0.6100706", "0.6098712", "0.60715884", "0.6052133", "0.60521096", "0.60141754", "0.59932876", "0.59778285", "0.5968707", "0.59547853", "0.5952075", "0.59505326", "0.5945055", "0.59401035", "0.5924844", "0.5908698", "0.5879702", "0.5876401", "0.58756006", "0.5857068", "0.5848812", "0.5844483", "0.5829135", "0.58276254", "0.58220494", "0.58184516", "0.5817705", "0.58170396", "0.58029115", "0.5800663", "0.5791198", "0.57911193", "0.57865983", "0.5776533", "0.5775183", "0.57724434", "0.5769446", "0.57660747", "0.576492", "0.57579243", "0.5757855", "0.57518476", "0.5740046", "0.5737315", "0.57370955", "0.57338685", "0.5733547", "0.57226616", "0.5720284", "0.5718236", "0.5717327", "0.57074755", "0.5698031", "0.5692368", "0.5690529", "0.56896824", "0.5688618", "0.5686815", "0.5685283", "0.56796163", "0.5679156", "0.56783277", "0.56782866", "0.56744516", "0.56726694", "0.56716114", "0.5670311", "0.56657636", "0.5665595", "0.5662027", "0.5659142", "0.56566983", "0.5653166", "0.56512666", "0.5645578", "0.5643719", "0.56427443", "0.5641935", "0.5638995", "0.56364256", "0.5631101", "0.56286395", "0.5628534", "0.56231904" ]
0.0
-1
function showing error message
function showPopUp(message) { var modal = document.getElementById('myModal'); var span = document.getElementsByClassName("close")[0]; var messageP = document.getElementById("message"); messageP.textContent = message; modal.style.display = "block"; span.onclick = function () { modal.style.display = "none"; }; window.onclick = function (event) { if (event.target === modal) { modal.style.display = "none"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showError() {}", "function showError(type, text) {}", "function showErrorMessage(msg) { }", "function showError() {\n showStatus('error');\n}", "showErrorMessage() {}", "function showError() {\r\n console.log(\"There is some error\");\r\n}", "function showError() {\n console.log(\"There was an error\");\n}", "function error(){\n return \"Invaild e-mail or password!\";\n }", "function displayError(error) {\n console.log(error);\n}", "function adderr(txt) { return !fields.attr(\"required\", false).mbError(txt); }", "function error(message) {\n jsav.umsg(message, {\"color\" : \"red\"});\n jsav.umsg(\"<br />\");\n }", "function displayError(error) {\n displayMessage(error, true);\n\n}", "function showError(message){\n alert(message);\n}", "function displayError(errorText) {\r\n // log the msg for the user to see\r\n logError(errorText);\r\n}", "function showError(err) {\n console.log(err);\n}", "function mostrarError(err){\n console.log('Error', err);\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "function error() {\r\n\t\tlet error = document.createElement(\"h3\");\r\n\t\terror.innerHTML = \"Sorry there are no recipes with \"+errorName+\", try again!\";\r\n\t\tdocument.getElementById(\"error\").appendChild(error);\r\n\t}", "function showError(error) {\r\n switch(error.code) {\r\n case error.PERMISSION_DENIED:\r\n smthgwrong.textContent = \"Pro zobrazení počasí v aktuální oblasti prosím povolte přítup k poloze.\"\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n smthgwrong.textContent = \"Nebylo možné identifikovat polohu.\"\r\n break;\r\n case error.TIMEOUT:\r\n smthgwrong.textContent = \"Příkaz pro získaní polohy vypršel, zkuste to prosím znova.\"\r\n break;\r\n case error.UNKNOWN_ERROR:\r\n smthgwrong.textContent = \"Během procesu došlo k neznámé chybě.\"\r\n break;\r\n }\r\n}", "function errorMsg(msg, error) {\n // errorElement.innerHTML += '<p>' + msg + '</p>';\n console.log(msg);\n if (typeof error !== 'undefined') {\n console.error(error);\n }\n }", "function outPutVisualError(namePassed, phonePassed, pickUpPassed, destinationPassed, dateTimePassed){\n var outPut = \"\";\n if(namePassed && phonePassed && pickUpPassed && destinationPassed && dateTimePassed){\n outPut = \"\";\n }else{\n document.getElementById('outPutString').style.color = \"#FF0000\";\n outPut = \"ERROR(S):<ul>\";\n if(!namePassed){ outPut += \"<li>The name input is incorrectly formatted. Please only use normal naming conventions</li>\"; }\n if(!phonePassed){ outPut += \"<li>Your phone number is incorrectly formatted. It must start with a 0 and be from 8-13 digits long</li>\"; }\n if(!pickUpPassed){ outPut += \"<li>Your pick up address is incorrectly formatted</li>\"; }\n if(!destinationPassed){ outPut += \"<li>Your destination address is incorrectly formatted</li>\"; }\n if(!dateTimePassed){ outPut += \"<li>Your pick up date/time is incorrect. It must be at least 1 minute from the current time and must be correctly formatted</li>\"; }\n outPut += \"</ul>\";\n }\n document.getElementById('outPutString').innerHTML = outPut;\n}", "function displayError(error) {\n console.log(error);\n console.log(\"Error --> \" + error);\n // hiding all views\n hideAll();\n // reset menu links\n enableAll();\n //displays panel\n document.querySelector(\"#error-view\").classList.remove(\"collapse\")\n // error message\n document.querySelector(\"#error\").innerHTML = \"Message: \" + error;\n ;\n}", "showError(error){\n\t\talert(error||'unknown error has occurred.');\n\t}", "function mdm_error(message) { document.getElementById(\"error\").innerHTML = 'try again'; }", "function error(err) {\n var problem;\n if (err.code == 1) {\n // user said no!\n problem = \"You won't share your location with us.\"\n }\n if (err.code == 2) {\n // location is unavailable - no satellites in range?\n problem = \"Your location is unavailable.\"\n }\n if (err.code == 3) {\n // request timed out\n problem = \"Something was too slow.\"\n }\n document.getElementById('location').innerHTML = \"Something went wrong! \"+problem;\n \n}", "function error(){\n alert('invalid info')\n}", "function displayError() {\n if(originalError instanceof ValidationError) {\n $(\".validation-message--error\").text(`Validation Error: ${originalError.message}`);\n }\n else if(originalError instanceof LocationError) {\n $(\".validation-message--error\").text(`Location Error: ${originalError.message}`);\n }\n else {\n $(\".validation-message--error\").text(`Error: ${originalError.message}`);\n }\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "function displayError() {\n\t\t// Hide loading animations\n\t\tdocument.getElementById(\"loadingmeaning\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadinggraph\").style.display = \"none\";\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t\t\n\t\t// Display error at bottom of the page\n\t\tdocument.getElementById(\"errors\").innerHTML =\n\t\t\t\"Sorry, but an error occured during your server request.\";\n\t}", "function defaultError(error)\n{\n msg(\"error \" + error.responseText);\n}", "function error(msg) {\r\n textFormat(color(0, 0, 100), 50, CENTER);\r\n alert(msg);\r\n}", "function ShowError (e)\n{\n alert('[ERROR] ' + e);\n}", "function displayError(error) {\n var errorType = {\n 0: \"Unknown Error\",\n 1: \"Permission denied by user\",\n 2: \"Position is not available\",\n 3: \"Request timed out\"\n };\n \n var errorMessage = errorType[error.code];\n if (error.code == 0 || error.code == 2) {\n errorMessage = errorMessage + \" \" + error.message;\n }\n \n var div = document.getElementById(\"location\");\n div.innerHTML = errorMessage;\n}", "function errorMessage() {\n\t\n\t$loader.html('<span class=\"error typeIt2\">Purrrlease make a selection...... You can do that right meoewwwwermmmm thanks.</span>');\n\n\t//typeIt effect\n\t$('.typeIt2').typeIt({\n\t\tcursor: false,\n\t});\n\n}", "function showError() {\n alert('show error');\n}", "function showErr(err){\n\tconst outputElem = $('#results');\n\tconst errMsg = (\n\t\t\t`<p class=font>No results found.</p>`\n\t\t);\n\toutputElem.html(errMsg);\n}", "function displayErrorMsg(error) {\n $(\".errorOverlay\", selector).text(tr(error));\n $(selector).addClass(\"error\");\n }", "function show_error(message) {\n\t\t$(\"#error_msg\").text(message);\n}", "function returnErrorMessage() {\n $('.result-line').text(\"That is not a valid response\");\n }", "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "function error() {\nalert(\"That's weird! We couldn't find you!\");\n}", "function error(err){\n alert('Error: ' + err + ' :('); // alert the error message\n}", "function show_error(a,b){\n\t\t$('error_creacion').innerHTML=b+' : '+errores[a];\n\t}", "function showError() {\n console.log(\"error in writing data to the database\")\n}", "function displayPHPError(error)\r\n{\r\n displayError (\"Error number :\" + error.errno + \"\\r\\n\" +\r\n \"Text :\"+ error.text + \"\\r\\n\" +\r\n \"Location :\" + error.location + \"\\r\\n\" +\r\n \"Line :\" + error.line + + \"\\r\\n\");\r\n}", "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "function displayErrors(pErr){\n console.log('-----------');\n console.log('Error in Mod: ' +pErr.mod +' | Func: ' +pErr.func);\n //console.log('name: ' +pErr.name);\n console.log(getException(pErr.name));\n console.log('msg: '+pErr.msg);\n if (pErr.isObj === true) {\n console.log('line: '+pErr.line);\n //console.log('\\n' +pErr.stfLingoMsg +': ' + pErr.msg);\n //console.log('\\n' +pErr.stfLingoStack +':');\n console.log('-----------');\n }\n console.log(pErr.stack);\n }", "function displayError(message) {\n errorElem.textContent = message;\n errorElem.classList.add('show');\n }", "function errback(err) {\n //alert(err.toString());\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function showError(error) {\n //console.log(error);\n window.alert('An error has occurred, please try again.');\n }", "displayError(message) {\n this.error = message;\n }", "function displayError() {\r\n let html = `${addBookmark()}<div id=\"error-message\">${store.error}</div>`;\r\n return html;\r\n}", "function error(msg) {\n alertify.alert('<img src=\"/images/cancel.png\" alt=\"Error\">Error!', msg);\n }", "function error(err) {\r\n notificationElement.style.display = \"block\"\r\n notificationElement.innerHTML = `<p>${err.message}</p>`\r\n}", "function displayError(message)\n{\n// display error message, with more technical details if debugMode is true\nalert(\"Error accessing the server! \"+\n(debugMode ? \"\\n\" + message : \"\"));\n}", "function erorrMessage(errors) {\n\n var txt =\"\";\n $.each(errors, function( index, value ) {\n txt += ErrorMsg('warning',value);\n \n });\n return txt;\n}", "function erorrMessage(errors) {\n\n var txt =\"\";\n $.each(errors, function( index, value ) {\n txt += ErrorMsg('warning',value);\n \n });\n return txt;\n}", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "function error(e) { \n console.error('error:'.bold.red, e); \n}", "function displayMessage(str){\n\tif(str){\n\t\taa.env.setValue(\"ErrorCode\", \"-1\");\n\t\taa.env.setValue(\"ErrorMessage\", str);\n\t}\n}", "function fallo() {\n return error(\"Reportar fallo\");\n}", "function showError(error){\n\t\thideFilters();\n\t\t\n\t\t$('.selections').show();\n\t\t$('.picker').hide();\n\t\t$('.show-another').hide();\n\t\t$('.heading').html(`<span>${error}</span><a href = \"index2.html\"><br><div style = \"margin-top: 50px\" class = \"button\">Try Again</div></a>`);\n\t}", "function errorMessage (text){\n resultLine.textContent = `Error : ${text}`;\n calcScreen.classList.add('error');\n }", "function fnShowError(errorText, action) {\n alert(errorText);\n }", "function alertErrorMsg(s){ errorAlert.html('<i class=\"fa fa-warning\"></i> ' + s).show(); }", "function ShowError(ids, msg) {\r\n document.getElementById(ids)\r\n .innerHTML = msg;\r\n return false;\r\n }", "function error (message){\r\n\tjava.lang.System.err.print(message)\r\n}", "function displayError(msg, title){\n\t\tvar htmlString = \"\";\n\t\tif(title && title.length){\n\t\t\thtmlString += \"<h3>\"+title+\"</h3>\";\n\t\t}\n\t\thtmlString += \"<p>\"+msg+\"</p>\";\n\n\t\t$parserErrorDisplay\n\t\t\t.show()\n\t\t\t.html(htmlString);\n\t}", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function showError( ){\n console.log(\"error in reading the position\");\n}", "function showErrorMessage(message){\n //Hide the submit button\n submitSection.hide()\n //Show the error section\n errorSection.show()\n errorSection.text(message)\n }", "function displayError(message) {\n errorMessage.html(message);\n error.show();\n state.change(\"error\");\n }", "function showError() {\n\t\t\talert('Error parsing csv');\n\t\t}", "function showError() {\n transitionSteps(getCurrentStep(), $('.demo-error'));\n }", "function displayError() {\n errorMessage.style.display = \"block\";\n return false;\n}", "function displayError() {\n Toast.show({\n style: { backgroundColor: \"red\", justifyContent: \"center\" },\n position: \"top\",\n text: \"Record meal(s) failed. Please try again.\",\n textStyle: {\n textAlign: 'center',\n },\n duration: 1500\n });\n }", "function err( i ) {\n if ( !data.errors ) return \"🚨 (Modular): \";\n\n let args = data.errors[i],\n type = `[${ args[0] }]`,\n position = \"\",\n information,\n error;\n\n // Removing error type\n args.shift();\n\n // Don't show error-origin if only one argument present.\n if ( args.length > 1 ) {\n position = `\\n@ ${ args.pop() }()\\n`;\n }\n\n // Formatting the error information\n information = args.map( arg => `\\n--> ${ arg }` ).join( \"\\n\" );\n error = `🚨 (Modular): ${ [type, information, position].join( \"\\n\" ) }`;\n\n return error;\n }", "function error() {\r\n\t\t\t\talert(\"error\");\r\n\t\t\t}", "function displayError() {\n errorMsgContainer.innerHTML = \"\";\n errorMsg.textContent = \"No results were found.\";\n errorMsgContainer.appendChild(errorMsg);\n studentUL.appendChild(errorMsgContainer);\n }", "function throwErr(error) {\n document.getElementById('errors').innerHTML =\n document.getElementById('errors').innerHTML + '<br/>' +\n error;\n gridWidth = 0\n throw error;\n}", "function showError(error) {\n console.log(error);\n window.alert('An error has occurred, please try again.');\n }", "function showError(msg) {\n var lblError = document.querySelector('#lblError');\n lblError.innerHTML = 'Error: ' + msg;\n lblError.hidden = false;\n}", "function error(msg) {\n\t\t// Update the status DOM object with the error message\n\t\tstatus.innerHTML = typeof msg === 'string' ? msg : 'Failed!';\n\t\tstatus.className = 'alert alert-error';\n\t}", "function displayError (errMsg) {\n $(\"#error-msg\").text(errMsg);\n $(\"#url-form,#loading,#content\").hide();\n $(\"#error\").show();\n}", "function callError(info){\n APP.displayError(info);\n }", "function showError(str, err) {\n console.log(\"An error occurred while processing configuration:\\n\");\n if (str) console.log(str);\n if (err) console.log(err);\n}", "function escribir(variableError){\n var mensaje= \"Error! El campo \"+ variableError + \" se encuentra vacío. Completelo.\";\n document.getElementById('alertaError').innerHTML= mensaje;\n }", "function error(message, data, title) {\n $mdToast.simple().content(message);\n }", "function ShowFormError(message) {\n console.log(\"error message is \" + JSON.stringify(error_message));\n error_message.innerText = message;\n ShowElements(error_message);\n}", "function showErrorDialog(boundary,errorInfo){return true;}", "function showErrorDialog(boundary,errorInfo){return true;}", "function showError(error) {\n\tif (error === false) {\n\t\t$('[id*=\"_error\"]').html('');\n\t} else {\n\t\t$('#' + error.extra.responsibleElement + '_error').html(\"Invalid Valid\");\n\t}\n}", "function error() {\r\n id(\"error-text\").classList.remove(\"hidden\");\r\n id(\"error-text\").innerText = \"Something went wrong with the request. Please try again later.\";\r\n }", "function errorHandler(data, errorCode, errorMessage) {\n document.getElementById(\"ErrorMessage\").innerText =\n \"Error occurred while retireving information. \" + errorMessage;\n }", "function throwError(error) {\n $('#errorValue').append('No Statement found');\n $('#modalError').modal('show');\n}", "function showError() {\n //error for email\n if (email.validity.valueMissing) {\n // If the field is empty,\n // display the following error message.\n errorEmail.textContent = \"You need to enter an e-mail address.\";\n } else if (email.validity.typeMismatch) {\n // If the field doesn't contain an email address,\n // display the following error message.\n errorEmail.textContent = \"Entered value needs to be an e-mail address.\";\n } else if (email.validity.tooShort) {\n // If the data is too short,\n // display the following error message.\n errorEmail.textContent = `Email should be at least ${email.minLength} characters; you entered ${email.value.length}.`;\n }\n // Set the styling appropriately\n errorEmail.className = \"error active\";\n\n //error for password\n if (password.validity.valueMissing) {\n errorPass.textContent = \"You need to enter a password.\";\n } else if (email.validity.typeMismatch) {\n errorPass.textContent = \"Entered at-least 8 characters.\";\n } else if (email.validity.tooShort) {\n errorPass.textContent = `Password should be at least ${password.minLength} characters; you entered ${password.value.length}.`;\n }\n errorPass.className = \"error active\";\n\n //error for passwordconf\n if (passwordConf.value != password.value) {\n passwordConf.validity.valueMissing;\n errorPassConf.textContent = \"Needs to match password above.\";\n return;\n }\n errorPassConf.className = \"error active\";\n\n //error for zipcode\n if (zipcode.validity.valueMissing) {\n errorZipcode.textContent = \"Needs to be zipcode\";\n } else if (zipcode.validity.typeMismatch) {\n errorZipcode.textContent = \"Entered at-least 8 characters.\";\n } else if (zipcode.validity.tooShort) {\n errorZipcode.textContent = `Password should be at least ${zipcode.minLength} characters; you entered ${zipcode.value.length}.`;\n }\n errorZipcode.className = \"error active\";\n}", "function showGDataError(e) {\n $('errors').innerHTML =\n 'Error: ' + (e.cause ? e.cause.statusText : e.message);\n $('errors').style.display = '';\n}", "function handleError(errStat){\n alert(\"this isnt working\" + errStat);\n }", "function showError(errors)\n{ \n var mes = '';\n for (var key in errors) {\n mes += '<p>' + errors[key] + '</p>';\n }\n $('#mes-error').innerHTML = mes;\n}", "function updateRelationErrorMsg() {\n relationErrorMsg.innerHTML = relationInput.validationMessage;\n}", "function errorFunction(){\n\talert(\"error!\");\n}" ]
[ "0.8691914", "0.83180195", "0.81096506", "0.7912872", "0.7862791", "0.7772021", "0.7553128", "0.74583834", "0.7426294", "0.74205774", "0.7393937", "0.73559994", "0.7350916", "0.7338263", "0.7327685", "0.73043233", "0.73043233", "0.7296762", "0.72808546", "0.72543365", "0.7250454", "0.72319615", "0.7223438", "0.72148407", "0.7213295", "0.7206241", "0.72031957", "0.72028345", "0.7178987", "0.71780384", "0.71753746", "0.7165486", "0.71651256", "0.7159951", "0.7156087", "0.7151756", "0.7139463", "0.71250546", "0.709158", "0.7084539", "0.7075482", "0.7072825", "0.7071959", "0.70666194", "0.70608515", "0.70505685", "0.70419186", "0.70355123", "0.70344365", "0.7031268", "0.7025002", "0.70205575", "0.70164603", "0.70147544", "0.7010663", "0.70023996", "0.70023996", "0.69999146", "0.6994471", "0.6990534", "0.6988937", "0.6987276", "0.698492", "0.69776046", "0.6970609", "0.69607115", "0.69560057", "0.695232", "0.695106", "0.6936219", "0.6930359", "0.6929025", "0.69288945", "0.6921477", "0.6917013", "0.69106823", "0.69053173", "0.6904373", "0.6900107", "0.6894845", "0.68936217", "0.68907446", "0.68863654", "0.68854594", "0.68791103", "0.6873619", "0.6870583", "0.686868", "0.68679154", "0.686193", "0.686193", "0.6857532", "0.6856719", "0.6853006", "0.6850731", "0.6849025", "0.6847725", "0.684337", "0.6834", "0.6832661", "0.68322074" ]
0.0
-1
itemSelector Toplevel function called by Script Deployment
function itemSelector(request, response) { if (request.getMethod() == 'GET') { //Get the parameters and create the form getParams(request, response); createSelectionForm(request, response); response.writePage(selectionForm); } //POST else { //Check the Search Criteria if(getSearchCriteria(request, response)==true) { postItems(request, response); } else { createSelectionForm(request, response); response.writePage(selectionForm); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectionMitem(item) {\n let titleSelection = $('#' + item + '').attr(\"title\");\n sNameTitle = titleSelection;\n let items = item.replace(\"mItem\", \"mSubItem\") + \"_0\";\n let dataForm = items.substring (items.indexOf('_', items.length)).replace(\"mSubItem_\",\"\")\n $('.collapsible - header').css('color', 'black');\n $(\"#\" + item + \"\").css('color', '#29b6f6');\n selectionMsubItems(items, \"dataForm\", false, false)\n\n\n\n}", "function useItem() {\n for (i = 0; i < items.length; i++) {\n if (items[i].selected) {\n items[i].use();\n console.log(\"datt\");\n }\n }\n \n}", "function selectItem(item) {\n var path = $(item).data(\"path\");\n\n lookupPath = path;\n\n lookupPath = lookupPath.replace(/\\\\/g, \"/\");\n\n createLookupBC();\n closeLookup(item);\n\n if (callback_itemSelected !== undefined || callback_itemSelected !== null) {\n callback_itemSelected(lookupPath)\n }\n\n\n\n }", "function useItem(){\n\t\n}", "function select(item) {\n return document.querySelector(item);\n}", "function nodeSelection(nodeId){\n requestItemInfo('GET', baseUrl_js + \"SppNav/item/\" + nodeId);\n}", "function selectItem(itemID) {\n $('.item').css('background-color', '');\n $('#' + itemID).css('background-color', 'rgba(29, 29, 29, .1)');\n $('.selected-river').empty().text($('#' + itemID).text()).attr('data-index', $('#' + itemID).attr('data-index'));\n // Close the menu\n $('#dropdown-wrapper').attr('data-open', 'false');\n $('#dropdown-wrapper').height($('.selected-river').height()+16).width((($('.selected-river').text().length)+3) + 'ch');\n $('body').css('background-color', '');\n $('.selected-river').width((($('.selected-river').text().length)+3) + 'ch').css('background-color', 'rgba(29, 29, 29, 0)');\n // Darken the content-question text\n $('.content-question').css('opacity', '1');\n // Drop down the CTA\n $('.cta-mask > .container').css('transform', 'translateY(0%)');\n}", "selectItem (i) { this.toggSel(true, i); }", "function ListItem() { }", "function selectResult(item) {\n\n \n\n _selectResult(item);\n\n \n\n }", "function selItem(c){\n CargarVentana('buscador4','Nuevo Usuario del Sistema','../../ccontrol/control/control.php?p1=MostrarPersona&idformula=&estado=nuevo&c='+c,'500','300',false,true,'',1,'',10,10,10,10);\n}", "function selectionSubItems(subItem, Form, cont_search) {\n\n let items = \"#\" + subItem + \"\";\n fromUpdateSearch = \"#form_search_\" + Form;\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"color\", \"#eafaf9\");\n let text = sNameTitle + \" \" + $(items).text();\n $('#titleForm ').text(text);\n\n\n if (cont_search) {\n $('#cont_search_' + Form).css(\"display\", \"block\");\n disableEnableInput(Form, 0);\n disableEnableElementInput(fromUpdateSearch, 1);\n\n } else {\n $('#cont_search_' + Form).css(\"display\", \"none\");\n disableEnableInput(Form, 1);\n disableEnableElementInput(fromUpdateSearch, 0);\n }\n selectForm(Form);\n\n typeSelectionUpdateCreate = subItem.substring(subItem.indexOf(\"_\") + 1, subItem.length);\n\n}", "function itemSelector() {\n let aDropdownItems = \"\";\n if (document.querySelector(\".dropdown__list-item\") !== null) {\n aDropdownItems = document.querySelectorAll(\".dropdown__list-item\");\n for (let i = 0; i < aDropdownItems.length; i++) {\n //remove active class from all items\n\n aDropdownItems[i].addEventListener(\"click\", (e) => {\n //To be able to loop through with foreach\n let aChildrenNodes = Array.from(\n aDropdownItems[i].parentElement.children\n );\n //Could have used a for loop instead though\n aChildrenNodes.forEach((eChild) => {\n //remove class\n eChild.classList.remove(\"dropdown__list-item--active\");\n });\n toggleDialogBox();\n clickedItem(aDropdownItems[i]);\n });\n }\n }\n}", "function SelectPackage()\n{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n Listbox.SelectListboxItems(\"Daily Admission\");\n selectQuantity(31);\n selectPackage(\"Open Dated\",\"Under 3\");\n selectPackage(\"Open Dated\",\"Adult\");\n selectPackage(\"Open Dated\",\"Children (Ages 3-12)\");\n AppLoginLogout.logout();\n}", "function OSelect_XFormItem() {}", "function selectionMsubItems(subItem, Form, cont_search, nav_mobile) {\n\n let items = \"#\" + subItem + \"\";\n fromUpdateSearch = \"#form_search_\" + Form;\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"color\", \"#eafaf9\");\n let text = sNameTitle + \" \" + $(items).text();\n $('#titleForm ').text(text);\n\n if (nav_mobile) {\n if ($('.button-collapse').is(\":visible\")) {\n $('.button-collapse').sideNav('hide');\n }\n }\n\n if (cont_search) {\n $('#cont_search_' + Form).css(\"display\", \"block\");\n\n disableEnableInput(Form, 0);\n disableEnableElementInput(fromUpdateSearch, 1);\n\n } else {\n $('#cont_search_' + Form).css(\"display\", \"none\");\n disableEnableInput(Form, 1);\n disableEnableElementInput(fromUpdateSearch, 0);\n }\n\n selectForm(Form);\n typeSelectionUpdateCreate = subItem.substring(subItem.indexOf(\"_\") + 1, subItem.length);\n\n\n}", "itemSelectionChanged(sender, args) {\n if (args == null) return\n let item = args.item\n\n if (INode.isInstance(item) && item.style instanceof UMLNodeStyle) {\n let model = item.style.model\n this.div.innerHTML = \"\"\n this.buildNodeProperties(model, this.div)\n } else if (IEdge.isInstance(item) && item.style instanceof UMLEdgeStyle) {\n let model = item.style.model\n this.div.innerHTML = \"\"\n this.buildEdgeProperties(model, this.div);\n\n }\n }", "addItems(itemSelector, activeClass)\n {\n const $itemsInMegaMenu = this.$menu.querySelectorAll(itemSelector);\n\n [...$itemsInMegaMenu].forEach($itemInMegaMenu => {\n const menuItem = new MenuItem($itemInMegaMenu, activeClass);\n this.menu.push(menuItem);\n });\n }", "get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }", "function showItems() {\n\n}", "function selectDropdownItem (item) {\r\n\t\t if(item) {\r\n\t\t \tif(selected_dropdown_item) {\r\n\t\t deselectDropdownItem($(selected_dropdown_item));\r\n\t\t }\r\n \t\titem.addClass(\"input-img-selected-item\");\r\n\t\t selected_dropdown_item = item;\r\n\t\t }\r\n\t\t }", "arangeItems () {\r\n // TODO: Add code here\r\n }", "function doOnSelect(itemId){\r\n var selectNodeType1 = getNodeType(itemId);\r\n\t\t\tif(itemId!=newItemId){\r\n\t\t\t\tif(tree.getLevel(newItemId)!=0){\r\n\t\t\t\t\tif(confirm(\"Do you want to save changes?\")){//save changes to new item\t\t\r\n\t\t\t\t\t var selectNodeType2 = getNodeType(newItemId);\r\n\t\t\t tree.selectItem(newItemId,false);\r\n\t\t\t\t\t\tif(selectNodeType2 == 2) button_saveCarrier(); \r\n\t\t\t\t\t\tif(selectNodeType2 == 4) button_saveResource();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttree.deleteItem(newItemId);\r\n\t\t\t\t}\t\r\n\t\t\t}else{//set color to new item label\r\n\t\t\t\ttree.setItemColor(itemId,\"red\",\"pink\");\r\n\t\t\t}\r\n\t\t\tswitchDest(selectNodeType1,itemId);\r\n\t\t}", "processItems() {}", "function select_default_menu_item()\r\n{\r\n\tmenu_item_selected(document.getElementById('mi_home'));\r\n\t//menu_item_selected(document.getElementById('mi_custreqs'));\r\n}", "select() {\n\t\tconsole.log('Selected. Yay');\n\t\tconst selected = this.menuData[this.cursor].id;\n\n\t\tconst items = [];\n\t\tfor (let i = 0; i < this.menuData.length; i++) {\n\t\t\tlet addItem = null;\n\t\t\tconsole.log('Item type ' + this.menuData[i].type);\n\t\t\tif (this.menuData[i].type === MenuTypes.SLIDER) {\n\t\t\t\tconsole.log('Evaluating Slider');\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: this.menuData[i].input.value\n\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (this.menuData[i].type === MenuTypes.EDIT) {\n\t\t\t\tconsole.log('Evaluating edit item');\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: this.menuData[i].input.value\n\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (this.menuData[i].type === MenuTypes.SELECTOR) {\n\t\t\t\tconsole.log('Evaluating selector');\n\t\t\t\tlet selectedID = 0;\n\t\t\t\tconst items = document.getElementsByName(this.menuData[i].id);\n\t\t\t\tfor (let j = 0; j < items.length; j++) {\n\t\t\t\t\tif (items[j].checked) {\n\t\t\t\t\t\tselectedID = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: selectedID,\n\n\t\t\t\t\tname: this.menuData[i].options[selectedID]\n\t\t\t\t};\n\t\t\t}\n\t\t\titems.push(addItem);\n\t\t}\n\n\t\tconst toReturn = {\n\t\t\tselected,\n\t\t\tcursor: this.cursor,\n\t\t\titems\n\t\t};\n\t\tif (this.sndChoose) this.sndChoose.play();\n\n\t\tthis.selectCallback(toReturn);\n\t}", "selectItem() {\n if (this.selectedItem !== this.item.Name) {\n const selectEvent = new CustomEvent(\"buttonclick\", {\n bubbles: true,\n detail: this.item\n });\n this.dispatchEvent(selectEvent);\n }\n }", "selectItemEvent(event) {\n\n var name = event.target.getAttribute('data-name')\n var boxid = event.target.getAttribute('id')\n var client = event.data.client\n var items = client.items\n var index = items.selected.indexOf(name);\n\n // If selected, we want to unselect it\n if ($(event.target).hasClass(client.selectedClass)) {\n $(event.target).removeClass(client.selectedClass);\n $(event.target).attr(\"style\", \"\");\n client.items.selected.splice(index, 1);\n\n // If unselected, we want to select it\n } else {\n $(event.target).attr(\"style\", \"background:\" + client.selectedColor);\n $(event.target).addClass(client.selectedClass);\n client.items.selected.push(name)\n }\n client.bingoCheck()\n }", "function itemSelected(key){\n childNodePath = key;\n let post = document.getElementById(key);\n console.log(\"clicked item key = \"+key);\n selecedItem.value = post.children[0].innerHTML;\n}", "function triggerItemSelected(item) {\n events.itemSelected.forEach(function (callback) {\n callback(item);\n });\n }", "function getItemContent($this){\n itemSelector = $this.data('open-target');\n itemContent = $('*[data-target=\"'+itemSelector+'\"]');\n }", "function clickItem()\n{\n\tvar item = this.item;\n\n\tif (null == item) item = this.parent.item\n\tif (null == item) item = this.parent.parent.item;\n\n\timage_list.toggleSelect(item.index);\n}", "function tagItem1(){\r\n var current = getCurrentEntry();\r\n var currentEntry = current.getElementsByTagName(\"entry-tagging-action-title\")[0];\r\n // var currentEntry = $(\"#current-entry .entry-actions\r\n // .entry-tagging-action-title\");\r\n simulateClick(currentEntry);\r\n }", "function selectItemsByPath(req, res, opts, onError){\n const paths = getWarehousePaths(opts, basepath)\n const itempath = paths.warehouse + paths.item\n const warehouse = client.connect(itempath)\n\n const selector = url.parse(req.url, true).query.selector\n res.setHeader('content-type', 'application/json')\n\n warehouse(selector)\n .ship(function(results){\n // filter out the node with the path because we are doing\n // a selector 'inside' it\n results = results.toJSON().filter(function(result){\n return [result._digger.path, result._digger.inode].join('/') != itempath\n })\n res.end(JSON.stringify(results))\n })\n .on('error', function(err){\n res.statusCode = 500\n res.end(err.toString())\n })\n }", "function SelectionUtil() {\n}", "function selectItem(e) {\n\n for (var i = 0; i < e.currentTarget.parentNode.children.length; i++) {\n e.currentTarget.parentNode.children[i].classList.remove(\"selected\");\n }\n\n e.currentTarget.classList.add(\"selected\");\n console.log($(e.currentTarget).children().eq(1).text());\n updateP1Moves($(e.currentTarget).children().eq(1).text());\n \n}", "function selectItem(itemId, itemName, target) {\n\tselectedItemId = itemId;\n\tselectedItemName = itemName;\n\tactualTarget = target;\n\tcalculationURL = calculationURLs[target];\n\t$(\"#estimateButton\").html('Estimate: ' + itemName);\n}", "function sel_items(txt, obj) {\n if (txt.length < 1) {\n $(`#${obj} .finder_list ul li`).css({ display: 'block' });\n } else {\n $(`#${obj} .finder_list ul li`).css({ display: 'none' });\n }\n\n $(`#${obj} .finder_list ul li`).each(function (index) {\n var cm = $(this).data('element').toUpperCase();\n\n cm = omitirAcentos(cm);\n var cr = cm.indexOf(txt);\n if (cr > -1) {\n // alert($(this).children().html())\n $(this).css({ display: 'block' });\n }\n });\n}", "function select_dropdown_item (item) {\n if(item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n\n item.addClass($(input).data(\"settings\").classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "function select_dropdown_item (item) {\n if(item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n\n item.addClass($(input).data(\"settings\").classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "function select_dropdown_item (item) {\n if(item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n\n item.addClass(settings.classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "function select_dropdown_item (item) {\n if(item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n\n item.addClass(settings.classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "function getShops(item){\n\t\t\n\t}", "function markingMenuOnSelect(selectedItem) {\r\n\ttracker.recordSelectedItem(selectedItem.name);\r\n\tdocument.getElementById(\"selectedItem\").innerHTML = selectedItem.name;\r\n}", "function select_dropdown_item (item) {\n if(selected_dropdown_item) {\n deselect_dropdown_item($(selected_dropdown_item));\n }\n if(item) {\n item.addClass($(input).data(\"settings\").classes.selectedDropdownItem);\n selected_dropdown_item = item.get(0);\n }\n }", "function selectMenuitem(evt) {\r\n\r\n var $this = $(this);\r\n\r\n var $element = $(evt.target);\r\n\r\n var container = $.radmenu.container;\r\n\r\n if (!$element.hasClass(container.itemClz))\r\n $element = $element.closest(\".\" + container.itemClz);\r\n\r\n var isInNested = $element.parents(\".\" + container.itemClz).length > 0;\r\n\r\n var index = $element.index();\r\n\r\n if (!isInNested)\r\n $this.parents(\".\" + container.clz).radmenu(index);\r\n\r\n else\r\n $this.radmenu(index);\r\n\r\n cancelBubble(evt);\r\n\r\n }", "selectSearchResultItem() {\n return this\n .waitForElementVisible('@searchResultItem')\n .click('@searchResultItem');\n }", "function button_Find()\n {\n var orderBy = \"CATENTRY.PARTNUMBER\";\n \n var itemPartNumber = cutspace(CONTENTS.ItemFindCriteriaFORM.itemPartNumber.value);\n var partNumberCaseSensitive = false;\n var partNumberLike = CONTENTS.ItemFindCriteriaFORM.partNumberLike.options[CONTENTS.ItemFindCriteriaFORM.partNumberLike.selectedIndex].value;\n\n \n var itemName = cutspace(CONTENTS.ItemFindCriteriaFORM.itemName.value);\n var nameCaseSensitive = false;\n var nameLike = CONTENTS.ItemFindCriteriaFORM.nameLike.options[CONTENTS.ItemFindCriteriaFORM.nameLike.selectedIndex].value;\n\n \n var itemShortDescription = cutspace(CONTENTS.ItemFindCriteriaFORM.itemShortDescription.value);\n var shortDescriptionCaseSensitive = false;\n var shortDescriptionLike = CONTENTS.ItemFindCriteriaFORM.shortDescriptionLike.options[CONTENTS.ItemFindCriteriaFORM.shortDescriptionLike.selectedIndex].value;\n \n var langid = CONTENTS.ItemFindCriteriaFORM.langid.value;\n var parentCategoryID = CONTENTS.ItemFindCriteriaFORM.parentCategoryID.value;\n if (parentCategoryID != \"\")\n \t parentCategoryID = strToInteger(parentCategoryID, langid);\n var parentProductID = CONTENTS.ItemFindCriteriaFORM.parentProductID.value;\n if (parentProductID != \"\")\n parentProductID = strToInteger(parentProductID, langid)\n \n if (CONTENTS.validatePanelData()) {\n var resultTitle = CONTENTS.getResultTitle();\n \n var startindex = 0;\n var listsize = 16;\n\n \n var aurl = \"/webapp/wcs/tools/servlet/DynamicListSCView\";\n\n var p = new Object();\n p[\"ActionXMLFile\"] = \"catalog.itemFindActions\";\n p[\"cmd\"] = \"ItemFindResults\";\n p[\"startindex\"] = startindex;\n p[\"listsize\"] = listsize;\n p[\"orderby\"] = orderBy;\n p[\"selected\"] = \"SELECTED\";\n p[\"refnum\"]=0;\n p[\"itemPartNumber\"] = itemPartNumber;\n p[\"partNumberCaseSensitive\"] = partNumberCaseSensitive;\n p[\"partNumberLike\"] = partNumberLike;\n p[\"itemName\"] = itemName;\n p[\"nameCaseSensitive\"] = nameCaseSensitive;\n p[\"nameLike\"] = nameLike;\n p[\"itemShortDescription\"] = itemShortDescription;\n p[\"shortDescriptionCaseSensitive\"] = shortDescriptionCaseSensitive;\n p[\"shortDescriptionLike\"] = shortDescriptionLike;\n p[\"parentCategoryID\"] = parentCategoryID;\n p[\"parentProductID\"] = parentProductID;\n \n\n top.setContent(resultTitle, aurl, true, p);\n \n }\n \n }", "repeaterOnAddItem() {\n }", "function custInj() {\n // do something with the selected element\n}", "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "get items() {\n if (!this.target) {\n return [];\n }\n var nodes = this.target !== this ? (this.itemsSelector ? \n this.target.querySelectorAll(this.itemsSelector) : \n this.target.children) : this.$.items.getDistributedNodes();\n return Array.prototype.filter.call(nodes, this.itemFilter);\n }", "function GetCurrentItem() {\n var MenuItem = \"Menu\";\n $(Container).children(\"ul\").find(\"a\").each(function () {\n if ($(this).attr(\"href\") == window.location) {\n MenuItem = $(this).children(\"p\").html();\n }\n });\n $(MenuButton).children(\"span.caption\").children(\"p.xtd_menu_ellipsis\").html(MenuItem);\n }", "function showItem(el, selector) {\n //console.info(el, selector);\n if (selector.charAt(0) === \".\") {\n selector = selector.substr(1);\n }\n $(el).removeClass(selector);\n }", "function setSelectedItem(item) {\n\twindow.selectedItem = item;\n\tif (selectedItem < 0) {\n\t\t\t\tselectedItem = 0;\n\t\t\t\t}\n\tif (selectedItem >= noofpagelinks) {\n\t\t\t\tselectedItem = noofpagelinks-1;\n\t\t\t\t}\n\tif(selectedItem<$midup)\n\t\t{\n\tcreateslide(0);\n\thighlightSelection(selectedItem); // to highlight page in first slide\n\t\t}\n\telse if(selectedItem>(noofpagelinks-$midup))\n\t\t{\n\tcreateslide(selectedItem-$midup); // to middle selection to index 2\t\n\thighlightSelection($slidelength-(noofpagelinks-selectedItem)); // to highlight page in last slide\n\t\t}\n\telse\n\t\t{\n\tcreateslide(selectedItem-$middown); // to middle selection to index 2\n\thighlightSelection($middown);\t\n\t\t}\n\t$('.totalpages').html((selectedItem+1)+\"&nbsp;of&nbsp;\"+noofpagelinks+\"&nbsp;pages\"); // display pages\n\t\n}", "function triggerItemChosen(item) {\n events.itemChosen.forEach(function (callback) {\n callback(item);\n });\n }", "function selectNode(event){\n item = $(event.toElement).closest('.literal-sequence, .literal, .capture-group, .charset, .digit, .non-digit, .word, .non-word, .white-space, .non-white-space, .start, .end, .space, .any-character, .word-boundary ');\n\n itemID = item.attr('id');\n }", "function get_data_for_items( items ) {\n\n\t/* Action */\n\n\tjQuery(document).trigger('get_data_for_items');\n\n\t/* Work */\n\n\t// Loop through each item\n\t$.each(items, function ( i, item ) {\n\n\n\t\t/* Debug */\n\n\t\tif( true === Buleys.debug ) {\n\t\t\tconsole.log(\"getting data for item\", item);\n\t\t}\n\n\t\t/* Work */\n\n\t\t// Calls get_item() using the item.link\n\t\tget_item(item.link);\n\n\t} );\n\n}", "function itemPage_elementsExtraJS() {\n // screen (itemPage) extra code\n /* menuItemList */\n listView = $(\"#itemPage_menuItemList\");\n theme = listView.attr(\"data-theme\");\n if (typeof theme !== 'undefined') {\n var themeClass = \"ui-btn-up-\" + theme;\n listItem = $(\"#itemPage_menuItemList .ui-li-static\");\n $.each(listItem, function(index, value) {\n $(this).addClass(themeClass);\n });\n }\n /* menuItem */\n }", "function selectDropDownItem(webPage, propertyName, propertyValue, count, exestatus) \n{\n if (equal(exestatus,true))\n {\n \n //Click the down arrow if the item is down the list\n //Temp solution\n //Scroll down till the element is visible for selection\n //var downArrow = webPage.NativeWebObject.Find(\"style\", \"OVERFLOW: auto; HEIGHT: 150px; WIDTH: 178px\");\n \n if(count < 5)\n {\n var element = webPage.FindChild(propertyName, propertyValue, 10);\n if(element.VisibleOnScreen)\n {\n element.Click();\n }\n }\n else\n {\n var panel; \n \n for(i=5; i<count; i++)\n {\n \n panel = Aliases.browser.pageOperationalReportReportViewe.formReportviewerform.panelDivdropdown.panel;\n panel.Click(166, 108); \n }\n panel.checkboxMroInIcu.ClickChecked(true);\n \n var element = webPage.FindChild(propertyName, propertyValue, 10);\n if(element.VisibleOnScreen)\n {\n element.Click();\n }\n }\n \n \n /*var element = webPage.FindChild(propertyName, propertyValue, 10);\n \n if(element.VisibleOnScreen)\n {\n element.Click();\n }\n else\n {\n //Scroll down till the element is visible for selection\n var downArrow = webPage.NativeWebObject.Find(\"style\", \"OVERFLOW: auto; HEIGHT: 150px; WIDTH: 178px\");\n \n do{\n if(downArrow.VisibleOnScreen)\n {\n downArrow.Click();\n }\n var element = webPage.FindChild(propertyName, propertyValue, 10);\n }\n while(element.VisibleOnScreen)\n element.Click();\n }*/\n \n }\n \n return exestatus;\n}", "function itemSelected (app) {\n const param = app.getSelectedOption();\n console.log('USER SELECTED: ' + param);\n if (!param) {\n app.ask('Sorry, was that?');\n } else if (param === SELECTION_KEY_INTERFACE) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here\\'s android interface')\n .addSimpleResponse('Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard..`)\n .setTitle('Android Interface')\n .addButton('Read more')\n .setImage('http://www.conceptdraw.com/solution-park/resource/images/solutions/android-user-interface/Software-development-Android-User-Interface-Design-Elements-Android-Tabs61.png', 'Android Interface')\n)\n);\n } else {\n app.ask('Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard. Now tell me if there\\'s anything else you want to know about Android. Maybe android version history or What is stack overflow.');\n}\n } else if (param === SELECTION_KEY_VIRTUAL) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. The platform is built into Android starting with Android Nougat, differentiating from standalone support for VR capabilities. The software is available for developers, and was released in 2016..`)\n .setTitle('Virtual reality')\n .addButton('Read more')\n .setImage('http://www.androidos.in/wp-content/uploads/2015/03/google-cardboard-1.jpg', 'Memory')\n)\n);\n } else {\n app.ask('At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. Now tell me if there\\'s anything else you want to know about Android. Maybe android history or Android Memory management');\n}\n } else if (param === SELECTION_KEY_APPLICATION) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Java may be combined with C/C++, together with a choice of non-default runtimes that allow better C++ support. The Go programming language is also supported, although with a limited set of application programming interfaces (API). In May 2017, Google announced support for Android app development in the Kotlin programming language..`)\n .setTitle('Android Application')\n .addButton('Read more')\n .setImage('http://cdn2.ubergizmo.com/wp-content/uploads/2015/03/Android-Applications.jpg', 'Application')\n)\n);\n } else {\n app.ask('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s anything else you want to know about Android. Maybe should need to know about Android kernel or What is stack overflow.');\n}\n } else if (param === SELECTION_KEY_MEMORY) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Since Android devices are usually battery-powered, Android is designed to manage processes to keep power consumption at a minimum. Now tell me if there\\'s something else that might you interested about Android?. Maybe android version history or what is android AOSP')\n .addBasicCard(app.buildBasicCard(`When an application is not in use the system suspends its operation so that, while available for immediate use rather than closed, it does not use battery power or CPU resources.[94][95] Android manages the applications stored in memory automatically: when memory is low, the system will begin invisibly and automatically closing inactive processes, starting with those that have been inactive for longest...`)\n .setTitle('Memory management')\n .addButton('Read more')\n .setImage('https://mobworld.files.wordpress.com/2010/07/processimage.jpg?w=500', 'Memory management')\n)\n);\n } else {\n app.ask('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s something else that might you interested about Android?. Maybe android version history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_GINGERBREAD) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Gingerbread\\'s user interface was refined in many ways, making it easier use, and more power-efficient. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`Gingerbread'\\s user interface was refined in many ways, making it easier to master, faster to use, and more power-efficient. A simplified color scheme with a black background gave vividness and contrast to the notification bar, menus, and other user interface components. Improvements in menus and settings resulted in easier navigation and system control.`)\n .setTitle('Gingerbread')\n .addButton('Read more')\n .setImage('https://www.technobuffalo.com/wp-content/uploads/2011/04/android-2-3-gingerbread.png', 'Gingerbread')\n)\n);\n } else {\n app.ask('Gingerbread\\'s user interface was refined in many ways, making it easier to use, and more power-efficient. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is Github ');\n}\n } else if (param === SELECTION_KEY_HONEYCOMB) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Honeycomb debuted with the Motorola Xoom in February 2011`)\n .setTitle('HoneyComb')\n .addButton('Read more')\n .setImage('https://i.amz.mshcdn.com/CencC65482MTabHzEy4F9EQqxrs=/356x205/2012%2F12%2F04%2Fe5%2Fintelpromis.bNW.jpg', 'HoneyComb')\n)\n);\n } else {\n app.ask('Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP ');\n}\n } else if (param === SELECTION_KEY_ICE_CREAM) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Ice Cream Sandwich\" is a codename for the Android mobile operating system developed by Google, that is no longer supported. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`The Ice Cream Sandwich release also introduced a number of other new features, including a refreshed home screen, near-field communication (NFC) support and the ability to \"beam\" content to another user using the technology, an updated web browser, a new contacts manager with social network integration, the ability to access the camera and control music playback from the lock screen, visual voicemail support, face recognition for device unlocking (\"Face Unlock\"), the ability to monitor and limit mobile data usage, and other internal improvements.`)\n .setTitle('Ice Cream Sandwich')\n .addButton('Read more')\n .setImage('http://cache.gawkerassets.com/assets/images/17/2011/05/icecreamsandwich.jpg', 'Ice Cream Sandwich')\n)\n);\n } else {\n app.ask('Android \"Ice Cream Sandwich\" is a codename for the Android mobile operating system developed by Google, that is no longer supported. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android features');\n}\n } else if (param === SELECTION_KEY_JELLBEAN) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Jelly Bean\" is the codename given to three major point releases of the Android mobile operating system developed by Google, spanning versions between 4.1 and 4.3.1, that are no longer supported. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('The first of these three, 4.1, was unveiled at Google\\'s I/O developer conference in June 2012, focusing on performance improvements designed to give the operating system a smoother and more responsive feel, improvements to the notification system allowing for \"expandable\" notifications with action buttons, and other internal changes. Two more releases were made under the Jelly Bean name in October 2012 and July 2013 respectively, including 4.2—which included further optimizations, multi-user support for tablets, lock screen widgets, quick settings, and screen savers, and 4.3—contained further improvements and updates to the underlying Android platform.')\n .setTitle('Jelly Bean')\n .addButton('Read more')\n .setImage('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcShdeTjcbZyQNNYfJodHgvpAMSFlPBFf63nne9oxdR4E1TOsazC', 'JellyBean')\n)\n);\n } else {\n app.ask('Android \"Jelly Bean\" is the codename given to three major point releases of the Android mobile operating system developed by Google, spanning versions between 4.1 and 4.3.1, that are no longer supported. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android Kernel ');\n}\n } else if (param === SELECTION_KEY_KITKAT) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Unveiled on September 3, 2013, KitKat focused primarily on optimizing the operating system for improved performance on entry-level devices with limited resources. Each Android OS has a title referring to a sweet treat.')\n .setTitle('Kitkat')\n .addButton('Read more')\n .setImage('http://d2rormqr1qwzpz.cloudfront.net/photos/2013/11/01/54929-jpeg.jpg', 'Kitkat')\n)\n);\n } else {\n app.ask('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_LOLLIPOP) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Lollipop\" is a codename for the Android mobile operating system developed by Google, spanning versions between 5.0 and 5.1.1, that is supported with security patches only. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Gingerbread\\'s user interface was refined in many ways, making it easier to master, faster to use, and more power-efficient. A simplified color scheme with a black background gave vividness and contrast to the notification bar, menus, and other user interface components. Improvements in menus and settings resulted in easier navigation and system control.')\n .setTitle('Lollipop')\n .addButton('Read more')\n .setImage('https://www.technobuffalo.com/wp-content/uploads/2011/04/android-2-3-gingerbread.png', 'Lollipop')\n)\n);\n } else {\n app.ask('Android \"Lollipop\" is a codename for the Android mobile operating system developed by Google, spanning versions between 5.0 and 5.1.1, that is supported with security patches only. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_MARSHMALLOW) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Marshmallow\" (codenamed Android M during development) is the sixth major version of the Android operating system. First released as a beta build on May 28, 2015, it was officially released on October 5, 2015, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android.?')\n .addBasicCard(app.buildBasicCard('Marshmallow primarily focuses on improving the overall user experience of its predecessor, Lollipop. It introduced a new permissions architecture, new APIs for contextual assistants (first used by a new feature \"Now on Tap\" to provide context-sensitive search results), a new power management system that reduces background activity when a device is not being physically handled, native support for fingerprint recognition and USB Type-C connectors, the ability to migrate data and applications to a microSD card, and other internal changes.')\n .setTitle('Marshmallow')\n .addButton('Read more')\n .setImage('https://www.androidcentral.com/sites/androidcentral.com/files/styles/w400h225crop/public/article_images/2015/12/android-marshmallow-4_0.jpg?itok=GsKySY9O&timestamp=1449673415', 'Marshmallow')\n)\n);\n } else {\n app.ask('Android \"Marshmallow\" (codenamed Android M during development) is the sixth major version of the Android operating system. First released as a beta build on May 28, 2015, it was officially released on October 5, 2015, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_NOUGAT) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Nougat\" (codenamed Android N during development) is the seventh major version of the Android operating system. First released as an alpha test version on March 9, 2016, it was officially released on August 22, 2016, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Nougat introduces notable changes to the operating system and its development platform, including the ability to display multiple apps on-screen at once in a split-screen view, support for inline replies to notifications, and an expanded \"Doze\" power-saving mode that restricts device functionality once the screen has been off for a period of time. Additionally, the platform switched to an OpenJDK-based Java environment and received support for the Vulkan graphics rendering API, and \"seamless\" system updates on supported devices.')\n .setTitle('Nougat')\n .addButton('Read more')\n .setImage('https://9to5google.files.wordpress.com/2016/07/nougat.jpg?quality=82&strip=all&w=1000', 'Nougat')\n)\n);\n } else {\n app.ask('Android \"Nougat\" (codenamed Android N during development) is the seventh major version of the Android operating system. First released as an alpha test version on March 9, 2016, it was officially released on August 22, 2016, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_O) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API. Now tell me if there\\'s something else that might you interested about Android?.')\n .addBasicCard(app.buildBasicCard('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API')\n .setTitle('Android O')\n .addButton('Read more')\n .setImage('https://www1-lw.xda-cdn.com/files/2017/03/android-o-logo1.png', 'Android O')\n)\n);\n } else {\n app.ask('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API. Now tell me if there\\'s something else that might you interested about Android?. Maybe android history or what is android AOSP');\n}\n } else {\n app.ask('Sorry but You selected an unknown item');\n } \n}", "function makeSoundListSelector() {\n\t\t\tvar i;\n\t\t\tvar currOptionName;\n\n\n\t\t\t//$.getJSON(\"soundList/TestModelDescriptors\", function(data){\n\t\t\t$.getJSON(soundServer+\"soundList/ModelDescriptors\", function(data){\n\n\t\t\tsoundList = data.jsonItems;\n\t\t\t//console.log(\"Yip! sound list is \" + soundList);\n\t\t\tsoundSelectorElem.options.length=0;\n\t\t\tsoundSelectorElem.add(new Option('Choose Sound'));\n\t\t\tfor (i = 0; i < soundList.length; i += 1) {\n\t\t\t\tcurrOptionName = soundList[i].displayName || \"\";\n\t\t\t\t\t//Add option to end of list\n\t\t\t\t\tsoundSelectorElem.add(new Option(currOptionName));\n\t\t\t\t}\n\t\t\t\tsoundSelectorElem.options[0].selected=\"true\";\n\t\t\t});\n\t\t}", "function scrollActiveItem() {\n var item = $('.ds-nav-lu-results-activeitem');\n var container = $('.ds-nav-lu-results');\n var activeItem = $(idDivLookupItemsJQ + \" .ds-nav-lu-results-activeitem\");\n\n if (activeItem.length > 0)\n scrollSelectedItem(item, container);\n }", "function selectitems(product){\n\t\telement.all(by.tagName(\"app-card\")).each(function(item){\n\n\t\t\titem.element(by.css(\"h4 a\")).getText().then(function(text){\n\n\t\t\t\tif(text==product){\n\n\t\t\t\t\t//click on add button\n\t\t\t\t\titem.element(By.css(\"button[class*='btn-info']\")).click();\n\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\n\t}", "function treeItemStandardCommonClick(sender, args) {\n // Need to get the text that should appear on item based on selection, and call the update service to set standard\n var comboBox = $hidden_dropdown;\n var node = args.get_node();\n\n var text = node.get_attributes().getAttribute(\"ButtonText\");\n var newValue = node.get_value();\n\n if (newValue == -1) {\n customDialog({ title: \"Invalid Selection\", maximize: true, maxwidth: 300, maxheight: 100, dialog_style: \"alert\", content: \"A standard set cannot be selected.<br/><br/>\" }, [{ title: \"Ok\" }]);\n return;\n }\n //var text = node.get_text();\n comboBox.set_text(text);\n\n //comboBox.trackChanges();\n comboBox.get_items().getItem(0).set_text(text);\n //comboBox.commitChanges();\n\n //comboBox.hideDropDown();\n assessmentitem_changeField($hidden_dropdown, \"StandardID\", newValue);\n //comboBox.attachDropDown();\n}", "function listSelector(event) {\n // highlight selected cat's name in dropdown list\n highlightList(event);\n // set selected cat's name in header\n setName(event);\n // hide drop-down list after selection\n hideList();\n}", "function setItems(){\n\n if (document.getElementsByName(\"items\")[0].selectedIndex == 0) {\n setItem('ITEM', 'BUILDING');\n }\n else \n if (document.getElementsByName(\"items\")[0].selectedIndex == 1) {\n setItem('ITEM', 'STRUCTURE');\n }\n else \n if (document.getElementsByName(\"items\")[0].selectedIndex == 2) {\n setItem('ITEM', 'LAND');\n }\n else \n if (document.getElementsByName(\"items\")[0].selectedIndex == 3) {\n setItem('LEASE', 'BUILDING');\n }\n else \n if (document.getElementsByName(\"items\")[0].selectedIndex == 4) {\n setItem('LEASE', 'PROPERTY');\n }\n \n}", "get items() {\n return this.getAllElements('item');\n }", "function getObjSelectedItems(){\r\n\t\tvar objItems = g_objWrapper.find(\".uc-filelist-item-selected\");\r\n\t\treturn(objItems);\r\n\t}", "function NavBar_Item_Click(event)\n{\n\t//get html\n\tvar html = Browser_GetEventSourceElement(event);\n\t//this a sub component?\n\tif (html.Style_Parent)\n\t{\n\t\t//use the parent\n\t\thtml = html.Style_Parent;\n\t}\n\t//valid?\n\tif (html && html.Action_Parent && !html.IsSelected || __DESIGNER_CONTROLLER)\n\t{\n\t\t//get the data\n\t\tvar data = [\"\" + html.Action_Index];\n\t\t//trigger the event\n\t\tvar result = __SIMULATOR.ProcessEvent(new Event_Event(html.Action_Parent, __NEMESIS_EVENT_SELECT, data));\n\t\t//not blocking it?\n\t\tif (!result.Block)\n\t\t{\n\t\t\t//not an action?\n\t\t\tif (!result.AdvanceToStateId)\n\t\t\t{\n\t\t\t\t//notify that we have changed data\n\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_USER_DATA, Name: html.Action_Parent.GetDesignerName(), Data: data });\n\t\t\t}\n\t\t\t//update selection\n\t\t\thtml.Action_Parent.Properties[__NEMESIS_PROPERTY_SELECTION] = html.Action_Index;\n\t\t\t//and update its state\n\t\t\tNavBar_UpdateSelection(html.Action_Parent.HTML, html.Action_Parent);\n\t\t}\n\t}\n}", "onSelectedChanged_() {\n const selector = /** @type {!IronSelectorElement} */ (this.$.selector);\n if (selector.selected === undefined) {\n return;\n }\n\n const selectedIndex = /** @type {number} */ (selector.selected);\n if (selectedIndex === 0 || selectedIndex === this.items.length - 1) {\n if (this.items.length > this.viewportItemCount_()) {\n this.getDomItem_(selectedIndex).scrollIntoView({behavior: 'smooth'});\n }\n } else {\n const previousItem = this.getDomItem_(selector.selected - 1);\n if (previousItem.offsetTop < this.scrollTop) {\n previousItem.scrollIntoView({behavior: 'smooth', block: 'nearest'});\n return;\n }\n\n const nextItemIndex = /** @type {number} */ (selector.selected) + 1;\n if (nextItemIndex < this.items.length) {\n this.ensureDomItemAvailable_(nextItemIndex);\n\n const nextItem = this.getDomItem_(nextItemIndex);\n if (nextItem.offsetTop + nextItem.offsetHeight >\n this.scrollTop + this.offsetHeight) {\n nextItem.scrollIntoView({behavior: 'smooth', block: 'nearest'});\n }\n }\n }\n }", "function getItems()\r\n{\r\n\t//Declaring the local variables\r\n\tvar itemFilters = new Array();\r\n\tvar itemTypes = new Array();\t\t//version 1.0.1\r\n\r\n\ttry\r\n\t{\r\n\t\t//version 1.0.1\r\n\t\titemTypes[0] = 'InvtPart';\r\n\t\titemTypes[1] = 'Kit';\r\n\t\titemTypes[2] = 'NonInvtPart';\r\n\t\titemTypes[3] = 'OthCharge';\r\n\t\titemTypes[4] = 'Payment';\r\n\r\n\r\n\t\t//Adding filters \r\n\t\titemFilters[0] = new nlobjSearchFilter('isinactive',null, 'is','F');\t\t\t\t\t\t\t\t\t\t//filtering by active Items\r\n\t\titemFilters[1] = new nlobjSearchFilter('custitem_itemprice_lastupdated',null, 'notonorafter',dateLimit);\t//filtering by date limit\r\n\t\titemFilters[2] = new nlobjSearchFilter('type',null, 'anyof',itemTypes);\t\t\t\t\t\t\t\t\t\t//filtering by item type\tversion 1.0.1\r\n\r\n\t\t//Getting particular columns in item search results \r\n\t\titemColumns[0] = new nlobjSearchColumn('internalid');\t\t\t\t\t\t//Getting Item's Internal ID\r\n\t\titemColumns[1] = new nlobjSearchColumn('baseprice');\t\t\t\t\t\t//Getting Item's base price\r\n\t\titemColumns[2] = new nlobjSearchColumn('name');\t\t\t\t\t\t\t\t//Getting Item's name\r\n\t\titemColumns[3] = new nlobjSearchColumn('averagecost');\t\t\t\t\t\t//getting the average cost of the item\r\n\t\titemColumns[4] = new nlobjSearchColumn('custitem_volumetricweight');\t\t//getting volumetric weight\r\n\t\titemColumns[5] = new nlobjSearchColumn('custitem_kitpackavgcost');\t\t\t//getting average cost of the kit/pacckage\r\n\t\titemColumns[6] = new nlobjSearchColumn('custitem_dimension1');\t\t\t\t//getting Item's dimension1\r\n\t\titemColumns[7] = new nlobjSearchColumn('custitem_dimension2');\t\t\t\t//getting Item's dimension2\r\n\t\titemColumns[8] = new nlobjSearchColumn('custitem_dimension3');\t\t\t\t//getting Item's dimension3\r\n\r\n\t\t//Searching the items using filters and columns \r\n\t\titemRecords = nlapiSearchRecord('item', null, itemFilters, itemColumns);\t\t\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"getItems : \" , e);\r\n\t} \r\n}", "_onItemSelect(item) {\n // handle action to render the new page!\n\n Actions.editdetails({text: item});\n }", "function nlobjSelectOption() {\n}", "_pageDownKeyHandler(items) {\n const that = this;\n\n if (items.length === 0) {\n return;\n }\n\n let selectedItem = that._items[that.selectedIndexes[that.selectedIndexes.length - 1]];\n if (that.selectionMode === 'checkBox' || that.selectionMode === 'radioButton' || that.selectionMode === 'zeroOrMany' ||\n that.selectionMode === 'oneOrMany' || that.selectionMode === 'zeroOrOne') {\n if (that._focusedItem) {\n selectedItem = that._focusedItem;\n }\n }\n\n let item;\n const selectedItemIndex = that._indexOf(selectedItem);\n let viewTop = selectedItem.top + that.$.itemsContainer.offsetHeight - selectedItem.height;\n\n for (let i = selectedItemIndex; i < items.length; i++) {\n if (items[i].top >= viewTop) {\n item = items[i];\n break;\n }\n }\n\n if (!item) {\n item = items[items.length - 1];\n }\n\n if (that.selectionMode === 'checkBox' || that.selectionMode === 'radioButton' || that.selectionMode === 'zeroOrMany'\n || that.selectionMode === 'oneOrMany' || that.selectionMode === 'zeroOrOne') {\n that._focus(item);\n }\n else {\n if (!item.selected) {\n if (!that._keysPressed['Shift']) {\n that.clearSelection();\n }\n that.select(item);\n that._focus(item);\n }\n }\n\n if (item.height + item.top > that.$.itemsContainer.scrollTop + that.$.itemsContainer.offsetHeight ||\n item.top < that.$.itemsContainer.scrollTop) {\n that.scrollTop = item.top - that.$.itemsContainer.offsetHeight + item.height;\n }\n }", "function TagMenu_applyServerBehavior(sbObj, paramObj) {\r\n var tagNode = this.listControl.getValue();\r\n paramObj[this.paramName] = tagNode;\r\n \r\n //set the selection property, so that fixUpSelection is not called again\r\n if (typeof tagNode == \"string\" && tagNode.indexOf(\"createAtSelection\") != -1) {\r\n paramObj.MM_selection = tagNode.substring(tagNode.indexOf(\"+\"));\r\n }\r\n \r\n return \"\";\r\n}", "onSelectedChanged_() {\n const selector = /** @type {!IronSelectorElement} */ (this.$.selector);\n if (selector.selected === undefined) {\n return;\n }\n\n const selectedIndex = /** @type{number} */ (selector.selected);\n if (selectedIndex === 0 || selectedIndex === this.items.length - 1) {\n /** @type {!Element} */ (selector.selectedItem).scrollIntoView({\n behavior: 'smooth'\n });\n } else {\n // If the following DOM item to the currently selected item has not yet\n // been rendered, ensure it is by waiting for the next render frame\n // before we scroll it into the view.\n if (!this.isDomItemAtIndexAvailable_(selectedIndex + 1)) {\n this.ensureDomItemsAvailableStartingAt_(selectedIndex + 1);\n\n afterNextRender(this, this.onSelectedChanged_);\n return;\n }\n\n const previousItem = selector.items[selector.selected - 1];\n if (previousItem.offsetTop < this.$.container.scrollTop) {\n /** @type {!Element} */ (previousItem)\n .scrollIntoView({behavior: 'smooth', block: 'nearest'});\n return;\n }\n\n const nextItem =\n selector.items[/** @type {number} */ (selector.selected) + 1];\n if (nextItem.offsetTop + nextItem.offsetHeight >\n this.$.container.scrollTop + this.offsetHeight) {\n /** @type {!Element} */ (nextItem).scrollIntoView(\n {behavior: 'smooth', block: 'nearest'});\n }\n }\n }", "function MenuSelectItem(item, classUnselectedMenu, classSelectedMenu) {\r\n\r\n\t//remove class from all menu\r\n\tfor( var i=0; i<MENU_ITEMS.length;i++) {\r\n\t\tif (MENU_ITEMS[i].tagName.toLowerCase() == \"div\") \tMENU_ITEMS[i].className=classUnselectedMenu;\r\n\t\tif (MENU_ITEMS[i].tagName.toLowerCase() == \"tr\") {\r\n\t\t\tfor (var k=0; k<MENU_ITEMS[i].childNodes.length; k++) MENU_ITEMS[i].childNodes[k].className=classUnselectedMenu;\r\n\t\t}\r\n\t}\r\n\t//...and add it to the new one\r\n\tif (item.tagName.toLowerCase() == \"div\") item.className=classSelectedMenu;\r\n\tif (item.tagName.toLowerCase() == \"tr\") for (var k=0; k<item.childNodes.length; k++) item.childNodes[k].className=classSelectedMenu;\r\n\t//MenuSetPosition(item);\r\n}", "function _selectResult(item) {\n\n \n\n itemUrl = item.data(\"url\");\n\n \n\n window.location = itemUrl;\n\n \n\n }", "[symbols.itemSelected](item, selected) {\n if (super[symbols.itemSelected]) { super[symbols.itemSelected](item, selected); }\n item.classList.toggle('selected', selected);\n }", "function showInventory() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.table(results);\n selectItem();\n })\n}", "function getMenuItem(item) {\n console.log(item);\n // setMenuItem(item);\n }", "function initRmaItemSelector() {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#order-return-form table thead input[type=checkbox]').on('click', function () {\n var checked = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).prop('checked');\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()('#order-return-form table tbody input[type=checkbox]').each(function (_, checkbox) {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(checkbox).prop('checked', checked);\n });\n });\n}", "function updateImages(itemId){ //dynamically update image drop down with images from directory\n $.get({\n url: `/images/${itemId}`, //this route will return information about the items\n })\n .then(function(results){ //the results includes all item details\n $(results).each(function(){\n //update the selection box with the name of the item and its value as the item id\n $('#primaryImageSelections').append(\n `<option value=${this}>${this}</option>`\n )\n });\n $('select').material_select();\n displayImages(itemId); //this will add the image below the dropdown to ensure correct choice\n });\n}", "function item_info(item) {\n return parent.G.items[item.name];\n}", "function selectItem(num){\n if (inventstage.split(\"_\")[0] !== \"toolbelt\") {\n if (num == 0) { selected = slot1.textContent.split(\":\")[0] }\n if (num == 1) { selected = slot2.textContent.split(\":\")[0] }\n if (num == 2) { selected = slot3.textContent.split(\":\")[0] }\n console.log(\"Selected: \" + selected);\n updateInvent(null, null, true, true);\n }\n else if (!combatActive[0])\n {\n if (num == 0) {selected = slot1.textContent.split(\":\")[0]}\n if (num == 1) {selected = slot2.textContent.split(\":\")[0]}\n if (num == 2) {selected = slot3.textContent.split(\":\")[0]}\n for(itemlist in toolbelt){\n //console.log(itemlist);\n for(i = 0; i < toolbelt[itemlist].length; i++)\n {\n //console.log(item);\n if (selected === toolbelt[itemlist][i].name) {\n if (money >= toolbelt[itemlist][i].cost[0] && toolbelt[itemlist][i].level > 0) {\n if(toolbelt[itemlist][i].level < entities[\"player\"][\"xp\"][\"level\"]){\n money -= toolbelt[itemlist][i].cost[0];\n toolbelt[itemlist][i].cost[0] += toolbelt[itemlist][i].cost[1];\n if (inventstage.split(\"_\")[1] === \"weapons\") {\n //console.log(toolbelt[itemlist][i].speed[0]);\n //console.log(toolbelt[itemlist][i].speed[1]);\n //console.log(toolbelt[itemlist][i].speed[0] + toolbelt[itemlist][i].speed[1]);\n toolbelt[itemlist][i].speed[0] += toolbelt[itemlist][i].speed[1];\n //Now that's a lota daamage!!\n toolbelt[itemlist][i].damage[0] += toolbelt[itemlist][i].damage[1];\n if(i==1){\n toolbelt[itemlist][i].maCost[0] += toolbelt[itemlist][i].maCost[1];\n }\n }\n if (inventstage.split(\"_\")[1] === \"tools\") {\n toolbelt[itemlist][i].efficiency[0] += toolbelt[itemlist][i].efficiency[1];\n }\n if (inventstage.split(\"_\")[1] === \"apparel\") {\n toolbelt[itemlist][i].ac[0] += toolbelt[itemlist][i].ac[1];\n }\n toolbelt[itemlist][i].level += 1;\n console.log(\"Upgraded: \" + selected);\n\n equipped = [\"\", \"\"];\n updateInvent(null, null, true, true);\n } else{\n desc.textContent = \"You need to level up to upgrade \"+selected;\n }\n\n }\n else\n {\n desc.textContent = \"Not enough funds to upgrade \"+selected;\n }\n }\n\n }\n }\n }\n else\n {\n if (num == 0) {selected = slot1.textContent.split(\":\")[0]} if (num == 1) {selected = slot2.textContent.split(\":\")[0]} if (num == 2) {selected = slot3.textContent.split(\":\")[0]}\n if (inventstage.split(\"_\")[1] === \"weapons\") {\n for (i in toolbelt.weapons)\n {\n if (toolbelt.weapons[i].name === selected)\n {\n if (toolbelt.weapons[i].wc === \"w\" && toolbelt.weapons[i].level > 0) {\n let equip = toolbelt.weapons[i];\n toolbelt.weapons.splice(i, 1);\n toolbelt.weapons.splice(0, 0, equip);\n }\n if (toolbelt.weapons[i].wc === \"s\" && toolbelt.weapons[i].level > 0) {\n let equip = toolbelt.weapons[i];\n toolbelt.weapons.splice(i, 1);\n toolbelt.weapons.splice(1, 0, equip);\n }\n }\n }\n }\n if (inventstage.split(\"_\")[1] === \"apparel\") {\n for (i in toolbelt.apparel) {\n if (toolbelt.apparel[i].name === selected) {\n if (toolbelt.apparel[i].level > 0)\n {\n let equip = toolbelt.weapons[i];\n toolbelt.weapons.splice(i, 1);\n toolbelt.weapons.splice(0, 0, equip);\n }\n }\n }\n }\n entities.player.armor = toolbelt.apparel[0];\n entities.player.weapon = toolbelt.weapons[0];\n entities.player.spell = toolbelt.weapons[1];\n updateInvent(null);\n }\n}", "function uomLabelItem_onSelected(page){\n page.children.flexLayout1.children.textFlex.children.flexLayout4.children.uomLabel.text = returnValue3;\n}", "function select(item){\r\n alert(item.text+\",\"+item.value);\r\n}", "getItem(...selects) {\r\n const q = this.listItemAllFields;\r\n return q.select.apply(q, selects).get().then((d) => {\r\n return extend((new Item(odataUrlFrom(d))).configureFrom(this), d);\r\n });\r\n }", "_findSelectors() {\n this._container = document.querySelector(this._settings.targetSelector);\n this._items = Array.from(\n document.querySelectorAll(`.${this._container.firstElementChild.className}`)\n );\n this._relatedSliders = this._settings.relatedSlidersSelectors\n .map(selector => document.querySelector(selector));\n this._leftControl = document.querySelector(this._settings.leftSelector);\n this._rightControl = document.querySelector(this._settings.rightSelector);\n }", "function UISelection(){\n\n }", "function PROC(item) {\n if (host.indexOf(item.host) !== -1) {\n item.fn();\n }\n }", "get itemsInSelection() {\n return this._itemsInSelection;\n }", "handlePanelItemSelection(View3dShowImage, View3dImageUrl, SelItem){\n this.updateDress(SelItem);\n if(SelItem == null || SelItem.itemData.modelUrl == \"\"){ \n this.setState({\n showImage: View3dShowImage,\n imageUrl: View3dImageUrl\n });\n }\n }", "function selectAddOn(name, effect, rarity, tooltip, icon, combinesWith, itarget) {\n var addOn = new DbDItem(name, effect, rarity, tooltip, icon, combinesWith, itarget);\n addOn.combinesWith = combinesWith;\n addOn.target = itarget;\n addOn.isSelected = false;\n addOn.type = combinesWith;\n return addOn;\n}", "function lootSelect (loot, Character){\n\nvar items = loot[1];\nvar itemsRare = loot[2];\n\n\tCharacter.goldAdd(loot[0]);\n\n\twhile (items > 0, items --){\n\t\t// define itemSelector -- somehting to randomly select items from a matrix and return them by name\n\t\tCharacter.inventoryAdd(itemSelector(items));\n\t}\n\n\twhile (itemsRare > 0, itemsRare --){\n\t\t// define itemSelector -- somehting to randomly select items from a matrix and return them by name\n\t\tCharacter.inventoryAdd(itemSelector(itemsRare));\n\t}\n}", "function OnProjectBrowserScript()\r\n{\r\n\tRepository.EnsureOutputVisible( \"Script\" );\r\n\t\r\n\t// Get the type of element selected in the Project Browser\r\n\tvar treeSelectedType = Repository.GetTreeSelectedItemType();\r\n\t\r\n\tswitch ( treeSelectedType )\r\n\t{\r\n//\t\t// this script operates on a diagram selected in the project browser.\r\n\t\tcase otDiagram :\r\n\t\t{\r\n\t\t\t// Code for when a diagram is selected\r\n\t\t\tSession.Output('Starting Remove connector Script');\r\n\t\t\tvar theDiagram as EA.Diagram;\r\n\t\t\ttheDiagram = Repository.GetTreeSelectedObject();\r\n\t\t\tremoveDiagramLinks(theDiagram);\r\n\t\t\tSession.Output('Finished Remove connector Script');\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tdefault:\r\n\t\t{\r\n\t\t\t// Error message\r\n\t\t\tSession.Prompt( \"This script does not support items of this type.\", promptOK );\r\n\t\t}\r\n\t}\r\n}", "function bwClick(itemId) {\n $(itemId).click();\n}" ]
[ "0.64251363", "0.6165957", "0.61287576", "0.59687084", "0.590061", "0.5897274", "0.58856964", "0.5870555", "0.5834007", "0.58337814", "0.58101183", "0.5810001", "0.58005357", "0.5791584", "0.5781253", "0.5728514", "0.568956", "0.5678085", "0.56746966", "0.56713194", "0.56643564", "0.5661865", "0.5656861", "0.5654354", "0.5640329", "0.5625543", "0.56107914", "0.5581789", "0.55675465", "0.5566829", "0.55500674", "0.5547105", "0.55015284", "0.54784316", "0.5465628", "0.5460503", "0.54515696", "0.54503995", "0.5431049", "0.5431049", "0.5426035", "0.5426035", "0.5405499", "0.5405381", "0.54020643", "0.54003334", "0.5386861", "0.53845143", "0.53818196", "0.5375543", "0.5359189", "0.5359189", "0.5359189", "0.5354775", "0.5335716", "0.5335611", "0.5333476", "0.53267914", "0.53245884", "0.53223425", "0.53201", "0.53179914", "0.53150946", "0.5297657", "0.5291244", "0.5286794", "0.5275034", "0.5270806", "0.52651453", "0.52464706", "0.52435446", "0.52386963", "0.52195704", "0.5216331", "0.52134496", "0.5210053", "0.5209021", "0.5204955", "0.52036595", "0.52001715", "0.5198434", "0.51980597", "0.5191785", "0.5185464", "0.5180524", "0.5166634", "0.51651347", "0.5163848", "0.5163613", "0.5163531", "0.51599866", "0.5158375", "0.5155852", "0.5154117", "0.51472104", "0.51464283", "0.5145575", "0.5142443", "0.51415837", "0.5139136" ]
0.6121593
3
getParams Get the parameter information
function getParams(request, response) { try { custBrandParam = request.getParameter('custparam_brand'); customer = request.getParameter('custparam_cust'); //Set errorDisplay display errorDisplay = 'hidden'; } catch (e) { errorHandler('checkCustomerBrand', e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParams() {\n return util.copyObject(currentState.params);\n }", "getParams() {\n\t\tlet params = \"?\";\n\t\tparams += \"&key=\" + this.config.apiKey;\n\t\tparams += \"&locatie=\" + this.config.lat + \",\" + this.config.lon;\n\n\t\treturn params;\n\t}", "getParams() {\n const params = {};\n // Get the values for each parameter\n for (let param of this.operation.params) {\n let id = param.id\n params[id] = document.getElementById(id).value;\n }\n return params;\n }", "function _getParams(funcParamObj, onExecuteComplete) {\r\n\r\n /** default object content of an operation */\r\n var httpRequest = funcParamObj.request;\r\n var httpResponse = funcParamObj.response;\r\n var data = funcParamObj.payload;\r\n\r\n // init data\r\n if (!data) {\r\n data = {}\r\n }\r\n\r\n // skip operation if coming from socket - no httprequest\r\n if (!funcParamObj.io) {\r\n\r\n // req body\r\n var keys = Object.keys(httpRequest.body);\r\n for (var iterator in keys) {\r\n _getValue(data, keys[iterator], httpRequest.body, httpResponse);\r\n }\r\n\r\n // req params\r\n keys = Object.keys(httpRequest.params);\r\n for (var iterator in keys) {\r\n _getValue(data, keys[iterator], httpRequest.params, httpResponse);\r\n }\r\n\r\n // req query\r\n keys = Object.keys(httpRequest.query);\r\n for (var iterator in keys) {\r\n _getValue(data, keys[iterator], httpRequest.query, httpResponse);\r\n }\r\n\r\n //replace \"[xx,yy]\" string with array\r\n keys = Object.keys(data);\r\n for (var iterator in keys) {\r\n var key = keys[iterator];\r\n var value = data[key];\r\n if (value && value.indexOf && value.indexOf('[') == 0 && value.indexOf(']') == (value.length - 1)) {\r\n value = value.substring(1, (value.length - 1));\r\n value = value.split(',');\r\n data[key] = value;\r\n }\r\n }\r\n\r\n //debug purpose\r\n if (process.env.PRINT_REQUEST_PARAM) {\r\n console.log(MODULE_NAME + ': PRINT_REQUEST_PARAM [' + JSON.stringify(data) + ']');\r\n }\r\n\r\n //get rawbody\r\n if (httpRequest.rawBody) {\r\n //data.rawBody = httpRequest.rawBody.toString('binary');\r\n data.rawBody = httpRequest.rawBody;\r\n }\r\n }\r\n\r\n\r\n /** callback with funcParamObj updated - maybe */\r\n funcParamObj.payload = data;\r\n onExecuteComplete(null, funcParamObj);\r\n}", "getParameters() {\n\t\treturn this.paramDefs.map((param) => param.name);\n\t}", "function getParams() {\n if (!window.frameElement.hasAttribute('data-params')) {\n return;\n }\n params = JSON.parse(decodeURIComponent(window.frameElement.getAttribute('data-params')));\n }", "getParams() {\n let validator = new Validator();\n let param = {};\n let msg = '';\n\n //email\n let email = this.state.email;\n if (validator.isEmpty(email) && validator.isValidEmail(email)) {\n param['email'] = email;\n }\n else {\n msg = msg + '\\n- ' + AlertConstants.MESSAGE.VALIDATION_ERROR_EMAIL;\n }\n\n //Password\n let password = this.state.password;\n if (validator.isEmpty(password)) {\n param['password'] = password;\n }\n else {\n msg = msg + '\\n- ' + AlertConstants.MESSAGE.VALIDATION_ERROR_PASSWORD;\n }\n\n if (msg.length > 0) {\n //show error\n AlertUtils.showOkAlert(AlertConstants.TITLE.VALIDATION_ERROR, msg);\n return null;\n }\n\n return param;\n }", "function params() {\n return (modal.params || {});\n }", "function getParameters() {\n let filtersParameter = filters.val() === '' ? '' : 'filters=' + filters.val();\n\n // let parameters = '?' + filtersParameter;\n return parameters= '?' + filtersParameter;\n }", "function getParameters(){\n\tvar url = document.URL;\n\tvar vett = url.split('?');\n\tvar rawParameters = vett[1]; // contiene tutti i parametri get separati dal carattere '&'\n\tif(rawParameters == null){\n\t\treturn null;\n\t}\n\tvar rawParametersCouples = rawParameters.split('&');\n\tvar parameters = new Array();\n\tfor(var i=0;i<rawParametersCouples.length; i++){\n\t\tvar elemento = rawParametersCouples[i].split('=');\n\t\tvar chiave = elemento[0];\n\t\tvar valore = elemento[1];\n\t\tvalore = valore.replace(/%20+/g,\" \"); // rimpiazzo i %20 con degli spazi\n\t\tparameters[chiave] = valore; // le inserisco dentro un array associativo\n\t\t//console.log(\"Chiave: \"+chiave+\", valore: \"+parameters[chiave]); // DEBUG\n\t}\n\treturn parameters;\n}", "getParameters () { return this.parameters }", "function obtainGETparameters() {\n\tvar oGetParameters = new Array();\n\n\tvar sLocation = location.search.split(\"?\");\t\n\tif(sLocation.length > 1) {\n\t\tvar sParameterList =sLocation[1].split(\"&\"); \n\n\t\tfor(var i=0; i < sParameterList.length; i++) { \n\t\t\tsParameterList[i] = sParameterList[i].split(\"+\").join(\" \");\n\t\t\tvar aValues = sParameterList[i].split(\"=\");\n\t\t\tvar sId = aValues[0];\n\t\t\tvar sValue = aValues[1];\n\t\t\toGetParameters[sId]=sValue;\n\t\t}\t\t\t\t\n\t}\n\treturn oGetParameters;\n}", "getParamsByMethodType(context) {\n\t\t/** If set config mergeParam = true at setting routes */\n\t\tif (context.params && !context.params.query && !context.params.body && !context.params.params) {\n\t\t\treturn context.params;\n\t\t}\n\t\t/** Else will check and get params via method type */\n\t\tlet params = {};\n\t\tif (context.meta.method) {\n\t\t\tswitch (context.meta.method) {\n\t\t\t\tcase \"GET\": {\n\t\t\t\t\tparams = {...context.params.query, ...context.params.params};\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"POST\" || \"PUT\" || \"DELETE\" || \"OPTIONS\": {\n\t\t\t\t\tparams = context.params.body;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (params && !_.isEmpty(params)) {\n\t\t\treturn params;\n\t\t}\n\t\t/** Try for get params if case method type is not set, merge all to a object params */\n\t\tparams = {...context.params.query, ...context.params.body, ...context.params.params};\n\t\treturn params;\n\t}", "function getParams()\n{\n var idx = document.URL.indexOf('?');\n var params = [];\n if (idx != -1) {\n var pairs = document.URL.substring(idx+1, document.URL.length).split('&');\n for (var i=0; i<pairs.length; i++)\n {\n nameVal = pairs[i].split('=');\n params[nameVal[0]] = nameVal[1];\n }\n }\n return params;\n}", "function parse_get_parameters() {\n if (location.search.length < 1) {\n return null;\n }\n else {\n var parameters = [];\n location.search\n .substr(1)\n .split(\"&\")\n .forEach(function (item) {\n let temp = item.split(\"=\");\n parameters.push(\n {\n parameter_name: temp[0],\n parameter_value: temp[1]\n }\n )\n });\n\n return parameters;\n }\n}", "function get_params() {\n return get_cookie(\"params\");\n}", "_getParams(route) {\n var matches = route.match(/:\\w+/g)\n return (matches || []).map(match => {\n return match.substring(1, match.length)\n })\n }", "getParams() {\n const self = this;\n const functionSignature = 'getParams()';\n return {\n callAsync(callData = {}, defaultBlock) {\n return __awaiter(this, void 0, void 0, function* () {\n base_contract_1.BaseContract._assertCallParams(callData, defaultBlock);\n const rawCallResult = yield self._performCallAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, callData), defaultBlock);\n const abiEncoder = self._lookupAbiEncoder(functionSignature);\n base_contract_1.BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);\n return abiEncoder.strictDecodeReturnValue(rawCallResult);\n });\n },\n getABIEncodedTransactionData() {\n return self._strictEncodeArguments(functionSignature, []);\n },\n };\n }", "function getParameters()/*:Object*/ {\n return this._parameters$aqE4;\n }", "function getParams() {\n return qs.parse(window.location.search);\n}", "function getParams() {\n var params = {};\n if (isVideoDropped) {\n params[\"./videoId\"] = storedId;\n params[\"./type\"] = getType();\n params[\"./videoService\"] = \"brightcove\";\n } else {\n params[\"./fileReference\"] = storedId;\n params[\"./type\"] = getType();\n params[\"./imageCrop\"] = calculateCrop();\n }\n return params;\n }", "function getParams() {\n var res = {}\n var params = location.search.substr(1).split('&')\n\n for (var value; value = params.pop();) {\n var tmp = value.split('=')\n res[tmp[0]] = decodeURIComponent(tmp[1])\n }\n\n return res\n}", "function getURLparams() {\n var paramsArray = getURLSearch().split('&');\n var returnArray = [];\n\n paramsArray.forEach(function(param) {\n \n splitedParams = param.split('=');\n\n returnArray.push({\n name: splitedParams[0],\n value: splitedParams[1]\n });\n\n });\n\n return returnArray;\n}", "function getArgs(params) {\n const returnArgs = [];\n params.forEach((val) => {\n returnArgs.push({\n description: val.description,\n param: val.name,\n type: getParamType(val),\n optional: val.type.type === 'OptionalType',\n });\n });\n return returnArgs;\n}", "function getParameter(name){\n var a_param=getParamsArray();\n return getParam(a_param,name);\n}", "function getParams(qs) {\n\t qs = qs.split(\"+\").join(\" \");\n\t var params = {},\n\t tokens,\n\t re = /[?&]?([^=]+)=([^&]*)/g;\n\t while (tokens = re.exec(qs)) {\n\t \tparams[decodeURIComponent(tokens[1])]\n\t \t= decodeURIComponent(tokens[2]);\n\t }\n\t return params;\n}", "getPathParameters() {\n return this.pathParams;\n }", "getParams(internal_name) {\n let widgetParams = null;\n if (this.asset.param.has(internal_name)) {\n widgetParams = Object.assign({}, this.asset.param.get(internal_name));\n }\n else {\n // temporary\n widgetParams = { internal_name: internal_name, name: TitleCase(SnakeToPascal(internal_name)) };\n }\n return widgetParams;\n }", "getGeneralParameters() {\n\t\t\tconst params = {};\n\t\t\tObject.keys(this.$route.query).forEach((key) => {\n\t\t\t\tif (!(key in this.filters)) {\n\t\t\t\t\tparams[key] = this.$route.query[key];\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn params;\n\t\t}", "function getExtParams (param)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif (!Ext.isEmpty(param))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvar extParams = param(extraParams);\r\n\t\t\t\t\t\t\t\t\t\treturn extParams;\r\n\r\n\t\t\t\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn extraParams;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t}", "function getParams(alexa) {\n var slots = alexa.event.request.intent.slots;\n var output = [];\n for(var param in slots)\n output.push(slots[param].value);\n return output;\n}", "function getParams(k) {\n\n // returns all parameters.\n if (typeof k == 'undefined') {\n return JSON.parse(JSON.stringify(parameters));\n }\n\n return typeof parameters[k] != 'undefined' ? parameters[k].slice(0) : [];\n }", "function getUrlParams() {\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < hashes.length; i++) {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n }", "getComponentParameters(urn) {\n let component = new component_1.Component(this.workspacePath);\n let config = component.parseName(urn);\n return component.getParameters(config);\n }", "get currentParams() {\n return this._currentParams;\n }", "function Params() {\n if (currentToken() == \"(\") {\n nextToken();\n ArgList();\n if (currentToken() == \")\") {\n nextToken();\n return;\n } else {\n let errorMessage = \"Não foi encontrado o fechamento da lista de parâmetros da função\";\n handleError(errorMessage);\n nextToken();\n }\n } else {\n return;\n }\n }", "param(name) {\n if(!this._params) {\n var search = window.location.search;\n this._params = {};\n if(search && search.length) {\n // This window do have search parameters\n search = search.substring(1); // Remove the start ?\n \n for(let s of search.split('&')) {\n let o = s.split('=');\n this._params[o[0]] = o[1];\n }\n }\n }\n \n if(!name)\n return this._params;\n return this._params[name];\n }", "function getParamObject(params) {\n if (!params) {\n return;\n }\n let paramsObject = [];\n let paramsArray = params.split(\"&\");\n paramsArray.forEach(element => {\n paramsObject.push(element.split(\"=\")[0]);\n });\n return paramsObject;\n}", "get parameters() {\n return [this.board_id, this.post_id, this.server, this.content, this.write_date, this.page_url];\n }", "function getUrlParameters() {\n\tvar vars = [], hash;\n\tvar hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n\tfor (var i = 0; i < hashes.length; i++) {\n\t\thash = hashes[i].split('=');\n\t\tvars.push(hash[0]);\n\t\tvars[hash[0]] = hash[1];\n\t}\n\treturn vars;\n}", "getParamsList() {\n return Object.entries(this.params)\n // ignore non DMX until implemented. A simple filter will do for now\n // @TODO use switch case or similar\n // @TODO Handle nested DmxParam's\n .filter(([name, param]) => param instanceof DmxParam)\n .map(([name, param]) => {\n\n\n const { min = 0, max = 0, map = {}, channels } = param\n\n // handle (map|mapping) inconsistency.\n // if mapping is available we can use its keys\n // if map is used (fallback defined above) we need to prefix it with an empty string\n // {@see https://github.com/NERDDISCO/luminave/commit/e54cbaedb35d8e2ce8c858688d01a03626f78d63#diff-fbbc7eb32e6a63e1dd48789843a0192fR78}\n const mapping = param.mapping ?\n Object.keys(param.mapping) : ['', ...Object.keys(map)]\n\n return {\n min,\n max,\n name,\n channels,\n mapping,\n isRgb: param instanceof RgbParam,\n isRange: param instanceof RangeParam,\n isMapped: param instanceof MappedParam,\n isMultiRange: param instanceof MultiRangeParam,\n isHiRes: param instanceof HiResParam\n }\n })\n }", "getParamsFromInputs() {\n return {\n url: this.url,\n title: this.title,\n description: this.description,\n image: this.image,\n tags: this.tags,\n via: this._share.config.twitterAccount,\n };\n }", "function getParams(url, param) { \n var valueArray = new Array();\n urlArray = url.split(\"?\")\n if (urlArray.length > 1) {\n var queryString = urlArray[1]; \n var hash = queryString.lastIndexOf('#');\n if (hash >= 0) // remove boomark reference\n queryString = queryString.substring(0, hash);\n var qsArray = queryString.split(\"&\");\n for (var i = 0 ; i < qsArray.length; i++) {\n attrValue = qsArray[i];\n avArray = attrValue.split(\"=\");\n if (avArray[0].toLowerCase() == param.toLowerCase()) { \n valueArray[valueArray.length] = avArray[1];\n } \n }\n }\n return valueArray;\n}", "function QueryParameters() {}", "function getURLParams (req) {\n\tvar urlParts = url.parse(req.url, true);\n\treturn urlParts.query;\n}", "get parametersInput() {\n return this._parameters;\n }", "function getUrlParams(){\r\n var url = decodeURIComponent(location.href);\r\n var query = url.split('?')[1];\r\n var params = {};\r\n if (query !== ''){\r\n var arr = query.split('&');\r\n for (var i of arr) {\r\n var entry = i.split('=');\r\n var key = entry[0];\r\n var value = entry[1];\r\n params[key] = value;\r\n }\r\n }\r\n return params;\r\n}", "getParams(func) {\n var fnStr = func.toString().replace(/((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg, '');\n return fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(/([^\\s,]+)/g) || [];\n }", "function getParameters() {\n\t\t\t var searchString = window.location.search.substring(1)\n\t\t\t\t, params = searchString.split(\"&\")\n\t\t\t\t, hash = {}\n\t\t\t\t;\n\n\t\t\t for (var i = 0; i < params.length; i++) {\n\t\t\t\tvar val = params[i].split(\"=\");\n\t\t\t\thash[unescape(val[0])] = unescape(val[1]);\n\t\t\t }\n\t\t\t return hash;\n\t\t\t}", "function insPARAMS( params ){\n var insPARAMS = [\n params.created_by.selected.id,\n params.manufacturer.selected.id,\n params.from_warehouse.selected.id,\n params.to_warehouse.selected.id,\n JSON.stringify(params.products.value),\n params.status.selected.id,\n moment( new Date(params.deliver_date.value) ).toISOString(),\n params.transfer_type.selected.id,\n JSON.stringify(params.notes.value)\n ];\n return insPARAMS;\n}", "function pj_get_params(args) {\n var rxp = /\\+([a-z][a-z0-9_]*(?:=[^\\s]*)?)/gi;\n var params = {};\n var match;\n while (match = rxp.exec(args)) {\n pj_mkparam(params, match[1]);\n }\n return params;\n}", "getUrlParams() {\n const params = [];\n for (let key in this.urlParameters) {\n params.push(`${encodeURIComponent(key)}=${encodeURIComponent(this.urlParameters[key])}`);\n }\n return params.join('&');\n }", "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach((value) => {\n params.push(value);\n });\n\n return params;\n }", "function getUrlParams()\n {\n var decodedUri = decodeURIComponent(window.location.href);\n var params = [], hash;\n var hashes = decodedUri.slice(decodedUri.indexOf('?') + 1).split('&');\n\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n if (hash[1]) {\n params.push(hash[1].replace('+', ' '));\n }\n }\n return params;\n }", "function getURLParameters()\n {\n var sURL = window.document.URL.toString();\n if (sURL.indexOf(\"?\") > 0)\n {\n var arrParams = sURL.split(\"?\");\n var arrURLParams = arrParams[1].split(\"&\");\n\n var i = 0;\n for (i = 0; i<arrURLParams.length; i++)\n {\n var sParam = arrURLParams[i].split(\"=\");\n key = unescape(sParam[0]);\n if (sParam[1] != \"\")\n value = unescape(sParam[1]);\n else\n value = null;\n\n if(argv[key] == null){\n argv[key] = value;\n }\n else if(typeof argv[key] === 'string'){\n argv[key] = [ argv[key], value ];\n }\n else {\n argv[key].push(value);\n }\n }\n }\n }", "function get_param(name) {\n var params_str = get_params();\n if (params_str === \"\") {\n return \"\";\n }\n var params = params_str.split('&');\n for (var i = 0; i < params.length; ++i) {\n var param = params[i];\n var pair = param.split('=');\n if (pair.length !== 2) {\n continue;\n }\n if (pair[0] === name) {\n return decodeURIComponent(pair[1]);\n }\n }\n return \"\";\n}", "_getRuleParameters()\n {\n let parameters = null;\n let parametersMatch = this.originalData.match(/(?:.*[:])(?<parameters>.*)/);\n\n if (parametersMatch && parametersMatch.groups.parameters) {\n parameters = parametersMatch.groups.parameters.split(',');\n };\n\n return parameters;\n }", "function getUrlArgs() {\n\tvar qs = (location.search.length > 0 ? location.search.substring(1) : \"\")\n\tvar args = {};\n\tvar items = qs.split(\"&\");\n\tvar item = null;\n\tname = null;\n\tvalue = null;\n\tfor (var i = 0; i < items.length; i++) {\n\t\titem = items[i].split(\"=\");\n\t\tname = decodeURIComponent(item[0]);\n\t\tvalue = decodeURIComponent(item[1]);\n\t\targs[name] = value;\n\t}\n\treturn args;\n}", "function getParams(url) {\r\n var i, item, len, key_value_section, params, params_list = {};\r\n\r\n if (typeof url === 'string') {\r\n params = url.match(/\\?(.*)/)[0] || '';\r\n } else {\r\n params = root.location.search;\r\n }\r\n\r\n if (params.substr(0, 1) === '?') {\r\n params = params.substr(1);\r\n }\r\n\r\n params = params.split('&');\r\n len = params.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n key_value_section = params[i];\r\n if (key_value_section.length > 0) {\r\n item = key_value_section.split('=');\r\n params_list[item[0]] = item[1];\r\n }\r\n }\r\n return params_list;\r\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._paramMap;\n }", "function get_url_params() {\n var url_params = new URLSearchParams(window.location.search);\n\n return url_params;\n}", "toGetParameters(data) {\n let parameters = \"\";\n let index = 0;\n for(let field in data) {\n if(index++ === 0) {\n parameters += \"?\";\n } else {\n parameters += \"&\";\n }\n parameters += encodeURIComponent(field) + \"=\" + encodeURIComponent(data[field]);\n }\n return parameters;\n }", "function getParams() {\n const hash = decodeURIComponent(window.location.hash.substr(1))\n const params = (/:(.*)/).exec(hash)[1].split('&').reduce(function (result, item) {\n const split = item.split('=')\n result[split[0]] = split[1]\n return result\n }, {})\n return params\n}", "function getURLParameters () {\n let paramstrings = window.location.search.substr(1).split('&');\n\n if (paramstrings == '') {\n return {};\n }\n\n let params = {};\n\n for (let i = 0; i < paramstrings.length; ++i) {\n let param = paramstrings[i].split('=', 2);\n if (param.length == 1)\n params[param[0]] = '';\n else\n params[param[0]] = decodeURIComponent(param[1].replace(/\\+/g, ' '));\n }\n\n return params;\n}", "get paramMap() {\n if (!this._paramMap) {\n this._paramMap = this.params.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(p => convertToParamMap(p)));\n }\n\n return this._paramMap;\n }", "getParameters() {\n assert(typeof this.link === 'string', 'You must provide at least one string as link!');\n const matches = this.REGEX_MATCHER_CURIE_PARAMS.exec(this.link);\n if (!matches || !matches[1]) return [];\n return matches[1].split(this.REGEX_MATCHER_PARAM_SPIT);\n }", "function urlParams(params){\n var ret = \"\";\n if(Object.keys(params).length > 0){ // if there are any optional params\n ret += '?';\n\n var encodeParams = Object.keys(params).map(function(key){\n if(key != \"status\") { // special case, not an OpenSensors parameter\n return key + '=' + params[key];\n }\n });\n\n ret += encodeParams.join('&');\n }\n return ret;\n }", "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }", "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }", "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) { // support array\n params = params[0];\n }\n return params;\n }", "parameterNames() {\n\t\tconst params = [];\n\t\tif (this.parameterMetadata) {\n\t\t\tfor (const param of this.parameterMetadata.paramDefs) {\n\t\t\t\tparams.push(param.name);\n\t\t\t}\n\t\t}\n\t\treturn params;\n\t}", "getParams(hash) {\n return hash\n .replace(\"#\", \"\")\n .replace(\"?\", \"\")\n .split(\"&\")\n .reduce(function(result, item) {\n var parts = item.split(\"=\");\n result[parts[0]] = parts[1];\n return result;\n }, {});\n }", "function getParams(args) {\n var params = slice.call(args);\n var length = params.length;\n if (length === 1 && is.array(params[0])) {\n // support array\n params = params[0];\n }\n return params\n }", "function getURLParameters() {\n var params = {};\n if (location.search) {\n var parts = location.search.substring(1).split(\"&\");\n for (var i = 0; i < parts.length; i++) {\n var pair = parts[i].split(\"=\");\n if (!pair[0]) {\n continue;\n }\n params[pair[0]] = pair[1] || \"\";\n }\n }\n return params;\n}", "function getUrlParams() \n{\n var paramMap = {};\n\n if (location.search.length === 0) {\n return paramMap;\n }\n\n var parts = location.search.substring(1).split(\"&\");\n\n for (var i = 0; i < parts.length; i ++) {\n var component = parts[i].split(\"=\");\n paramMap [decodeURIComponent(component[0])] = decodeURIComponent(component[1]);\n }\n\n return paramMap;\n}", "function queryParamsValues() {\n const params = [];\n urlBase.searchParams.forEach((value) => {\n params.push(value);\n });\n\n return params;\n }", "static get params () {\n return [\n 'allow-same-version',\n 'commit-hooks',\n 'git-tag-version',\n 'json',\n 'preid',\n 'sign-git-tag',\n 'workspace',\n 'workspaces',\n ]\n }", "function HttpParamsOptions() {}", "function HttpParamsOptions() {}", "parseParams(paramValues = []) {\n if (this.inDef && this.inDef.length > 0 && paramValues && paramValues.length > 0) {\n let params = [];\n this.inDef.forEach((piid, i) => {\n let newParam = {};\n newParam.piid = piid;\n newParam.value = paramValues[i];\n params.push(newParam);\n });\n return params;\n }\n return [];\n }", "function GetParameterValues(param) {\n var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < url.length; i++) {\n var urlparam = url[i].split('=');\n if (urlparam[0] == param) {\n return urlparam[1];\n }\n }\n}", "function getParameterValues(param) {\n\n var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for (var i = 0; i < url.length; i++)\n {\n var urlparam = url[i].split('=');\n if (urlparam[0] === param) {\n return urlparam[1];\n }\n }\n }", "function getSearchParameters() {\r\n var prmstr = window.location.search.substr(1);\r\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\r\n }", "function getPathParams(req, res){\n const params = 'id' in req.params ? req.params.id : null;\n console.log(\"getPathParams\");\n console.log(req.method);\n console.log(params);\n return params\n}", "function encodeParams () {\n\n }", "function getUrlParameters() {\n var params = location.search.slice(1).split('&');\n\n var targetUrl = \"\";\n var configUrl = \"\";\n\n for (var i =0; i < params.length; i++) {\n var param = params[i];\n if (param.split('=')[0] == 'target') {targetUrl = param.split('=')[1]}\n if (param.split('=')[0] == 'config') {configUrl = param.split('=')[1]}\n }\n\n // read default configuration\n $.ajax({\n type: \"GET\",\n url: \"config/default.json\",\n dataType: \"json\",\n async: false,\n success: function(data) {\n setConfig(data);\n },\n error: function() {\n alert(\"Could not read default configuration. Consult the administrator.\");\n }\n });\n\n if (configUrl != \"\") {\n $.ajax({\n type: \"GET\",\n url: configUrl,\n dataType: \"json\",\n crossDomain: true,\n success: function(data) {\n setConfig(data);\n getAnnotationFrom(targetUrl);\n },\n error: function() {\n alert('could not read the configuration from the location you specified.');\n }\n });\n } else {\n getAnnotationFrom(targetUrl);\n }\n }", "calcExtraParams () {}", "function getURLParams()\n{\n var vars = [], hash;\n var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');\n for(var i = 0; i < hashes.length; i++)\n {\n hash = hashes[i].split('=');\n vars.push(hash[0]);\n vars[hash[0]] = hash[1];\n }\n return vars;\n}", "function UsingParams(pRequired, pDefault, pOptional) {\n if (pDefault === void 0) { pDefault = \"DBS-ID\"; }\n var pRest = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n pRest[_i - 3] = arguments[_i];\n }\n console.log(pRequired);\n console.log(pDefault);\n console.log(pOptional);\n console.log(pRest);\n}", "function HttpParamsOptions() { }", "function HttpParamsOptions() { }", "function HttpParamsOptions() { }", "function Params() {\n return {\n // Wave shape\n wave_type: SQUARE,\n\n // Envelope\n env_attack: 0, // Attack time\n env_sustain: 0.3, // Sustain time\n env_punch: 0, // Sustain punch\n env_decay: 0.4, // Decay time\n\n // Tone\n base_freq: 0.3, // Start frequency\n freq_limit: 0, // Min frequency cutoff\n freq_ramp: 0, // Slide (SIGNED)\n freq_dramp: 0, // Delta slide (SIGNED)\n\n // Vibrato\n vib_strength: 0, // Vibrato depth\n vib_speed: 0, // Vibrato speed\n\n // Tonal change\n arp_mod: 0, // Change amount (SIGNED)\n arp_speed: 0, // Change speed\n\n // Duty (affects the timbre of SQUARE waves)\n duty: 0, // Square duty\n duty_ramp: 0, // Duty sweep (SIGNED)\n\n // Repeat\n repeat_speed: 0, // Repeat speed\n\n // Phaser\n pha_offset: 0, // Phaser offset (SIGNED)\n pha_ramp: 0, // Phaser sweep (SIGNED)\n\n // Low-pass filter\n lpf_freq: 1.0, // Low-pass filter cutoff\n lpf_ramp: 0, // Low-pass filter cutoff sweep (SIGNED)\n lpf_resonance: 0, // Low-pass filter resonance\n // High-pass filter\n hpf_freq: 0, // High-pass filter cutoff\n hpf_ramp: 0, // High-pass filter cutoff sweep (SIGNED)\n\n // Sample parameters\n sound_vol: 0.5,\n sample_rate: 44100,\n sample_size: 8\n };\n}", "get params () {\n const ravelInstance = this.app;\n return {\n get: ravelInstance.get.bind(ravelInstance)\n };\n }", "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\t\n\t for (var p in params) {\n\t if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\t }return routeParams;\n\t}", "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\t\n\t for (var p in params) {\n\t if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\t }return routeParams;\n\t}", "function getRouteParams(route, params) {\n\t var routeParams = {};\n\t\n\t if (!route.path) return routeParams;\n\t\n\t var paramNames = _PatternUtils.getParamNames(route.path);\n\t\n\t for (var p in params) {\n\t if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];\n\t }return routeParams;\n\t}" ]
[ "0.69304407", "0.6885752", "0.67742133", "0.66605014", "0.6498137", "0.642117", "0.6397994", "0.636412", "0.63394904", "0.63177556", "0.6313064", "0.6297894", "0.6278161", "0.6248462", "0.62339985", "0.6159306", "0.610189", "0.6084473", "0.6041255", "0.603953", "0.5988341", "0.5965851", "0.59614104", "0.5957272", "0.5951721", "0.59460723", "0.59409875", "0.5927798", "0.5903883", "0.58953905", "0.5887583", "0.58760864", "0.58297354", "0.5817783", "0.58160484", "0.58073026", "0.5804315", "0.58002865", "0.5793471", "0.57880044", "0.5787773", "0.5769733", "0.57696843", "0.57538927", "0.5752373", "0.57480186", "0.5731014", "0.57190967", "0.57153594", "0.57141113", "0.56942993", "0.56893164", "0.5687124", "0.56866485", "0.5683874", "0.56753427", "0.5672519", "0.5668368", "0.5667692", "0.5658571", "0.5658571", "0.5658571", "0.5658571", "0.5658571", "0.5656818", "0.563726", "0.56322074", "0.5629263", "0.56273913", "0.5623758", "0.5619", "0.5618478", "0.5618478", "0.5618478", "0.56178", "0.56175923", "0.5615715", "0.56146014", "0.5596982", "0.5591071", "0.5583888", "0.5582052", "0.5582052", "0.55801046", "0.5570397", "0.55698204", "0.5566863", "0.5563754", "0.55631876", "0.5563157", "0.55612147", "0.5556797", "0.5554246", "0.5548735", "0.5548735", "0.5548735", "0.5543829", "0.55411404", "0.5540914", "0.5540914", "0.5540914" ]
0.0
-1
createSelectionForm Create an item selection form
function createSelectionForm(request, response) { try { //CreateSselection Form selectionForm = nlapiCreateForm('Add Item',true); //Create Buttons selectionForm.addSubmitButton('Submit'); //Create Fields errorLabel = selectionForm.addField('custpage_errorlabel','text', 'Error').setDefaultValue(errorText); selectionForm.getField('custpage_errorlabel').setDisplaySize(37, 10); selectionForm.getField('custpage_errorlabel').setDisplayType(errorDisplay); hiddenCustomer = selectionForm.addField('custpage_hiddencustomer','integer','Customer Id').setDefaultValue(customer); selectionForm.getField('custpage_hiddencustomer').setDisplaySize(10, 10); selectionForm.getField('custpage_hiddencustomer').setDisplayType('hidden'); hiddencustomerBrand = selectionForm.addField('custpage_hiddencustomerbrand','integer','Customer Brand Id').setDefaultValue(custBrandParam); selectionForm.getField('custpage_hiddencustomerbrand').setDisplaySize(10, 10); selectionForm.getField('custpage_hiddencustomerbrand').setDisplayType('hidden'); //Create SubList itemlines = selectionForm.addSubList('custpage_sublist_itemlines', 'inlineeditor', 'Add Items', 'itemlines'); itemCode = itemlines.addField('custpage_custcol_item', 'text', 'Item Code').setMandatory(true); itemlines.setLineItemValues(itemCode); qty = itemlines.addField('custpage_custcol_quantity', 'integer', 'Quantity').setMandatory(true); itemlines.setLineItemValues(qty); } catch(e) { errorHandler('createSelectionForm ', e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OSelect_XFormItem() {}", "function createSellform(d,item,quant,descid,hash,itemimage,textdesc) {\n var form = document.createElement('form');\n form.setAttribute('name','sellform');\n form.setAttribute('action','managestore.php');\n form.setAttribute('method','post');\n form.setAttribute('style','display:inline;');\n var input = document.createElement('input'); \n input.setAttribute('type','hidden');\n input.setAttribute('name','action');\n input.setAttribute('value','additem');\n form.appendChild(input);\n input = document.createElement('input'); \n input.setAttribute('id','quickmall_hash');\n input.setAttribute('type','hidden');\n input.setAttribute('name','pwd');\n input.setAttribute('value',hash);\n form.appendChild(input);\n if (itemimage) {\n var img = itemimage.cloneNode(false);\n img.setAttribute('id','quickmall_itemimage');\n img.setAttribute('title',textdesc);\n form.appendChild(img);\n }\n input = document.createTextNode('Qty:'); \n form.appendChild(input);\n input = document.createElement('input'); \n input.setAttribute('id','quickmall_quant');\n input.setAttribute('name','qty1');\n input.setAttribute('size','3');\n input.setAttribute('value',quant);\n form.appendChild(input);\n \n input = document.createElement('input'); \n input.setAttribute('id','quickmall_itemdesc');\n input.setAttribute('type','hidden');\n input.setAttribute('name','item1');\n input.setAttribute('value',item);\n input.setAttribute('descid',descid);\n form.appendChild(input);\n \n input = document.createTextNode('Price:'); \n form.appendChild(input);\n input = document.createElement('input'); \n input.setAttribute('name','price1');\n input.setAttribute('size','9');\n form.appendChild(input);\n input = document.createTextNode('Limit:'); \n form.appendChild(input);\n input = document.createElement('input'); \n input.setAttribute('name','limit1');\n input.setAttribute('size','3');\n form.appendChild(input);\n input = document.createElement('input'); \n input.setAttribute('class','button');\n input.setAttribute('type','submit');\n input.setAttribute('value','Add Items to Store');\n form.appendChild(input);\n // and then insert it\n // add a row above this tdnode\n var tbl = document.createElement('table');\n var row = document.createElement('tr');\n var cell = document.createElement('td');\n //cell.setAttribute('colspan','2');\n cell.appendChild(form);\n row.appendChild(cell);\n tbl.appendChild(row);\n d.appendChild(tbl);\n}", "function PostProcessing_createSelection() {\n var opts = [\"type\", \"title\", \"description\", /*\"start\", \"end\", */ \"tags\" /*, \"key\"*/];\n var sel = document.createElement(\"select\");\n for (var _i = 0, opts_1 = opts; _i < opts_1.length; _i++) {\n var opt = opts_1[_i];\n var optElm = document.createElement(\"option\");\n optElm.value = opt;\n optElm.innerHTML = opt;\n sel.appendChild(optElm);\n }\n return sel;\n }", "function Select() {\r\n setButtonDisable(add, true);\r\n setButtonDisable(edit, true);\r\n\r\n if (!list.selectedItem) {\r\n setButtonDisable(del, true);\r\n return false;\r\n }\r\n entry.value = list.selectedItem.getAttribute(\"label\");\r\n setButtonDisable(del, false);\r\n return true;\r\n}", "function itemSelector(request, response)\r\n{\r\n\tif (request.getMethod() == 'GET')\r\n\t{\r\n\t\t//Get the parameters and create the form\r\n\t\tgetParams(request, response);\r\n\t\tcreateSelectionForm(request, response);\r\n\t\tresponse.writePage(selectionForm);\r\n\t}\r\n\t//POST\r\n\telse\r\n\t{\r\n\t\t//Check the Search Criteria\r\n\t\tif(getSearchCriteria(request, response)==true)\r\n\t\t{\r\n\t\t\tpostItems(request, response);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tcreateSelectionForm(request, response);\r\n\t\t\tresponse.writePage(selectionForm);\r\n\t\t}\r\n\t}\r\n}", "function selectForm(e){\n setActiveForm(e.target.name)\n }", "function selectionSubItems(subItem, Form, cont_search) {\n\n let items = \"#\" + subItem + \"\";\n fromUpdateSearch = \"#form_search_\" + Form;\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"color\", \"#eafaf9\");\n let text = sNameTitle + \" \" + $(items).text();\n $('#titleForm ').text(text);\n\n\n if (cont_search) {\n $('#cont_search_' + Form).css(\"display\", \"block\");\n disableEnableInput(Form, 0);\n disableEnableElementInput(fromUpdateSearch, 1);\n\n } else {\n $('#cont_search_' + Form).css(\"display\", \"none\");\n disableEnableInput(Form, 1);\n disableEnableElementInput(fromUpdateSearch, 0);\n }\n selectForm(Form);\n\n typeSelectionUpdateCreate = subItem.substring(subItem.indexOf(\"_\") + 1, subItem.length);\n\n}", "function responseToSelectForm(selected_items)\n{\n var prompt = 'You selected: ' + selected_items.join(', ');\n Browser.msgBox(prompt);\n}", "handleSelect(item) {\n this._selected = item\n this._opener.inputValue = item.text\n }", "function newField(field, action) {\n var label = document.createElement(field + \"_label\");\n label.id = field + \"_label\";\n \n if (action == \"add\"){\n if (field == 'preacher')\n label.appendChild(document.createTextNode('Please enter preacher\\'s full name: '));\n else if (field == 'series')\n label.appendChild(document.createTextNode('Please enter title of series: '));\n }\n else if (action == \"select\") {\n if (field == 'preacher')\n label.appendChild(document.createTextNode('Preacher: '));\n else if (field == 'series')\n label.appendChild(document.createTextNode('Series: '));\n }\n\n label.setAttribute(\"style\", \"font-weight:normal\");\n\n // replace field label with new label\n var fieldDiv = document.getElementById(field + \"_label\");\n var parentDiv = fieldDiv.parentNode;\n parentDiv.replaceChild(label, fieldDiv);\n\n // create new input box\n if (action == \"add\"){\n var txtbox = document.createElement(\"input\");\n txtbox.setAttribute(\"type\", \"text\");\n }\n else if (action == \"select\") {\n var txtbox = document.createElement(\"select\");\n txtbox.setAttribute(\"size\", \"4\");\n \n // TODO: HERE\n var arr = $.parseJSON('<?php echo json_encode($preacher_list); ?>');\n var i = 0;\n for (i=0; i<=arr.length; i++) {\n var option = document.createElement(arr[i]);\n option.text = arr[i];\n txtbox.add(option);\n }\n }\n \n txtbox.setAttribute(\"id\", field);\n txtbox.setAttribute(\"value\", \"\");\n txtbox.setAttribute(\"name\", field);\n txtbox.setAttribute(\"style\", \"width:200px\");\n\n // replace selection box with input box\n var fieldDiv = document.getElementById(field);\n var parentDiv = fieldDiv.parentNode;\n parentDiv.replaceChild(txtbox, fieldDiv);\n\n // create link to select field instead\n var link = document.createElement('a');\n link.id = \"new_\" + field;\n \n if (action == \"add\") {\n var linkText = document.createTextNode('Select ' + field + ' from list');\n link.setAttribute('href', \"javascript:newField('\" + field + \"','select')\");\n } \n else if (action == \"select\") {\n var linkText = document.createTextNode('New ' + field + '?');\n link.setAttribute('href', \"javascript:newField('\" + field + \"','action')\");\n }\n \n link.appendChild(linkText);\n \n var fieldname = \"new_\" + field;\n var fieldDiv = document.getElementById(fieldname);\n var parentDiv = fieldDiv.parentNode;\n\n // replace existing node sp2 with the new span txtbox sp1\n parentDiv.replaceChild(link, fieldDiv);\n}", "function productoSeleccionado(event, ui) {\n //recibo la lista de items a mostrar\n var sku = ui.item.value;\n //le paso la lista de items al campo sobre el que escribio la referencia\n $(this).val(sku.Referencia);\n //envio al objeto objRef, el id del formulario sobre el cual estoy situado\n objRef.idForm = $(this).closest(\"div\").attr(\"alt\");\n //con el id del formulario anterior se donde poner los valores de los campos\n $(\"#\" + objRef.idForm + \" #Referencia\").val(sku.Referencia);\n $(\"#\" + objRef.idForm + \" #idSku\").val(sku.idSKU);\n //seteo los precios recibidos, segun la referencia seleccionada\n objRef.precios=sku.Precio;\n event.preventDefault();\n //llenarDetalle(sku.Referencia);\n //lleno el select, con\n procesarSelect(sku.Referencia);\n \n}", "function loadElementSelectionForm() {\n currentState = \"SelectElementTypes\";\n customInputsTitle.innerText = \"Select Element Types\";\n customInputsContent.innerHTML = \"\";\n var elementSelectionList = document.createElement(\"ul\");\n elementSelectionList.setAttribute(\"id\", \"element-selection-list\");\n elementSelectionList.setAttribute(\"class\", \"selection-list\");\n for (var type in elementSelectionForm.elementTypes) {\n var typeId = type + \"-selection\";\n // create list item element\n var newListItem = document.createElement(\"li\");\n newListItem.setAttribute(\"id\", type + \"-list-item\");\n // create checkbox element\n var newCheckbox = document.createElement(\"input\");\n newCheckbox.setAttribute(\"id\", typeId);\n newCheckbox.setAttribute(\"type\", \"checkbox\");\n newCheckbox.setAttribute(\"name\", \"\");\n newCheckbox.setAttribute(\"value\", type);\n if (elementSelectionForm.elementTypes[type]) {\n newCheckbox.setAttribute(\"checked\", \"checked\");\n newCheckbox.setAttribute(\"disabled\", \"disabled\");\n } else if (elementSelectionForm.selectables[type]) {\n newCheckbox.setAttribute(\"checked\", \"checked\");\n }\n // create label element for checkbox\n var newLabel = document.createElement(\"label\");\n newLabel.setAttribute(\"for\", typeId);\n newLabel.innerText = type;\n // add elements to DOM\n newListItem.appendChild(newCheckbox);\n newListItem.appendChild(newLabel);\n elementSelectionList.appendChild(newListItem);\n }\n customInputsContent.appendChild(elementSelectionList);\n // add event listeners\n\n var _loop2 = function _loop2(_type2) {\n var typeId = _type2 + \"-selection\";\n document.getElementById(typeId).addEventListener(\"click\", function () {\n elementSelectionForm.selectables[_type2] = !elementSelectionForm.selectables[_type2];\n });\n };\n\n for (var _type2 in elementSelectionForm.selectables) {\n _loop2(_type2);\n }\n}", "function create_select () {\n var contenedor = $(self.container);\n // Div principal MySelect\n var div_principal = $('<div class=\"myselect container '+self.type+'\"></div>');\n div_principal.css({\n 'width': self.width,\n 'font-size': self.font_size,\n 'z-index':self.z_index,\n 'color':self.color,\n 'font-weight': self.font_weight\n });\n // Div de la caja de opciones\n var div_options_box = create_options_box();\n // Div de la caja de seleccion\n var div_select_box = create_select_box(div_principal, div_options_box);\n // Evento de contraer/expandir\n if (self.collapsable)\n div_select_box.on('click', function(){\n div_principal.toggleClass('active');\n div_options_box.stop();\n div_options_box.animate(toggle_animation(div_options_box),self.transition);\n });\n // Añadir las cajas al contenedor\n div_principal.append(div_select_box);\n div_principal.append(div_options_box);\n contenedor.append(div_principal);\n }", "function addAFormItem(itemNum, itemName) {\n let resultsArea = document.getElementById('results-container');\n createForm(itemName, resultsArea, itemNum);\n\n itemsChosen.push(itemName);\n}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "function newForm() {\n\n var form = document.createElement(\"form\")\n form.style = \"heigth:100px;width:300px;border-style:solid;border-color:black;border-width:1px\"\n form.id = \"form\"\n\n var ObjLabel = document.createElement(\"label\")\n ObjLabel.textContent = \"Object \"\n\n var ObjInput = document.createElement(\"input\")\n ObjInput.id = \"object-input\"\n ObjInput.name = \"object\"\n ObjInput.type = \"text\"\n ObjInput.placeholder = \"Object name\"\n\n var QtyLabel = document.createElement(\"label\")\n QtyLabel.textContent = \"Quantity \"\n\n var QtyInput = document.createElement(\"input\")\n QtyInput.id = \"quantity-input\"\n QtyInput.name = \"quantity\"\n QtyInput.type = \"text\"\n QtyInput.placeholder = \"Please insert a positive number\"\n\n var submit = document.createElement(\"input\")\n submit.id = \"submit\"\n submit.type = \"button\"\n submit.value = \"Confirm\"\n submit.setAttribute(\"onmousedown\", \"addItems()\")\n\n // adding all items under \"form\" in the DOM tree\n form.appendChild(ObjLabel)\n form.appendChild(ObjInput)\n form.appendChild(document.createElement(\"br\"))\n form.appendChild(QtyLabel)\n form.appendChild(QtyInput)\n form.appendChild(document.createElement(\"br\"))\n form.appendChild(submit)\n\n return form\n}", "function createForm(itemName, resultsArea) {\n // Name input, but disabled because the name is from json file\n let labelElem = document.createElement(\"input\");\n labelElem.setAttribute('name', `item${numOfSelectedItems}`);\n labelElem.setAttribute('class', 'form-control mr-5 mb-4 shadow');\n labelElem.setAttribute('id', `item${numOfSelectedItems}`);\n labelElem.setAttribute('type', 'text');\n labelElem.setAttribute('placeholder', 'Exercise name');\n labelElem.setAttribute('value', itemName);\n labelElem.required = true;\n labelElem.readOnly = true;\n\n // Time input\n let inputTimeElement = document.createElement(\"input\");\n inputTimeElement.setAttribute('type', 'number');\n inputTimeElement.setAttribute('name', `item${numOfSelectedItems}timeInput`);\n inputTimeElement.setAttribute('id', `item${numOfSelectedItems}timeInput`);\n inputTimeElement.setAttribute('class', 'form-control mr-5 mb-4 shadow');\n inputTimeElement.setAttribute('placeholder', 'Minutes exercised');\n inputTimeElement.setAttribute('step', '1');\n inputTimeElement.setAttribute('min', '1');\n inputTimeElement.required = true;\n\n // Remove (X) button\n let removeEntry = document.createElement(\"button\");\n removeEntry.setAttribute('id', `remove${numOfSelectedItems}Entry`);\n removeEntry.setAttribute('class', 'btn btn-danger mb-4 shadow');\n removeEntry.setAttribute('type', 'button');\n removeEntry.innerHTML = \"X\";\n\n // 2 line breakers for space consistency between entries\n let linebreakElem = document.createElement(\"br\");\n linebreakElem.setAttribute('id', `br1${numOfSelectedItems}`);\n let linebreakElem2 = document.createElement(\"br\");\n linebreakElem2.setAttribute('id', `br2${numOfSelectedItems}`);\n\n // Create onclick listner to know when to remove an entry\n removeEntry.setAttribute('onClick', `renameAttributes('item${numOfSelectedItems}',` + \n `'item${numOfSelectedItems}timeInput',` + \n `'remove${numOfSelectedItems}Entry',` +\n `'br1${numOfSelectedItems}',` +\n `'br2${numOfSelectedItems}',` +\n `true)`);\n\n inputTimeElement.setAttribute('onInput', 'validate_time_field(this)');\n \n // Appends the entry components to the entry area\n resultsArea.appendChild(labelElem);\n resultsArea.appendChild(inputTimeElement);\n resultsArea.appendChild(removeEntry);\n resultsArea.appendChild(linebreakElem);\n resultsArea.appendChild(linebreakElem2);\n\n ++numOfSelectedItems;\n}", "function create_entity_list_form() {\n var str_array = [];\n str_array.push(\"<form name='entities'>\");\n str_array.push(\"<select name='entity' onchange='update_entity_select(this.options[this.selectedIndex].value);'>\");\n for(var ent in Domain.entities) {\n var sel = \"\";\n if(ent == \"User\") {\n sel = \"selected\";\n }\n str_array.push(\"<option value='\" + ent + \"' \" + sel + \">\" + ent + \"</option>\");\n }\n str_array.push(\"</select>\");\n str_array.push(\"</form>\");\n return str_array.join(\"\\n\");\n}", "function populateForm() {\n\n // TODO(done): Add an <option> tag inside the form's select for each product\n const selectElement = document.getElementById('items');\n\n for (let product of Product.allProducts) {\n let optionElement = document.createElement('option');\n optionElement.textContent = product.name;\n selectElement.appendChild(optionElement);\n }\n\n}", "if (availableOptions.length > 0) {\n setSelected(newItem);\n setSearch(newItem.label);\n if (onSelect) onSelect({ event, item: newItem });\n }", "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 optionEl = document.createElement('option');\n optionEl.textContent = Product.allProducts[i].name;\n selectElement.appendChild(optionEl);\n }\n}", "function populateForm() {\n //TODO: Add an <option> tag inside the form's select for each product\n Product.allProducts.forEach((prod) => {\n createTheElement('option', prod.name, selectElement);\n });\n\n}", "function dropDownInsert(txt , selections) {\r\n\tif(window.isIE)\r\n\t{\r\n\t\ttxtBoxInsert(txt);\r\n\t\treturn false;\r\n\t}\r\n\tvar UIX = parseInt( getUniqueID() );\r\n\tvar newID = 'qry'+UIX\r\n\tvar options = selections.split(';');\r\n\t\r\n\tvar nProps = new Object();\r\n\tnProps.id = newID;\r\n\tnProps[\"class\"] = \"qryPart\";\r\n\tnProps.className='qryPart';\r\n\taddElement( 'components_builder' , 'div' , txt , nProps );\r\n\t\r\n\tvar iProps = new Object();\r\n\tiProps.id = 'selector_'+newID;\r\n\tiProps.type = 'text';\r\n\tvar selector = addElement( newID , 'select' , null , iProps );\r\n\t\r\n\tvar props = new Object();\r\n\tprops.id = '';\r\n\tprops. value = '';\t\t\r\n\tfor(var i=0;i<options.length;i++) {\r\n\t\tprops.id = 'option_'+i+'_'+newID;\r\n\t\tprops. value = options[i];\r\n\t\taddElement( 'selector_'+newID , 'option' , options[i] , props );\r\n\t}\r\n\t\r\n\tvar aProps = new Object();\r\n\taProps.id = newID+'_closer';\r\n\taProps.href = 'javascript:;';\r\n\taProps[\"class\"] = \"closer\";\r\n\taProps.className='closer';\r\n\tvar a = addElement( newID , 'span' , 'x' , aProps );\r\n\ta.onclick = function(){ deleteItem( 'components_builder' , newID ); };\r\n}", "function populateForm() {\n\n // Add an <option> tag inside the form's select for each product\n const selectElement = document.getElementById('items');\n for (let i = 0; i < Product.allProducts.length; i++) {\n const addOptions = document.createElement('option');\n addOptions.innerText = Product.allProducts[i].name;\n addOptions.value = Product.allProducts[i].name;\n selectElement.appendChild(addOptions);\n }\n\n}", "function createTextToComplet(qElement) {\n if (questions[pageCounter].textToComplet != null) {\n $(document).ready(function () {\n $(\"select\").formSelect();\n });\n\n var item = $('<div class=\"input-field col s12\"><select>');\n var input = \"\";\n for (var i = 0; i < questions[pageCounter].options1.length; i++) {\n input =\n '<option value=\"\">' +\n questions[pageCounter].options1[i] +\n \"</option>\";\n item.append(input);\n }\n item.append(\"</select></div>\");\n qElement.append(item);\n }\n }", "marginItem(value) {\n \n \n let selectables = this.object_item(value).selectables;\n let selections = this.object_item(value).selections;\n \n \n if (selectables.length > 0) {\n\n selectables.addClass('OPTION-selected')\n .hide();\n\n selections.addClass('OPTION-selected')\n .show();\n\n this.object_item(value).options.prop('selected', true); // active selected original select\n\n\n\n }\n }", "function createSelectionGroupsHTML(i) {\n var el = document.getElementsByClassName('container-selections');\n var options = createSelectionOptionsHTML(inputInfo[i]);\n var selGroupHTML =\n \"<div class='selection-category bdr-lt bdr-rad-lt'>\" +\n \"<div class='bg-red txt-white txt-md txt-ctr pad-rg'>\" +\n selHeaders[i] + \"</div>\" +\n \"<form class='selection-group bg-white'>\" + options + \"</form>\" +\n \"</div>\";\n el[0].insertAdjacentHTML('afterbegin', selGroupHTML);\n}", "function SelectMultiChoice(mySelectElement, myFormElement, myAddButton, myDisplaySpace,\n\t\t\t\t\t\t\t\t myRemoveItemClass, myPlaceholder, myContainer) {\n\n\t\t\tmyContainer = (typeof myContainer === 'undefined') ? $(\"body\") : myContainer; // default value\n\n\t\t\tvar container = myContainer; // the container that holds this SelectMultiChoice\n\t\t\tvar selectElement = $(mySelectElement, container);//the actual select element of the form.\n\t\t\tvar formElement = $(myFormElement, container);//the hidden form field where we store the actual data we want as a list\n\t\t\tvar addButton = $(myAddButton, container);//The button we click to add items to this.formElement\n\t\t\tvar displaySpace = $(myDisplaySpace, container);//Where we'll draw our set of jquery-ui boxes showing what's in this.formElement\n\t\t\tvar removeItemClass = myRemoveItemClass;//The class applied to the X's of the jQuery-ui boxes.\n\t\t\tvar placeholder = myPlaceholder;//The text to display in an empty this.displaySpace.\n\n\t\t\t/*a few items we use throughout this object*/\n\t\t\tthis.itemList = new List( $(this.formElement).val() );//fetch a list object of the current values.\n\t\t\tvar itemArray = this.itemList.toArray();//make that list into an array for use with native functions.\n\t\t\tvar isText = selectElement.is(\"input\");//We do a few different behaviors for clearing a form if we're dealing with a text field or a select box.\n\n\t\t\tthis.isTextHelper = isText;\n\t\t\tthis.formElementHelper = formElement;\n\t\t\tthis.selectHelper = selectElement;\n\t\t\t\n\t\t\tvar local = this;//for use in anonymous functions for things like jQuery event handlers.\n\n\t\t\t/* METHODS */\n\n\t\t\t//This method takes a value and loops over the options in this.selectElement, returning the text displayed for the option.\n\t\t\tthis.findSelectOption = function(myValue){\n\t\t\t\tvar textValue = myValue;//default to just showing the straight value.\n\n\t\t\t\t$(\"option\", this.selectElement).each(function(i, item){\n\t\t\t\t\t//have we found a match for myValue?\n\t\t\t\t\tif($(item).attr(\"value\") == myValue){\n\t\t\t\t\t\ttextValue = $(item).html();\n\t\t\t\t\t\treturn false;//returning false is how to break out of an each() loop.\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//because we use non-breaking spaces to indent items replace all &nbsp;'s with \" \"\n\t\t\t\ttextValue = textValue.replace(/&nbsp;/g, \" \");//that replace string may look wild, but it's just some RegEx.\n\t\t\t\ttextValue = $.trim(textValue);//also trim any leading/trailing whitespace.\n\n\t\t\t\treturn textValue;\n\t\t\t}\n\n\t\t\t//When we add an item from a select box we'd like to disable it to prevent duplicates.\n\t\t\tthis.disableOption = function(myValue) {\n\t\t\t\t$(\"option\", selectElement).each(function(i, item){\n\t\t\t\t\t//have we found a match for myValue?\n\t\t\t\t\tif($(item).attr(\"value\") == myValue){\n\t\t\t\t\t\t$(item).prop(\"disabled\", 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t//Also reset our selector, do this by looping over the options until we hit the first item that isn't disabled.\n\t\t\t\t$(\"option\", selectElement).each(function(i, item){\n\t\t\t\t\tif(!$(item).prop(\"disabled\")){\n\t\t\t\t\t\t$(item).prop(\"selected\", true);\n\t\t\t\t\t\treturn false;//returning false breaks out of an each() loop.\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//If we remove an item previous selected from a select box re-enable it.\n\t\t\tthis.enableOption = function(myValue) {\n\t\t\t\t$(\"option\", this.selectElement).each(function(i, item){\n\t\t\t\t\t//have we found a match for myValue?\n\t\t\t\t\tif($(item).attr(\"value\") == myValue){\n\t\t\t\t\t\t$(item).removeAttr('disabled');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//There are a few cases where we will want to re-enable all options.\n\t\t\tthis.enableAllOptions = function() {\n\t\t\t\t$(\"option\", this.selectElement).each(function(i, item){\n\t\t\t\t\t$(item).removeAttr('disabled');\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//draw the jQuery-UI boxes showing what items are currently in formElement.\n\t\t\tthis.drawUIboxList = function () {\n\t\t\t\t//Use the values of itemArray to build an array of objects, containing the value and what to display in the jQuery-ui boxes\n\t\t\t\tvar dispArray = new Array();\n\n\t\t\t\tfor(var n in itemArray){\n\t\t\t\t\tvar value = {\n\t\t\t\t\t\t\"item\": itemArray[n],\n\t\t\t\t\t\t\"display\": localFindSelectOption(itemArray[n]) /*This calls a method that finds the text displayed for this value in this.selectElement*/\n\t\t\t\t\t}\n\n\t\t\t\t\tdispArray.push(value);\n\t\t\t\t}\n\n\n\t\t\t\t/* if there are no items, write our placeholder text in this.displaySpace */\n\t\t\t\tif(dispArray.length > 0)\n\t\t\t\t\tdisplaySpace.html(\"\");//blank it to make room for our new spans.\n\t\t\t\telse\n\t\t\t\t\tdisplaySpace.html(placeholder);//there's nothing, so just show our placeholder text.\n\n\t\t\t\t/* draw a span for each item in dispArray */\n\t\t\t\t$(dispArray).each(function(n) {\n\n\t\t\t\t\tvar item = dispArray[n];\n\t\t\t\t\tvar cleanItem = item.item.replace(/\"/g, '&quot;');//if the user provides an entry with double-quotes it breaks our setting of the item attribute, this sanitizes the entry.\n\n\t\t\t\t\tvar span = '<span class=\"ui-state-default ui-corner-all\">';\n\t\t\t\t\tspan += item.display;\n\t\t\t\t\tspan += '<span class=\"ui-icon ui-icon-close ' + removeItemClass + '\" style=\"display: inline-block;\" item=\"';\n\t\t\t\t\tspan += cleanItem;\n\t\t\t\t\tspan += '\" index=\"';\n\t\t\t\t\tspan += n;\n\t\t\t\t\tspan += '\" title=\"Remove\"></span></span>';\n\n\t\t\t\t\tdisplaySpace.append(span);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//this method just fires the formElement.change() event so we draw the default values.\n\t\t\tthis.init = function(){\n\t\t\t\tformElement.change();\n\t\t\t}\n\n\t\t\tvar localFindSelectOption = this.findSelectOption;//We live in a kind of scoping hell since we use anonymous event handling functions with jQuery.\n\t\t\tvar localDrawUIboxList = this.drawUIboxList;\n\t\t\tvar localDisableOption = this.disableOption;\n\t\t\tvar localEnableOption = this.enableOption;\n\t\t\tvar localEnableAllOptions = this.enableAllOptions;\n\n\t\t\t/* Event Handlers */\n\t\t\t//Action to re-draw this.displaySpace each time this.formElement is changed\n\t\t\tformElement.on(\"change\", function(){\n\t\t\t\t//We just got a new value for this.formElement, update our itemList and item array.\n\t\t\t\tlocal.itemList = new List( $(this).val() );//fetch a list object of the current values.\n\t\t\t\titemArray = local.itemList.toArray();//make that list into an array for use with native functions.\n\n\t\t\t\t//if we've wound-up with a fresh item array make sure all our options are re-activated.\n\t\t\t\tif(itemArray.length == 0)\n\t\t\t\t\tlocalEnableAllOptions();\n\n\t\t\t\t//now call the drawUIboxList() method.\n\t\t\t\tlocalDrawUIboxList();\n\t\t\t});\n\n\t\t\t//what happens when we click the button to add an item?\n\t\t\taddButton.on(\"click\", function(e){\n\t\t\t\te.preventDefault();//don't let a click percolate up.\n\t\t\t\tlocal.addValue();\n\t\t\t});\n\n\t\t\tthis.addValue = function(){\n\t\t\t\t//Get the current value of our select box.\n\t\t\t\tvar myVal = selectElement.val();\n\n\t\t\t\t/* don't do anything if the text field is empty */\n\t\t\t\tif(myVal != \"\") {\n\t\t\t\tif (myVal == \"unknown\") {\n\t\t\t\t\t\tmyVal = \"#unknown\";\n\t\t\t\t\t}\n\t\t\t\t\t//now append our value to this.itemList.\n\n\t\t\t\t\tthis.itemList.append(myVal);\n\t\t\t\t\t//if this is a text box clear out the current value.\n\t\t\t\t\tif(isText) {\n\t\t\t\t\t\t selectElement.val(\"\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t localDisableOption(myVal);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Update this.formElement to match our revised itemList.\n\t\t\t\t\tformElement.val( this.itemList.toString() );\n\t\t\t\t\tformElement.change();//make sure the change event fires.\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//What happens when we remove an item from our display space?\n\t\t\t$(container).on(\"click\", \"span.\" + removeItemClass, function(e){\n\t\t\t\te.preventDefault();//don't let a click percolate up.\n\n\t\t\t\tvar myVal = $(this).attr(\"item\");\n\t\t\t\tvar myIndex = $(this).attr(\"index\");\n\n\t\t\t\t//take our existing list of labs, and remove this one from it.\n\t\t\t\tlocal.itemList.removeByIndex(myIndex); /* remove by index to prevent duplicates from going with it */\n\n\t\t\t\t//having removed it we can re-enable it if this is a select box.\n\t\t\t\tif(!isText) localEnableOption(myVal);\n\n\t\t\t\t//Update this.formElement to match our revised itemList.\n\t\t\t\tformElement.val( local.itemList.toString() );\n\t\t\t\tformElement.change();//make sure the change event fires.\n\t\t\t});\n\n\t\t\t//check for enter key press if this element is focused\n\t\t\t$(selectElement).keypress(function(e) {\n\t\t\t\tif(e.which == 13) {\n\t\t\t\t \tlocal.addValue();\n\t\t\t \treturn false; // stop form from submitting\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t});\n\n\t\t\t/*what to do if a user submits the form with text un-added in a text-based SelectMultiChoice?*/\n\t\t\tif(isText){\n\t\t\t\tselectElement.parents().each(function(i){\n\t\t\t\t\tif ($(this).is(\"form\") && $(this).attr(\"SelectMultiListening\") != 1){\n\t\t\t\t\t\t//add a listener\n\t\t\t\t\t\t$(this).on(\"submit\", function(e){\n\t\t\t\t\t\t\t//only do an automatic addValue() if it is helpful.\n\t\t\t\t\t\t\tif (local.selectHelper.val() != \"\" || local.itemList.toString() == \"\") {\n\t\t\t\t\t\t\t\tlocal.addValue();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t//set SelectMultiListening attribute for this form so we don't put more than one listener on it.\n\t\t\t\t\t\t$(this).attr(\"SelectMultiListening\", 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t}", "function generateSelectionMenu() {\n // Iterate through the river info to determine the dropdow groupings\n var selectionGroups = [];\n for(var i=0; i < riverInfo.length; i++) {\n if(i == 0) {\n selectionGroups.push(riverInfo[i].state);\n } else {\n if(selectionGroups.includes(riverInfo[i].state) == false) {\n selectionGroups.push(riverInfo[i].state);\n }\n }\n }\n\n // Iterate over each selection group, placing the group in the item-list\n for(var i=0; i < selectionGroups.length; i++) {\n var currentGroup = '<div id=\"' + abbrState(selectionGroups[i], 'abbr') + '-group\" class=\"item-group\" data-state=\"' + selectionGroups[i] + '\"></div>';\n $('.item-list').append(currentGroup);\n }\n\n // Iterate over each item in the river info list, placing each one in its appropriate dropdown group\n riverInfo.forEach((riverData, i) => {\n var selectionIDText = riverData.river.toLowerCase().split(\" \").join(\"-\") + \"-selection\";\n var currentItem = document.createElement('div');\n currentItem.id = riverData.river.toLowerCase().split(\" \").join(\"-\") + '-selection';\n currentItem.classList.add('item');\n currentItem.dataset.index = i;\n currentItem.addEventListener('click', () => selectItem(selectionIDText));\n currentItem.innerHTML = riverData.river;\n var itemGroup = '#' + abbrState(riverData.state, 'abbr') + '-group';\n $(itemGroup).append(currentItem);\n })\n}", "function FillFormSelect() {\n //Categories\n let cat = [];\n for (let el of Categories.values()) {\n cat.push(el);\n }\n $(\"#formCategoryId\").empty();\n $(\"#formCategoryId\").append($('<option>', { value: -1, text: \"New Category\" }));\n cat.sort((a, b) => a.Name < b.Name);\n for (let category of cat) {\n $('<option>', { value: category.Id, text: category.Name }).appendTo(\"#formCategoryId\");\n }\n\n //Publishers\n let pub = [];\n for (let el of Publishers.values()) {\n pub.push(el);\n }\n pub.sort((a, b) => a.Name < b.Name);\n $(\"#formPublisherId\").empty();\n $(\"#formPublisherId\").append($('<option>', { value: -1, text: \"New Publisher\" }));\n for (let publisher of pub) {\n $('<option>', { value: publisher.Id, text: publisher.Name }).appendTo(\"#formPublisherId\");\n }\n\n //Languages\n let lan = [];\n for (let el of Languages.values()) {\n lan.push(el);\n }\n lan.sort((a, b) => a.Name < b.Name);\n $(\"#formLanguageId\").empty();\n $(\"#formLanguageId\").append($('<option>', { value: -1, text: \"New Language\" }));\n for (let language of lan) {\n $('<option>', { value: language.Id, text: language.Name }).appendTo(\"#formLanguageId\");\n }\n\n //Authors\n let auth = [];\n for (let el of Authors.values()) {\n auth.push(el);\n }\n auth.sort((a, b) => `${a.FirstName}${a.LastName}` < `${b.FirstName}${b.LastName}`);\n $(\"#formAuthorId\").empty();\n $(\"#formAuthorId\").append($('<option>', { value: -1, text: \"New Author\" }));\n for (let author of auth) {\n $('<option>', { value: author.Id, text: `${author.FirstName} ${author.LastName}` }).appendTo(\"#formAuthorId\");\n }\n }", "function createForm() {\n var form = FormApp.create('Temperature Data Trends');\n form.addTextItem().setTitle('UserID').setRequired(true);\n // Will need to manually add validation after this is created!\n form.addTextItem().setTitle('Temperature (F)').setRequired(true);\n \n var feelingItem = form.addMultipleChoiceItem().setTitle('Feeling').setRequired(true); \n var symptomsPage = form.addPageBreakItem().setTitle('Do you have any of these symptoms?');\n var wellChoice = feelingItem.createChoice('Well', FormApp.PageNavigationType.SUBMIT);\n var sickChoice = feelingItem.createChoice('Sick', symptomsPage);\n feelingItem.setChoices([wellChoice, sickChoice]);\n \n var symptomsCheckbox = form.addCheckboxItem().setTitle('Symptoms');\n symptomsCheckbox.setChoices([symptomsCheckbox.createChoice('Extreme tiredness'),\n symptomsCheckbox.createChoice('Muscle pain'),\n symptomsCheckbox.createChoice('Headache'), \n symptomsCheckbox.createChoice('Sore throat'), \n symptomsCheckbox.createChoice('Vomiting'), \n symptomsCheckbox.createChoice('Diarrhea'), \n symptomsCheckbox.createChoice('Rash'), \n symptomsCheckbox.createChoice('Unexplained bleeding'), \n symptomsCheckbox.createChoice('Taking pain relievers')]);\n \n \nLogger.log('Published URL: ' + form.getPublishedUrl());\nLogger.log('Editor URL: ' + form.getEditUrl());\n}", "selectItem() {\n if (this.selectedItem !== this.item.Name) {\n const selectEvent = new CustomEvent(\"buttonclick\", {\n bubbles: true,\n detail: this.item\n });\n this.dispatchEvent(selectEvent);\n }\n }", "function createTeamForm () {\n var item = team_form.addMultipleChoiceItem();\n \n // Create form UI\n team_form.setShowLinkToRespondAgain(false);\n team_form.setTitle(name + \" game\");\n team_form.setDescription(\"Game RSVP form\");\n // Set the form items\n item.setTitle(\"Will you attend the game?\");\n item.setChoices([\n item.createChoice(rsvp_opts[0]),\n item.createChoice(rsvp_opts[1]),\n item.createChoice(rsvp_opts[2]),\n item.createChoice(rsvp_opts[3])]);\n team_form.addSectionHeaderItem().setTitle(\n \"Do not change if you want your reply to count.\");\n team_form.addTextItem();\n team_form.addTextItem();\n\n // Attach the form to its destination [spreadsheet]\n team_form.setDestination(destination_type, destination);\n }", "function Selection() {\n var boundingBox = this.ui = $('<div></div>');\n var sid = this.id = null;\n selectionObjects.push(this);\n boundingBox.css({\n 'background': '#e8e8e8',\n 'padding': '4px 4px 2px 4px',\n 'border-radius': '6px',\n 'margin-bottom': '3px',\n 'position': 'relative',\n 'width': '156px'\n });\n\n var header = $('<div></div>');\n boundingBox.append(header);\n var heading = $('<div></div>');\n var controls = $('<div></div>');\n\n header.append(heading, controls);\n heading.css({\n 'font-family': 'Arial',\n 'font-weight': 'bold',\n 'font-size': '12px',\n 'display': 'inline-block',\n 'width': '60px'\n });\n\n controls.css({\n 'display': 'inline-block'\n });\n\n header.hide();\n controls.editMode = false;\n\n var removeButton = new button(icons.minus, 16, { bfr: 0.5, backgroundColor: '#f06f6f', tooltip: 'Remove Selection' });\n var editButton = new button(icons.pencil, 16, { tooltip: 'Edit Selection' });\n var visibleButton = new button(icons.visible, 16, { tooltip: 'Show / Hide Selection' });\n\n controls.append(removeButton.ui)\n controls.append(editButton.ui);\n controls.append(visibleButton.ui);\n\n var parameters = $('<div></div>');\n boundingBox.append(parameters);\n\n var styleHolder = $('<div></div>');\n\n removeButton.ui.on('click', function () {\n stateManager.removeSelection(sid);\n boundingBox.detach();\n //delete this;\n });\n\n editButton.ui.on('click', function () {\n parameters.toggle();\n });\n\n var hidden = false;\n visibleButton.ui.on('click', () => {\n stateManager.toggleHide(sid);\n if (hidden) {\n hidden = false;\n visibleButton.setSVG(icons.visible);\n }\n else {\n hidden = true;\n visibleButton.setSVG(icons.invisible);\n }\n });\n\n var styleBox = new StyleBox();\n\n styleHolder.append(styleBox.ui);\n styleBox.ui.css({\n 'position': 'static',\n // 'left' : '0',\n 'width': 'px',\n 'border-radius': '4px'\n });\n\n styleBox.ui.hide();\n\n var allControl = this.allSelector = {\n key: 'Select All Atom',\n value: null,\n active: true\n }\n\n var allCheckBox = new $3Dmol.UI.Form.Checkbox(allControl);\n parameters.append(allCheckBox.ui);\n\n\n var selectionFormControl = this.selectionValue = {\n key: 'Selection Spec',\n value: null,\n active: true\n }\n\n var selectionSpecForm = new $3Dmol.UI.Form(validAtomSelectionSpecs, selectionFormControl);\n parameters.append(selectionSpecForm.ui);\n\n var submitControls = $('<div></div>');\n var submit = new button(icons.tick, 16, { backgroundColor: 'lightgreen', tooltip: 'Submit' });\n var cancel = new button(icons.cross, 16, { backgroundColor: 'lightcoral', tooltip: 'Cancel' });\n submitControls.append(submit.ui, cancel.ui);\n\n\n var alertBox = new AlertBox();\n parameters.append(alertBox.ui);\n\n parameters.append(submitControls);\n boundingBox.append(styleHolder);\n\n allCheckBox.update = function () {\n selectionSpecForm.ui.toggle();\n }\n\n function finalizeSelection(id) {\n header.show();\n controls.editMode = true;\n sid = this.id = id;\n heading.text('Sel#' + id);\n boundingBox.attr('data-id', id);\n parameters.hide();\n styleBox.setSid(id);\n styleBox.ui.show();\n }\n\n function checkAndAddSelection(sid = null) {\n var validate = selectionSpecForm.validate();\n if (validate) {\n selectionSpecForm.getValue();\n var checkAtoms = stateManager.checkAtoms(selectionFormControl.value);\n\n if (Object.keys(selectionFormControl.value).length == 0) {\n alertBox.error('Please enter some input');\n }\n else {\n if (checkAtoms) {\n var id = stateManager.addSelection(selectionFormControl.value, sid);\n finalizeSelection(id);\n if (sid == null) _editingForm = false;\n }\n else {\n alertBox.error('No atom selected');\n }\n }\n }\n else {\n alertBox.error('Invalid Input');\n }\n }\n\n function removeSelf() {\n\n // delete selectionToRemove;\n }\n\n submit.ui.on('click', () => {\n if (controls.editMode == false) {\n if (allControl.value) {\n let id = stateManager.addSelection({});\n finalizeSelection(id);\n _editingForm = false;\n }\n else {\n checkAndAddSelection();\n }\n\n }\n else {\n if (allControl.value) {\n let id = sid;\n stateManager.addSelection({}, id);\n finalizeSelection(id);\n }\n else {\n let id = sid;\n checkAndAddSelection(id);\n }\n }\n });\n\n var self = this;\n\n cancel.ui.on('click', () => {\n if (controls.editMode) {\n parameters.hide();\n }\n else {\n boundingBox.detach();\n removeSelf(self);\n _editingForm = false;\n }\n });\n\n\n boundingBox.on('keyup', (e) => {\n if (e.key == 'Enter') {\n submit.ui.trigger('click');\n }\n });\n\n /*\n * @function Selection#setProperty\n * @param {string} id Id of the selection created in StateManager \n * @param {Object} specs Defination of the selection that will be used to set default \n * values in the form\n */\n this.setProperty = function (id, specs) {\n // check for all selection\n if (Object.keys(specs).length == 0) {\n allCheckBox.setValue(true)\n } else {\n selectionSpecForm.setValue(specs);\n }\n\n // finalize the selection \n finalizeSelection(id);\n }\n\n /*\n * Adds style to the given selection \n * \n * @function Selection#addStyle \n * @param {String} selId Id of the selection to inititate the StyleBox\n * @param {String} styleId Id of the style that is created through StateManager\n * @param {AtomStyleSpecs} styleSpecs \n */\n this.addStyle = function (selId, styleId, styleSpecs) {\n styleBox.addStyle(selId, styleId, styleSpecs);\n }\n }", "function selectionMsubItems(subItem, Form, cont_search, nav_mobile) {\n\n let items = \"#\" + subItem + \"\";\n fromUpdateSearch = \"#form_search_\" + Form;\n $('.collection-item').css(\"background-color\", \"#fff\");\n $('.collection-item').css(\"color\", \"#26a69a\");\n\n $(items).css(\"background-color\", \"#26a69a\");\n $(items).css(\"color\", \"#eafaf9\");\n let text = sNameTitle + \" \" + $(items).text();\n $('#titleForm ').text(text);\n\n if (nav_mobile) {\n if ($('.button-collapse').is(\":visible\")) {\n $('.button-collapse').sideNav('hide');\n }\n }\n\n if (cont_search) {\n $('#cont_search_' + Form).css(\"display\", \"block\");\n\n disableEnableInput(Form, 0);\n disableEnableElementInput(fromUpdateSearch, 1);\n\n } else {\n $('#cont_search_' + Form).css(\"display\", \"none\");\n disableEnableInput(Form, 1);\n disableEnableElementInput(fromUpdateSearch, 0);\n }\n\n selectForm(Form);\n typeSelectionUpdateCreate = subItem.substring(subItem.indexOf(\"_\") + 1, subItem.length);\n\n\n}", "function populateForm() {\n\n //Add an <option> tag inside the form's select for each product\n var selectElement = document.getElementById('items');\n\n for (var i in Product.allProducts) {\n\n var newListItem = document.createElement('option');\n newListItem.textContent= Product.allProducts[i].name;\n\n selectElement.appendChild(newListItem);\n }\n\n}", "function markingMenuOnSelect(selectedItem) {\r\n\ttracker.recordSelectedItem(selectedItem.name);\r\n\tdocument.getElementById(\"selectedItem\").innerHTML = selectedItem.name;\r\n}", "function loadTerrainModificationSelectionForm() {\n currentState = \"SelectTerrainModificationTypes\";\n customInputsTitle.innerText = \"Select Terrain Modificatinos to be Made\";\n customInputsContent.innerHTML = \"\";\n var terrainModificationSelectionList = document.createElement(\"ul\");\n terrainModificationSelectionList.setAttribute(\"id\", \"terrain-modification-selection-list\");\n terrainModificationSelectionList.setAttribute(\"class\", \"selection-list\");\n for (var i in terrainModificationSelectionForm.terrainModificationTypes) {\n var type = terrainModificationSelectionForm.terrainModificationTypes[i];\n var typeId = type + \"-count\";\n // create list item element\n var newListItem = document.createElement(\"li\");\n newListItem.setAttribute(\"id\", type + \"-list-item\");\n // create nubmer input element\n var numberField = document.createElement('input');\n numberField.setAttribute(\"class\", \"custom-input\");\n numberField.setAttribute(\"type\", \"number\");\n numberField.setAttribute(\"id\", typeId);\n numberField.setAttribute(\"min\", 0);\n numberField.setAttribute(\"max\", maxTerrainModifications);\n numberField.value = 0;\n // create label element for checkbox\n var newLabel = document.createElement(\"label\");\n newLabel.setAttribute(\"for\", typeId);\n newLabel.innerText = type;\n // add elements to DOM\n newListItem.appendChild(numberField);\n newListItem.appendChild(newLabel);\n terrainModificationSelectionList.appendChild(newListItem);\n }\n customInputsContent.appendChild(terrainModificationSelectionList);\n}", "function createSelectForm(id, label, subLabel, options ) {\n\t\n\tvar tmpStr = \"<option value='undefined' selected>\" +options[0]+ \"</option>\";\n\tfor(var i = 0; i < options.length-1; i++) {\n\t\ttmpStr +=\n\t\t\t\"<option value='\" +i+ \"'>\" +options[i+1]+ \"</option>\";\n\t}\n\t\n\t$(\"#\"+id).addClass(\"formContainer\").append(\n\t\t\t\"<label for='\"+id+\"Select' class='mylabel'>\" +label+ \"</label>\" +\n\t\t\t\"<span class='mylabelSmall'>\" +subLabel+ \"</span>\" +\n\t\t\t\"<select name='\" +id+ \"Select' id='\" +id+ \"Select'>\" +\n\t\t\t tmpStr + \"</select>\"); \n}", "function main(args){\r\n\r\n var selectedItem = args.DOC_REF.selection[0];\r\n var selectionName;\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n selectionName = selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n selectionName = selectedItem.typename; \r\n }\r\n \r\n\r\n\r\n var myDialog = sfDialogFactory(mainDialog(selectionName));\r\n \r\n myDialog.show();\r\n}", "function populateForm() {\n\n //TODO: Add an <option> tag inside the form's select for each product\n const selectElement = document.getElementById('items');\n for (let i in Product.allProducts) {\n let optionsEle = document.createElement('option');\n optionsEle.textContent = Product.allProducts[i].name;\n selectElement.appendChild(optionsEle); \n\n }\n\n}", "function populateForm() {\n var selectElement = document.getElementById('items');\n for (var i in Product.allProducts) {\n var optionEl = document.createElement('option');\n optionEl.textContent = Product.allProducts[i].name;\n selectElement.appendChild(optionEl);\n }\n}", "function selectProductListInteraction() {\n\n var TriggeredAction = request.triggeredFormAction;\n if (TriggeredAction !== null) {\n if (TriggeredAction.formId === 'select') {\n\n\n //var ProductList = TriggeredAction.object;\n\n // where to continue now?\n return;\n }\n }\n\n\n}", "function Dropdown(){\n this.createDropdown = function(dict, name, id, selected){\n this.item = document.createElement(\"select\")\n\t\tthis.name = name\n\n\t\tvar ttmp = document.createElement(\"label\")\n\t\tttmp.setAttribute(\"name\", name)\t\t\t\n\t\tttmp.innerHTML = this.name\n\t\tthis.item.appendChild(ttmp)\n\n \t\tfor(var x in dict){\n \t\tvar tmp =document.createElement(\"option\")\n \t\ttmp.setAttribute('value',dict[x])\n \t\ttmp.innerHTML= x + '<br>' \n \n \t\tthis.item.appendChild(tmp)\n \t}\n\n },\n \n this.getSelected = function(){\n this.item=document.getElementById()\n },\n\n this.addToDocument = function(){\n document.body.appendChild(this.item);\n\n }\n}", "_onItemSelect(item) {\n // handle action to render the new page!\n\n Actions.editdetails({text: item});\n }", "function populateForm() {\n var selectElement = document.getElementById(\"items\");\n for (var i in Product.allProducts) {\n var option=document.createElement(\"option\");\n option.value=Product.allProducts[i].name;\n option.textContent=Product.allProducts[i].name;\n selectElement.appendChild(option);\n }\n\n}", "__showSelectionDialog() {\n if (this.isEnabled() == true) {\n // Set index before items, because setItems() triggers rendering.\n this.__selectionDialog.setSelectedIndex(this.getSelection());\n this.__selectionDialog.setItems(this.getModel());\n this.__selectionDialog.show();\n }\n }", "function create_item() {\n document.getElementById('modify-header').textContent = 'Creating new Item';\n create_form('meat_shop_item','content-div');\n}", "function xcustom_makeActionOnObjectSelection() {\r\n var currentSelectedObject = xcustom_getCurrentSelectedObject();\r\n if (null === currentSelectedObject) {\r\n // console.log('Nothing Selected...');\r\n xcustom_resetAndClosePanelSelectedObjectContent();\r\n $('#xcustom-div-right-panel').hide();\r\n return;\r\n }\r\n // console.log('The Selected Object Is : ', currentSelectedObject);\r\n xcustom_showSelectedObjectDataOnViewer(currentSelectedObject);\r\n}", "function setCurrentItem(item)\n{\n selectedObject = item;\n}", "function addItemInSelect(item) {\n const optionItem = document.createElement('option')\n optionItem.text = item.nome\n optionItem.value = `${item.codigo}|${item.nome}|${item.foto}|${item.regiao}`\n selDedicantes.appendChild(optionItem)\n}", "function populateForm() {\n const selectElement = document.getElementById('items');\n for (let i in Product.allProducts) {\n let option = document.createElement('option');\n option.textContent = Product.allProducts[i].name;\n option.id = i; \n selectElement.appendChild(option);\n } \n}", "function addDefinitionForm()\n{\n \n \n formp = $(getFormPalabra());\n $(\"#forms_conceptos\").append(formp);\n //inserta una animacion usa magic.css\n formp.addClass('magictime spaceInDown');\n $(\"#sec_\"+items_conceptos).find(\"select\").selectpicker();\n\n \n\t\n}", "function displaySelectedItem() {\n var fi = findItem();\n if (fi) {\n $scope.item.category = fi.category;\n $scope.item.text = fi.text;\n $scope.item.amount = fi.amount;\n }\n else\n {\n //item add\n $scope.item.category={};\n $scope.item.text = '';\n $scope.item.amount = '';\n $rootScope.editMode = false;\n }\n }", "setNewItem(state) {\n state.selectedItem.user_id = 0\n state.selectedItem.user_name.value = ''\n state.selectedItem.password.value = ''\n state.selectedItem.full_name.value = ''\n state.selectedItem.email.value = ''\n state.selectedItem.phone_number.value = ''\n state.selectedItem.mobile_number.value = ''\n state.selectedItem.unit.value = ''\n state.selectedItem.sex.value = 0\n state.selectedItem.address.value = ''\n state.selectedItem.status = 1\n state.selectedItem.schedule_id.value = 0\n state.selectedItem.birthday.value = ''\n state.selectedItem.list_group.value = []\n state.selectedItem.ip.value = []\n state.selectedIndex = -1\n }", "function showNewItemField(id, name){\r\n\r\n // leverage existing onchange() to remove red text formatting for selected option\r\n var selectClasses = document.getElementById(id).classList;\r\n selectClasses.remove('defaultGray');\r\n\r\n if (name in newAnimalItemIds) {\r\n if (id === \"animal\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Animal:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newAnimal\" id=\"newAnimal\" />';\r\n } else if (id === \"habitat\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Habitat:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newHabitat\" id=\"newHabitat\" />';\r\n } else if (id === \"menu\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Menu:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newMenu\" id=\"newMenu\" />';\r\n } else if (id === \"option\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Option:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newOption\" id=\"newOption\" />';\r\n }\r\n } else {\r\n if (id === \"animal\") {\r\n document.getElementById(newAnimalItemIds.key(0)).innerHTML = ''; // name is undefined so use index to access value\r\n } else if (id === \"habitat\") {\r\n document.getElementById(newAnimalItemIds.key(1)).innerHTML = '';\r\n } else if (id === \"menu\") {\r\n document.getElementById(newAnimalItemIds.key(2)).innerHTML = '';\r\n } else if (id === \"option\") {\r\n document.getElementById(newAnimalItemIds.key(3)).innerHTML = '';\r\n } else {\r\n console.log(\"No matches!\")\r\n }\r\n }\r\n}", "function create_select_function(autocompletion_widget_id) {\n return function(event, ui) {\n // Prevent the value (the id number) of the item selected from\n // displaying after a selection has been made ...\n event.preventDefault();\n\n // ... and display the *label* of the item selected instead ...\n jQuery(this).val(ui.item.label);\n\n // ... but store the value of the item selected in a hidden field.\n jQuery('#' + completion_fields[autocompletion_widget_id].hidden_field_id).val(ui.item.value);\n }\n}", "function populateForm() {\n \n //TODO: Add an <option> tag inside the form's select for each product\n \n var selectElement1 = document.getElementById('items');\n for (var i=0;i<assets.length;i++) {\n var options = document.createElement('option');\n selectElement1.appendChild(options);\n options.textContent= assets[i].split('.')[0];\n\n }\n \n \n\n}", "click(){\n createAddItemWindow();\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function createForm(obj){\n // set curr uni as the set value\n var currCollegeKey = jsonObject.user.college.key;\n console.log(currCollegeKey);\n\n var list = document.getElementById(\"inputUni\");\n\n list.setAttribute(\"name\", \"collegeKey\");\n list.classList.add(\"form-control\");\n\n //add college option from list to select tag\n for(i = 0; i < obj.length; i++) {\n var singleCollegeOption = document.createElement(\"OPTION\");\n singleCollegeOption.innerHTML = obj[i].name;\n singleCollegeOption.setAttribute(\"value\", obj[i].key);\n if (currCollegeKey == obj[i].key) {\n singleCollegeOption.setAttribute(\"selected\", \"selected\");\n }\n list.appendChild(singleCollegeOption);\n }\n\n}", "function changeProductColor(item){\n document.selectForm.selectedProductColor.value=item.value;\n document.selectForm.submit();\n}", "renderNewItemForm(e) {\n const form = e.target.parentElement.querySelector('form')\n form.style.display = 'block'\n }", "function loginBox() {\n var x = document.createElement(\"SELECT\");\n var y = document.createElement(\"SELECT\");\n\n x.setAttribute(\"id\", \"selectionBox\");\n x.setAttribute(\"name\", \"academic_level\");\n y.setAttribute(\"id\", \"selectionBox1\");\n y.setAttribute(\"name\", \"program\");\n\n document.getElementById('login-box__selsction').appendChild(x);\n document.getElementById('login-box__selsction1').appendChild(y);\n\n for (let i = 0; i < niveaus.length; i++) {\n var z = document.createElement(\"option\");\n var t = document.createTextNode(niveaus[i]);\n\n z.appendChild(t);\n document.getElementById(\"selectionBox\").appendChild(z);\n }\n\n for (let i = 0; i < programs.length; i++) {\n var z = document.createElement(\"option\");\n var t = document.createTextNode(programs[i]);\n\n z.appendChild(t);\n document.getElementById(\"selectionBox1\").appendChild(z);\n }\n}", "function chooseASpot(){\n\t\tvar formTag = document.getElementsByTagName(\"form\"),\n\t\t\tselectLi = ge('select'),\n\t\t\tmakeSelect = document.createElement('select');\n\t\t\tmakeSelect.setAttribute(\"id\", \"establishment\");\n\t\tfor(var i=0, j=establishmentGroups.length; i<j; i++){\n\t\t\tvar makeOption = document.createElement('option');\n\t\t\tvar optText = establishmentGroups[i];\n\t\t\tmakeOption.setAttribute(\"value\", optText);\n\t\t\tmakeOption.innerHTML = optText;\n\t\t\tmakeSelect.appendChild(makeOption);\n\t\t}\n\t\tselectLi.appendChild(makeSelect);\n\t\t\n\t}", "function makeCategory() {\n var pageForms = document.getElementsByTagName(\"form\"), // pageForms is an array of all the form tags\n selectLi = $(\"select\"),\n makeSelect = document.createElement(\"select\");\n\n makeSelect.setAttribute(\"id\", \"Title\");\n for (var i = 0; i < titleList.length; i++){\n var makeOption = document.createElement(\"option\");\n var optText = titleList[i];\n makeOption.setAttribute(\"value\", optText);\n makeOption.innerHTML = optText;\n makeSelect.appendChild(makeOption);\n }\n selectLi.appendChild(makeSelect);\n }", "function createSelectColors(product) {\n //selectionde la couleur\n let colorChoiceSelect = document.getElementById(\"colorChoice\");\n product.colors.forEach(function (color) {\n var newOption = document.createElement(\"option\");\n newOption.text = color.toString(); //item.whateverProperty\n\n colorChoiceSelect.add(newOption);\n let c = newOption;\n\n colorChoiceSelect.addEventListener(\"click\", (e) => {\n colorProduct = e.target.value;\n });\n });\n}", "function _create_select_box(val, id, name){\n\tif( ! bbop.is_defined(name) ){\n\t name = select_item_name;\t \n\t}\n\t\n\tvar input_attrs = {\n\t 'value': val,\n\t 'name': name,\n\t 'type': 'checkbox'\n\t};\n\tif( bbop.is_defined(id) ){\n\t input_attrs['id'] = id;\n\t}\n\tvar input = new html.input(input_attrs);\n\treturn input;\n }", "function edit(){\n toggle_all();\n let form = document.getElementById('editform');\n let header = document.createElement('h4');\n header.innerHTML = \"Select Tuning\";\n header.className = 'aaron-header';\n form.appendChild(header);\n\n let selector, option;\n\n //for each string\n for(let i = 6; i >= 1; i--){\n selector = document.createElement('select');\n\n //for each option for each string\n for(let i = 0; i < sounds.length; i++){\n option = document.createElement('option');\n option.text = sounds[i].name;\n selector.add(option);\n }\n\n //adding select element to page\n selector.className = \"w3-select w3-pale-purple\";\n selector.id = \"selector\"+i;\n selector.required = true;\n form.appendChild(selector);\n }\n\n //add confirm button to form\n let button = document.createElement('button');\n button.innerHTML = \"APPLY\";\n button.className = \"w3-btn w3-indigo\"\n button.onclick = confirm_edits;\n form.appendChild(button);\n add_cancel_button('editform');\n}", "function populateForm() {\n\n //TODO: Add an <option> tag inside the form's select for each product\n var myItem = document.getElementById('items');\n for (var i = 0; i < products.length; i++) {\n var userOptions = document.createElement('option');\n myItem.appendChild(userOptions);\n userOptions.textContent = products[i].split(\".\", 1);\n }\n}", "function createNumSelectForm(id, label, subLabel, placeholder, startNum, quantity ) {\n\t\n\tvar tmpStr = \"\";\n\tfor( ; startNum <= quantity; startNum++) {\n\t\ttmpStr += \"<option value='\" +startNum+ \"'>\" +startNum+ \"</option>\";\n\t}\n\t\n\t$(\"#\"+id).addClass(\"formContainer\").append(\n\t\t\t\"<label for='\"+id+\"' class='mylabel'>\" +label+ \"</label>\"+\n\t\t\t\"<span class='mylabelSmall'>\" +subLabel+ \"</span>\"+\n\t\t\t\"<select name='\" +id+ \"' id='\" +id+ \"'>\"+\n\t\t\t\t\"<option value='undefined' selected>\" +placeholder+ \"</option>\" + tmpStr + \"</select>\");\n}", "function selectForm(){\n\tif(document.getElementById(\"designComponent\").checked){\n\t\tdocument.getElementById(\"componentForm\").style.display = \"block\";\n\n\t\tdocument.getElementById(\"sequenceForm\").style.display = \"none\";\n\t\tdocument.getElementById(\"backboneForm\").style.display = \"none\";\n\n\t\tscrollToId(\"componentForm\");\n\t}\n\telse if(document.getElementById(\"designSequence\").checked){\n\t\tdocument.getElementById(\"sequenceForm\").style.display = \"block\";\n\n\t\tdocument.getElementById(\"componentForm\").style.display = \"none\";\n\t\tdocument.getElementById(\"backboneForm\").style.display = \"none\";\n\n\t\tscrollToId(\"designSequence\");\n\t}\n\telse if(document.getElementById(\"designBackbone\").checked){\n\t\tdocument.getElementById(\"backboneForm\").style.display = \"block\";\n\n\t\tdocument.getElementById(\"componentForm\").style.display = \"none\";\n\t\tdocument.getElementById(\"sequenceForm\").style.display = \"none\";\n\n\t\tscrollToId(\"backboneForm\");\n\t}\n}", "constructor(value, selected) {\r\n this.value = value;\r\n this.selected = selected;\r\n }", "function createSelect(rawData, itemName) {\n console.log(\"itemName\", itemName);\n console.log(\"rawdata\", rawData);\n var myDiv = document.getElementById(\"select_\" + itemName);\n myDiv.innerHTML = \"\";\n\n\n if (itemName == \"username\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"user_name\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"user_name\"]).trim();\n myDiv.appendChild(option);\n }\n // var selected = $(\"#current-route\").val();\n // alert($scope.currentRoute);\n $(\"#select_username\").val($scope.currentRoute);\n }\n\n \n\n\n }", "function selectItem(event) {\n if (event.target.checked) {\n //adding\n for (let i = 0; i < allcat.length; i++) {\n for (let j = 0; j < allcat[i].length; j++) {\n if (allcat[i][j].id == event.target.id) {\n selected.push(allcat[i][j]);\n break;\n }\n }\n }\n } else {\n //deleting\n let delpos = -1;\n for (let i = 0; i < selected.length; i++) {\n if (selected[i].id == event.target.id) {\n delpos = i;\n break;\n }\n }\n if (delpos >= 0) {\n selected.splice(delpos, 1);\n }\n }\n diagram();\n}", "function drawItemSelection(x,y,w,h,id){\n\t\n\tif (numberSelected() == 1) { //Change to == numberRuleItems\n\t\tallowed = false;\n\t} else if (numberSelected() == 0) { // < numberRuleItems\n\t\tallowed = true;\n\t}\n\t\tconsole.log(ruleType, ruleNumber, ruleColor)\n\t\n\t//Depending on which item you draw... Do the following...\n\tvar img = borderImage2; // deselected\n\tif (id == \"hat\"){\n\t\tif (hatSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[2] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (hatSelected){\n\t\t\t\t\thatSelected = false; // Hat selected\n\t\t\t\t} else if (allowed==true) {hatSelected = true;}\n\t\t\t\tconsole.log(\"hat selected.\")\n\t\t}, null, function() {});\n\t}\n\n\tif (id == \"shirt\"){\n\t\tif (shirtSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[3] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (shirtSelected){\n\t\t\t\t\tshirtSelected = false; // shirt selected\n\t\t\t\t}else if (allowed==true) {shirtSelected = true;}\n\t\t\t\tconsole.log(\"shirt selected.\")\n\t\t}, null, function() {});\t\t\n\t}\n\n\tif (id == \"pants\"){\n\t\tif (pantsSelected == true){\n\t\t\timg = borderImage; // selected\t\t\n\t\t}\n\t\tuiObjects[4] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (pantsSelected){\n\t\t\t\t\tpantsSelected = false; // pants selected\n\t\t\t\t}else if (allowed==true) {pantsSelected = true;}\n\t\t\t\tconsole.log(\"pants selected.\")\n\t\t}, null, function() {});\n\t}\n\n\tif (id == \"shoes\"){\n\t\tif (shoesSelected == true){\n\t\t\timg = borderImage; // selected\t\t\n\t\t}\n\t\tuiObjects[5] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (shoesSelected){\n\t\t\t\t\tshoesSelected = false; // shoes selected\n\t\t\t\t}else if (allowed==true) {shoesSelected = true;}\n\t\t\t\tconsole.log(\"shoes selected.\")\n\t\t}, null, function() {});\n\t}\n\t\n\t\tif (id == \"itemFront\"){\n\t\tif (itemfSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[6] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (itemfSelected){\n\t\t\t\t\titemfSelected = false; // Hat selected\n\t\t\t\t}else if (allowed==true) {itemfSelected = true;}\n\t\t\t\tconsole.log(\"front item selected.\")\n\t\t}, null, function() {});\n\t}\n\t\n\t\tif (id == \"itemBack\"){\n\t\tif (itembSelected == true){\n\t\t\timg = borderImage; // selected\n\t\t}\n\t\tuiObjects[7] = new uiObject(x, y, w, h, \n\t\t\tfunction (){\n\t\t\t\tif (itembSelected){\n\t\t\t\t\titembSelected = false; // Hat selected\n\t\t\t\t}else if (allowed==true) {itembSelected = true;}\n\t\t\t\tconsole.log(\"back item selected.\")\n\t\t}, null, function() {});\n\t}\n\n\t//create a box around each item.\n\tctx.drawImage(img,x,y,w,h);\n}", "function selectItem(e) {\r\n\t// Remove all show and border classes\r\n\tremoveBorder();\r\n\tremoveShow();\r\n\t// Add border to current tab item\r\n\tthis.classList.add('tab-border');\r\n\t// Grab content item from DOM\r\n\tconst tabContentItem = document.querySelector(`#${this.id}-content`);\r\n\t// Add show class\r\n\ttabContentItem.classList.add('show');\r\n}", "function selectItem(e) {\n removeBorder();\n removeShow();\n this.classList.add('mood-selected');\n const moodContentItem = document.querySelector(`#${this.id}-content`);\n moodContentItem.classList.add('show');\n}", "function AdicionaItem(tipo_item, div, div_pai) {\n var input_em_uso = CriaInputCheckbox(false);\n input_em_uso.name = 'em_uso';\n input_em_uso.addEventListener('change', {\n tipo_item: tipo_item,\n handleEvent: function(e) {\n ClickUsarItem(this.tipo_item, e.target); } });\n div.appendChild(input_em_uso);\n\n var select = CriaSelect();\n var items_ordenados = [];\n var tabela_item = tabelas_itens[tipo_item].tabela;\n for (var chave in tabela_item) {\n items_ordenados.push({ chave_item: chave, valor_item: tabela_item[chave] });\n }\n items_ordenados.sort(function(ie, id) {\n return Traduz(ie.valor_item.nome).localeCompare(Traduz(id.valor_item.nome));\n });\n items_ordenados.forEach(function(item) {\n select.appendChild(\n CriaOption(Traduz(item.valor_item.nome) + ' (' + TraduzDinheiro(item.valor_item.preco) + ')', item.chave_item));\n });\n select.addEventListener('change', AtualizaGeral);\n select.name = 'item';\n div.appendChild(select);\n\n var botao_remover = CriaBotao('-', null, null);\n botao_remover.addEventListener('click', {\n handleEvent: function(e) {\n RemoveFilho(div, div_pai);\n AtualizaGeral();\n e.stopPropagation();\n } });\n div.appendChild(botao_remover);\n\n var button_vender = CriaBotao(Traduz('Vender'), null, 'venda', {\n div: div,\n tabela: tabela_item,\n handleEvent: function(evt) {\n ClickVenderItem(this.div, this.tabela);\n }\n });\n var button_comprar = CriaBotao(Traduz('Comprar'), null, 'compra', {\n div: div,\n tabela: tabela_item,\n handleEvent: function(evt) {\n ClickComprarItem(this.div, this.tabela);\n }\n });\n div.appendChild(button_vender);\n div.appendChild(button_comprar);\n\n div_pai.appendChild(div);\n}", "function render() {\n\n // create button that adds patients to the system - launches lateroundsQuick form\n var addClient = document.createElement('p');\n addClient.onclick = function() {\n odkTables.addRowWithSurvey(\n \t\tnull,\n 'pediatria',\n 'lateroundsQuick',\n null,\n null);\n };\n addClient.setAttribute('class', 'launchForm');\n addClient.innerHTML = 'Add child';\n document.getElementById('searchBox').appendChild(addClient);\n\n for (var i = 0; i < pediatria.getCount(); i++) {\n\n var regdateEntered = pediatria.getData(i, 'regdate');\n var nameEntered = pediatria.getData(i, 'nome');\n var dobEntered = pediatria.getData(i, 'dob');\n var anosEntered = pediatria.getData(i, 'anos');\n var mesEntered = pediatria.getData(i, 'meses');\n var semEntered = pediatria.getData(i, 'semanes');\n var diasEntered = pediatria.getData(i, 'dias');\n var\tsexEntered = pediatria.getData(i, 'sex');\n var pesoEntered = pediatria.getData(i, 'peso');\n var tempEntered = pediatria.getData(i, 'tempr');\n var maeEntered = pediatria.getData(i, 'nomemae');\n var bairroEntered = pediatria.getData(i, 'bairro');\n var secEntered = pediatria.getData(i, 'sec1');\n var camEntered = pediatria.getData(i, 'cam1');\n var checkSmxcau = pediatria.getData(i, 'smxcau');\n\n // make list entry\n // Only show not patients not yet checked today\n{\n /* Creating the item space */\n var item = document.createElement('li');\n item.setAttribute('class', 'item_space');\n item.setAttribute(\n 'onClick',\n 'handleClick(\"' + pediatria.getRowId(i) + '\")');\n if(nameEntered === null) {\n \tnameEntered = 'Não sabe';\n }\n item.innerHTML = nameEntered;\n document.getElementById('list').appendChild(item);\n\n var chevron = document.createElement('img');\n chevron.setAttribute(\n 'src',\n odkCommon.getFileAsUrl('config/assets/img/little_arrow.png'));\n chevron.setAttribute('class', 'chevron');\n item.appendChild(chevron);\n\n // create sub-list in item space\n // DoB/age information\n var age = document.createElement('li');\n var ageEntered = null;\n \tage.setAttribute('class', 'detail');\n if(dobEntered !== null) {\n ageEntered = dobEntered.substring(8,10) + dobEntered.substring(4,7) + '-' + dobEntered.substring(0,4);\n age.innerHTML = 'Dob: ' + ageEntered;\n } else if(dobEntered === null) {\n \tif(anosEntered !== null) {\n \t\tageEntered = anosEntered + ' ano(s)';\n \t} else if(mesEntered !== null) {\n \t\tageEntered = mesEntered + ' mês(es)';\n \t} else if(semEntered !== null) {\n \t\tageEntered = semEntered + ' semana(s)';\n \t} else if(diasEntered !== null) {\n \t\tageEntered = diasEntered + ' dia(s)';\n \t} else {\n \tageEntered = 'Não sabe';\n }\n \tage.innerHTML = 'Age: ' + ageEntered;\n } \n item.appendChild(age);\n \n // Sex information\n var sex = document.createElement('li');\n sex.setAttribute('class', 'detail');\n if(sexEntered === '1') {\n \tsexEntered = 'Male';\n } else if(sexEntered === '2') {\n \tsexEntered = 'Female';\n } else {\n \tsexEntered = 'Não sabe';\n }\n sex.innerHTML = 'Sex: ' + sexEntered;\n item.appendChild(sex);\n \n // Weight and temperature information\n var pesotemp = document.createElement('li');\n pesotemp.setAttribute('class', 'detail');\n if(pesoEntered === null) {\n \tpesoEntered = 'Não sabe';\n }\n if(tempEntered === null) {\n \ttempEntered = 'Não sabe';\n }\n pesotemp.innerHTML = 'Weight: ' + pesoEntered + ',' + ' Temperature: ' + tempEntered;\n item.appendChild(pesotemp);\n \n // Bairro information\n var bairro = document.createElement('li');\n bairro.setAttribute('class', 'detail');\n if(bairroEntered === '1') {\n \tbairroEntered = 'Bandim I';\n } else if(bairroEntered === '2') {\n \tbairroEntered = 'Bandim II';\n } else if(bairroEntered === '3') {\n \tbairroEntered = 'Belem';\n } else if(bairroEntered === '4') {\n \tbairroEntered = 'Mindera';\n } else if(bairroEntered === '7') {\n \tbairroEntered = 'Cuntum I';\n } else if(bairroEntered === '9') {\n \tbairroEntered = 'Cuntum II';\n } else if(bairroEntered === '999') {\n \tbairroEntered = 'Não sabe';\n } else {\n \tbairroEntered = 'Não sabe';\n }\n bairro.innerHTML = 'Bairro: ' + bairroEntered;\n item.appendChild(bairro);\n \n // Name of mother\n var mae = document.createElement('li');\n mae.setAttribute('class', 'detail');\n if(maeEntered === null) {\n \tmaeEntered = 'Não sabe';\n }\n mae.innerHTML = 'Nome da mãe: ' + maeEntered;\n item.appendChild(mae);\n \n // Section and bed\n var seccam = document.createElement('li');\n seccam.setAttribute('class', 'detail');\n if(secEntered === null) {\n \tsecEntered = 'Não sabe';\n }\n if(camEntered === null) {\n \tcamEntered = 'Não sabe';\n }\n seccam.innerHTML = 'Seção: ' + secEntered + ',' + ' Cama: ' + camEntered;\n item.appendChild(seccam);\n }\n }\n}", "function addListItemFromForm() {\n addListItem( getFormValues());\n}", "setSelectedItem(state, itemDb) {\n //console.log(itemDb,'setSelectedItem');\n state.selectedItem.user_id = itemDb.user_id\n state.selectedItem.user_name.value = itemDb.user_name\n state.selectedItem.password.value = itemDb.password\n state.selectedItem.full_name.value = itemDb.full_name\n state.selectedItem.email.value = itemDb.email\n state.selectedItem.phone_number.value = itemDb.phone_number\n state.selectedItem.mobile_number.value = itemDb.mobile_number\n state.selectedItem.unit.value = itemDb.unit\n state.selectedItem.sex.value = itemDb.sex\n state.selectedItem.address.value = itemDb.address\n state.selectedItem.status = itemDb.status\n state.selectedItem.birthday.value = this.$formatDateVNToISO(itemDb.birthday)\n state.selectedItem.schedule_id.value = itemDb.schedule_id\n let obj = state.items.find(p => p.user_id === itemDb.user_id)\n if (obj) state.selectedIndex = state.items.indexOf(obj)\n state.selectedItem.list_group.value = []\n state.selectedItem.ip.value = []\n }", "function createSelect(rawData, itemName) {\n console.log(\"itemName\", itemName);\n console.log(\"rawdata\", rawData);\n var myDiv = document.getElementById(\"select_\" + itemName);\n myDiv.innerHTML = \"\";\n\n if (itemName == \"mctype\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = rawData[i][\"woid\"];//Subcon QC\n option.text = rawData[i][\"woid\"];\n myDiv.appendChild(option);\n }\n\n }\n }", "function setupForm() {\n var index = 1;\n document.getElementById(\"name\").focus();\n document.getElementById(\"colors-js-puns\").classList.add(\"is-hidden\");\n document.getElementById(\"other-title\").classList.add(\"is-hidden\");\n document.getElementById(\"payment\").selectedIndex = index;\n\n createTotal();\n togglePaymentDiv(index);\n }", "function newItem(){\n sendRequest(\n 'usergroups',\n {\n 'action': 'getNewItemForm',\n \"id_menucategory\": $('#kategoria').val()\n }, function(data){\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n });\n}", "function addSelection(item) {\n //if the owner reference is still null, set it to this item's parent\n //so that further selection is only allowed within the same container\n if (!selections.owner) {\n selections.owner = item.parentNode;\n }\n\n //or if that's already happened then compare it with this item's parent\n //and if they're not the same container, return to prevent selection\n else if (selections.owner != item.parentNode) {\n return;\n }\n\n //set this item's grabbed state\n item.setAttribute('aria-grabbed', 'true');\n\n //add it to the items array\n selections.items.push(item);\n}", "select(value) {\n\n \n let selectables = this.object_item(value).selectables;\n let selections = this.object_item(value).selections;\n\n\n\n if (selectables.length > 0) {\n\n selectables.addClass('OPTION-selected')\n .hide(1000);\n\n selections.addClass('OPTION-selected')\n .show(1000);\n\n this.object_item(value).options.prop('selected', true); // active selected original select\n\n // effacer class css SELECT-hover de cursur chaque changement\n this.$newSelect.find(this.elemsSelector).removeClass('SELECT-hover');\n\n\n\n\n if (this.options.keepOrder) { // order de position des item( asec or none)\n var selectionLiLast = this.$selectionUl.find('.OPTION-selected'); //les elements non hide =>show\n if ((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {\n selections.insertAfter(selectionLiLast.last());\n }\n }\n\n\n this.$originalSelect.trigger('change'); // start onchange de element original\n this.afterSelect(value);\n\n }\n }", "select() {\n\t\tconsole.log('Selected. Yay');\n\t\tconst selected = this.menuData[this.cursor].id;\n\n\t\tconst items = [];\n\t\tfor (let i = 0; i < this.menuData.length; i++) {\n\t\t\tlet addItem = null;\n\t\t\tconsole.log('Item type ' + this.menuData[i].type);\n\t\t\tif (this.menuData[i].type === MenuTypes.SLIDER) {\n\t\t\t\tconsole.log('Evaluating Slider');\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: this.menuData[i].input.value\n\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (this.menuData[i].type === MenuTypes.EDIT) {\n\t\t\t\tconsole.log('Evaluating edit item');\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: this.menuData[i].input.value\n\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (this.menuData[i].type === MenuTypes.SELECTOR) {\n\t\t\t\tconsole.log('Evaluating selector');\n\t\t\t\tlet selectedID = 0;\n\t\t\t\tconst items = document.getElementsByName(this.menuData[i].id);\n\t\t\t\tfor (let j = 0; j < items.length; j++) {\n\t\t\t\t\tif (items[j].checked) {\n\t\t\t\t\t\tselectedID = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: selectedID,\n\n\t\t\t\t\tname: this.menuData[i].options[selectedID]\n\t\t\t\t};\n\t\t\t}\n\t\t\titems.push(addItem);\n\t\t}\n\n\t\tconst toReturn = {\n\t\t\tselected,\n\t\t\tcursor: this.cursor,\n\t\t\titems\n\t\t};\n\t\tif (this.sndChoose) this.sndChoose.play();\n\n\t\tthis.selectCallback(toReturn);\n\t}", "function buildFormItem(options) {\n itemIdCount ++;\n \n options = options || {};\n \n Ext.applyIf(options, {\n valid: true,\n dirty: false,\n id : itemIdCount\n });\n \n return (function(itemId, config) {\n return Ext.apply(config || {}, {\n isFormField: true,\n itemId : itemId,\n\n getName: function() {\n return config.name || config.id;\n },\n\n getItemId: function() {\n return itemId;\n },\n\n validate: function() {\n return config.valid;\n },\n\n isDirty: function() {\n return config.dirty;\n },\n \n setValue: function() {\n return true;\n }\n });\n })(itemIdCount, options);\n }", "render() {\n\n return (\n\n <div className=\"addItemContainer\">\n <form className=\"newItemForm\">\n <h3>New Item to Loan</h3>\n <p>Please enter some info about the item you are loaning.</p>\n <input type=\"text\" id=\"name\" value={this.state.name || ''} onChange={this.handleNameChange} placeholder=\" Item Name\" />\n <input type=\"text\" id=\"description\" value={this.state.description || ''} onChange={this.handleDescriptionChange} placeholder=\"Description\" />\n\n <select type=\"select\" placeholder=\"Select a Friend\" value={this.state.borrowerName || ''} onChange={this.onDropdownSelected} label=\"Select Borrower\" >\n <option>Select a Borrower</option>\n {this.createSelectItems()}\n </select>\n\n <input type=\"text\" id=\"borrowerName\" value={this.state.borrowerName || ''} onChange={this.handleBorrowerNameChange} placeholder=\"Borrower Name\" />\n <label>Lend Date <input type=\"date\" id=\"lendDate\" value={this.state.lendDate || ''} onChange={this.handleLendDateChange} placeholder=\"Lend Date\" /></label>\n <label>Due Date <input type=\"date\" id=\"dueDate\" value={this.state.dueDate || ''} onChange={this.handleDueDateChange} placeholder=\"Due Date\" /></label>\n <input type=\"text\" id=\"image\" value={this.state.image || ''} onChange={this.handleImageChange} placeholder=\"Image Url\" />\n <button className=\"addItemButton\" type=\"submit\" value=\"Add Loan Item\" onClick={this.addItem}>Confirm Loan</button>\n </form>\n </div>\n )\n }", "function addForm() {\n let cakeId = document.querySelector(\"#cake_id\").value;\n let cakeName = document.querySelector(\"#cake_name\").value;\n let quantity = document.querySelector(\"#quantity\").value;\n let price = document.querySelector(\"#price\").value;\n let description = document.querySelector(\"#description\").value;\n let productImage = document.querySelector(\"#product_image\").src;\n // check if any option is selected \n if(!isSelected)\n {\n document.querySelector(\"#weight\").setCustomValidity(\"Please select weight!\");\n document.querySelector(\"#weight\").reportValidity();\n \n } else \n {\n document.querySelector(\"#weight\").setCustomValidity(\"\"); \n addToList(cakeId, cakeName, quantity, selectedText , price, description, productImage);\n \n }\n \n}", "populateForm(order){\n // populate the name fields\n form.elements.namedItem(\"nameFirst\").value = order.getNameFirst(); \n form.elements.namedItem(\"nameMiddle\").value = order.getNameMiddle();\n form.elements.namedItem(\"nameLast\").value = order.getNameLast();\n \n // populate the address fields\n var mailingAddress = order.getMailingAddress();\n form.elements.namedItem(\"street1\").value = mailingAddress.getStreet1();\n form.elements.namedItem(\"street2\").value = mailingAddress.getStreet2();\n form.elements.namedItem(\"city\").value = mailingAddress.getCity();\n form.elements.namedItem(\"state\").value = mailingAddress.getState();\n form.elements.namedItem(\"zip\").value = mailingAddress.getZip();\n\n // set the values of the listbox\n if(null != order.getAreasOfInterest() ){\n var selectBox = form.elements.namedItem(\"areasOfInterest\");\n for(let option of selectBox.options){\n if( order.getAreasOfInterest().includes(option.value) ) {\n option.selected = true;\n } else {\n option.selected = false;\n }\n }\n }\n\n // check the fruitCake radio button\n form.elements.namedItem( order.getFruitCake() ).checked = true;\n }", "function createListItem(item) {\n const ul = document.getElementById(\"item-list\");\n const listItem = extractItemTemplate();\n const deleteBtn = listItem.getElementById(\"delete-btn\");\n const editBtn = listItem.getElementById(\"edit-btn\");\n const itemContainer = listItem.getElementById(\"item-container\");\n itemContainer.innerText = JSON.stringify(item, null, 4);\n\n deleteBtn.addEventListener(\"click\", () => deleteItem(item));\n editBtn.addEventListener(\"click\", () => displayForm(item));\n\n ul.append(listItem);\n}", "selectItem (i) { this.toggSel(true, i); }", "function editItem(currItem) {\n //if item found select combo\n\n //else set combo to please select\n\n }", "function selectItem( e ) {\n // Remove all show and border classes\n removeBorder();\n removeShow();\n // Add border to current tab item\n this.classList.add( 'tab-border' );\n // Grab content item from DOM\n const tabContentItem = document.querySelector( `#${this.id}-content` );\n // Add show class\n tabContentItem.classList.add( 'show' );\n}", "function selectItem(e) {\n removeBorder();\n removeShow();\n // Add border to current tab\n this.classList.add('tab-border');\n // Grab content item from DOM\n const tabContentItem = document.querySelector(`#${this.id}-content`);\n // Add show class\n tabContentItem.classList.add('show');\n}", "function comboFormador() {\r\n\r\n //Criar o HTML (option) para todos os tags\r\n let strHtml = \"<option value=''>Escolher</option>\"\r\n for (let i = 0; i < formadores.length; i++) {\r\n strHtml += `<option value='${formadores[i]._id}'>${formadores[i]._name}</option>`\r\n }\r\n let selFormad = document.getElementById(\"idSelForm\")\r\n selFormad.innerHTML = strHtml\r\n}", "function selectItem(e){\n removeBorder();\n removeShow();\n //Add border to current tab\n this.classList.add('tab-border');\n //Grab content item for Dom\n const tabContentItem=document.querySelector(`#${this.id}-content`)\n //Add show\n tabContentItem.classList.add('show');\n}" ]
[ "0.6568907", "0.61604923", "0.60122895", "0.59901494", "0.5973197", "0.5971516", "0.59151924", "0.5914817", "0.5910627", "0.5890022", "0.58494586", "0.58254844", "0.58111006", "0.580995", "0.5785791", "0.5781966", "0.574826", "0.57324183", "0.5718386", "0.56893796", "0.56878626", "0.56734836", "0.5650249", "0.56472194", "0.56429833", "0.5641419", "0.5637592", "0.56368023", "0.561905", "0.5603623", "0.5596239", "0.5594108", "0.55884546", "0.55809927", "0.55792415", "0.55735433", "0.5569153", "0.5565224", "0.5561477", "0.55595565", "0.5548666", "0.5528755", "0.55161065", "0.550783", "0.54858404", "0.54807603", "0.54771525", "0.54671884", "0.5462243", "0.5458172", "0.54551524", "0.5447766", "0.5445761", "0.54405326", "0.54338723", "0.54262984", "0.5425903", "0.5407341", "0.5405664", "0.54020643", "0.54020643", "0.54009175", "0.5400242", "0.5397314", "0.53964466", "0.53923744", "0.53920585", "0.5391382", "0.53707194", "0.5359555", "0.5357112", "0.53555185", "0.53540516", "0.53523475", "0.5352041", "0.53507084", "0.53491354", "0.53481877", "0.5337829", "0.53372055", "0.5336242", "0.5335557", "0.5330563", "0.5329069", "0.53255004", "0.5324479", "0.53214717", "0.53140867", "0.53100646", "0.5300396", "0.5299065", "0.5296846", "0.5294067", "0.52916425", "0.52889", "0.52886796", "0.52879226", "0.5283463", "0.52833724", "0.5282429" ]
0.69874
0
postItems Post the Item to the line
function postItems(request, response) { var addNewScript = ''; var url = ''; var scriptId = 0; try { //Check Environment and Account and set the URL if(getEnvironment() && getAccountID()) { // Sandbox 1 scriptId = 162; } else { // Sandbox 2 & Production scriptId = 203; } url = '/app/site/hosting/scriptlet.nl?script=' + scriptId + '&deploy=1&custparam_cust=' + customer + '&custparam_brand=' + customerBrand; addNewScript = '<script type="text/javascript">'; for (var i=1; i <= lineCount; i++) { addNewScript += "window.opener.nlapiSetCurrentLineItemValue(\'item\',\'item\',\'" + itemArray[i-1] + "\', true, true);"; addNewScript += "window.opener.nlapiSetCurrentLineItemValue(\'item\',\'custcol_itemdepartment\',\'" + itemArray[i-1] + "\', true, true);"; addNewScript += "window.opener.nlapiSetCurrentLineItemValue(\'item\',\'quantity\',\'" + qtyArray[i-1] + "\', true, true);"; addNewScript += "window.opener.nlapiCommitLineItem('item');"; } addNewScript += "window.location.href='" + url + "';"; addNewScript += '</script>'; addNewScript += '<body onblur="self.focus();">'; response.write(addNewScript); } catch(e) { errorHandler("postItems ", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processItems() {}", "function sendItem ( item ) {\n oauth.sendSignedRequest(\n url,\n sendItemHandler,\n {\n 'method': 'POST',\n 'parameters': {\n 'operation': 'insertItem',\n 'message': item.message,\n 'imageUrl': item.imageUrl\n }\n }\n );\n}", "function submitItem(item) {\n $.post(\"/addItem\", item)\n }", "onAddItem () {\n const newItem = this.get('bunsenModel').items.type === 'object' ? {} : ''\n const items = this.get('items')\n const index = items.length\n\n items.pushObject(newItem)\n this.notifyParentOfNewItem(newItem, index)\n }", "_processItems()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"Form._processItems\",\n\t\t\tcontext: \"when processing the form items\",\n\t\t};\n\n\t\ttry\n\t\t{\n\t\t\tif (this._autoLog)\n\t\t\t{\n\t\t\t\t// note: we use the same log message as PsychoPy even though we called this method differently\n\t\t\t\tthis._psychoJS.experimentLogger.exp(\"Importing items...\");\n\t\t\t}\n\n\t\t\t// import the items:\n\t\t\tthis._importItems();\n\n\t\t\t// sanitize the items (check that keys are valid, fill in default values):\n\t\t\tthis._sanitizeItems();\n\n\t\t\t// randomise the items if need be:\n\t\t\tif (this._randomize)\n\t\t\t{\n\t\t\t\tutil.shuffle(this._items);\n\t\t\t}\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\t// throw { ...response, error };\n\t\t\tthrow Object.assign(response, { error });\n\t\t}\n\t}", "function RENDER_items(items) {\n\n }", "function generateLineItems(items) {\n const lineItems = items.map(item => {\n return {\n price_data: {\n currency: 'usd',\n product_data: {\n name: item.name,\n images: item.imageUrls,\n },\n unit_amount: item.hasOwnProperty('salePrice') ? parseInt(item.salePrice) * 100 : parseInt(item.Price) * 100 ,\n },\n quantity: item.quantity,\n // Description of item for admin\n description: `${item.name} | ${item.colorName}`\n }\n })\n return lineItems\n}", "addLineItem(){\n\t\t\t\tthis.setState({\n\t\t\t\t\tlineItems: this.state.lineItems + 1\n\t\t\t\t});\n\t\t\t\tthis.state.lineItemsArray.push({id: this.state.lineItems, desc: \"\", amount: 0});\n\t\t}", "itemPost(incomingOptions, cb) {\n const Rollbar = require('./dist');\n\n let apiInstance = new Rollbar.ItemApi(); // String | An access token with scope `post_server_item` or `post_client_item`. A post_client_item token must be used if the `platform` is `browser\\\"`, `android`, `ios`, `flash`, or `client`. A post_server_item token should be used for other platforms.\n /*let xRollbarAccessToken = \"xRollbarAccessToken_example\";*/ let opts = {\n body: new Rollbar.Api1ItemRequest(), // Api1ItemRequest |\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.itemPost(\n incomingOptions.xRollbarAccessToken,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data.result, response);\n }\n }\n );\n }", "addItem(_item) { }", "addItem(pid, text) {\n // Internal id for this item. NOTE that the internal id is different\n // from the pid. The items \"coke\" and \"coca cola\" share a pid, but have\n // different ids.\n const id = this.items.length;\n this.items.push(text);\n this.pids.push(pid);\n // Split input string into individual terms.\n const terms = text.split(' ');\n const stemmed = terms.map(this.stemTerm);\n this.stemmedItems.push(stemmed.join(' '));\n const hashed = stemmed.map(this.hashTerm);\n this.hashedItems.push(hashed);\n hashed.forEach((hash, index) => {\n // Add this term to hash_to_text so that we can decode hashes later.\n if (!(hash in this.hashToText)) {\n this.hashToText[hash] = stemmed[index];\n }\n // Update term frequency\n // DESIGN ALTERNATIVE: could use lengths of posting lists instead.\n if (hash in this.hashToFrequency) {\n this.hashToFrequency[hash]++;\n }\n else {\n this.hashToFrequency[hash] = 1;\n }\n // Add current item to posting list for this term.\n // This is the inverted index.\n if (hash in this.postings) {\n this.postings[hash].push(id);\n }\n else {\n this.postings[hash] = [id];\n }\n });\n // TODO: Add tuples.\n }", "arangeItems () {\r\n // TODO: Add code here\r\n }", "addItem(item) {\n\n item.onmouseleave();\n item.lock();\n\n this._items.push(item);\n\n if (this._items.length > 1) {\n let comma = new TextExpr(',');\n this.graphicNode.holes.splice(this.graphicNode.holes.length-1, 0, comma);\n }\n\n this.graphicNode.holes.splice(this.graphicNode.holes.length-1, 0, item);\n\n this.graphicNode.update();\n }", "function sendAdd(itemCode) {\n console.log(\"adding \" + itemCode);\n sendText(\"{\\\"action\\\":\\\"add\\\",\" + \"\\\"item\\\":\\\"\" + itemCode + \"\\\"}\");\n}", "function postItemByPath(req, res, opts, onError){\n\n const paths = getWarehousePaths(opts, basepath)\n const itempath = paths.warehouse + paths.item\n const warehouse = client.connect(itempath)\n\n req.pipe(concat(function(body){\n try {\n body = JSON.parse(body.toString())\n } catch (e) {\n res.statusCode = 500\n return res.end(e.toString())\n }\n\n const addContainer = client.create(body)\n\n warehouse\n .append(addContainer)\n .ship(function(added){\n \n res.setHeader('content-type', 'application/json')\n res.end(JSON.stringify(added.toJSON()))\n\n })\n .on('error', function(err){\n res.statusCode = 500\n res.end(err.toString())\n })\n\n }))\n\n }", "updateItems() {\n\t\tthis.callItemR('update');\n\t}", "function gotItems(items, request) {\n\t\tvar i;\n\t\tfor (i = 0; i < items.length; i++) {\n\t\t\tvar item = items[i];\n\t\t\titemsToProcess.push(item);\n\t\t}\n\t}", "async function postItem() {\n\n // sets var equal to the FormData returned by the function.\n var postData = addItem();\n\n // sets a custom request overriding the const request.\n let customRequest = Object.assign(fetchRequest, {method: 'POST', body: postData});\n\n // get the endpoint from the config file.\n let endpoint = appConfigurations.Endpoints.MostPopularBuilds || '';\n\n // makes a fetch post request with the custom request.\n await fetch(endpoint, customRequest)\n\n // redirects the page to the main page after a submission.\n window.location.assign(\"../MPBmain/MPB.html\")\n}", "postpone(idx) {\n\t\treturn this._do(idx, (i)=>this.ledger.postponeItem(i));\n\t}", "function add(item) {\n data.push(item);\n console.log('Item Added...');\n }", "postItem(title, picture, price, sku) {\n axios\n .post(\n `https://api.mlab.com/api/1/databases/e-sell-mobile/collections/e-sell-mobile?apiKey=${mLabKey}`,\n { title, picture, price, sku }\n )\n .then(() => this.props.navigation.navigate(\"ShoppingCart\"));\n }", "queueInsertItems(items, beforeItemId, customData) {\n return Native.queueInsertItems(items, beforeItemId || 0, customData);\n }", "addPost(...steps) {\n this.post.push(...steps);\n }", "enqueueCustomised(items){\r\n this.items.length=this.items.length+1;\r\n for(let i=0; i<this.items.length; i++){\r\n this.items[this.items.length-1]=item;\r\n }\r\n}", "function addItem( entry ) {\n $http.post( storelist_url, entry ).then(\n function(response) {\n console.log(\"POST success\");\n console.log(response);\n deferred.resolve(response);\n },\n function(error) {\n console.log(\"POST error\");\n deferred.reject(error);\n }\n );\n return deferred.promise;\n }", "function addItem(){\n const value = newItemInput.value;\n\n if(!value){\n alert(\"Please enter a value\");\n return;\n }\n\n const _item = {...item, message: value};\n\n items.push(_item);\n newItemInput.value = \"\";\n render();\n\n postItemToJSON(\"http://localhost:8000/index.php\", _item, items.length - 1);\n}", "addNewItem(state, payload) {\n //update GUI\n state.items.unshift(payload)\n }", "enqueue(item) {\n\t\tthis.stack1.add(item);\n\t}", "setItems(state, items) {\n state.items = items;\n }", "onNewItem(item, type) {\n const { items, itemMaps } = this.state;\n\n items[type].push(item);\n Form.updateItemMap(type, itemMaps[type], items[type].length - 1,\n item.r, item.c, item.h, item.w);\n\n this.setState({\n items, itemMaps,\n });\n }", "function printItem(item){\n\t\t$(\"#items_list\").append('<span style=\"min-height:55px;min-width:55px;display:inline-block;\"><a class=\"tooltip-stop\" href=\"http://canisback.com/tooltips/item/'+item['id']+'\"><span class=\"item\" data-id=\"'+item['id']+'\" style=\\'background : url(\"'+Canis.LoL.TheoryCrafter.getQuery()+'application/ddragon/'+Canis.LoL.TheoryCrafter.getDDragon()+'/img/sprite/'+item['sprite']+'\") no-repeat scroll -'+item['x']+'px -'+item['y']+'px transparent;height: 48px;width: 48px;display:inline-block;\\'></span></a></span>');\n\t}", "function menu_item(pid) {\n var request = {\n 'action': 'menu_item',\n 'id': pid,\n };\n jQuery.post( ajaxurl, request, function(response){\n //console.log('Menu: ' + response);\n process_item(response);\n });\n\n}", "enqueue(item) {\n this.items.push(item); // adds an item to the queue\n }", "function postInvoiceIntoNetsuite()\r\n{\r\n\r\n\tvar entity='';\r\n\tvar item='';\r\n\tvar auditDesc='Success';\r\n\t\r\n\r\n\ttry\r\n\t{\r\n\r\n\t\t// set values for the invoice header\r\n\t\tif(invoiceHeader()==true)\r\n\t\t{\r\n\t\t\tfor(var x=0; x<=itemsArray.length-1;x++)\r\n\t\t\t{\r\n\r\n\t\t\t\tnlapiLogExecution('AUDIT', 'invoice line being set', 'invoice ' + invoiceNo);\r\n\r\n\t\t\t\t// set details for the invoice detail line\r\n\t\t\t\tinvoiceDetailLine(x);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tapplyARRuleToInvoiceHead();\r\n\r\n\t\t\t// submit header and detail records\r\n\t\t\tinvID = nlapiSubmitRecord(invoiceRecord, true);\r\n\t\t\tnlapiLogExecution('AUDIT', 'success', 'invoice ' + invoiceNo);\r\n\r\n\t\t\tauditTrail('TRUE', 'Invoice Posted');\r\n\t\t}\r\n\t\t\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(e);\r\n\t\tnlapiLogExecution('AUDIT', 'failure', 'failed to post invoice');\r\n\t\tauditTrail('FAILED', 'postInvoiceIntoNetsuite ' + getErrorMessage(e));\r\n\t} \r\n\r\n}", "async _processItems (h) {\n const pages = await this.store.table('page').catch(ERROR)\n const items = pages.find({\n updated: true\n })\n const plist = []\n for (const itemRaw of items) {\n const item = new Item(itemRaw)\n const promise = this.trains.run('processItem', {h, item})\n .catch(ERROR)\n plist.push(promise)\n }\n await Promise.all(plist)\n this.store.save()\n }", "function post() {\n const data = cartItems.map((item) => {\n return { name: item.beer, amount: item.amount };\n });\n console.log(data);\n const postData = JSON.stringify(data);\n fetch(\"https://foobar-jearasfix.herokuapp.com/order\", {\n method: \"post\",\n body: postData,\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n },\n })\n .then((res) => res.json())\n .then((dataobj) => setOrderId(dataobj.id));\n setCartItems([]);\n }", "saveItem() {\n\n }", "function renderItem({ item, navigation}) {\n return (\n <View\n style={{\n padding: 10,\n paddingTop: 20,\n paddingBottom: 20,\n borderBottomColor: \"#ccc\",\n borderBottomWidth: 1,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n }}\n >\n \n <Text>{item.title}</Text>\n <Text>{item.timestamp}</Text>\n <TouchableOpacity onPress={() => deleteNote(item.id)}>\n <Ionicons name=\"trash\" size={16} color=\"#944\" />\n </TouchableOpacity>\n </View>\n );\n }", "addItem(item) {\n this.items.push(item);\n // tegye közzé a frissített elemek listáját, hogy frissítse a Cart topic-ot\n // amikor a cart tartalma frissült\n PubSub.publish(\"updateCart\", this.getItems());\n }", "handleServerItemAdd(addItem) {\n //作POST\n fetch(`${severUrl}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(addItem)\n })\n .then(response => {\n //ok 代表狀態碼在範圍 200-299\n if (!response.ok) throw new Error(response.statusText);\n return response.json();\n })\n .then(item => {\n //這裡可以顯示一些訊息,或是結束指示動畫…\n this.handleServerItemsLoad();\n });\n }", "function addItem() {\n var input = document.getElementById('input-value').value;\n if (input) {\n itemIndex++;\n document.getElementById('list-item').appendChild(generatingItem(itemIndex, input));\n var newItem = {\n id: itemIndex,\n content: input\n };\n // toDoList.push(newItem);\n axios.post(url, newItem)\n .then(function (res) {\n alert(`ADD SUCCESSFULLY `)\n })\n .catch(function (err) {\n alert(\"ADD ERROR \")\n });\n }\n}", "function modifyItem(expandedObject) {\n\t\t\tvar jqObj = $(expandedObject.pregeneratedHTML),\n\t\t\t\tnewPostElement = \"\",\n\t\t\t\toriginalDataItem = expandedObject.originalDataObject,\n\t\t\t\tgrabbedFeedObject = expandedObject.GrabbedFeedObject,\n\t\t\t\tpostObjectInside$ = jqObj.find('.postObject-inside-main');\n\n\n\t\t\tjqObj.find(\".ASWidgetPostUL\").append('<li class=\"oM-Actions\">' + getMetaChunk() + '</li>');\n\n\t\t\tif (isCommunityMode() && !currentAccess.isMember) {\n\t\t\t\tjqObj.find('.oM-Actions').remove();\n\t\t\t}\n\n\t\t\tif (!savedSettings.useDefaultStyle) {\n\t\t\t\tjqObj.find('.ASWidgetcommentsSection').hide();\n\t\t\t\tjqObj.find('.oM-Actions').appendTo(postObjectInside$);\n\t\t\t}\n\n\t\t\t(function generateImagesHTML() {\n\t\t\t\tvar imageSrcUrl = (originalDataItem.object && originalDataItem.object.image && originalDataItem.object.image.url) ? originalDataItem.object.image.url : originalDataItem.object.fileUrl,\n\t\t\t\t\timageTags = \"\";\n\n\t\t\t\tif (originalDataItem.object.tags && originalDataItem.object.tags.length) {\n\t\t\t\t\t$.each(originalDataItem.object.tags, function(i, elem) {\n\t\t\t\t\t\timageTags += elem.displayName + ((i !== originalDataItem.object.tags.length - 1) ? \",\" : \"\");\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (imageSrcUrl && imageSrcUrl.indexOf(\"files/form\") !== -1) {\n\t\t\t\t\timageSrcUrl = formatToThumbnailImage(imageSrcUrl);\n\t\t\t\t}\n\n\t\t\t\tif (imageSrcUrl && originalDataItem.object.mimeType && (originalDataItem.object.mimeType.indexOf(\"image\") !== -1)) {\n\t\t\t\t\tnewPostElement = '<div class=\"ActivityStreamWidgetPostDetails ActivityStreamWidgetChunk\">' +\n\t\t\t\t\t\t'<div class=\"ActivityStreamWidgetPostObject\"> ' +\n\t\t\t\t\t\t'<a href=\"' + originalDataItem.object.url + '\" class=\"imageOfPost\"><img class=\"activityStreamImageUpload\" src=\"' +\n\t\t\t\t\t\timageSrcUrl + '\" title=\"' + originalDataItem.object.displayName +\n\t\t\t\t\t\t'\" alt=\"' + originalDataItem.object.displayName + '\">' +\n\t\t\t\t\t\t'</div>' +\n\n\t\t\t\t\t\t'<div class=\"ActivityStreamWidgetMeta\"> ' +\n\t\t\t\t\t\t'<ul class=\"ActivityStreamWidgetInlinelist\">' +\n\t\t\t\t\t\t'<li class=\"ActivityStreamWidgetFirst ASWidgetLinkContainer\">' + localizeString(\"ASWidget-from\", \"From:\") + ' ' +\n\n\t\t\t\t\t\t'<span class=\"vcard ASWidgetvcard\">' +\n\t\t\t\t\t\t'<a href=\"' + grabbedFeedObject.targetAuthor.eventDestActorProfileUrl() + '\" ' +\n\t\t\t\t\t\t' class=\"fn bidiAware url\" target=\"_blank\" _bizcardprocessed_=\"true\" role=\"button\" ' +\n\t\t\t\t\t\t'href_bc_=\"' + grabbedFeedObject.targetAuthor.eventDestActorProfileUrl() + '\">' + grabbedFeedObject.targetAuthor.eventDestActorFullName() +\n\t\t\t\t\t\t'<span class=\"x-lconn-userid\" ' +\n\t\t\t\t\t\t' style=\"display: none;\">' + grabbedFeedObject.targetAuthor.eventDestActorProfileId() +\n\t\t\t\t\t\t'</span>' +\n\t\t\t\t\t\t'</a>' +\n\t\t\t\t\t\t'</span>' +\n\n\t\t\t\t\t\t'</li>' +\n\n\t\t\t\t\t\t(imageTags.length > 0 ? '<li class=\"ASWidget-Post-Image-Tags\"><span>Tags:</span> <div class=\"ASWidget-Post-Image-Tags-InLine\">' + imageTags + '</div></li>' : '') +\n\t\t\t\t\t\t'</ul>' +\n\t\t\t\t\t\t'</div>' +\n\t\t\t\t\t\t'</div>';\n\t\t\t\t\tjqObj.find(\".postContent\").html(newPostElement);\n\t\t\t\t}\n\t\t\t}());\n\n\n\t\t\t(function createCommentsinHTML() {\n\t\t\t\tvar items = [],\n\t\t\t\t\tcommentsList$;\n\t\t\t\tif ((!grabbedFeedObject.mainObject.Replies.RepliesArray.length) && (!grabbedFeedObject.targetObject.Replies.RepliesArray.length)) {\n\t\t\t\t\tjqObj.find(\"[data-rel=Main]\").hide();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (grabbedFeedObject.mainObject.Replies.RepliesArray.length) {\n\t\t\t\t\tif (grabbedFeedObject.mainObject.Replies.RepliesTotalAmount > 2 && (\"file\" !== grabbedFeedObject.mainObject.Type)) {\n\t\t\t\t\t\titems.push(getShowPreviousCommentsIndicator$(savedSettings.useDefaultStyle)[0].outerHTML);\n\t\t\t\t\t}\n\n\t\t\t\t\titems = items.concat(generateCommentsHtml(grabbedFeedObject.mainObject.Replies.RepliesArray));\n\t\t\t\t\tcommentsList$ = jqObj.find(\"[data-rel=Main] .ASWidgetcommentsList\");\n\t\t\t\t\tcommentsList$.html(items.join(\"\"));\n\t\t\t\t\tif (!savedSettings.useDefaultStyle) {\n\t\t\t\t\t\tcommentsList$.parents('.ASWidgetcommentsSection').hide();\n\t\t\t\t\t}\n\t\t\t\t\titems = [];\n\t\t\t\t}\n\n\t\t\t\tif (grabbedFeedObject.targetObject.Replies.RepliesArray.length) {\n\t\t\t\t\titems = [];\n\t\t\t\t\tif (grabbedFeedObject.mainObject.Replies.RepliesTotalAmount > 2 && (\"file\" !== grabbedFeedObject.targetObject.Type)) {\n\t\t\t\t\t\titems.push(getShowPreviousCommentsIndicator$(savedSettings.useDefaultStyle)[0].outerHTML);\n\t\t\t\t\t}\n\t\t\t\t\titems = items.concat(generateCommentsHtml(grabbedFeedObject.targetObject.Replies.RepliesArray));\n\t\t\t\t\tjqObj.find(\"[data-rel=Main] .ASWidgetcommentsList\").html(items.join(\"\"));\n\t\t\t\t}\n\n\t\t\t\tjContainer.find('[data-toggle=\"ASWidget-Comment-Tooltip\"]').tooltip();\n\t\t\t\treturn false;\n\t\t\t}());\n\n\t\t\treturn jqObj.get(0).outerHTML;\n\t\t}", "function sendItemHandler ( text, xhr ) {\n// console.log( arguments );\n}", "queueInsertItem(item, beforeItemId, customData) {\n return this.queueInsertItems([item], beforeItemId, customData);\n }", "function addItem(data) {\n console.log(` Adding: ${data.lastName} (${data.owner})`);\n Items.insert(data);\n}", "function addItem(data) {\n console.log(` Adding: ${data.lastName} (${data.owner})`);\n Items.insert(data);\n}", "static sendToBack(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).reverse().forEach(item => {\n item.sendToBack();\n });\n });\n }", "function insertItem(type) {\n var item = (type == \"backlog\") ? new Backlog() : new Task();\n if (type == \"task\" && !item.Backlog_ID) showErrorDialog(2);\n else {\n showProcessingDiaglog();\n $.ajax({\n url: \"Handler/ItemHandler.ashx\",\n data: {\n action: \"insertItem\",\n projectID: projectID,\n type: type,\n item: JSON.stringify(item)\n },\n type: \"post\",\n success: function (result) {\n // Link assignee to the created item\n var deferreds = saveAssignee(result.substring(0, result.indexOf(\".\")), type, true);\n $.when(deferreds).done(function () {\n showSuccessDiaglog(0);\n });\n\n // Display created item in board\n var objtext = getVisualNote(result, type, item);\n var swimlanePosition = parseInt($(\"#txtSwimlanePosition\").val());\n $(objtext).appendTo($(\".connected\")[swimlanePosition]);\n (type == \"backlog\") ? clearBacklogWindow() : clearTaskWindow();\n\n // Send to other clients\n proxyNote.invoke(\"sendInsertedNote\", swimlanePosition, objtext);\n }\n });\n }\n \n}", "addItem(item) {\n this.items.push(item)\n }", "function addItem() {\n\n console.log('adding', { amount }, { name });\n\n dispatch({\n type: 'ADD_ITEM', payload: {\n name: name,\n amount: amount,\n list_id: id,\n }\n })\n //reset local state of new item textfield to allow for more items to be added\n setName('');\n setAmount(1);\n }", "putin(item) {\n if (this.open = true) {\n this.item.push(item);\n alert(\"Item has been added to the backpack.\");\n }\n }", "function onRequestSucceeded() {\n console.log( list + 'Item\\nCreated '); \n\n\n\n\n\n }", "function pushItem(obj, item) {\n obj.items.push(item);\n item.parent = obj;\n }", "function addItem(item) {\n $state.go('main.addItem', {item: item, foodListId: $stateParams.foodListId});\n }", "function buildItem (post, ul) {\n var data = postInfo(post);\n var header = headerItem(data);\n var content = contentRow(data);\n var itemFrag = document.createRange().createContextualFragment(\n '<li class=\"activity-type-discussion rda-entry\">' +\n header +\n '<table class=\"wallfeed\">' +\n '<tbody>' +\n content +\n '</tbody>' +\n '</table>' +\n '</li>'\n );\n var li = itemFrag.firstChild;\n var tbody = li.getElementsByTagName('tbody')[0];\n // Functions that will add extra rows if needed\n imageRow(data.image, tbody);\n openGraphRow(data.openGraph, tbody);\n statusRow(data, tbody);\n // Appends the element to the list\n ul.appendChild(itemFrag);\n }", "function AddItem(item){\n console.log(\"Adding \" + item.Name + \" to the basket!\");\n basket.push(item);\n}", "handleAddItem() {\n const transactionState = this.props.transactionState;\n const items = transactionState.transactionItems;\n items[items.length - 1].item = {\n name: this.state.name,\n category: this.state.category,\n gender: this.state.gender,\n typeColor: this.state.typeColor,\n size: this.state.size,\n location: this.state.location,\n };\n items[items.length - 1].quantityChanged = this.state.quantity;\n items[items.length - 1].recipient = this.state.recipient;\n this.props.setTransactionState(transactionState);\n }", "function sendPostsList(request, response) {\n response.send(posts);\n}", "runOnTaskFinishedHandlers(item) {\n this.onTaskFinishedHandlers.forEach(handler => {\n handler(item, this);\n });\n }", "async function addItem(item) {\n setSubHeader(\"Result\");\n\n const response = await fetch(\"/api/shoes\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(item),\n });\n const responseItem = await response.json();\n\n if (response.ok) {\n createListItem(responseItem);\n } else {\n createErrorItem(responseItem);\n }\n\n const formContainer = document.getElementById(\"form-container\");\n formContainer.innerHTML = \"\";\n}", "handleSubmit(e){\n e.preventDefault();\n item.itemID = 'item'+this.state.item;\n item.itemName = this.state.item;\n\n item.addItems(item);\n this.setState({\n iList:[]\n });\n setTimeout(()=>{\n this.handleItemObject()\n }, 500)\n }", "push(item) {\n this.items.push(item);\n }", "push(item) {\n this.items.push(item);\n }", "function addItem(event) {\n event.preventDefault();\n\n const newItem = {\n title: item.title,\n description: item.description,\n };\n\n axios.post(\"/newitem\", newItem);\n\n setItem({\n title: \"\",\n description: \"\",\n });\n }", "function handlePosts() {\n var posts = [\n { id: 23, title: 'Daily JS News' },\n { id: 52, title: 'Code Refactor City' },\n { id: 105, title: 'The Brightest Ruby' }\n ];\n \n for (var i = 0; i < posts.length; i++) {\n savePost(posts[i]);\n }\n}", "releaseItem(item) {}", "function addToDoItem(){\n var todoText = getComponent('todo-text')\n var text = todoText.value;\n if(text === \"\"){\n return ;\n }\n var ddl = jsonFormat2showFormat(getNextHourJsonDate());\n console.log(text);\n var item = createToDoItem(model.data.id++,0,text,0,ddl);\n model.data.items.push(item);\n\n todoText.value = \"\";\n update();\n}", "addItem(item){\n this.items.splice(this.findIndex(item.job.priority, this.items) + 1, 0, item);\n }", "function addItem(item) {\n groceries.push(\"item\");\n displayData();\n}", "function addTestItem(item) {\n if (item !== undefined) {\n console.log(\"Adding \" + item);\n }\n }", "function openPostModal() {\n PostDepartmentService.postItem();\n }", "repeaterOnAddItem() {\n }", "_addNewItem() {\n // Add new Item from Order's Items array:\n this.order.items = this.order.items.concat([this.item]);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeAddNewItem();\n }", "function postNewItems(itemNum, newQty) {\r\n let query = \"UPDATE bamazon.products SET stock_quantity=? WHERE item_id=? \";\r\n bamazon.query(query, [newQty, itemNum], function (err, res) {\r\n if (err) throw (err);\r\n\r\n console.log(\"\\n Success! New item(s) added to the inventory\\n\");\r\n displayAllInventory();\r\n });\r\n}", "function _InsertItemEntry(req_json, resp_json) {\n\t\ttry {\n\t\t\t//Get the Request Body\n\t\t\tvar oBody = JSON.parse($.request.body.asString());\n\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Build the Statement to insert the entries\n\t\t\tvar oStatement = oConnection.prepareStatement('INSERT INTO \"' + gvSchemaName + '\".\"' + gvItemTable +\n\t\t\t\t'\" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');\n\n\t\t\t//Item Number Initialization\n\t\t\tvar item = 0;\n\n\t\t\t//Prepare the Batch Statement\n\t\t\toStatement.setBatchSize(req_json.ToItem.length);\n\n\t\t\t//Populate the fields with values from the incoming payload\n\t\t\tfor (var i = 0; i < req_json.ToItem.length; i++) {\n\t\t\t\t//SAP Document\n\t\t\t\toStatement.setString(1, resp_json.DocumentNumber);\n\n\t\t\t\t//Fiscal Year\n\t\t\t\tif (req_json.FiscalYear) {\n\t\t\t\t\toStatement.setString(2, req_json.FiscalYear);\n\t\t\t\t} else {\n\t\t\t\t\toStatement.setString(2, resp_json.FiscalYear);\n\t\t\t\t}\n\t\t\t\t//Company Code\n\t\t\t\tif (req_json.CompanyCode) {\n\t\t\t\t\toStatement.setString(3, req_json.CompanyCode);\n\t\t\t\t} else {\n\t\t\t\t\toStatement.setString(3, resp_json.CompanyCode);\n\t\t\t\t}\n\n\t\t\t\t//Item\n\t\t\t\tif (!req_json.ToItem[i].ItemNumber) {\n\t\t\t\t\titem = item + 1;\n\t\t\t\t\tvar itemNumber = padToThree(item);\n\t\t\t\t\toStatement.setString(4, itemNumber);\n\t\t\t\t} else {\n\t\t\t\t\toStatement.setString(4, req_json.ToItem[i].ItemNumber);\n\t\t\t\t}\n\n\t\t\t\t//GL Account\n\t\t\t\toStatement.setString(5, req_json.ToItem[i].GLAccount);\n\t\t\t\t//Value Date\n\t\t\t\toStatement.setString(6, req_json.ToItem[i].ValueDate);\n\t\t\t\t//Posting Date\n\t\t\t\toStatement.setString(7, req_json.ToItem[i].PostingDate);\n\t\t\t\t//Item Text\n\t\t\t\toStatement.setString(8, req_json.ToItem[i].ItemText);\n\t\t\t\t//Ref Key 1\n\t\t\t\toStatement.setString(9, req_json.ToItem[i].RefKey1);\n\t\t\t\t//Ref Key 2\n\t\t\t\toStatement.setString(10, req_json.ToItem[i].RefKey2);\n\t\t\t\t//Ref Key 3\n\t\t\t\toStatement.setString(11, req_json.ToItem[i].RefKey3);\n\t\t\t\t//Account Type\n\t\t\t\toStatement.setString(12, req_json.ToItem[i].AccountType);\n\t\t\t\t//Document Type\n\t\t\t\toStatement.setString(13, req_json.ToItem[i].DocumentType);\n\t\t\t\t//Fiscal Period\n\t\t\t\toStatement.setString(14, req_json.ToItem[i].FiscalPeriod);\n\t\t\t\t//Profit Center\n\t\t\t\toStatement.setString(15, req_json.ToItem[i].ProfitCenter);\n\t\t\t\t//Assignment Number\n\t\t\t\toStatement.setString(16, req_json.ToItem[i].AssignmentNumber);\n\t\t\t\t//Trading Partner\n\t\t\t\toStatement.setString(17, req_json.ToItem[i].TradingPartner);\n\t\t\t\t//Customer\n\t\t\t\toStatement.setString(18, req_json.ToItem[i].Customer);\n\t\t\t\t//Vendor\n\t\t\t\toStatement.setString(19, req_json.ToItem[i].VendorNo);\n\t\t\t\t//Entry Date\n\t\t\t\tvar lvDate = new Date();\n\t\t\t\tvar lvDateString = lvDate.toISOString().substring(0, 10);\n\t\t\t\toStatement.setString(20, lvDateString);\n\n\t\t\t\t//Add Batch process to executed on the database\n\t\t\t\toStatement.addBatch();\n\t\t\t}\n\n\t\t\t//Execute the Insert\n\t\t\toStatement.executeBatch();\n\n\t\t\t//Close the connection\n\t\t\toStatement.close();\n\t\t\toConnection.commit();\n\t\t\toConnection.close();\n\n\t\t\tgvTableUpdate += \",Table entries created for CDL_GL_ITEM\";\n\n\t\t} catch (errorObj) {\n\t\t\tgvTableUpdate += \",Error saving Payload Item field level entries:\" + errorObj.message;\n\t\t}\n\t}", "function writeOrdersToDb(item){\n var prom_orders_products = [];\n\n for (var key in item){\n\n if (key === '$'){\n for (var key2 in item['$']){\n item[key2] = item['$'][key2];\n }\n delete item['$'];continue;\n }\n\n if (key === 'index'){\n item['postCode'] = item['index'];\n delete item['index'];\n }\n\n if (key === 'items'){\n prom_orders_products = item['items'][0]['item'];\n\n for(var i = 0; i < prom_orders_products.length; i++){\n prom_orders_products[i]['order_id'] = item['id'];\n writeItemsToDb(prom_orders_products[i]);\n }\n\n delete item['items'];\n }\n\n if (Array.isArray(item[key])){\n if(key === 'items'){\n continue;\n }\n item[key] = item[key].join('');\n }\n\n if (key === 'date'){\n var rev = item['date'].split(' ');\n rev[0] = rev[0].split(\".\").reverse().join(\".\");\n item['date'] = rev.join(' ');\n }\n }\n\n orderQueries.ordersToDb(item);\n}", "function threadItemHoverOver(item) {\n item.addEvents({\n mouseenter: function(){\n this.morph({\n duration: 100,\n 'background-color': '#6E9489',\n 'border-color' : '#4b655d',\n 'color' : '#d9e3e0'\n });\n var editForm = this.getElement('.editThreadForm');\n if (editForm != null){\n editForm.getElements('input').morph('.editPostFormStyle');\n }\n },\n mouseleave: function(){\n this.morph('.threadItem');\n var editForm = this.getElement('.editThreadForm');\n if (editForm != null){\n editForm.getElements('input').morph('.editThreadFormStyle');\n }\n }\n });\n}", "function addItem(obj, item) {\n obj.items.push(item);\n obj.childrenCount = +obj.childrenCount + 1;\n }", "function addInventoryItem(itemName, quantity, userId )\n\t{\t\n\t\titemName = \"ItemF\" ;\t//TEST CODE REMOVE\n\t\tquantity = 77;\t\t\t//TEST CODE REMOVE\n\t\tuserId = 3;\t\t\t\t//TEST CODE REMOVE\n\n\t\t// object to post (body)\n\t\tvar item = {\n\t\t\t\"item_name\": itemName,\n\t\t\t\"quantity\": quantity,\n\t\t\t\"allUserId\": userId\n\t\t};\n\t\t\n\t\t$.ajax({\n \tmethod: \"POST\",\n \turl: \"/api/inventory\",\n \tdata: item\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "function doNotify(item) {\n\tif(item == null)\n\t\treturn;\n\tpostObject = item;\n\tchrome.notifications.create(\"id\"+notID++, makeOption(item), creationCallback);\n}", "function saveItem(index){\n const value = document.getElementById('input-item-' + index).value;\n const _item = {message: value, editing: false};\n\n items.splice(index, 1, _item);\n\n removeItemFromJSON(\"http://localhost:8000/index.php\", index);\n postItemToJSON(\"http://localhost:8000/index.php\", _item, index);\n\n render();\n}", "function addItemToThePage(itemWrapper, item) {\n\t\t$(itemWrapper).on('click', function() {\n\t\t\twindow.open($(itemWrapper).find('.itemLink').attr('link'),'_blank');\n\t\t});\n\t\t\n\t\tvar minValueOfColumn = Array.min(ColumnsHeightArray);\n\t\tvar minIndex = $.inArray(minValueOfColumn, ColumnsHeightArray);\n\t\tvar itemLeftPosition = MARGIN+(minIndex*(COLUMN_WIDTH+MARGIN))+LeftOffSet;\n\t\t/**\n\t\tvar randomColor = '#'+randomHexHelperArray[Math.floor((Math.random()*15))]+randomHexHelperArray[Math.floor((Math.random()*15))]\n\t\t+randomHexHelperArray[Math.floor((Math.random()*15))]+randomHexHelperArray[Math.floor((Math.random()*15))]\n\t\t+randomHexHelperArray[Math.floor((Math.random()*15))]+randomHexHelperArray[Math.floor((Math.random()*15))];\n\t\t**/\n\t\tvar randomColor = COLOR_ARRAY[Math.floor((Math.random()* COLOR_ARRAY.length))];\n\t\t$(itemWrapper).css ({\n\t\t\t'left' : itemLeftPosition+'px',\n\t\t\t'top' : minValueOfColumn+'px',\n\t\t\t'background' : randomColor,\n\t\t\t'width' : COLUMN_WIDTH+'px'\n\t\t});\n\t\tif(\t$(itemWrapper).find('.title').html().indexOf('Podcast') <0)\n\t\t{\n\t\t\t$('#feedContainer').append(itemWrapper);\n\t\t\t$(itemWrapper).fadeIn(1300);\n\t\t\tColumnsHeightArray[minIndex] += minIndex+$(itemWrapper).height()+MARGIN;\n\t\t}\n}", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "function addItem(countId, content, itemName) {\n\n\tvar itemHtml = $(\"#itemTemplate\").html();\n\tvar itemCount = $(\"#\" + countId).val();\n\tvar item = new Item();\n\titem.makeHtml(content, itemHtml, function(name) {\n\t\tconsole.log('template call back!!..');\n\n\t\t// jquery日付の呼び出す初期化\n\t\t$(\".datepicker\").datepicker();\n\n\t\t// 連動呼び出す\n\t\titemAreaHide(name);\n\t}, itemCount, itemName);\n\t$(\"#\" + countId).val(parseInt(itemCount) + 1);\n}", "add(properties = {}, listItemEntityTypeFullName = null) {\r\n const removeDependency = this.addBatchDependency();\r\n return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(listItemEntityType => {\r\n const postBody = jsS(extend(metadata(listItemEntityType), properties));\r\n const promise = this.clone(Items_1, \"\").postCore({ body: postBody }).then((data) => {\r\n return {\r\n data: data,\r\n item: this.getById(data.Id),\r\n };\r\n });\r\n removeDependency();\r\n return promise;\r\n });\r\n }", "addMenuItem( item ){\n this.itemList.push(item);\n }", "function itemKeypress() {\n //'13' represents the enter key\n if (event.which === 13) {\n updateItem.call(this);\n }\n}", "post(newGearItemObject) {\n return fetch(`${remoteURL}/gearItems`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(newGearItemObject)\n }).then(data => data.json())\n }", "function aq_sortable_list_add_item(action_id, items) {\n\t\t\n\t\tvar blockID = items.attr('rel'),\n\t\t\tnumArr = items.find('li').map(function(i, e){\n\t\t\t\treturn $(e).attr(\"rel\");\n\t\t\t});\n\t\tvar type_shortcode = items.attr('data-shortcode-type');\n\t\tvar maxNum = Math.max.apply(Math, numArr);\n\t\tif (maxNum < 1 ) { maxNum = 0};\n\t\tvar newNum = maxNum + 1;\n\t\t\n\t\tvar data = {\n\t\t\taction: 'aq_block_'+action_id+'_add_new',\n\t\t\tsecurity: $('#aqpb-nonce').val(),\n\t\t\tcount: newNum,\n\t\t\tblock_id: blockID,\n\t\t\ttype: type_shortcode\n\t\t};\n\t\t\n\t\t$.post(ajaxurl, data, function(response) {\n\t\t\tvar check = response.charAt(response.length - 1);\n\t\t\t\n\t\t\t//check nonce\n\t\t\tif(check == '-1') {\n\t\t\t\talert('An unknown error has occurred');\n\t\t\t} else {\n\t\t\t\titems.append(response);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t});\n\t}", "function saveItem(itemID, type) {\n showProcessingDiaglog();\n var item;\n if (type == \"backlog\") {\n item = new Backlog()\n item.Backlog_ID = itemID;\n }\n else {\n item = new Task();\n item.Task_ID = itemID;\n document.getElementById(type + \".\" + itemID).setAttribute(\"data-backlog-id\", item.Backlog_ID);\n }\n\n var saveData = $.ajax({\n url: \"Handler/ItemHandler.ashx\",\n data: {\n action: \"updateItem\",\n projectID: projectID,\n type: type,\n item: JSON.stringify(item)\n },\n type: \"post\",\n success: function (result) {\n updateVisualNote(type + \".\" + itemID, item.Title, item.Color);\n\n // Update note in other clients\n proxyNote.invoke(\"updateNote\", type + \".\" + itemID, item.Title, item.Color);\n }\n });\n\n var saveAssignee = (assigneeChange == true) ? updateAssignee(itemID, type) : null;\n\n // Turn off processing window and display success message\n // Send new info to other clients\n $.when(saveData, saveAssignee).done(function () {\n showSuccessDiaglog(1);\n });\n}", "get addItemsWarp() {\n return event => {\n this.ItemsWarp.push({});\n };\n }", "function onInsertItemClick(event){\n var $el = $(this).closest('.scheduled-item-fields'),\n fields = setDynamicFieldIDs($(\"#add-event-button\").data('fields')),\n insertIndex = $items.index($el) + 1;\n\n $el.after(fields);\n $itemContainer.trigger('afterAppendScheduledItem', insertIndex);\n $(document).trigger('dynamic_fields_added', [$(fields)]);\n }", "function addItem(item) {\n backpack.push(item);\n}", "add(event, item) {\n event.preventDefault();\n this.props.addToBasket({\n product_id: item.product_id,\n product_name: item.product_name,\n product_images: item.product_images,\n product_price: item.product_price\n })\n }", "addLineItem(item, units, comment) {\n\t\tlet sku = item.sku\n if (sku in this.items) {\n\t\t\tlet existing = this.items[sku]\n //console.log(`addLineItem ${units} to update existing item-${sku}`)\n\t\t\texisting.units += units \n\t\t\tif (comment) existing.comment = comment \n } else {\n\t\t\t//console.log(`addLineItem ${units} to new item ${sku}`)\n\t\t\tthis.items[sku] = new OrderItem({\n\t\t\t\tsku: item.sku,\n\t\t\t\tname:item.name, \n\t\t\t\timage: item.image,\n\t\t\t\tunits:units, \n\t\t\t\tcomment:comment})\n }\n\t\tthis.render() // updates the view\n return this\n\t}", "function markItem(item) {\n // First check off the item.\n list[item].completed = true;\n\n // Then reprint the screen.\n printList();\n \n // Then save the list.\n saveList(list);\n}", "enqueue(item) {\n\t\tthis.storage.add_to_tail(item);\n\t\tthis.length++;\n\t}", "moveItems(items, toFloor) {\n for(const item of items) {\n this.#delItem(item, this.elevator_on);\n this.#addItem(item, toFloor);\n }\n this.elevator_on = toFloor;\n return this;\n }", "function createItems(title, imageUrl, value, callback) {\n var item = new Item();\n item.title = title;\n item.value = value;\n item.imageUrl = imageUrl;\n\n item.save(function (err) {\n if (err) {\n var error = {error: 'Cannot save the item', msg: err};\n console.log('Error = ' + JSON.stringify(error));\n } else {\n console.log('Item saved ' + JSON.stringify(item));\n }\n callback();\n });\n}", "add(item) {\n\t\tthis.queue.set(item, item);\n\t}" ]
[ "0.6130734", "0.5910054", "0.5888954", "0.55749893", "0.5568133", "0.5446455", "0.54139936", "0.538187", "0.5379793", "0.53779024", "0.5367255", "0.5342791", "0.53397524", "0.5335092", "0.53263664", "0.53146493", "0.5289795", "0.52637213", "0.5241706", "0.5241644", "0.5228958", "0.5227493", "0.5227378", "0.5224265", "0.5199256", "0.51974666", "0.5169429", "0.5158304", "0.51509607", "0.5140856", "0.5134875", "0.5128289", "0.5110985", "0.51051205", "0.50911385", "0.50892144", "0.5088716", "0.50792146", "0.50789434", "0.50713307", "0.50613624", "0.50613326", "0.50469685", "0.50371265", "0.50326324", "0.50326324", "0.5022951", "0.50116444", "0.5010533", "0.5010254", "0.5004146", "0.50041056", "0.49820328", "0.4980979", "0.49809358", "0.496509", "0.49641937", "0.49594706", "0.49549645", "0.49531117", "0.4943981", "0.49416342", "0.49416342", "0.4935982", "0.4924707", "0.49235472", "0.49219838", "0.49214187", "0.4917971", "0.49147338", "0.49131855", "0.49102193", "0.4898866", "0.48961866", "0.48930854", "0.48927414", "0.48879856", "0.48867807", "0.4884042", "0.48820314", "0.48787493", "0.48739165", "0.48733258", "0.48706", "0.48656487", "0.48656034", "0.48637983", "0.4862486", "0.48595205", "0.4855347", "0.4854027", "0.4849072", "0.4841278", "0.4837933", "0.4831222", "0.48294768", "0.48214686", "0.48128012", "0.48099834", "0.4803453" ]
0.58456343
3
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n return {\n source: convert_source_map_1.removeComments(file.text).replace(/\\n\\n$/, '\\n'),\n map: inlineSourceMap,\n isInline: true,\n };\n }\n else if (external) {\n var externalSourceMap = null;\n try {\n var fileName = external[1] || external[2];\n var filePath = file_system_1.resolve(file_system_1.dirname(file_system_1.absoluteFromSourceFile(file)), fileName);\n var mappingFile = fs.readFile(filePath);\n externalSourceMap = convert_source_map_1.fromJSON(mappingFile);\n }\n catch (e) {\n if (e.code === 'ENOENT') {\n logger.warn(\"The external map file specified in the source code comment \\\"\" + e.path + \"\\\" was not found on the file system.\");\n var mapPath = file_system_1.absoluteFrom(file.fileName + '.map');\n if (file_system_1.basename(e.path) !== file_system_1.basename(mapPath) && fs.exists(mapPath) &&\n fs.stat(mapPath).isFile()) {\n logger.warn(\"Guessing the map file name from the source file name: \\\"\" + file_system_1.basename(mapPath) + \"\\\"\");\n try {\n externalSourceMap = convert_source_map_1.fromObject(JSON.parse(fs.readFile(mapPath)));\n }\n catch (e) {\n logger.error(e);\n }\n }\n }\n }\n return {\n source: convert_source_map_1.removeMapFileComments(file.text).replace(/\\n\\n$/, '\\n'),\n map: externalSourceMap,\n isInline: false,\n };\n }\n else {\n return { source: file.text, map: null, isInline: false };\n }\n }", "function computeSourceMap(\n code,\n filePath,\n {compiledFilename},\n) {\n let mappings = \"AAAA\";\n for (let i = 0; i < code.length; i++) {\n if (code.charCodeAt(i) === charCodes.lineFeed) {\n mappings += \";AACA\";\n }\n }\n return {\n version: 3,\n file: compiledFilename || \"\",\n sources: [filePath],\n mappings,\n names: [],\n };\n}", "_generateSourceMap(baseDir, code, units){\n const sections = [];\n for (let unit of Array.from(units)) {\n const unitDir = path.dirname(unit.fpath);\n if (unit.sm) {\n // TODO: should support http, https, etc...\n var i, s, sm, sp;\n const url = path.resolve(unitDir, unit.sm.url);\n try {\n sm = JSON.parse(fs.readFileSync(url));\n } catch (e) {\n log(`Skipped invalid source map file ${path.relative(baseDir,url)}`);\n continue;\n }\n\n // if sm itself consists of concatenated sections, merge them\n if (sm.sections) {\n const iterable = sm.sections || [];\n for (i = 0; i < iterable.length; i++) {\n const sec = iterable[i];\n sec.offset.line += unit.smline;\n for (i = 0; i < sec.map.sources.length; i++) {\n s = sec.map.sources[i];\n sp = path.resolve(unitDir, s);\n sec.map.sources[i] = path.relative(baseDir, sp);\n }\n }\n sections.push(...Array.from(sm.sections || []));\n } else {\n // concatenate sources into sections, with path resolved\n for (i = 0; i < sm.sources.length; i++) {\n s = sm.sources[i];\n sp = path.resolve(unitDir, s);\n sm.sources[i] = path.relative(baseDir, sp);\n }\n sections.push({\n offset: {line : unit.smline, column : 0},\n map : sm\n });\n }\n } else { // js file has no matching source map file, generate it\n var line;\n const { SourceMapGenerator } = sourceMap;\n const srcfile = path.relative(baseDir, unit.fpath);\n const map = new SourceMapGenerator({file:srcfile});\n const lc = fuse._lc(unit.src);\n if (lc > 0) {\n for (line = 1, end = lc, asc = 1 <= end; asc ? line <= end : line >= end; asc ? line++ : line--) { // 1 to 1 mapping for each line\n var asc, end;\n map.addMapping({\n source: srcfile,\n original : {line, column:0},\n generated : {line, column:0}\n });\n }\n }\n sections.push({\n offset: {line: unit.smline, column: 0},\n map: map.toJSON()\n });\n }\n }\n return sections.length === 0 ? null : {\n version : 3,\n file : '',\n sections\n };\n }", "function SourceMap(){\n this.lines = [];\n }", "_parseMappings(aStr, aSourceRoot) {\n const generatedMappings = (this.__generatedMappingsUnsorted = [])\n const originalMappings = (this.__originalMappingsUnsorted = [])\n for (let i = 0; i < this._sections.length; i++) {\n const section = this._sections[i]\n\n const sectionMappings = []\n section.consumer.eachMapping((m) => sectionMappings.push(m))\n\n for (let j = 0; j < sectionMappings.length; j++) {\n const mapping = sectionMappings[j]\n\n // TODO: test if null is correct here. The original code used\n // `source`, which would actually have gotten used as null because\n // var's get hoisted.\n // See: https://github.com/mozilla/source-map/issues/333\n let source = util.computeSourceURL(\n section.consumer.sourceRoot,\n null,\n this._sourceMapURL\n )\n this._sources.add(source)\n source = this._sources.indexOf(source)\n\n let name = null\n if (mapping.name) {\n this._names.add(mapping.name)\n name = this._names.indexOf(mapping.name)\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n const adjustedMapping = {\n source,\n generatedLine:\n mapping.generatedLine + (section.generatedOffset.generatedLine - 1),\n generatedColumn:\n mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name,\n }\n\n generatedMappings.push(adjustedMapping)\n if (typeof adjustedMapping.originalLine === 'number') {\n originalMappings.push(adjustedMapping)\n }\n }\n }\n }", "function w(e,t){if(!he)\n// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\n// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\nreturn Q(e)?y(e):e;if(null==t){if(e instanceof $)return e;t={}}return null==t.loc?new $(null,null,he,e,t.name||null):new $(t.loc.start.line,t.loc.start.column,he===!0?t.loc.source||null:he,e,t.name||null)}", "function updateSourceMap(sourceMapText, fileName) {\n var sourceMap = JSON.parse(sourceMapText);\n sourceMap.file = fileName;\n sourceMap.sources = [fileName];\n delete sourceMap.sourceRoot;\n return JSON.stringify(sourceMap);\n}", "function renderSourceAndMap(sourceFile, input, output) {\n var outputPath = file_system_1.absoluteFromSourceFile(sourceFile);\n var outputMapPath = file_system_1.absoluteFrom(outputPath + \".map\");\n var relativeSourcePath = file_system_1.basename(outputPath);\n var relativeMapPath = relativeSourcePath + \".map\";\n var outputMap = output.generateMap({\n source: outputPath,\n includeContent: true,\n });\n // we must set this after generation as magic string does \"manipulation\" on the path\n outputMap.file = relativeSourcePath;\n var mergedMap = mergeSourceMaps(input.map && input.map.toObject(), JSON.parse(outputMap.toString()));\n var result = [];\n if (input.isInline) {\n result.push({ path: outputPath, contents: output.toString() + \"\\n\" + mergedMap.toComment() });\n }\n else {\n result.push({\n path: outputPath,\n contents: output.toString() + \"\\n\" + convert_source_map_1.generateMapFileComment(relativeMapPath)\n });\n result.push({ path: outputMapPath, contents: mergedMap.toJSON() });\n }\n return result;\n }", "findSourceMapUrl(contents) {\n const lines = contents.split('\\n');\n for (let l = lines.length - 1; l >= Math.max(lines.length - 10, 0); l--) {\n const line = lines[l].trim();\n const matches = EagerSourceMapTransformer.SOURCE_MAPPING_MATCHER.exec(line);\n if (matches && matches.length === 2) {\n return matches[1].trim();\n }\n }\n return null;\n }", "function SourceMap(input) {\n if (!(this instanceof SourceMap)) {\n return new SourceMap(input);\n }\n this.file = [];\n this.mappings = [];\n this.filemap = {};\n if (input && typeof input == 'object') {\n if (input instanceof SourceMap) {\n return input;\n } else {\n this.append(input);\n }\n }\n}", "function w(e,t){if(!ht)// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\n// with no source maps, generated is either an\n// array or a string. if an array, flatten it.\n// if a string, just return it\nreturn Q(e)?y(e):e;if(null==t){if(e instanceof $)return e;t={}}return null==t.loc?new $(null,null,ht,e,t.name||null):new $(t.loc.start.line,t.loc.start.column,ht===!0?t.loc.source||null:ht,e,t.name||null)}", "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n\tvar base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function $i__NM$$css$$_$$loader$lib$css$$_$$base__toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}", "function SourceMapGenerator(aArgs){if(!aArgs){aArgs={};}this._file=util.getArg(aArgs,'file',null);this._sourceRoot=util.getArg(aArgs,'sourceRoot',null);this._skipValidation=util.getArg(aArgs,'skipValidation',false);this._sources=new ArraySet();this._names=new ArraySet();this._mappings=new MappingList();this._sourcesContents=null;}", "function computeSourceMap(\n {code: generatedCode, mappings: rawMappings},\n filePath,\n options,\n source,\n tokens,\n) {\n const sourceColumns = computeSourceColumns(source, tokens);\n const map = new (0, _genmapping.GenMapping)({file: options.compiledFilename});\n let tokenIndex = 0;\n // currentMapping is the output source index for the current input token being\n // considered.\n let currentMapping = rawMappings[0];\n while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) {\n tokenIndex++;\n currentMapping = rawMappings[tokenIndex];\n }\n let line = 0;\n let lineStart = 0;\n if (currentMapping !== lineStart) {\n _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0);\n }\n for (let i = 0; i < generatedCode.length; i++) {\n if (i === currentMapping) {\n const genColumn = currentMapping - lineStart;\n const sourceColumn = sourceColumns[tokenIndex];\n _genmapping.maybeAddSegment.call(void 0, map, line, genColumn, filePath, line, sourceColumn);\n while (\n (currentMapping === i || currentMapping === undefined) &&\n tokenIndex < rawMappings.length - 1\n ) {\n tokenIndex++;\n currentMapping = rawMappings[tokenIndex];\n }\n }\n if (generatedCode.charCodeAt(i) === _charcodes.charCodes.lineFeed) {\n line++;\n lineStart = i + 1;\n if (currentMapping !== lineStart) {\n _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0);\n }\n }\n }\n const {sourceRoot, sourcesContent, ...sourceMap} = _genmapping.toEncodedMap.call(void 0, map);\n return sourceMap ;\n}", "function relocateSourceMapSources({ artefacts, entryPoint }) {\n return __awaiter(this, void 0, void 0, function* () {\n yield json_1.modifyJsonFiles(`${artefacts.stageDir}/+(bundles|esm2015|esm5)/**/*.js.map`, (sourceMap) => {\n sourceMap.sources = sourceMap.sources\n .map((path) => {\n let trimmedPath = path;\n // Trim leading '../' path separators\n while (trimmedPath.startsWith('../')) {\n trimmedPath = trimmedPath.substring(3);\n }\n return `ng://${entryPoint.moduleId}/${trimmedPath}`;\n });\n return sourceMap;\n });\n });\n}", "function getSourceMap(outFile, sourceMap) {\n let resolvedSourceMap = sourceMap;\n\n // dynamic source map; run the given iterator function\n if (typeof sourceMap === 'function') {\n resolvedSourceMap = sourceMap(outFile);\n }\n\n // source map is a boolean; use the output file\n if (sourceMap === true) {\n resolvedSourceMap = outFile;\n }\n\n // source map is a directory; append the output's basename\n if (!isFile(resolvedSourceMap)) {\n resolvedSourceMap = path.join(\n resolvedSourceMap,\n path.basename(outFile)\n );\n }\n\n // resolve and ensure '.map' extension\n return path.resolve(resolvedSourceMap.replace(/(\\.map)?$/, '.map'));\n}", "function createJsIdentitySourcemap(sourceUrl, sourceContent, lineOffset, firstLineCharOffset) {\n const generator = new source_map_1.SourceMapGenerator();\n const tokens = espree.tokenize(sourceContent, { loc: true, ecmaVersion: 2017, sourceType: 'module' });\n tokens.forEach(token => {\n if (!token.loc) {\n return null;\n }\n let mapping = {\n original: {\n line: token.loc.start.line + lineOffset,\n column: token.loc.start.column +\n (token.loc.start.line === 1 ? firstLineCharOffset : 0)\n },\n generated: token.loc.start,\n source: sourceUrl\n };\n if (token.type === 'Identifier') {\n mapping.name = token.value;\n }\n generator.addMapping(mapping);\n });\n return generator.toJSON();\n}", "function SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n };\n return {\n add : add,\n get : function() { return generator },\n toString : function() { return generator.toString() }\n };\n}", "function SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n };\n return {\n add : add,\n get : function() { return generator },\n toString : function() { return generator.toString() }\n };\n}", "function updateSourcemapLocations(document, ast) {\n // We need to serialize and reparse the dom for updated location information\n const documentContents = parse5.serialize(ast);\n ast = astUtils.parse(documentContents, { locationInfo: true });\n const reparsedDoc = new polymer_analyzer_1.ParsedHtmlDocument({\n url: document.url,\n contents: documentContents,\n ast: ast,\n isInline: document.isInline,\n locationOffset: undefined,\n astNode: null\n });\n const inlineScripts = dom5.queryAll(ast, matchers.inlineJavascript);\n inlineScripts.forEach(script => {\n let content = dom5.getTextContent(script);\n const sourceMapUrlParts = content.match(sourceMappingUrlExpr);\n if (!sourceMapUrlParts) {\n return;\n }\n const sourceMapContentParts = sourceMapUrlParts[1].match(inlineSourceMapExpr);\n if (!sourceMapContentParts) {\n return;\n }\n const sourceRange = reparsedDoc.sourceRangeForStartTag(script);\n const sourceMap = base64StringToRawSourceMap(sourceMapContentParts[2]);\n const updatedMap = offsetSourceMap(sourceMap, sourceRange.end.line, sourceRange.end.column);\n const base64Map = rawSourceMapToBase64String(updatedMap);\n content = content.replace(sourceMappingUrlExpr, `${inlineSourcemapPrefix}${base64Map}\\n`);\n dom5.setTextContent(script, content);\n });\n return ast;\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function toComment(sourceMap) {\n var base64 = new Buffer(JSON.stringify(sourceMap)).toString('base64');\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n return '/*# ' + data + ' */';\n}", "function remapping(input, loader, options) {\n const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };\n const tree = buildSourceMapTree(input, loader);\n return new SourceMap(traceMappings(tree), opts);\n}", "dumpSource(filename) {\n const config = this.getConfigFor(filename);\n const resolved = config.resolve();\n const sources = resolved.transformFilename(filename);\n return sources.reduce((result, source) => {\n result.push(`Source ${source.filename}@${source.line}:${source.column} (offset: ${source.offset})`);\n if (source.transformedBy) {\n result.push(\"Transformed by:\");\n result = result.concat(source.transformedBy.reverse().map((name) => ` - ${name}`));\n }\n if (source.hooks && Object.keys(source.hooks).length > 0) {\n result.push(\"Hooks\");\n for (const [key, present] of Object.entries(source.hooks)) {\n if (present) {\n result.push(` - ${key}`);\n }\n }\n }\n result.push(\"---\");\n result = result.concat(source.data.split(\"\\n\"));\n result.push(\"---\");\n return result;\n }, []);\n }", "function simpleShimSourceMap(sourceMap) {\n if (sourceMap === undefined) {\n return undefined; //undefined case\n }\n else if (typeof sourceMap === \"object\") {\n return sourceMap.pc_pos_map_compressed; //Vyper object case\n }\n else {\n try {\n return JSON.parse(sourceMap).pc_pos_map_compressed; //Vyper JSON case\n }\n catch (_) {\n return sourceMap; //Solidity case\n }\n }\n}" ]
[ "0.69679236", "0.69377637", "0.67660517", "0.644171", "0.63287604", "0.62983114", "0.6256009", "0.6210124", "0.61941147", "0.61812603", "0.6174446", "0.6158444", "0.6158444", "0.6158444", "0.6154958", "0.60953784", "0.6039884", "0.5989862", "0.5980611", "0.5979347", "0.5979151", "0.5979151", "0.5962547", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.59396034", "0.5933014", "0.59271747", "0.58930284" ]
0.0
-1
checks if props are coming from yourmenuitem because of edit recipe button
componentDidMount() { if (this.props.menuItem) { const { menuItem } = this.props; const { name, ingredients, directions, categories, id } = menuItem; this.setState({ name, ingredients, directions, categories, id }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEditMenuItemValid(){\r\n return(EMenuItemNameField.isValid() && EMenuItemDescField.isValid() && EMenuItemValidFromField.isValid() && EMenuItemValidToField.isValid() && EMenuItemPriceField.isValid() && EMenuItemTypePerField.isValid());\r\n }", "function handleEdit(recipe: string, props: State & WrappedActionProps) {\n props.setForm('Recipe', recipe)\n props.setForm('Ingredients', pack(props.recipes.get(recipe)))\n props.selectRecipe(recipe)\n props.setModal('Edit_Recipe_Modal')\n}", "launchEditPrompt(e) {\n e.preventDefault();\n const categoryToBeEdited = this.props.data.filter((category) => {\n return category.name === e.target.name;\n });\n this.setState({\n categoryId: categoryToBeEdited[0].id,\n categoryName: categoryToBeEdited[0].name,\n categoryDescription: categoryToBeEdited[0].description,\n displayEditModal: 'block',\n });\n }", "function editMenuItem() \n{\n\tvar url = '';\n\tvar module = $('#item' + selectedItemID).attr('rel');\n\tif(!treeConfigObj[module]) {\n\t return false;\n\t}\n\n\tswitch(treeConfigObj[module].edit_mode) {\n\t case 'module':\n\t\turl = \"/admin/\" + module;\n\t\tbreak;\n\t case 'linked':\n\t\turl = \"/admin/\" + module + '/index/' + selectedItemID;\n\t\tbreak;\n\t default:\n\t\turl = \"/admin/structure/edit/\" + selectedItemID;\n\t}\n\n\tif(window.location.pathname != url) {\n\t window.location.href = url;\n\t}\n\treturn false;\n}", "handleEdit(recipe, index) {\n this.props.handleEdit(recipe, index)\n }", "onEditClicked(){\n this.props.onEdit(this.props.item);\n }", "function handleIsEdit(property) {\n setIsEdit(property)\n }", "openEdit(editRecipe) {\n this.setState( { showEdit: true, editRecipe: editRecipe } );\n }", "handleEditClicked(bool){\n this.setState({edit : bool});\n\n // only when users click save and input is not empty\n if(this.state.edit === true && this.state.term !== ''){\n // passing input value and its id to action creator\n this.props.editTodoLists(this.props.id, this.state.term);\n }\n }", "isEditing(wizardStep) {\n return wizardStep.editing;\n }", "isEditing(wizardStep) {\n return wizardStep.editing;\n }", "function isEditAllowed()\n {\n return activeInitData.editAllowed === true;\n }", "viewEditModel(data, type) {\n if (type != \"checkbox\") {\n if (data) {\n this.setState({\n showEditModal: true, itemEdit: data,\n selectedExpensesTypeItemEdit: { label: data.expenseTypeName, value: data.expenseTypeId }\n });\n }\n }\n }", "onAddSuppliesClick() {\n const edit = this.state.editing;\n const visible = this.state.inputsVisible;\n this.setState({\n editing: !edit,\n inputsVisible: !visible\n });\n }", "onEditMode() {\n const {selectedPage, selectedView, selectedPageDirty} = this.props;\n return ((selectedPage && selectedPage.tabId === 0) || selectedPageDirty\n || selectedView === panels.SAVE_AS_TEMPLATE_PANEL\n || selectedView === panels.ADD_MULTIPLE_PAGES_PANEL \n || selectedView === panels.CUSTOM_PAGE_DETAIL_PANEL);\n }", "isActionbuttonEnabled(item, index) {\n \n if(item.name!=\"\" && item.categories[0].removed == undefined)\n {\n return false;\n }\n \n return true;\n }", "function RenderMenuItem({recipe, auth, postFavorite}) {\n return (\n <CardGroup>\n <a id='recipe-card' target='_blank' href={recipe.url} rel=\"noreferrer\">\n <Card id='recipe-card' className='h-100'>\n <CardHeader className='text-secondary'>{recipe.name}</CardHeader>\n { auth ?\n <CardBody className=\"d-flex flex-column\">\n <CardImg id=\"card-img-top\" src={recipe.image} alt='No image availabe' />\n <Button color='info' className='mt-auto' onClick={e => {\n e.preventDefault();\n console.log(recipe);\n postFavorite(recipe);\n }}>\n Save\n </Button>\n </CardBody>\n :\n <CardBody className=\"d-flex flex-column\">\n <CardImg id=\"card-img-top\" src={recipe.image} alt='No image availabe' />\n </CardBody>\n }\n </Card>\n </a>\n </CardGroup>\n );\n}", "function handleEditButtonClick(event) {\r\n editBookID = event.target.parentNode.parentNode.parentNode.getAttribute('data-id');\r\n showEditBookModal();\r\n for (let book of allBooks) {\r\n if (Number(book.id) === Number(editBookID)) {\r\n initializeEditBookModalValues(book);\r\n }\r\n }\r\n}", "function edit(){\n\t\treturn M.status == 'edit';\n\t}", "function isEditMenuValid(){\r\n return(EMenuNameField.isValid() && EMenuDescField.isValid() && EMStartDateField.isValid() && EMEndDateField.isValid());\r\n }", "handleExpenseOrItemClick(e) {\n this.editExpenseOrItem(e)\n }", "function handleSave(oldRecipe: ?string, newRecipe: string, newIngredients: string, props: WrappedActionProps) {\n if (oldRecipe && newRecipe !== oldRecipe) { // user has editted the recipe name\n props.deleteRecipe(oldRecipe)\n }\n props.addRecipe(newRecipe, newIngredients)\n}", "function EditItem(props) {\n\n // Tuodaan propsien kautta muokattavan nimikkeen id ja etsitään sen indeksi props.datasta\n const index = props.data.findIndex(item => item.id === props.match.params.id);\n // Käytetään datana vain kyseisen nimikkeen dataa\n let itemData = props.data[index];\n\n return (\n <Content>\n <div className=\"edititem\">\n {/*<div className=\"edititem__header\">\n {/*<h2>Muokkaa</h2>\n </div>*/}\n {/* Tuodaaan ItemForm-komponentti, jolle annetaan propseiksi kyseisen nimikkeen data sekä \n App.js:ssä määritellyt funktiot lomakkeen lähettämiseen ja nimikkeen poistamiseen */}\n <ItemForm\n onFormSubmit={props.onFormSubmit}\n data={itemData}\n onDeleteItem={props.onDeleteItem}\n onDeleteImage={props.onDeleteImage} />\n </div>\n\n </Content >\n );\n}", "addButton() {\n if (this.props.thread.posterid == this.props.userid && this.props.thread.postername === this.props.username) {\n return (\n <div>\n <p className=\"editbutton\" style={{ float: 'none' }} onClick={() => this.setState({ editing: true })}>edit</p>\n </div>\n )\n }\n }", "editReservation(state, payload) {\n let found = false\n state.reservations.forEach(r => {\n if (r._id == JSON.parse(payload)._id) {\n state.updateForm = r\n state.updateFormShow = true\n state.bookingFormShow = false\n state.reservationsShow = false\n found = true\n }\n })\n if (!found)\n console.log(\"Error: Cannot find reservation, cannot edit\")\n }", "ifCreatorElseReviewer(isReadable, isEditable, props = this.props) {\n const {\n mainView,\n } = props;\n\n if (mainView === VIEW_ANSWERS_VIEW) {\n return isReadable();\n }\n else if (mainView === ANSWER_QUESTIONS_VIEW) {\n return isEditable();\n }\n }", "_canItemBeSelected(item) {\n return item.disabled === false && item.templateApplied !== true;\n }", "editTicket() {\n if (this.props.item.category) {\n this.toggleHidden()\n } else {\n this.setState({categoryHintHidden: false})\n }\n }", "addEdit(id, recipe){\n console.log(\"add/edit called\");\n if(id === undefined){\n this.props.addRecipe(recipe, () => {\n this.props.history.push('/');\n });\n\n }\n else{\n this.props.updateRecipe(id, recipe, () => {\n /*pass function to redirect page after submtting*/\n console.log(\"udpate recipe:\" + id);\n this.props.history.push(`/full/${id}`);\n });\n }\n }", "renderSelectedItem( ) {\n let content;\n\n if(this.state.currentList) {\n let currentList = this.state.listItems[this.state.currentList];\n if(!this.state.edit) {\n content = (\n <div>\n <div className=\"item\">\n <button onClick={this.enableEdit}>Change</button>\n </div>\n </div>\n );\n } else {\n content = (\n <div>\n <div className=\"item\">\n <button onClick={this.updateCurrentList}>Keep</button>\n </div>\n <input className=\"item\" defaultValue={currentList.title} ref=\"editListInput\" />\n </div>\n );\n }\n }\n return content;\n }", "function isId(recipe) {\r\n return recipe.id === id;\r\n }", "function editOrDelete(e){\n if (e.target.className === \"delete\"){\n updateView(e)\n }\n else if (e.target.className === \"edit\") {\n setUpEditForm(e)\n }\n }", "editButton(e, i) {\n this.prevent(e);\n this.setState({\n signal: i,\n show: true,\n description: this.props.reducerApp.todos[i].description,\n }, () => {\n this.showModal()\n })\n }", "editExpenseOrItem(e) {\n if (e.target.classList.contains('expense-name')) {\n e.preventDefault()\n const li = e.target\n li.contentEditable = true\n li.focus()\n li.classList.add('editable')\n }\n\n if (e.target.classList.contains('item-name') || e.target.classList.contains('item-price') || e.target.classList.contains('item-quantity')) {\n e.preventDefault()\n const li = e.target\n li.contentEditable = true\n li.focus()\n li.classList.add('editable')\n }\n }", "function _isEditing(flowInfo){\n\t\tvar isEditing = editingFlow != null;\n\t\tif(isEditing && flowInfo){\n\t\t\tisEditing &= (toolkit.getValue(flowInfo.categories) == toolkit.getValue(editingFlow.categories));\n\t\t\tisEditing &= (flowInfo.id == editingFlow.id);\n\t\t}\n\t\treturn isEditing;\n\t}", "function enableEditing(itemId){\n $('#'+itemId+'-desc').removeAttr('disabled');\n $('#'+itemId+'-info').removeAttr('disabled');\n $('#'+itemId+'-type').removeAttr('disabled');\n $('#'+itemId+'-category').removeAttr('disabled');\n $('#'+itemId+'-price').removeAttr('disabled');\n $('#'+itemId+'-stock').removeAttr('disabled');\n $('#'+itemId+'-save').removeAttr('disabled');\n $('#'+itemId+'-edit').hide();\n $('#'+itemId+'-cancel').show();\n}", "edit ( props ) {\n \n var link_text = props.attributes.link_text // To bind attribute link_text\n var link_url = props.attributes.link_url // To bind attribute link_url\n var text_color = props.attributes.text_color // To bind text colour\n var button_color = props.attributes.button_color // To bind button background colour\n\n // Style object for the button\n // I created a style in JSX sintax to keep it here for\n // the dynamic changes\n var button_style = props.attributes.button_style // To bind the style of the button\n button_style = {\n backgroundColor: button_color,\n color: text_color,\n padding: '14px 25px',\n textAlign: 'center',\n textDecoration: 'none',\n display: 'inline-block', \n }\n\n //\n // onChange event functions\n //\n function onChangeContentURL ( content ) {\n props.setAttributes({link_url: content})\n } \n \n function onChangeContentName ( content ) {\n props.setAttributes({link_text: content})\n } \n\n function onChangeButtonColor ( content ) {\n props.setAttributes({button_color: content})\n } \n\n function onChangeTextColor ( content ) {\n props.setAttributes({text_color: content})\n }\n\n return [\n <InspectorControls> {/* Whatever is inside this block will be displayed on the sidebar */}\n <div id=\"gbs-block-inspected-inspector-control-wrapper\">\n <label class=\"blocks-base-control__label\" for=\"mce_2\">URL</label> {/* WordPress class for labels */}\n <RichText\n format=\"string\" // Default is 'element'. Wouldn't work for a tag attribute\n className=\"gbs-block-inspected-inspector-control-field\"\n onChange={onChangeContentURL} // onChange event callback\n value={link_url} // Input Binding\n /> \n <label class=\"blocks-base-control__label\">Button colour</label> \n <ColorPalette // Element Tag for Gutenberg standard colour selector\n onChange={onChangeButtonColor} // onChange event callback\n />\n <label class=\"blocks-base-control__label\">Text colour</label> \n <ColorPalette // Element Tag for Gutenberg standard colour selector\n onChange={onChangeTextColor} // onChange event callback\n /> \n </div>\n </InspectorControls>\n ,\n <div id=\"gbs-block-inspected-box\"> {/* You have to have a wrapper tag when your markup has more than 1 tag */}\n <a style={button_style}>\n <RichText\n onChange={onChangeContentName} // onChange event callback\n value={link_text} // Input Binding\n placeholder=\"Name of the link\"\n />\n </a>\n </div>\n ]\n }", "handleEdit(e) {\n e.preventDefault();\n this.setState({\n isEditing: !this.state.isEditing\n });\n }", "edit() {\n return this._isAdmin();\n }", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "showEdit() {\n this.setState({\n editDetails: !this.state.editDetails\n })\n }", "handleEditClick() {\n\n const {r, c} = this.selectedRowCoords;\n if (r === null && c === null) return;\n\n if (this.isRowCanBeEditable(r)) {\n\n // Lock mechanism controls\n const dto = this.prepareDTOforLockMechanism(r, false);\n\n this.restApi.callApi('lock', dto).then(response => {\n const json = response.resultLock;\n const {user} = this.props;\n\n // can I continue to edit ?\n const continueToEdit = json.islock && json.uname === user.name;\n\n if (continueToEdit) {\n\n // create backup data before editing;\n this.handsontableDataBackup = JSON.parse(JSON.stringify(this.handsontableData));\n\n // Change edit mode on redux\n this.props.setEdit();\n\n this.setCellProperties(r, c);\n this.editedRowCoords.r = r;\n this.editedRowCoords.c = c;\n\n } else {\n this.showMessageForLockMechanism(true, json)\n }\n })\n\n }\n }", "function handleEdit(){\r\n\t\thistory.push({ \r\n\t\t\tpathname: `/search/editDocument/${props.doc._id}`,\r\n\t\t\tstate: { fromButtonEdit: true, type: \"book\" }\r\n\t\t });\r\n\r\n\t}", "handleRecipeClick(popupState, recipeData) {\n //recipeData - data of the recipe that was clicked\n this.setState({\n showPopup: popupState,\n recipeData: recipeData,\n });\n }", "canEdit() {\n return ['jpg', 'jpeg', 'png'].indexOf(this.item.extension.toLowerCase()) > -1;\n }", "editar(e){\n e.preventDefault();\n let grupo = this.state.selectedOption.value;\n let nombreU = this.refs.nombre.value.trim();\n let apePU = this.refs.apellidoP.value.trim();\n let matricula1 = this.refs.matricula.value.trim();\n let claveEscuela1 = this.refs.claveEscuela.value.trim();\n let correo = this.refs.correo.value.trim();\n this.props.editar(e,nombreU, apePU, correo, this.miId, matricula1, claveEscuela1, grupo);\n this.toggleModal();\n }", "render() {\n if (this.props.item !== null) {\n return (\n <Modal\n isOpen={this.props.showEditModal}\n toggle={this.props.toggleShowEditModal}\n >\n <Form>\n <ModalHeader toggle={this.props.toggleShowEditModal}>\n <h2>Edit Item</h2>\n <Button onClick={this.toggleEditMode}>Edit</Button>\n </ModalHeader>\n <ModalBody>\n {this.renderEditComponent()}\n </ModalBody>\n <ModalFooter>\n {this.state.editActive ? (\n <Button className={\"btn btn-primary\"} onClick={this.sumbitEdit}>\n Save\n </Button>\n ) : (\n <p />\n )}\n <p>\n {this.state.previouslyEdited && !this.state.editActive\n ? \"Click Close to see Changes\"\n : \"\"}\n </p>\n <Button\n className={\"btn btn-danger\"}\n onClick={this.props.toggleShowEditModal}\n >\n {this.state.editActive ? \"Cancel\" : \"Close\"}\n </Button>\n </ModalFooter>\n </Form>\n </Modal>\n );\n } else {\n return <div />;\n }\n }", "enableEditing() {\n var locationData = {};\n\n // A variable to store changes\n // untul the item is saved.\n locationData = {\n name: this.props.item.name,\n address: this.props.item.address,\n coordinates: this.props.item.coordinates,\n categories: this.props.item.categories\n };\n\n this.props.dispatch({type: LocationActions.ActionTypes.LOCATION.ENABLE_LOCATION_ROW_EDITING,\n locationIndex: this.props.locationIndex, locationData: locationData});\n }", "function handleAdd(props: WrappedActionProps) {\n props.setForm('Recipe', '')\n props.setForm('Ingredients', '')\n props.selectRecipe(null)\n props.setModal('Add_Recipe_Modal')\n}", "function handleEditButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"review\");\n var id = listItemData.id;\n // Edit the review via the cms form\n inputReview(id);\n }", "function isAddMenuItemValid(){\r\n return(MenuItemNameField.isValid() && MenuItemDescField.isValid() && MenuItemValidFromField.isValid() && MenuItemPriceField.isValid() && MenuItemTypePerField.isValid());\r\n }", "function showButton(e) {\r\n if( $(e.target).is( $('input[type=checkbox]') )) {\r\n let areChecked = 0;\r\n $('.items li').each(function() {\r\n if($(this).find( $('input[type=checkbox]') ).prop('checked') === true) {\r\n areChecked ++;\r\n }\r\n });\r\n if(areChecked > 0) {\r\n $('.edit').show();\r\n $('.add').hide();\r\n } else {\r\n $('.edit').hide();\r\n $('.add').show();\r\n }\r\n }\r\n}", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "function checkInput(recipe) {\n const required = ['name', 'description', 'categories', 'html'];\n required.forEach(property => {\n if (!recipe.hasOwnProperty(property)) {\n throw \"missing property! \" + property;\n }\n });\n return true;\n}", "onEdit (item) {\n this.setState({\n editItem: item\n })\n }", "function editItem() {\n var value = localStorage.getItem($(this).attr(\"key\"));\n var item = jQuery.parseJSON(value);\n toggleControls(\"off\");\n $('#displayLink').hide();\n $('#rname').val(item.rname[1]);\n $('#dateadded').val(item.dateadded[1]);\n var radios = $('input[name=\"category\"]:checked').val();\n $('#rtype').val(item.rtype[1]);\n $('#ringredients').val(item.ringredients)[1];\n $('#rdirections').val(item.rdirections)[1];\n save.off(\"click\", storeData);\n $('#submit').val(\"Edit Recipe\");\n var editSubmit = $('#submit');\n editSubmit.on(\"click\");\n editSubmit.attr(\"key\", this.key);\n }", "function allowedToEdit() {\n\t\treturn role === 'farm_admin' || role === 'farmer';\n\t}", "function ModifySection(props) {\n const productData = props.data\n if (productData.length === 0) {\n return <div>No products found</div>\n } else if (productData.length > 1) {\n return popChooseProd(productData)\n } else if (productData.length === 1) {\n return popModifyProd(productData)\n } else {\n return <div>Error!</div>\n }\n }", "handleEdit(e){\n if(e.type==='keypress'&&e.key!=='Enter') {\n return\n }\n\n const text = e.target.value;\n const {id} = this.props;\n\n if(text.trim().length) {\n this.props.editComponent(id, text)\n }\n }", "function editClicked() {\n edit = true;\n}", "editIngredient(id, name) {\n this.props.editIngredient(id, name);\n }", "onRecipeEdit() {\n this.router.navigate(['../', this.Id, 'edit'], { relativeTo: this.route });\n }", "render() {\n return (\n <div>\n {this.state.editButtonClick === false ? (\n\n // this checks for condition of deleted button clicked or not\n <div>\n {this.state.deleted === false ? (\n <div className=\"blog\">\n {this.state.post.length > 0 &&\n <div className=\"postTitle\">\n <h1>{this.state.post[0].title}</h1>\n <h2>{this.state.post[0].content}</h2>\n <br />\n <button className=\"delete\" onClick={this.handleDelete}> Delete </button>\n <button className=\"edit\" onClick={this.showEditForm}> Edit </button>\n </div>\n }\n </div>\n ) : (\n <Redirect to=\"/\" />\n )}\n </div>\n\n ) : (\n\n // edit form here\n <div className=\"edit\">\n <form onSubmit={this.handleEdit}>\n <input className=\"submitTitle\" type=\"text\" name=\"title\" value={this.state.title} onChange={this.handleChange} />\n <br />\n <input className=\"submitPost\" type=\"text\" name=\"content\" value={this.state.content} onChange={this.handleChange} />\n <br />\n <input type=\"submit\" value=\"Edit\" />\n </form>\n </div>\n )}\n </div>\n );\n }", "function editItem(currItem) {\n //if item found select combo\n\n //else set combo to please select\n\n }", "onPressModify(){\n if(this.props.onPressModify !== undefined) {\n this.props.onPressModify();\n }\n }", "function checkModify(categoryId, name, description, features){\n\tif(beforeEditData && categoryId in beforeEditData)\n\t{\n\t\t//categoryId is not changed.\n\t}\n\telse\n\t\treturn true;\n\tif(beforeEditData[categoryId].label != name)\n\t\treturn true;\n\tif(beforeEditData[categoryId].description != description)\n\t\treturn true;\n\tfor(key in features){\n\t\tif(beforeEditData[\"features\"] && key in beforeEditData[\"features\"]){\n\t\t\t//\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\tfor(key in beforeEditData[\"features\"]){\n\t\tif(key in features){\n\t\t\t//\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\t$.messager.alert(\"Information\", \"No information has been modified for this category\", \"info\");\n\treturn false;\n}", "canEdit(record) {\n return false;\n }", "checkPrimary(item) {\n if (this.props.primaryId === item.id) {\n return null;\n } else {\n return (\n <a key={item.id} className=\"option-row\" data-option-id={item.id} onClick={this.optionToggle}>\n <p className=\"branch-name\">{item.name}</p>\n <p className=\"branch-option\">Select</p>\n </a>\n );\n }\n }", "confirmDialogEdit() {\n\n if (this.props.first_passage === false) {\n\n if (this.state.weapon.length > 0\n && this.state.weapon[this.state.ID_weapon - 1].weaponname !== this.props.inscription.weaponname) {\n for (let i = 1; i < 4; i++)\n if (this.state.weapon[i - 1].weaponname === this.props.inscription.weaponname)\n this.setState({ID_weapon: i});\n }\n\n if (this.state.category.length > 0\n && this.state.category[this.state.ID_category - 1].categoryname !== this.props.inscription.categoryname) {\n for (let j = 1; j < 9; j++)\n if (this.state.category[j - 1].categoryname === this.props.inscription.categoryname) {\n this.setState({ID_category: j});\n\n }\n }\n\n this.setState({ID_depart: this.props.inscription.ID_depart});\n this.props.update_first_passage();\n }\n }", "onClickEdit(){\n this.setState({edit:true}) \n }", "function editItem(e) {\n const element = e.currentTarget.parentElement.parentElement; // Mismo Target que DELETE\n editElement = e.currentTarget.parentElement.previousElementSibling;\n grocery.value = editElement.innerHTML;\n editFlag = true;\n editID = element.dataset.id;\n submitBtn.textContent = 'Edit';\n}", "handleEditSelCrit() {\n const p = this.props;\n p.dispatch( actions.selCrit.edit(p.selCrit) );\n }", "handleEditClick(portfolioItem) {\n\t\tthis.setState({\n\t\t\teditData: portfolioItem,\n\t\t});\n\t}", "componentWillReceiveProps(nextProps){\n if(Object.keys(nextProps.edit).length > 0){\n this.editForm(nextProps)\n } else{\n this.newForm()\n }\n \n }", "passEdit({ commit }, payload) {\n // console.log(payload);\n commit(\"edition\", true);\n commit(\"setEditProd\", payload);\n }", "reviewButton() {\n let reviewId = false;\n if (this.props.currentUser) {\n Object.keys(this.props.reviews).forEach(el => {\n if (this.props.reviews[el].user_id === this.props.currentUser.id) {\n reviewId = true\n }\n });\n }\n if (this.props.currentUser && reviewId) {\n return (\n <button\n onClick={this.handleEdit}\n className=\"edit-review\">\n <FontAwesome className=\"fa fa-star\"\n name=\"star\"\n size='lg'/>\n Edit Your Review </button>\n );\n } else if (this.props.currentUser) {\n return (\n <button\n onClick={this.handleCreate}\n className=\"show-review\">\n <FontAwesome className=\"fa fa-star\"\n name=\"star\"\n size='lg'/>\n Write a Review </button>\n );\n } else {\n return (\n <LoginFormContainer/>\n );\n }\n }", "editItem(item) {\n this.editedIndex = this.clientes.indexOf(item)\n this.editedItem = Object.assign({}, item)\n this.dialog = true\n }", "handleEdit(instructions, evt){\n this.setState({\n editOn : true\n })\n }", "renderEditForm(event) {\n let id = event.target.getAttribute('data-id');\n\n document.querySelector('.edit-popup').classList.remove('hide');\n document.querySelector('.edit-popup').classList.add('show');\n document.querySelector('.btn-update').setAttribute('data-id', id);\n\n mockData.forEach(item => {\n if (item.id === id) {\n document.querySelector('.edit-item').value = item.title;\n }\n });\n}", "handleEdit(e) {\n e.preventDefault();\n {this.props.editBlog(e, this.state, this.state.id)}\n }", "handleEdit(evt) {\n evt.preventDefault();\n this.setState({ isEditing: true, editTodoText: this.props.todoText });\n }", "showButton() {\n if (this.state.shouldShowEdit) {\n return (\n <td>\n <button className=\"editButton\" onClick={this.handleEditRide} type=\"button\">Edit</button>\n </td>\n );\n } else {\n return null;\n } \n }", "function handleDelete(recipe: string, props: State & WrappedActionProps) {\n props.selectRecipe(recipe)\n props.setModal('Confirm_Modal')\n}", "editClick(){\n this.props.edit(this.props.pin);\n }", "handleEditClick(event, description, id, day_id) {\n event.stopPropagation();\n this.setState({showEditForm: true, currentEditId:id, editEventDescription: description, currentDayId: day_id})\n }", "function editItem(){\n changeItemIndex = index;\n food = item[changeItemIndex].food;\n calory = item[changeItemIndex].calory;\n document.querySelector('.add-item').style.display = \"none\";\n document.querySelector('.change-item').style.display = \"block\";\n document.querySelector('.input-food').value = food;\n document.querySelector('.input-calory').value = calory;\n\n }", "function EditProductModal({editable}) {\n const classes = useStyles3();\n const [open, setOpen] = React.useState(false);\n const [forcedClose, setForcedClose] = React.useState(false);\n\n const [id, setId] = useState(editable.itemId);\n const [nuevoNombre, setNuevoNombre] = useState('');\n const [nuevaDescripcion, setNuevaDescripcion] = useState('');\n const [nuevoIdCategoria, setNuevoIdCategoria] = useState(0);\n const [nuevaImagen, setNuevaImagen] = useState('');\n const [nuevoPrecio, setNuevoPrecio] = useState('');\n let history = useHistory();\n\n const handleClickOpen = () => {\n setOpen(true);\n setForcedClose(false);\n setNuevoNombre(editable.nombre);\n setNuevaDescripcion(editable.descripcion);\n setNuevoIdCategoria(editable.idCategoria);\n setNuevaImagen(editable.imagen);\n setNuevoPrecio(editable.precioU);\n };\n\n const closeModal = (e) => {\n setOpen(false);\n setForcedClose(true);\n }\n\n const handleClose = () => {\n if(!forcedClose){\n setOpen(false);\n editarProducto();\n setForcedClose(false);\n }\n };\n\n const editarProducto = () => {\n let editedProduct = {\n 'nombre': '',\n 'descripcion': '',\n 'idCategoria': 0,\n 'imagen': '',\n 'precioU': '',\n }\n editedProduct.nombre = nuevoNombre;\n editedProduct.descripcion = nuevaDescripcion;\n editedProduct.idCategoria = nuevoIdCategoria;\n editedProduct.imagen = nuevaImagen;\n editedProduct.precioU = nuevoPrecio;\n\n api.put(`/items/${id}`,editedProduct).then(res=> {\n window.location.reload(true);\n }).catch(err => {\n alert(\"Error al editar producto. \",err);\n });\n }\n\n return (\n <div>\n <Button className={classes.whiteBlend} variant=\"secondary\" variant=\"secondary\" onClick={handleClickOpen}>\n <CreateIcon/>\n </Button>\n <EditProductDialog open={open} onClose={handleClose} closeModal={closeModal} nombre={nuevoNombre} setNombre={(value)=> setNuevoNombre(value)} descripcion={nuevaDescripcion} setDescripcion={(value)=> setNuevaDescripcion(value)} idCat={nuevoIdCategoria} setIdCat={(value) => setNuevoIdCategoria(value)} imagen={nuevaImagen} setImagen={(value) => setNuevaImagen(value)} precio={nuevoPrecio} setPrecio={(value)=> setNuevoPrecio(value)}/>\n </div>\n );\n}", "editThis(){\n this.setState(prev=>{return {edit:true,tmp:prev.text}});\n this.props.closeOthers(this.props.propKey);\n }", "get canEdit() {\n return this.isEditable && !this.alwaysEditing && !!this.recordFields.length;\n }", "function editBtn(e){\n\t\n\tif (e.source.title == \"Edit\") {\n\t\t\n\t\t$.tbl.editing = true;\n\t\te.source.title = \"Done\";\n\t\t$.addTransect.enabled = false; \n\t\t\n\t} else { //text is 'Done', switch to 'Edit'\n\t\t\n\t\t$.tbl.editing = false;\n\t\te.source.title = \"Edit\";\n\t\t$.addTransect.enabled = true;\n\t\t\n\t}\n}", "function GroceryItemButtons({ item, setReadyToEdit, readyToEdit, editItem, setEditItem }) {\n\n const classes = useStyles();\n const dispatch = useDispatch();\n\n // when user clicks the \"check\" marks item as purchased and puts the item\n // into the user's pantry\n const handlePurchase = () => {\n // dispatches item to mark as purchased\n dispatch({ type: 'ITEM_PURCHASED', payload: item });\n dispatch({ type: 'ADD_ITEM_TO_PANTRY', payload: item });\n }\n\n // deletes item from grocery list\n const handleDelete = () => {\n dispatch({ type: 'DELETE_GROCERY_ITEM', payload: item });\n }\n\n // conditionally renders and populates form with item to edit\n const handleEdit = () => {\n setReadyToEdit(true);\n setEditItem({\n id: item.id,\n name: item.name,\n quantity: item.quantity,\n unit: item.unit,\n category_id: item.category_id\n });\n }\n\n // conditionally renders and undoes what handelPurchase does\n const handleUndo = () => {\n //dispatch({type: 'DELETE_ITEM_FROM_PANTRY', payload: item});\n // dispatches item to mark as un-purchased \n Swal.fire({\n title: 'are you sure?',\n text: 'this will undo the purchase',\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: 'blue',\n cancelButtonColor: 'red',\n confirmButtonText: 'Yes, Undo!'\n }).then((result) => {\n if (result.isConfirmed) {\n dispatch({ type: 'ITEM_PURCHASED', payload: item });\n dispatch({ type: 'DELETE_PANTRY_PURCHASE', payload: item });\n }\n })\n\n }\n\n return (\n <div>\n {!item.purchased &&\n <div className={classes.buttons}>\n <Tooltip title=\"Purchase Item\">\n <IconButton color=\"primary\" onClick={handlePurchase}>\n <DoneIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Edit Item\">\n <IconButton onClick={handleEdit} className={classes.edit}>\n <EditIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Delete Item\">\n <IconButton color=\"secondary\" onClick={handleDelete}>\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n </div>\n }\n {item.purchased &&\n <div className={classes.purchased}>\n <p><b>Purchased!</b></p>\n <Tooltip title=\"Undo Purchase\">\n <IconButton color=\"primary\" onClick={handleUndo}>\n <UndoIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title=\"Delete Item\">\n <IconButton color=\"secondary\" size=\"small\" onClick={handleDelete}>\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n\n </div>\n }\n\n </div>\n )\n}", "_editModeChanged(newValue, oldValue) {\n if (typeof newValue !== typeof undefined) {\n this._itemsChanged(this.items);\n for (var i in this.items) {\n if (this.items[i].metadata) {\n this.items[i].metadata.canEdit = newValue;\n this.notifyPath(`items.${i}.metadata.canEdit`);\n }\n }\n }\n }", "function handleFoodEditClick(e) {\n var $foodRow = $(this).closest('.food');\n var foodId = $foodRow.data('food-id');\n // remove console logs from production\n console.log('edit food', foodId);\n console.log($foodRow);\n\n // show the save changes button\n $foodRow.find('.save-food').toggleClass('hidden');\n // hide the edit button\n $foodRow.find('.edit-food').toggleClass('hidden');\n\n\n // get the food name and replace its field with an input element\n var foodName = $foodRow.find('span.food-name').text();\n $foodRow.find('span.food-name').html('<input class=\"edit-food-name\" value=\"' + foodName + '\"></input>');\n\n // get the calories and replace its field with an input element\n var calories = $foodRow.find('span.calories').text();\n $foodRow.find('span.calories').html('<input class=\"edit-calories\" value=\"' + calories + '\"></input>');\n\n }", "handleClick(event) {\n if (this.state.isEditing) {\n this.finishUpdate();\n } else {\n this.setState({\n isEditing: true,\n startEditing: true\n });\n }\n }", "function isCollectionEditing(){\r\n\t\t\treturn loadingData.EDITING_COLLECTION;\r\n\t\t}", "function changeProperties(e) {\n if (e.target.classList.contains(\"deleteBtn\")) {\n let bookindex = e.target.attributes[\"data-index\"].value;\n myLibrary.splice(bookindex, 1);\n const parent = e.target.parentElement.parentElement;\n parent.remove();\n } else if (e.target.classList.contains(\"change-read\")) {\n if (e.target.innerText === \"Yes\") e.target.innerText = \"No\";\n else e.target.innerText = \"Yes\";\n }\n}", "_originatesFromEditingChip(event) {\n return this._checkForClassInHierarchy(event, 'mdc-chip--editing');\n }", "componentWillReceiveProps(nextProps){\n //if(nextProps.selectedRecipe.modalVisible === true){\n this.setState({\n recipe: nextProps.selectedRecipe,\n ingredients: nextProps.selectedRecipe.ingredients.toString(),\n index: nextProps.selectedRecipe.index,\n modalVisible: nextProps.modalVisible\n });\n //}\n }", "function InventoryAllowPelvisItem(C) {\n\tif ((InventoryGet(C, \"Cloth\") != null) || (InventoryGet(C, \"Panties\") != null)) {\n\t\tDialogSetText(\"RemoveClothesForItem\");\n\t\treturn false;\n\t}\n\treturn true;\n}", "function editModelPress(){\n var oldObj = selectedItem;\n console.log('You have decided to edit: '+ selectedItem.id);\n stateChange('stateC');\n}", "function addOrEditItem(event, item) {\n event.preventDefault();\n const inputType = event.target.querySelector(\"#item-type\");\n const inputColour = event.target.querySelector(\"#item-colour\");\n const inputMaterial = event.target.querySelector(\"#item-material\");\n const inputSize = event.target.querySelector(\"#item-size\");\n const inputQuantity = event.target.querySelector(\"#item-quantity\");\n\n const newItem = {\n type: inputType.value,\n colour: inputColour.value,\n material: inputMaterial.value,\n size: inputSize.value,\n quantity: inputQuantity.value,\n };\n\n if (item) {\n editItem(item, newItem);\n } else {\n addItem(newItem);\n }\n}" ]
[ "0.6741978", "0.6352564", "0.61313254", "0.61196285", "0.6115168", "0.6111925", "0.61020166", "0.60936314", "0.60280794", "0.59706736", "0.59706736", "0.58798563", "0.58744997", "0.5863178", "0.58624846", "0.58619314", "0.5755007", "0.57430243", "0.57375443", "0.56895524", "0.5625248", "0.5621911", "0.5603912", "0.5602284", "0.5602189", "0.55820835", "0.55780375", "0.55716354", "0.55565166", "0.55564725", "0.55529284", "0.5552835", "0.5549786", "0.5549423", "0.55448467", "0.5540226", "0.5536685", "0.5524975", "0.5524602", "0.55230653", "0.55145806", "0.5509898", "0.5509459", "0.55069715", "0.5505491", "0.54986954", "0.5492952", "0.5478989", "0.54709727", "0.5469522", "0.5463102", "0.54553163", "0.5449446", "0.5449022", "0.5447501", "0.54418725", "0.5440316", "0.5423916", "0.5420628", "0.5399926", "0.53998476", "0.53994405", "0.5395744", "0.5390779", "0.5375487", "0.5360629", "0.53585654", "0.5355678", "0.53533757", "0.53503805", "0.5349095", "0.53489333", "0.53442574", "0.5339851", "0.5338141", "0.5326726", "0.53260434", "0.53149253", "0.5314799", "0.53145134", "0.53129935", "0.53062195", "0.5293679", "0.52832955", "0.528298", "0.5268505", "0.5267878", "0.5262598", "0.5262508", "0.5261581", "0.5258948", "0.5250092", "0.5249324", "0.52488106", "0.52444017", "0.5243461", "0.52423245", "0.5233387", "0.5222028", "0.5219562", "0.52180284" ]
0.0
-1
arrow functions can not be used as constructors new a();
function outer(){ console.log(this) function inner(){ console.log(this) } inner(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i(e){return new s.default(function(t){t(a(e))})}", "function temporaryConstructor() {}", "constructur() {}", "function tempCtor() {}", "function o(e){return new a[\"default\"](e)}", "function Foo(a) {\n this.a = a;\n }", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function M(){this.a={}}", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function ctor() {\n return function(){};\n }", "function AO(a){return function(b,c){b.constructor.hasOwnProperty(\"properties\")||Object.defineProperty(b.constructor,\"properties\",{value:{}});b.constructor.properties[c]=Object.assign(Object.assign({},b.constructor.properties[c]),a)}}", "static of (a) {\n return new IO(() => a);\n }", "function c(a,b,c){try{return{type:\"normal\",arg:a.call(b,c)}}catch(a){return{type:\"throw\",arg:a}}}// Dummy constructor functions that we use as the .constructor and", "function a(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "function Persona(){\n\n let persona2 = new Persona()\n\n}", "function hn(t) {\n return new an(t);\n}", "function it(t,e){return new A(t,e)}", "function a(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "function a(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "function x(){this.a={}}", "function x(){this.a={}}", "function x(){this.a={}}", "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "function o(e,t,n){try{return{type:\"normal\",arg:e.call(t,n)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "constructor(a,b){\n this.a = a;\n this.b = b;\n }", "function s(e){return new n.default(function(t){t(c(e))})}", "construct (target, args) {\n return new target(...args)\n }", "function HelperConstructor() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function a(c){(0,b.default)(this,a),(0,d.default)(this,\"arr\",void 0),(0,d.default)(this,\"arrIterator\",void 0),this.arr=c,this.arrIterator=c[Symbol.iterator]()}", "function createFn() {\n return function (a) {};\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function create(c) {\n return new c();\n}", "function a(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "arrow() {\n const RickAndMorty = 'Rick and Morty';\n return () => RickAndMorty;\n }", "function r(e,t,o){try{return{type:\"normal\",arg:e.call(t,o)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "function construct() { }", "function K(){this.a={}}", "function __cons(t, a) {\n return eval('new t(' + a.map(function(_, i) { return 'a[' + i + ']'; }).join(',') + ')');\n}", "function a(e,t){function i(){this.constructor=e}o(e,t),e.prototype=null===t?RS(t):(i.prototype=t.prototype,new i)}", "function a$c(r,s)\n{\n this.a$a = r;\n this.a$b = s; \n return this;\n}", "function a$c(r,s)\n{\n this.a$a = r;\n this.a$b = s; \n return this;\n}", "function foo(){\n var a = \"Hello\";\n this.a = 22;\n this.greet =()=>{\n return this.a;\n }\n}", "function foo() {\n // console.log(this);\n return () => {\n console.log(\"In arrow function:\", this.a);\n };\n}", "function Ci(a){this.o=a}", "function foo(a) {\n this.a = a;\n}", "function tf(a){tf.Z.constructor.call(this,a);this.ae()}", "constructor(a, b, c) {\n super(a, b, c);\n }", "function foo4(a /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + 1\n })\n}", "function Cd(a){this.ta={};this.o=a}", "function Q(){this.a={}}", "function Q(){this.a={}}", "function Q(){this.a={}}", "__init2() {this.noAnonFunctionType = false}", "function Ag(){this.b=null;this.a=[]}", "function foo(a) {\n\tthis.a = a;\n}", "function newcapFun() {\n this.a = 'a';\n}", "function new2() {\n const constructor = arguments[0];\n const args = [].slice.call(arguments, 1);\n const obj = new Object();\n obj.__proto__ = constructor.prototype;\n const ret = constructor.apply(obj, [...args]);\n if (ret && (typeof ret === 'object' || typeof ret === 'function')) {\n return ret;\n }\n return obj;\n}", "static create(...args /* :Array<*> */) {\n\t\treturn new this(...args)\n\t}", "function w(){this.a={}}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function a(){}", "function as(b) {\n return self => as_(self, b);\n}", "function as(b) {\n return self => as_(self, b);\n}", "function newOperator(constructor, ...params){\n const result = {}\n Object.setPrototypeOf(result, Person.prototype)\n constructor.apply(result, params)\n return result\n}", "constructor(keyFn) {\n\t\tthis.a = [];\n\t\tthis.keyFn = keyFn;\n\t}", "function Cb(){}", "function callAsConstructor(callback) {\n new callback();\n}", "function Ctor() {}", "getProductLink (state) {\n let objConstructor = this.objConstructors[state];\n if (objConstructor) return new objConstructor();\n }", "function NewObj(){}", "function a(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "constructor() {\n copy(this, create());\n }", "constructor() {\n if (new.target === MatrixBase) {\n throw new TypeError('Cannot construct MatrixBase instances directly');\n }\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}" ]
[ "0.65385205", "0.6372191", "0.6324294", "0.6294236", "0.62859017", "0.61193246", "0.6092351", "0.6092351", "0.6092351", "0.6092351", "0.6092351", "0.6092351", "0.6024952", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58390206", "0.5831895", "0.57899576", "0.578344", "0.57707214", "0.57524014", "0.5750685", "0.57423353", "0.57423353", "0.5717095", "0.5717095", "0.5717095", "0.5714699", "0.5697275", "0.56780314", "0.5673061", "0.5666566", "0.56632924", "0.56600773", "0.56600773", "0.56600773", "0.56426114", "0.56413573", "0.5632937", "0.5632937", "0.5632937", "0.5632937", "0.56326586", "0.5624746", "0.5624746", "0.56165963", "0.5614487", "0.559785", "0.5582517", "0.55793464", "0.5573709", "0.5568169", "0.5568169", "0.5556746", "0.55399776", "0.55299854", "0.55233777", "0.54987943", "0.5498636", "0.549834", "0.54889697", "0.5488005", "0.5488005", "0.5488005", "0.5475565", "0.54705375", "0.5460846", "0.5458617", "0.545026", "0.5448895", "0.544138", "0.5436912", "0.5436912", "0.5436912", "0.5436912", "0.5436912", "0.5436912", "0.5431934", "0.5431934", "0.5420764", "0.5419228", "0.54037404", "0.5403248", "0.53994805", "0.53967816", "0.53874224", "0.5373139", "0.5371999", "0.53657234", "0.5361356", "0.5361356", "0.5361356", "0.5361356", "0.5361356" ]
0.0
-1
For paginated scrolling, simply scroll the gallery one item in the given // direction and let css scroll snaping handle the specific alignment.
function scrollToNextPage() { gallery_scroller.scrollBy({ left: gallery_item_size, top: 0, behavior: 'smooth' }); // updateBtns() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scroll(direction) {\n // Keeps the index from going higher than the max length or lower than 0\n if (direction === \"left\") {\n this.currentIndex--;\n } else this.currentIndex++;\n if (this.currentIndex < 0) {\n this.currentIndex = this.indexMax;\n return;\n } else if (this.currentIndex > this.indexMax-1) {\n this.currentIndex = 0;\n return;\n } else {\n this.images.forEach((currentValue, index) => {\n if (index === this.currentIndex) {\n currentValue.style.display = \"flex\";\n } else {\n currentValue.style.display = \"none\";\n }\n });\n }\n }", "function scroll(direction) {\n if (direction === 'prev') {\n itemPositions.push(itemPositions.shift());\n } else if (direction === 'next') {\n itemPositions.unshift(itemPositions.pop());\n }\n $('#scroller .item').removeClass('left-hidden farLeft left middle right farRight right-hidden').each(function(index) {\n $(this).addClass(itemPositions[index]);\n });\n }", "function drag_scroll(dir)\n {\n if (!drag_active)\n return;\n\n var old_top = list_scroll_top;\n container.parent().get(0).scrollTop += p.scroll_step * dir;\n list_scroll_top = container.parent().scrollTop();\n scroll_timer = null;\n\n if (list_scroll_top != old_top)\n scroll_timer = window.setTimeout(function(){ drag_scroll(dir); }, p.scroll_speed);\n }", "function scroll(e, dir){\r\n\tif(e.button == 0){\r\n\t\tif(dir){\r\n\t\t\t//scroll right\r\n\t\t\t// v.scrollLeft += (pageWidth*2/5);\r\n\t\t\t$('#scrollBody').animate({\r\n\t\t\t\tscrollLeft: v.scrollLeft + (pageWidth*2/5)\r\n\t\t\t}, 1500);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//scroll left\r\n\t\t\t// v.scrollLeft += -(pageWidth*2/5);\r\n\t\t\t$('#scrollBody').animate({\r\n\t\t\t\tscrollLeft: v.scrollLeft - (pageWidth*2/5)\r\n\t\t\t}, 1500);\r\n\t\t}\r\n\t}\r\n}", "function navigate(direction) {\n var numberPhotos = self.placePhotos().length;\n var current = self.currentIndex();\n var next = (current + direction) % numberPhotos;\n if (next < 0) {\n next = numberPhotos - 1;\n }\n self.currentPhoto(self.placePhotos()[next]);\n self.currentIndex(next);\n }", "_snapCarouselPage() {\n this._setTransitionDuration(this.getTransitionDuration());\n\n var leastDistance = 10000;\n var nearestPageIndex = 0;\n\n // Determine nearest snapPoint.\n for (var i = 0; i < this.__pages.length; i++) {\n var snapPoint = -i * this.__carouselWidth;\n var distance = this.__onMoveOffset[0] - snapPoint;\n if (Math.abs(distance) < leastDistance) {\n leastDistance = Math.abs(distance);\n nearestPageIndex = i;\n }\n }\n\n if (this.getCurrentIndex() == nearestPageIndex) {\n this._refreshScrollerPosition();\n } else {\n this.setCurrentIndex(nearestPageIndex);\n }\n }", "_handlePaginatorClick(direction) {\n this._stopInterval();\n this._scrollHeader(direction);\n }", "navigateGalleryImage(direction) {\n\n // Get currently displayed image.\n const galleryListEl = this.galleryContentEl.querySelector('.gallery__list');\n const currentImageEl = galleryListEl.querySelector('.visible');\n if (!currentImageEl) return false;\n\n // Get next image and display it.\n const nextImageEl = direction === 'left' ? currentImageEl.previousSibling : currentImageEl.nextSibling;\n if (!nextImageEl) return false;\n currentImageEl.classList.remove('visible');\n nextImageEl.classList.add('visible');\n\n return true;\n }", "function animateScroll() {\n var time = 1; //Seconds on animation to switch\n\n carousel.scrollLeft += frame; //Scroll \n if (carousel.scrollLeft < initial + width) { //If image isn't fixed within carousel viewport\n window.requestAnimationFrame(animateScroll); //Call next frame\n }\n }", "function animate() {\n // Get scroll direction\n if (event.deltaY > 0) {\n scrollDirection = 'down';\n } else if (event.deltaY < 0) {\n scrollDirection = 'up';\n }\n myLoop();\n\n // Run animation\n setTimeout(function () {\n $('.page').bind('mousewheel', wheelHandler);\n toogleScrollEvent = true;\n }, 2000);\n}", "_scrollToItem(idx) {\n const item = this.items[idx];\n if (!item) {\n return;\n }\n\n const props = this._vertical ? ['top', 'bottom'] :\n this._isRTL ? ['right', 'left'] : ['left', 'right'];\n\n const scrollerRect = this._scrollerElement.getBoundingClientRect();\n const nextItemRect = (this.items[idx + 1] || item).getBoundingClientRect();\n const prevItemRect = (this.items[idx - 1] || item).getBoundingClientRect();\n\n let scrollDistance = 0;\n if (!this._isRTL && nextItemRect[props[1]] >= scrollerRect[props[1]] ||\n this._isRTL && nextItemRect[props[1]] <= scrollerRect[props[1]]) {\n scrollDistance = nextItemRect[props[1]] - scrollerRect[props[1]];\n } else if (!this._isRTL && prevItemRect[props[0]] <= scrollerRect[props[0]] ||\n this._isRTL && prevItemRect[props[0]] >= scrollerRect[props[0]]) {\n scrollDistance = prevItemRect[props[0]] - scrollerRect[props[0]];\n }\n\n this._scroll(scrollDistance);\n }", "function scroller(){\n\t\t\t\t\t$('.scrollPage').click(function(){\n\t\t\t\t\t\tvar elementClicked = $(this).attr(\"href\");\n\t\t\t\t\t\tvar destination = $(elementClicked).offset().top;\n\t\t\t\t\t\t$(\"html:not(:animated),body:not(:animated)\").animate({\n\t\t\t\t\t\t\tscrollTop: destination - 1 //Number being the pixel distance from destination.\n\t\t\t\t\t\t}, 1000, 'easeInOutQuint');\n\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}", "_cycle(direction) {\n let items = this.node.querySelectorAll(`.${ITEM_CLASS}`);\n let index = this._activeIndex;\n let active = this.node.querySelector(`.${ACTIVE_CLASS}`);\n active.classList.remove(ACTIVE_CLASS);\n if (direction === 'up') {\n this._activeIndex = index === 0 ? index : index - 1;\n }\n else {\n this._activeIndex = index < items.length - 1 ? index + 1 : index;\n }\n active = items[this._activeIndex];\n active.classList.add(ACTIVE_CLASS);\n domutils_1.ElementExt.scrollIntoViewIfNeeded(this.node, active);\n }", "function swipeFunc(e, dir) {\n\t\t\t\t\n\t\t\t\tvar $currentTarget = $(e.currentTarget);\n\n\t\t\t\tif ($currentTarget.data('slideCount') > 1) {\n\t\t\t\t\t$currentTarget.data('dir', '');\n\t\t\t\t\tif (dir === 'left') {\n\t\t\t\t\t\t$currentTarget.cycle('next');\n\t\t\t\t\t}\n\t\t\t\t\tif (dir === 'right') {\n\t\t\t\t\t\t$currentTarget.data('dir', 'prev');\n\t\t\t\t\t\t$currentTarget.cycle('prev');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function scrollToNextPage() {\n card_scroller.scrollBy(card_item_size, 0);\n }", "function slide(direction) {\n var directionPositionMapping,\n stringInitialRectClip;\n\n switch (direction) {\n case \"right\":\n directionPositionMapping = 3;\n stringInitialRectClip = \"rect(0px, 958px, 634px, 958px)\";//TODO: needs to get height and width auto\n //now we need to decremnent the pic previous.\n setZIndexAtCarPos(false, intIndexCurrentImg -1);\n // upon touch, decrements pic that lies underneath\n setZIndexAtCarPos(false, intIndexCurrentImg);\n break;\n case \"left\":\n directionPositionMapping = 1;\n stringInitialRectClip = \"rect(0px 0px 634px 0px)\";\n setZIndexAtCarPos(false, intIndexCurrentImg +1);\n // upon touch, decrements pic that lies underneath\n setZIndexAtCarPos(false, intIndexCurrentImg);\n break;\n }\n\n (direction === \"right\") ? intIndexCurrentImg++: intIndexCurrentImg--;\n\n setZIndexAtCarPos(true, intIndexCurrentImg); // for image we want to slide in\n\n imgToSlide = arrayDOMCache[getImageArrayPosModulo(intIndexCurrentImg)];\n imgToSlide.style.clip = stringInitialRectClip;\n itrClipParam = getClipParam(imgToSlide.style.clip, directionPositionMapping);\n intervalTimer(directionPositionMapping, direction, 50);\n }", "function myLoop() {\n\n // Scrolled down\n if (scrollDirection === 'down') {\n animateDown();\n } else {\n animateUp();\n }\n}", "function navigate(direction) {\n // hide current image\n current.style.display = 'none';\n //change the index\n index += direction;\n\n // make sure the index isn't negative when using prev\n if (direction === -1 && index < 0) {\n index = amount -1;\n }\n // when the index gets too high and it can't be found set it to 0\n if (direction === 1 && !items[index]) {\n index = 0;\n }\n\n //set set the current image to the current index\n current = carouselImages[index];\n // display the current image\n current.style.display = 'inline-block';\n}", "function moveSlide(dir) {\n\t// try to advance the current image\n\tcurrentImage += dir;\n\t// check for before the first, or after the last...\n\tif (currentImage < 0) {\n\t\tcurrentImage = images.length - 1;\n\t} else if (currentImage === images.length) {\n\t\tcurrentImage = 0;\n\t}\n\n\t// TODO: make adjustmetns in order to manage the fade out and fade in of the image\n\ttargetImage.src = images[currentImage];\n\ttargetImage.style.opacity = 1;\n}", "function animateMobile() {\n // Get scroll direction\n if (swipeDirection === 'down') {\n scrollDirection = 'down';\n } else if (swipeDirection === 'up') {\n scrollDirection = 'up';\n }\n myLoop();\n\n // Run animation\n setTimeout(function () {\n mc.on(\"swipedown\", function (e) {\n // scroll down analog - next items animation\n swipeDirection = 'up';\n swipeHandler();\n });\n\n mc.on(\"swipeup\", function (e) {\n // scroll up analog - previuos items animation\n swipeDirection = 'down';\n swipeHandler();\n });\n toogleScrollEvent = true;\n }, 2000);\n}", "function jumpToPosition(){\n flexImages3.scrollIntoView({behavior: \"smooth\", block: 'center',inline: 'center'});\n}", "function scroll(dir){\n\t\t//if dir is \"tb\" (top -> bottom) increment current, \n\t\t//else if \"bt\" decrement it\n\t\tcurrent\t= (dir == 'tb')?current + 1:current - 1;\n\t\t\n\t\t//we want a circular slideshow, \n\t\t//so we need to check the limits of current\n\t\tif(current == total) current = 0;\n\t\telse if(current < 0) current = total - 1;\n\t\t\n\t\t//flip the thumb\n\t\t$tf_thumbs.flip({\n\t\t\tdirection\t: dir,\n\t\t\tspeed\t\t: 400,\n\t\t\tonBefore\t: function(){\n\t\t\t\t//the new thumb is set here\n\t\t\t\tvar content\t= '';\n\t\t\t\tif (show_tf_zoom) content = '<span id=\"tf_zoom\" class=\"tf_zoom\"></span>';\n\t\t\t\tcontent\t\t+='<img src=\"' + $tf_bg_images.eq(current).attr('longdesc') + '\" alt=\"Thumb' + (current+1) + '\"/>';\n\t\t\t\t$tf_thumbs.html(content);\n\t\t}\n\t\t});\n\n\t\t//we get the next image\n\t\tvar $tf_bg_img_next\t= $tf_bg_images.eq(current),\n\t\t\t//its dimentions\n\t\t\tdim\t\t\t\t= getImageDim($tf_bg_img_next),\n\t\t\t//the top should be one that makes the image out of the viewport\n\t\t\t//the image should be positioned up or down depending on the direction\n\t\t\t\ttop\t= (dir == 'tb')?$(window).height() + 'px':-parseFloat(dim.height,10) + 'px';\n\t\t\t\t\n\t\t//set the returned values and show the next image\t\n\t\t\t$tf_bg_img_next.css({\n\t\t\t\twidth\t: dim.width,\n\t\t\t\theight\t: dim.height,\n\t\t\t\tleft\t: dim.left,\n\t\t\t\ttop\t\t: top\n\t\t\t}).show();\n\t\t\t\n\t\t//now slide it to the viewport\n\t\t\t$tf_bg_img_next.stop().animate({\n\t\t\t\ttop \t: dim.top\n\t\t\t},1000);\n\t\t\t\n\t\t//we want the old image to slide in the same direction, out of the viewport\n\t\t\tvar slideTo\t= (dir == 'tb')?-$tf_bg_img.height() + 'px':$(window).height() + 'px';\n\t\t\t$tf_bg_img.stop().animate({\n\t\t\t\ttop \t: slideTo\n\t\t\t},1000,function(){\n\t\t\t//hide it\n\t\t\t\t$(this).hide();\n\t\t\t//the $tf_bg_img is now the shown image\n\t\t\t\t$tf_bg_img\t= $tf_bg_img_next;\n\t\t\t//show the description for the new image\n\t\t\t\n\t\t\tvar desc = $tf_content_wrapper.children().eq(current);\n\t\t\tjQuery(\"h2, p\",desc).css(\"opacity\", 0);\n\t\t\tvar speed = 1000, titlesFactor = 0, titlespeed = 1000, titleeasing = 'swing';\n\t\t\t\t\n\t\t\tdesc.show()\n\t\t\t\t\t .find('h2')\n\t\t\t\t\t .css('left', -50 + 'px' )\n\t\t\t\t\t .stop()\n\t\t\t\t\t .delay( speed * titlesFactor )\n\t\t\t\t\t .animate({ left : 0 + 'px', opacity : 1 }, titlespeed, titleeasing)\n\t\t\t\t\t .end()\n\t\t\t\t\t .find('p')\n\t\t\t\t\t .css( 'left', 50 + 'px' )\n\t\t\t\t\t .stop()\n\t\t\t\t\t .delay( speed * titlesFactor )\n\t\t\t\t\t .animate({ left : 0 + 'px', opacity : 1 }, titlespeed, titleeasing)\n\t\t\t\t\t .end();\n\t\t\t\t\t\t\t\t \n\t});\n\t\t//hide the current description\t\n\t\t\t$tf_content_wrapper.children(':visible')\n\t\t\t\t\t\t\t .hide()\n\t\n\t}", "function updateScroll(event) {\n moveElements();\n}", "function _snapToPage(size, scrollOffset) {\n\n\t // Check whether pagination is active\n\t if (!this.options.paginated ||\n\t this._scroll.scrollForceCount || //don't paginate while moving\n\t (this._scroll.springPosition !== undefined)) {\n\t return;\n\t }\n\n\t // Local data\n\t var pageOffset = scrollOffset;\n\t var pageLength;\n\t var hasNext;\n\n\t // Lookup page in previous direction\n\t var node = this._nodes.getStartEnumNode(false);\n\t while (node) {\n\t if (!node._invalidated) {\n\t break;\n\t }\n\t if (node.scrollLength !== 0) {\n\t if ((pageOffset <= 0) || (node.scrollLength === undefined)) {\n\t break;\n\t }\n\t hasNext = (pageLength !== undefined);\n\t pageLength = node.scrollLength;\n\t pageOffset -= node.scrollLength;\n\t }\n\t node = node._prev;\n\t }\n\n\t // Lookup page in next direction\n\t if (pageLength === undefined) {\n\t node = this._nodes.getStartEnumNode(true);\n\t while (node) {\n\t if (!node._invalidated) {\n\t break;\n\t }\n\t if (node.scrollLength !== 0) {\n\t if (node.scrollLength === undefined) {\n\t break;\n\t }\n\t hasNext = (pageLength !== undefined);\n\t if (hasNext) {\n\t if ((pageOffset + pageLength) > 0) {\n\t break;\n\t }\n\t pageOffset += pageLength;\n\t }\n\t pageLength = node.scrollLength;\n\t }\n\t node = node._next;\n\t }\n\t }\n\t if (!pageLength) {\n\t return;\n\t }\n\n\t // When velocity exceeds thresshold, treat as flip to\n\t // a certain direction and select that page.\n\t var flipToPrev;\n\t var flipToNext;\n\t if (this.options.paginationEnergyThresshold && (Math.abs(this._scroll.particle.getEnergy()) >= this.options.paginationEnergyThresshold)) {\n\t var velocity = this._scroll.particle.getVelocity1D();\n\t flipToPrev = velocity > 0;\n\t flipToNext = velocity < 0;\n\t }\n\n\t // Determine snap spring-position (not quite working properly yet for alignment = 1...)\n\t var boundOffset = pageOffset;\n\t var snapSpringPosition;\n\t if (!hasNext || flipToPrev || (!flipToNext && ((Math.abs(boundOffset) < Math.abs(boundOffset + pageLength))))) {\n\t snapSpringPosition = (scrollOffset - pageOffset) - (this.options.alignment ? pageLength : 0);\n\t if (snapSpringPosition !== this._scroll.springPosition) {\n\t //_log.call(this, 'setting snap-spring to #1: ', snapSpringPosition, ', previous: ', this._scroll.springPosition);\n\t this._scroll.springPosition = snapSpringPosition;\n\t this._scroll.springSource = SpringSource.SNAPPREV;\n\t }\n\t }\n\t else {\n\t snapSpringPosition = (scrollOffset - (pageOffset + pageLength));\n\t if (snapSpringPosition !== this._scroll.springPosition) {\n\t //_log.call(this, 'setting snap-spring to #2: ', snapSpringPosition, ', previous: ', this._scroll.springPosition);\n\t this._scroll.springPosition = snapSpringPosition;\n\t this._scroll.springSource = SpringSource.SNAPNEXT;\n\t }\n\t }\n\t }", "function scrollImageList() {\n var imageLink = $('#annotate_image_link_' + gImageId);\n var list = $('#image_list');\n\n var offset = list.offset().top;\n var linkTop = imageLink.offset().top;\n\n // link should be (roughly) in the middle of the element\n offset += parseInt(list.height() / 2);\n\n list.scrollTop(list.scrollTop() + linkTop - offset);\n }", "function scroll($container, $el, dir, callback) {\n var container = $container[0],\n maxScroll = container.scrollHeight - container.clientHeight;\n if (maxScroll && dir && !interval) {\n // Scroll view if the mouse is over the first or last pixels of the container\n interval = window.setInterval(function () {\n var scrollTop = $container.scrollTop();\n if ((dir === -1 && scrollTop <= 0) || (dir === 1 && scrollTop >= maxScroll)) {\n endScroll($el);\n } else {\n $container.scrollTop(scrollTop + 7 * dir);\n callback($el);\n }\n }, 50);\n }\n }", "bindMouseEvent () {\n document.addEventListener(\"mousewheel\", (event) => {\n this.direction = event.wheelDelta < 0\n this.changeSlide()\n })\n document.addEventListener(\"DOMMouseScroll\", (event) => {\n this.direction = event.detail == 3 \n this.changeSlide()\n })\n }", "scrollPageDown() {\n this.$moveByPage(1);\n }", "scrollSearchToThumbnail()\n {\n if(this.isAnimating || !this.parent.active || this.dragger.position < 1)\n return;\n\n ppixiv.app.scrollSearchToMediaId(this.parent.dataSource, this.parent._wantedMediaId);\n }", "function moveSlide(direction){\n var activeSection = $(SECTION_ACTIVE_SEL);\n var slides = activeSection.find(SLIDES_WRAPPER_SEL);\n var numSlides = slides.find(SLIDE_SEL).length;\n\n // more than one slide needed and nothing should be sliding\n if (!slides.length || slideMoving || numSlides < 2) {\n return;\n }\n\n var currentSlide = slides.find(SLIDE_ACTIVE_SEL);\n var destiny = null;\n\n if(direction === 'prev'){\n destiny = currentSlide.prev(SLIDE_SEL);\n }else{\n destiny = currentSlide.next(SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(!destiny.length){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n if(direction === 'prev'){\n destiny = currentSlide.siblings(':last');\n }else{\n destiny = currentSlide.siblings(':first');\n }\n }\n\n slideMoving = true;\n\n landscapeScroll(slides, destiny);\n }", "function scrollToPosition(position, dir) {\n console.log(\"ScrollToPosition\");\n if (position < 0 || position > 1) {\n console.log(\"InvalidPosition\");\n return;\n }\n\n if (isScrollModeEnabled()) {\n let offset = document.scrollingElement.scrollHeight * position;\n document.scrollingElement.scrollTop = offset;\n // window.scrollTo(0, offset);\n } else {\n var documentWidth = document.scrollingElement.scrollWidth;\n var factor = dir == \"rtl\" ? -1 : 1;\n let offset = documentWidth * position * factor;\n document.scrollingElement.scrollLeft = snapOffset(offset);\n }\n}", "function snapToListPosition(direction) {\n var $target;\n var dragElementPositionTop = $dragging.position().top;\n var dragElementHeight = $dragging.outerHeight();\n var targetElementPositionTop;\n var targetElementHeight;\n\n // if the delta is large enough, $target may well not be the previous list element\n if (direction === UP) {\n $target = $dragging.prev('.draggable');\n } else {\n $target = $dragging.next('.draggable');\n }\n\n // if $draggable is more than 50% over $target swap positions\n if ($target.length) {\n targetElementPositionTop = $target.position().top;\n targetElementHeight = $target.outerHeight();\n if (direction === UP) {\n if (dragElementPositionTop <\n targetElementPositionTop + targetElementHeight / 2) {\n $dragging.insertBefore($target);\n swapListItemPositions($target, direction);\n }\n } else {\n // check whether drag.$dragging yPos is more than 50% over $target\n if (dragElementPositionTop + dragElementHeight >\n targetElementPositionTop + targetElementHeight / 2) {\n // if it is, switch positions\n $dragging.insertAfter($target);\n swapListItemPositions($target, direction);\n }\n }\n }\n }", "function scrollImages(distance, duration) {\n\timgs.css(\"transition-duration\", (duration / 1000).toFixed(1) + \"s\");\n\t\n\t//inverse the number we set in the css\n\tvar value = (distance < 0 ? \"\" : \"-\") + Math.abs(distance).toString();\n\timgs.css(\"transform\", \"translate(\" + value + \"px,0)\");\n}", "function catalogLinkScroll() {\n // Get link wrapper\n var catalogLinkWrapper = $('#edit-name--2');\n // Get horizontal position of currently selected link\n var scrollPosition = $('#edit-name--2--wrapper a.bef-link--selected').position().left;\n // Get current scroll position\n var currentScrollPosition = catalogLinkWrapper.scrollLeft();\n // Get current width of wrapper container\n var containerWidth = catalogLinkWrapper.width();\n // Set new scroll position to half of wrapper width\n var scrollPosition = (scrollPosition + currentScrollPosition) - (containerWidth/2);\n // Set horizontal scroll position to show letter\n $('#edit-name--2').scrollLeft(scrollPosition);\n // Scroll the bar automatically to show that item\n catalogLinkWrapper.animate({'scrollLeft': scrollPosition});\n }", "function slideImage(direction, buttonClicked) {\n\n if (!$(buttonClicked).hasClass(\"disabled\")) {\n \n if (direction === \"right\") {\n // Only move carousel if the carousel has not reached the end\n if (firstImageShowing !== (numberOfImages - currentNumberOfImagesPerPage) + 1) {\n \n \n // Calculates the percentage the image should be moved\n $carouselHolder.animate({left: \"-=\" + percentageWidthOfImage + '%'}, 500);\n firstImageShowing++;\n }\n } else {\n if (firstImageShowing !== 1) {\n \n $carouselHolder.animate({left: \"+=\" + percentageWidthOfImage + '%'}, 500);\n firstImageShowing--;\n }\n }\n\n // Change carousel direction to reverse\n if (firstImageShowing >= (numberOfImages - currentNumberOfImagesPerPage) + 1) {\n automatedCarouselDirection = \"left\";\n // Change carousel direction to forwards\n } else if (firstImageShowing === 1) {\n automatedCarouselDirection = \"right\";\n }\n }\n }", "function scrollOver(){\n var current = $galleryDoc.docById();\n var scrollAmount;\n if (current.length){\n scrollAmount = current.position().left - current.parent().width()/2 + current.innerWidth()/2;\n }else{\n return;\n }\n\n current.addClass('current-document');\n $galleryDoc.embedViewport.find('.gallery').animate({\n scrollLeft: scrollAmount\n }, 200);\n }", "function _snapToPage() {\n\t\n\t // Check whether pagination is active\n\t if (!this.options.paginated ||\n\t this._scroll.scrollForceCount || //don't paginate while moving\n\t (this._scroll.springPosition !== undefined)) {\n\t return;\n\t }\n\t\n\t // When the energy is below the thresshold, paginate to the current page\n\t var item;\n\t switch (this.options.paginationMode) {\n\t case PaginationMode.SCROLL:\n\t if (!this.options.paginationEnergyThreshold || (Math.abs(this._scroll.particle.getEnergy()) <= this.options.paginationEnergyThreshold)) {\n\t item = this.options.alignment ? this.getLastVisibleItem() : this.getFirstVisibleItem();\n\t if (item && item.renderNode) {\n\t this.goToRenderNode(item.renderNode);\n\t }\n\t }\n\t break;\n\t case PaginationMode.PAGE:\n\t item = this.options.alignment ? this.getLastVisibleItem() : this.getFirstVisibleItem();\n\t if (item && item.renderNode) {\n\t this.goToRenderNode(item.renderNode);\n\t }\n\t break;\n\t }\n\t }", "function move(sel) {\ndocument.querySelector(sel).scrollIntoView({ \n behavior: 'smooth' \n});\n}", "setScrollPosition() {\n var step = this.state.step;\n var isVertical = this.props.vertical;\n var left = !isVertical ? step * this.state.width : 0;\n var top = isVertical ? step * this.state.height : 0;\n\n this.scroller.setPosition(left, top);\n this.scroller.scrollTo(left, top, false);\n }", "function setScroll() {\n\t\t$(document).on(\"click\", \"#prevThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif ($(\"#imageWrapper\").scrollLeft() > \"0\") {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos - 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\t$(document).on(\"click\", \"#nextThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif (leftPos < $(\"#imageWrapper\")[0].scrollWidth) {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos + 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\t}", "function setScroll() {\n\t\t$(document).on(\"click\", \"#prevThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif ($(\"#imageWrapper\").scrollLeft() > \"0\") {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos - 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\n\t\t$(document).on(\"click\", \"#nextThumb\", function() {\n\t\t\tvar leftPos = $(\"#imageWrapper\").scrollLeft();\n\n\t\t\tif (leftPos < $(\"#imageWrapper\")[0].scrollWidth) {\n\t\t\t\t$(\"#imageWrapper\").animate({scrollLeft: leftPos + 500}, 300);\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t});\n\t}", "function navigate(direction) {\n // hide the old current list item \n current.classList.remove('current');\n \n // calculate th new position\n counter = counter + direction;\n // if the previous one was chosen and the counter is less than 0 make the counter the last element,\n // thus looping the carousel\n if (direction === -1 && \n counter < 0) { \n counter = amount - 1; \n }\n\n // if the next button was clicked and there is no items element, set the counter to 0\n if (direction === 1 && \n !items[counter]) { \n counter = 0;\n }\n\n // set new current element and add CSS class\n current = items[counter];\n current.classList.add('current');\n }", "function updateOffset(dir) {\n var position = (NUMBERS.SLIDE_WIDTH + NUMBERS.SLIDE_GUTTER);\n\n if (typeof dir === 'undefined') {\n defineOffset();\n }\n else if(dir) {\n STATE.OFFSET = STATE.OFFSET - position;\n } else {\n STATE.OFFSET = STATE.OFFSET + position;\n }\n\n return this;\n }", "function myMoveLeft() { //ad ogni click sulla freccia di sinistra\n scrollPosition = scrollPosition - scrollChange; //sottraggo alla posizione iniziale il valore di cambiamento settato \n carousel.scrollTo(scrollPosition, 0); //vado ad assegnare la posizione finale al contenitore sull'asse x\n}", "move(direction) {\r\n let container = document.querySelector(this.target + ' .images'),\r\n bcr = container.getBoundingClientRect(),\r\n prev = (this.active > 0) ? this.active - 1 : this.len - 1,\r\n next = (this.active < this.len - 1) ? this.active + 1 : 0,\r\n self = this,\r\n step = Math.round(bcr.height / 15)\r\n\r\n //animation\r\n function anim(dir) {\r\n let top = getComputedStyle(container).top.match(/[-]?[0-9]{1,}/)[0]\r\n self.animRun = true\r\n\r\n if(dir === '->' && (-top < bcr.height)) {\r\n\r\n if((bcr.height + +(top)) < step)\r\n step = bcr.height + +(top)\r\n\r\n container.style.top = (top - step) + 'px'\r\n window.requestAnimationFrame(() => {anim(direction)})\r\n\r\n } else if(dir === '<-' && (top < bcr.width)) {\r\n\r\n if((bcr.height - +(top)) < step)\r\n step = bcr.height - +(top)\r\n\r\n container.style.top = (+(top) + step) + 'px'\r\n window.requestAnimationFrame(() => {anim(direction)})\r\n\r\n } else {\r\n\r\n //switches the src of imgs -> active one in middle, prev on the left, next on the right\r\n self.img.prev.src = self.src[prev]\r\n self.img.prev.alt = prev\r\n\r\n self.img.active.src = self.src[self.active]\r\n self.img.active.alt = self.active\r\n\r\n self.img.next.src = self.src[next]\r\n self.img.next.alt = next\r\n\r\n container.style.top = 0\r\n self.animRun = false\r\n\r\n }\r\n }\r\n window.requestAnimationFrame(() => {anim(direction)})\r\n\r\n this.mark(this.active)\r\n }", "initSnap(){\n\t\tthis.currentPage = {};\n\t\tconst snap = this.options.snap;\n\n\t\tif (snap.loop) {\n\t\t\tlet children = this.scroller.children;\n\t\t\tif (children.length > 0) {\n\t\t\t\tprepend(children[children.length - 1].cloneNode(true), this.scroller);\n\t\t\t\tthis.scroller.appendChild(children[1].cloneNode(true));\n\t\t\t}\n\t\t}\n\n\t\tlet el = snap.el;\n\t\tif (typeof el === 'string') {\n\t\t\tel = this.scroller.querySelectorAll(el);\n\t\t}\n\n\t\tthis.on('refresh', () => {\n\t\t\tthis.pages = [];\n\n\t\t\tif (!this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet stepX = snap.stepX || this.wrapperWidth;\n\t\t\tlet stepY = snap.stepY || this.wrapperHeight;\n\n\t\t\tlet x = 0;\n\t\t\tlet y;\n\t\t\tlet cx;\n\t\t\tlet cy;\n\t\t\tlet i = 0;\n\t\t\tlet l;\n\t\t\tlet m = 0;\n\t\t\tlet n;\n\t\t\tlet rect;\n\t\t\tif (!el) {\n\t\t\t\tcx = Math.round(stepX / 2);\n\t\t\t\tcy = Math.round(stepY / 2);\n\n\t\t\t\twhile (x > -this.scrollerWidth) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile (y > -this.scrollerHeight) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor (; i < l; i++) {\n\t\t\t\t\trect = getRect(el[i]);\n\t\t\t\t\tif (i === 0 || rect.left <= getRect(el[i - 1]).left) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!this.pages[m]) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif (x > this.maxScrollX) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet initPage = snap.loop ? 1 : 0;\n\t\t\tthis.goToPage(this.currentPage.pageX || initPage, this.currentPage.pageY || 0, 0);\n\n\t\t\tconst snapThreshold = snap.threshold;\n\t\t\tif (snapThreshold % 1 === 0) {\n\t\t\t\tthis.snapThresholdX = snapThreshold;\n\t\t\t\tthis.snapThresholdY = snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('scrollEnd', () => {\n\t\t\tif (snap.loop) {\n\t\t\t\tif (this.currentPage.pageX === 0) {\n\t\t\t\t\tthis.goToPage(this.pages.length - 2, this.currentPage.pageY, 0);\n\t\t\t\t}\n\t\t\t\tif (this.currentPage.pageX === this.pages.length - 1) {\n\t\t\t\t\tthis.goToPage(1, this.currentPage.pageY, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (snap.listenFlick !== false) {\n\t\t\tthis.on('flick', () => {\n\t\t\t\tlet time = snap.speed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\t\tthis.goToPage(\n\t\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\t\ttime\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t}", "goTop() {\n refs.galleryList.scrollIntoView({\n block: \"start\",\n behavior: \"smooth\",\n });\n }", "function scrollPosition(e){ \n // recalculate position everytime we move the mouse\n const x = e.pageX - items.offsetLeft\n // this variable is to tell us how far we move from the initial click or x\n const walk = (x - startX) * 2;\n // set the scroll position\n items.scrollLeft = scrollLeft - walk;\n \n e.preventDefault();\n}", "function scroll(event){if(!ctrl.shouldPaginate)return;event.preventDefault();ctrl.offsetLeft=fixOffset(ctrl.offsetLeft-event.wheelDelta);}", "scrollDown() {\n if (this.currentOffset < this.items.length - 1) {\n this.currentOffset++\n this.goToThePage()\n }\n }", "function inertia_scroll() {\n\t\tmove_delta = start_velocity * (1 - Math.exp(-(Date.now() - inertia_starts) / options.inertion ));\n\t\tvelocity = start_velocity - move_delta;\n\t\tif ( hand_control ) {\n\t\t\tstarted_animation = false;\n\t\t\treturn;\n\t\t}\n\t\tif ( velocity < -0.5 || velocity > 0.5 ) {\n\t\t\trequestAnimationFrame( inertia_scroll );\n\t\t\tscroll_content( start_pos + move_delta );\n\t\t} else {\n\t\t\tscroll_content( start_pos + start_velocity );\n\t\t\tstarted_animation = false;\n\t\t}\n\t}", "if (index > -1 && index < this.props.cards.length) {\n // console.log('ok scrolling, x:', this.props.screen.width*index);\n this.currentCardIndex = index; // need this as am setting this.currentCardIndex onMomentumScrollEnd now instead of onScroll\n if (this.scroller) this.scroller.scrollTo({ x:this.props.screen.width*index });\n }", "function scrollImages(distance, duration)\n{\n imgs.css(\"-webkit-transition-duration\", (duration/1000).toFixed(1) + \"s\");\n //inverse the number we set in the css\n var value = (distance<0 ? \"\" : \"-\") + Math.abs(distance).toString();\n imgs.css(\"-webkit-transform\", \"translate3d(\"+value +\"px,0px,0px)\");\n}", "function slide(dir) {\n let active_index = $('.active-img').index();\n let new_index;\n if (dir == 'right') {\n new_index = active_index + 1;\n if (new_index == $('.carousel').children('li').length - 1) {\n new_index = 0;\n };\n } else if (dir == 'left') {\n new_index = active_index - 1;\n if (new_index == 0) {\n new_index = $('.carousel').children('li').length - 1;\n };\n };\n slideTo(new_index);\n}", "scroll(direction, yOffset = 0, xOffset = 0) {\n return __awaiter(this, void 0, void 0, function* () {\n //await this._driver.execute(\"mobile: scroll\", [{direction: 'up'}])\n //await this._driver.execute('mobile: scroll', { direction: direction === 0 ? \"down\" : \"up\", element: this._element.ELEMENT });\n const location = yield this.location();\n const size = yield this.size();\n const x = location.x === 0 ? 10 : location.x;\n let y = (location.y + 15);\n if (yOffset === 0) {\n yOffset = location.y + size.y - 15;\n }\n if (direction === 0 /* down */) {\n y = (location.y + size.y) - 15;\n if (!this._webio.isIOS) {\n if (yOffset === 0) {\n yOffset = location.y + size.y - 15;\n }\n }\n }\n if (direction === 1 /* up */) {\n if (yOffset === 0) {\n yOffset = size.y - 15;\n }\n }\n const endPoint = utils_1.calculateOffset(direction, y, yOffset, x, xOffset, this._webio.isIOS, false);\n if (direction === 0 /* down */) {\n //endPoint.point.y += location.y;\n }\n let action = new this._wd.TouchAction(this._driver);\n action\n .press({ x: x, y: y })\n .wait(endPoint.duration)\n .moveTo({ x: endPoint.point.x, y: endPoint.point.y })\n .release();\n yield action.perform();\n yield this._driver.sleep(150);\n });\n }", "function scrollFunc(event) { allSections[index].scrollIntoView({ behavior: \"smooth\", block: \"end\", inline: \"nearest\" }); }", "function swipeStatus(event, phase, direction, distance)\n{\n //If we are moving before swipe, and we are going Lor R in X mode, or U or D in Y mode then drag.\n if( phase==\"move\" && (direction==\"left\" || direction==\"right\") )\n {\n var duration=0;\n if (direction == \"left\")\n scrollImages((IMG_WIDTH * currentImg) + distance, duration);\n else if (direction == \"right\")\n scrollImages((IMG_WIDTH * currentImg) - distance, duration);\n \n if(currentImg == 0) {\n \n }\n }\n else if ( phase == \"cancel\")\n {\n scrollImages(IMG_WIDTH * currentImg, speed);\n }\n else if ( phase ==\"end\" )\n {\n if (direction == \"right\")\n previousImage()\n else if (direction == \"left\")\n nextImage()\n }\n}", "moveDown() {\n this.point.y += this.scrollSpeed;\n }", "onSwipeComplete(direction) {\r\n const { onSwipeLeft, onSwipeRight, data } = this.props;\r\n const item = data[this.state.index];\r\n direction === 'right' ? onSwipeRight(item) : onSwipeLeft(item);\r\n\r\n this.setState({ index: this.state.index + 1 });\r\n this.state.position.setValue({ x: 0, y: 0 });\r\n }", "function scrollStep() {\n\n var newX = easing(currentTime, startX, deltaX, configs.duration);\n var newY = easing(currentTime, startY, deltaY, configs.duration);\n\n youScrollTo(newX, newY);\n\n currentTime += configs.intervalTime;\n\n if (currentTime >= configs.duration) {\n newX = startX + deltaX;\n newY = startY + deltaY;\n youScrollTo(newX, newY);\n youScrollInstance.end();\n }\n\n }", "function _scrollUpdate(event) {\n\t if (!this.options.enabled) {\n\t return;\n\t }\n\t var offset = Array.isArray(event.delta) ? event.delta[this._direction] : event.delta;\n\t this.scroll(offset);\n\t }", "function _scrollUpdate(event) {\n\t if (!this.options.enabled) {\n\t return;\n\t }\n\t var offset = Array.isArray(event.delta) ? event.delta[this._direction] : event.delta;\n\t this.scroll(offset);\n\t }", "set scrolling(scrolling) {\n this._scrolling = scrolling;\n }", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "function Gallery() {\n ViewGroup.apply(this);\n\n this.setTag(\"Gallery\");\n\n var maxDuration = 200;\n var snapV = 100;\n var self = this;\n var curScreen = 0;\n var processor = new Processor();\n var inScrolling = false;\n var isXLocked = false;\n var lastX = 0;\n var lastY = 0;\n var downX = 0;\n var downY = 0;\n var touchSlop = 10;\n var leftEdge = 0;\n var rightEdge = 0;\n var totalWidth;\n var screenWidth;\n var rollPadding = 0.4;\n var vTracker = new VelocityTracker();\n var xChangedListener = null;\n var screenChangedListener = null;\n\n this.setOnXChangedListener = function(l) {\n xChangedListener = l;\n };\n\n this.setOnScreenChangedListener = function(l) {\n screenChangedListener = l;\n };\n\n processor.setEndListener(function() {\n setTimeout(fireScreenChanged, 10);\n });\n\n this.scrollTo = function(x) {\n x = Math.floor(x);\n if (x == this.getScrollX()) {\n return;\n }\n this.setScrollX(x);\n this.translate3d(-x, 0);\n if (xChangedListener) {\n xChangedListener.call(this, x);\n }\n };\n\n this.checkBounds = function(i) {\n return (i < 0 ? 0 : i > (this.getChildCount() - 1) ? (this.getChildCount() - 1) : i);\n };\n\n this.setToScreen = function(i) {\n i = this.checkBounds(i);\n curScreen = i;\n this.scrollTo(i * this.getMW());\n fireScreenChanged();\n };\n\n this.snapToScreen = function(index, duration) {\n index = this.checkBounds(index);\n\n if (this.getScrollX() == (this.getChildAt(index).getLeft())) {\n return;\n }\n\n var delta = calcDist(index);\n var during = duration;\n if (during == undefined) {\n during = Math.abs(delta);\n }\n during = this.controlScrollDuration(during);\n processor.startProcess(self.getScrollX(), self.getScrollX() + delta, during);\n\n curScreen = index;\n\n this.invalidate();\n };\n\n this.snapByV = function(index, v) {\n index = this.checkBounds(index);\n var delta = calcDist(index);\n var duration = Math.abs(delta * 1000 / v) / 3;\n duration = Math.min(duration, maxDuration);\n this.snapToScreen(index, duration);\n };\n\n this.controlScrollDuration = function(d) {\n return d;\n };\n\n this.lockX = function() {\n isXLocked = true;\n };\n\n this.unlockX = function() {\n isXLocked = false;\n };\n\n this.isXLocked = function() {\n return isXLocked;\n };\n\n this.onInterceptTouchEvent = function(e) {\n var action = e.getAction();\n if ((action == MotionEvent.ACTION_MOVE) && inScrolling && !isXLocked) {\n return true;\n }\n\n var x = e.getX();\n\n switch (action) {\n case MotionEvent.ACTION_DOWN:\n this.getParent().requestDisallowInterceptTouchEvent(true);\n lastX = x;\n downY = e.getY();\n inScrolling = !processor.isFinished();\n break;\n case MotionEvent.ACTION_MOVE:\n var xDiff = Math.abs(lastX - x);\n if (xDiff > touchSlop) {\n inScrolling = true;\n lastX = x;\n if (xDiff < Math.abs(e.getY() - downY)) {\n this.lockX();\n this.getParent().requestDisallowInterceptTouchEvent(false);\n }\n }\n break;\n case MotionEvent.ACTION_CANCEL:\n case MotionEvent.ACTION_UP:\n inScrolling = false;\n isXLocked = false;\n break;\n default:\n break;\n }\n return inScrolling;\n };\n\n this.onTouchEvent = function(ev) {\n vTracker.addMovement(ev);\n var x = ev.getX();\n\n switch (ev.getAction()) {\n case MotionEvent.ACTION_DOWN:\n forceEnd();\n\n downX = x;\n lastX = x;\n lastY = ev.getY();\n break;\n case MotionEvent.ACTION_MOVE:\n\n if (isXLocked) {\n break;\n }\n\n var dX = lastX - x;\n lastX = x;\n lastY = ev.getY();\n\n var dst = this.getScrollX() + dX;\n if (dst < 0) {\n if (leftEdge == 0) {\n dX = -this.getScrollX();\n } else {\n dX = (dX * (leftEdge - this.getScrollX()) / leftEdge);\n }\n } else if (dst > (totalWidth - screenWidth)) {\n if (rightEdge == 0) {\n dX = screenWidth - this.getScrollX();\n } else {\n var maxExceed = rightEdge - totalWidth;\n var realExceed = this.getScrollX() - (totalWidth - screenWidth);\n if (realExceed < 0) {\n dX = (-realExceed);\n } else if (maxExceed == 0){\n dX = (-realExceed);\n } else {\n dX = dX * (1 - realExceed / maxExceed);\n }\n }\n }\n this.scrollTo(this.getScrollX() + dX);\n break;\n case MotionEvent.ACTION_UP:\n vTracker.computeCurrentVelocity(1000);\n var vX = vTracker.getXVelocity();\n if (vX > snapV && curScreen > 0) { // left\n touchEnd(curScreen - 1, vX);\n } else if (vX < -snapV && curScreen < this.getChildCount() - 1) {\n touchEnd(curScreen + 1, vX);\n } else {\n snap();\n }\n reset();\n break;\n case MotionEvent.ACTION_CANCEL:\n snap();\n reset();\n break;\n }\n return true;\n };\n\n this.onMeasure = function(wMS, hMS) {\n var w = MS.getSize(wMS);\n var h = MS.getSize(hMS);\n\n screenWidth = w;\n\n var count = this.getChildCount();\n totalWidth = 0;\n for (var i = 0; i < count; i++) {\n this.getChildAt(i).measure(MS.makeMS(w, MS.EXACTLY),\n MS.makeMS(h, MS.EXACTLY));\n totalWidth += this.getChildAt(i).getMW();\n }\n\n leftEdge = -screenWidth * rollPadding;\n rightEdge = totalWidth + rollPadding * screenWidth;\n\n this.setMD(totalWidth, h);\n\n this.scrollTo(curScreen * screenWidth, 0);\n };\n\n\n this.onLayout = function() {\n var x = 0;\n for (var i = 0; i < this.getChildCount(); i++) {\n var c = this.getChildAt(i);\n if (c.getVisibility() == View.GONE) {\n continue;\n }\n\n var cWidth = c.getMW();\n c.layout(x, 0);\n x += cWidth;\n }\n };\n\n this.computeScroll = function() {\n if (processor.computeProcessOffset()) {\n var x = processor.getCurrProcess();\n this.scrollTo(x);\n\n this.postInvalidate();\n } else {\n var x = this.getScrollX();\n this.translate3d(-x, 0);\n }\n };\n\n function touchEnd(index, v) {\n self.snapByV(index, v);\n }\n\n function calcDist(index) {\n var d = self.getChildAt(index).getLeft() - self.getScrollX();\n var rightShift = self.getChildAt(index).getLeft() + screenWidth - totalWidth;\n if (rightShift > 0) {\n d -= rightShift;\n }\n return d;\n }\n\n function reset() {\n self.unlockX();\n inScrolling = false;\n vTracker.clear();\n }\n\n function snap() {\n var index;\n var currentWidth = 0;\n\n for (index = 0; index < self.getChildCount(); index++) {\n var cWidth = self.getChildAt(index).getMW();\n if (currentWidth + cWidth > self.getScrollX()) {\n break;\n }\n currentWidth += cWidth;\n }\n if (index + 1 < self.getChildCount() && self.getScrollX() - currentWidth > self.getChildAt(index).getMW() / 2) {\n index += 1;\n }\n self.snapToScreen(index);\n }\n\n function forceEnd() {\n if (!processor.isFinished()) {\n processor.forceFinished(true);\n }\n }\n\n function fireScreenChanged() {\n if (screenChangedListener) {\n screenChangedListener.call(this, curScreen);\n }\n }\n}", "_goToCard(n, dir) {\n var cardwidth = this._cards[0].offsetWidth,\n currentPos = Math.max(-cardwidth * this._currentPos, this._minPos),\n scrollWidth = cardwidth,\n newPos;\n\n if (dir === 'next') {\n newPos = Math.max(this._minPos, currentPos - scrollWidth);\n } else if (dir === 'prev') {\n newPos = Math.min(0, currentPos + scrollWidth);\n } else {\n newPos = 0;\n }\n\n this._cardsContainer.style.transition =\n 'margin-left ' + this._speed + 'ms' + ' ' + this._effect + ' ' + this._delay + 'ms';\n this._cardsContainer.style.marginLeft = newPos == 0 && this._minPos >= 0 ? 'auto' : newPos + 'px';\n this._currentPos = n;\n\n this._btnNext.disabled = false;\n this._btnPrev.disabled = false;\n\n if (this._currentPos >= this._maxPosIndex) {\n this._btnNext.disabled = true;\n this._btnPrev.disabled = false;\n }\n\n if (this._currentPos <= 0) {\n this._btnPrev.disabled = true;\n this._btnNext.disabled = false;\n }\n }", "function slidePage(direction, pageNumber) {\n\n\t\tfor ( i = 0; i < $('.page').length; i++ ) {\n\t\t\tif ($('.page').eq(i).hasClass('current')) {\n\t\t\t\tcurrentId = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (pageNumber == -1 && direction) { // getNextPageIndex\n\t\t\tpageNumber = currentId + 1;\n\t\t\tif (pageNumber >= $('.page').length)\n\t\t\t\treturn;\n\n\t\t} else if (pageNumber == -1 && !direction) { // getPreviousPageIndex\n\t\t\tpageNumber = currentId - 1;\n\t\t\tif (pageNumber < 0)\n\t\t\t\treturn;\n\n\t\t}\n\n\t\tsetPages(pageNumber, false);\n\t}", "function animateContent(direction) {\r\n var animationOffset = $('.menu-holder').height() - $('.content').height();\r\n if (direction === 'up') { animationOffset = 0;}\r\n //Calculating the animation time based on the height of the scrollable div\r\n // animationRate : pixels per second\r\n\r\n\r\n \r\n var animationRate = 200, \r\n contentHeight = $(\".content\").height(),\r\n animationTime = contentHeight / animationRate * 1000;\r\n\r\n $('.content').animate({ \"marginTop\": animationOffset + \"px\" }, {duration: animationTime, easing: \"linear\"});\r\n}", "function run(){\n \n /**\n * indicate click with simple message\n */ \n function onLinkClick( event ){\n event.preventDefault();\n var link = event.target,\n html = link.innerHTML;\n link.innerHTML = 'Click';\n link.className = 'item clicked';\n setTimeout( function(){\n link.innerHTML = link.getAttribute('data-num');\n link.className = 'item';\n }, 500 );\n return false;\n } \n\n var i = -1,\n wrap = document.getElementById('testwrap'),\n links = wrap.getElementsByTagName('div');\n \n while( ++i < links.length ){\n links[i].setAttribute('data-num', links[i].innerHTML );\n // very important to use capture here. So container gets event before we do.\n links[i].addEventListener('click', onLinkClick, true );\n } \n \n \n \n // initialize animated-scrolling of element\n var scroller = initScroller( wrap );\n\n // initialize swiping of scroll area with start and end handlers\n initSwiper( wrap, \n // stop scroll animation when swipe starts\n function(){\n scroller.stop();\n }, \n // carry on to nearest item when swipe stops\n function( speed, direction ){\n if( ! speed ){ \n return; \n }\n // apply some tollerance as to speed of swipe and tweak expected behavior\n var spaced = 187,\n minSpeed = 0.6,\n round = speed > minSpeed ? Math[ direction === 1 ? 'ceil' : 'floor' ] : Math.round,\n snapTo = spaced * ( round( wrap.scrollLeft / spaced ) ),\n speed = Math.max( speed, minSpeed );\n scroller.scroll( snapTo, speed ); \n }\n ); \n \n}", "reposSlide() {\n this.current_button.classList.toggle('scroller__page_current', false);\n this.current_button = this.paginator_buttons[Math.min(Math.max(this.current_page, 0), this.count - 1)];\n this.current_button.classList.toggle('scroller__page_current', true);\n this.move(this.current_page);\n }", "scrollPage(){\n setTimeout(() => {\n window.scrollBy(0, this.scrollDirection * AUTO_SCROLL_STEP);\n if(this.shouldScroll){\n this.scrollPage();\n }\n }, AUTO_SCROLL_DELAY);\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "function ScrollAll(_X,_Y,_ms){\n\t\t\t//Scroll both appropriately within the same animation\n\t\t\tanimateScroll(_X);\n\t\t}", "function moveSlide(direction, section) {\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0]; // more than one slide needed and nothing should be sliding\n\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\n return;\n }\n\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\n var destiny = null;\n\n if (direction === 'left') {\n destiny = prevUntil(currentSlide, SLIDE_SEL);\n } else {\n destiny = nextUntil(currentSlide, SLIDE_SEL);\n } //isn't there a next slide in the secuence?\n\n\n if (destiny == null) {\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n var slideSiblings = siblings(currentSlide);\n\n if (direction === 'left') {\n destiny = slideSiblings[slideSiblings.length - 1]; //last\n } else {\n destiny = slideSiblings[0]; //first\n }\n }\n\n slideMoving = true && !FP.test.isTesting;\n landscapeScroll(slides, destiny, direction);\n }", "function scrollNext(aTime) {\n if (imgCount == totalImages) { // Last frame.\n imgCount = 0; // Reset Slides\n //clearInterval(animateId); // Stop slide anmitation.\n return;\n }\n imgCount++;\n // Vertically centering image. From: http://stackoverflow.com/a/21778615/1208507\n var $image = $('#frame' + imgCount);\n var imgOffset = $image.offset().top;\n var imgHeight = $image.height();\n var windowHeight = $(window).height();\n var offest;\n\n if (imgHeight < windowHeight) {\n offset = imgOffset - ((windowHeight / 2) - (imgHeight / 2))\n } else {\n offset = imgOffset;\n }\n $('html, body').animate({ scrollTop: offset }, aTime);\n }", "move(direction) {\r\n let parent = this.selection.parent;\r\n if (parent === null)\r\n return;\r\n let previous, next;\r\n if (direction < 0) {\r\n next = this.selection;\r\n previous = next.previous;\r\n if (previous === null)\r\n return;\r\n }\r\n else {\r\n previous = this.selection;\r\n next = previous.next;\r\n if (next === null)\r\n return;\r\n }\r\n parent.graphic.insertBefore(next.graphic, previous.graphic);\r\n parent.item.lastElementChild.insertBefore(next.item, previous.item);\r\n }", "moveUpOrDownWrap (event, direction) {\n this.preserveGoalColumn()\n\n const cursor = this.outlet.getLastCursor()\n const cursorRow = cursor.getBufferRow()\n const lastRow = this.outlet.getLastBufferRow()\n\n if (direction === 'up' && cursorRow === 0) {\n setBufferRow(cursor, lastRow)\n event.stopImmediatePropagation()\n } else if (direction === 'down' && cursorRow === lastRow) {\n setBufferRow(cursor, 0)\n event.stopImmediatePropagation()\n }\n }", "next () {\n\t\tconsole.log(this.currentItem)\n\t\tthis.gotoItem(this.currentItem + this.slidesToScroll) // Appel de la methode gotoItem et parametres : index de l'item + nombres de slide a defiler\n\t}", "function checkDirection() {\n switch (scrollDown) {\n case true:\n moveDownOnePage();\n break;\n\n case false:\n moveUpOnePage();\n break;\n }\n }", "function moveTo(direction) {\n const isFirst = carouselItemsActiveIndex === 0;\n const isLast = carouselItemsActiveIndex === carouselItemsLength - 1;\n\n if (direction === \"forward\" && !isLast) {\n carouselItemsActiveIndex += 1;\n } else if (direction === \"back\" && !isFirst) {\n carouselItemsActiveIndex -= 1;\n }\n\n isResizing = false;\n moveCarousel();\n}", "scrollTo() {\n window.scroll({\n top: this.getCurrSlide().offsetTop,\n left: 0,\n behavior: 'smooth'\n })\n }", "function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }", "function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }", "function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }", "function scrollSelectedItem(item, container) {\n\n\n\n //Code taken from internet - refactored slightly.\n if (item.position().top + container.height() >= container.scrollTop() + container.height()) {\n\n container.scrollTop(item.position().top - container.height() + container.scrollTop())\n\n } else if (item.position().top <= container.scrollTop()) {\n\n container.scrollTop(0 + item.position().top)\n }\n\n }", "_refreshScrollerPosition() {\n this.__carouselScrollerWidth = qx.bom.element.Dimension.getWidth(\n this.__carouselScroller.getContentElement()\n );\n\n this._scrollToPage(this.getCurrentIndex());\n }", "function scrollAnimate() {\n\t// Cap targets and current.\n\ttarget_wCol = target_wCol.clamp(0, _COLLENGTH);\n\tcurrent_wCol = current_wCol.clamp(0, _COLLENGTH);\n\t// Move slider/send data if current position doesn't equal to target\n\tif(current_wCol != target_wCol) {\n\t\t// Make sure we are running fast!\n\t\tsend(\"zixelspeed\", { speed: 0 });\n\t\t// Compute direction of motion.\n\t\tvar step = 1;\n\t\tvar dx = (target_wCol < current_wCol) ? -step : step;\n\t\t// Bring it closer.\n\t\tvar bMoved = false;\n\t\tif (target_wCol != current_wCol) { current_wCol += dx; bMoved -= true; }\n\t\t// Redraw and repeat.\n\t\tredraw(current_wCol);\n\t\tsetTimeout(scrollAnimate, 500);\n\t}\n}", "function moveSlide(direction, section){\r\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\r\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\r\n\r\n // more than one slide needed and nothing should be sliding\r\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\r\n return;\r\n }\r\n\r\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\r\n var destiny = null;\r\n\r\n if(direction === 'left'){\r\n destiny = prevUntil(currentSlide, SLIDE_SEL);\r\n }else{\r\n destiny = nextUntil(currentSlide, SLIDE_SEL);\r\n }\r\n\r\n //isn't there a next slide in the secuence?\r\n if(destiny == null){\r\n //respect loopHorizontal settin\r\n if (!options.loopHorizontal) return;\r\n\r\n var slideSiblings = siblings(currentSlide);\r\n if(direction === 'left'){\r\n destiny = slideSiblings[slideSiblings.length - 1]; //last\r\n }else{\r\n destiny = slideSiblings[0]; //first\r\n }\r\n }\r\n\r\n slideMoving = true && !FP.test.isTesting;\r\n landscapeScroll(slides, destiny, direction);\r\n }", "function moveSlide(direction, section){\r\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\r\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\r\n\r\n // more than one slide needed and nothing should be sliding\r\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\r\n return;\r\n }\r\n\r\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\r\n var destiny = null;\r\n\r\n if(direction === 'left'){\r\n destiny = prevUntil(currentSlide, SLIDE_SEL);\r\n }else{\r\n destiny = nextUntil(currentSlide, SLIDE_SEL);\r\n }\r\n\r\n //isn't there a next slide in the secuence?\r\n if(destiny == null){\r\n //respect loopHorizontal settin\r\n if (!options.loopHorizontal) return;\r\n\r\n var slideSiblings = siblings(currentSlide);\r\n if(direction === 'left'){\r\n destiny = slideSiblings[slideSiblings.length - 1]; //last\r\n }else{\r\n destiny = slideSiblings[0]; //first\r\n }\r\n }\r\n\r\n slideMoving = true && !FP.test.isTesting;\r\n landscapeScroll(slides, destiny, direction);\r\n }", "function slideImage(dir){\n if((dir > 0) && (currentImageViewed < currentAdViewed.images.length - 1)){\n currentImageViewed++;\n document.getElementById(\"00195364\").src = currentAdViewed.images[currentImageViewed].src;\n } else if ( (dir < 0) && (currentImageViewed > 0)){\n currentImageViewed--;\n document.getElementById(\"00195364\").src = currentAdViewed.images[currentImageViewed].src;\n }\n}", "function moveSlide(direction, section){\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\n\n // more than one slide needed and nothing should be sliding\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\n return;\n }\n\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\n var destiny = null;\n\n if(direction === 'left'){\n destiny = prevUntil(currentSlide, SLIDE_SEL);\n }else{\n destiny = nextUntil(currentSlide, SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(destiny == null){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n var slideSiblings = siblings(currentSlide);\n if(direction === 'left'){\n destiny = slideSiblings[slideSiblings.length - 1]; //last\n }else{\n destiny = slideSiblings[0]; //first\n }\n }\n\n slideMoving = true && !FP.test.isTesting;\n landscapeScroll(slides, destiny, direction);\n }", "function moveSlide(direction, section){\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\n\n // more than one slide needed and nothing should be sliding\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\n return;\n }\n\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\n var destiny = null;\n\n if(direction === 'left'){\n destiny = prevUntil(currentSlide, SLIDE_SEL);\n }else{\n destiny = nextUntil(currentSlide, SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(destiny == null){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n var slideSiblings = siblings(currentSlide);\n if(direction === 'left'){\n destiny = slideSiblings[slideSiblings.length - 1]; //last\n }else{\n destiny = slideSiblings[0]; //first\n }\n }\n\n slideMoving = true && !FP.test.isTesting;\n landscapeScroll(slides, destiny, direction);\n }", "function moveSlide(direction, section){\n var activeSection = section == null ? $(SECTION_ACTIVE_SEL)[0] : section;\n var slides = $(SLIDES_WRAPPER_SEL, activeSection)[0];\n\n // more than one slide needed and nothing should be sliding\n if (slides == null || slideMoving || $(SLIDE_SEL, slides).length < 2) {\n return;\n }\n\n var currentSlide = $(SLIDE_ACTIVE_SEL, slides)[0];\n var destiny = null;\n\n if(direction === 'left'){\n destiny = prevUntil(currentSlide, SLIDE_SEL);\n }else{\n destiny = nextUntil(currentSlide, SLIDE_SEL);\n }\n\n //isn't there a next slide in the secuence?\n if(destiny == null){\n //respect loopHorizontal settin\n if (!options.loopHorizontal) return;\n\n var slideSiblings = siblings(currentSlide);\n if(direction === 'left'){\n destiny = slideSiblings[slideSiblings.length - 1]; //last\n }else{\n destiny = slideSiblings[0]; //first\n }\n }\n\n slideMoving = true && !FP.test.isTesting;\n landscapeScroll(slides, destiny, direction);\n }", "function pageSlide(arg){\n if(isReachBoundary(arg)){\n return false;\n }\n var page_height = $(\".fullPage\").eq(0).height();\n var pre_top = parseInt($(\".fullPage-Container\").css(\"top\"));\n _index -= arg;\n var callback = $(\".fullPage\").eq(_index).attr(\"inView\");\n return $(\".fullPage-Container\").animate({top:pre_top+arg*page_height+\"px\"},400,\"swing\",function(){\n strTofunc(callback);\n location.hash=$(\".fullPage\").eq(_index).attr(\"page-id\");\n });\n }", "function shift(direction) {\n\t// update Index\n\t( direction === 'left') ? currentIndex-- : currentIndex++;\n\t// default speed calculated as\n\t// 2000(2sec) ma 400px\n\t// 10ms ma (400/2000)*10 = 2px;\n\tvar speed = -((IMG_WIDTH/2000) * 10);\n\tif(direction === 'left') speed = -speed;\n\n\t//handle if all images have been shown\n\tif( currentIndex >= (images.length)) {\n\t\t//reset current Index\n\t\tcurrentIndex = 0;\t\n\t\t// calculate speed\n\t\t// 2000ms ma 400*3 images\n\t\t// 10 ms ma (400*3)/2000 * 10\n\t\tspeed = ( ( IMG_WIDTH*(images.length-1) ) / 2000 ) * 10;\n\n\t}\n\n\tif( currentIndex < 0 ) {\n\t\tvar currentPosition = -(images.length * IMG_WIDTH);\n\t\tcurrentIndex = images.length-1;\n\t\tspeed = -( ( IMG_WIDTH*(images.length-1) ) / 2000 ) * 10;\t\t\t\n\t}\n\n\tvar slideInterval = setInterval(function(){\n\t\tvar currentPosition = imageWrapper[0].style.left.split('px')[0];\n\t\tcurrentPosition = currentPosition =='' ? 0: parseInt(currentPosition);\n\t\tcurrentPosition += speed;\t\n\t\timageWrapper[0].style.left = currentPosition + '.px';\t\t\n\t},10);\n\n\tsetTimeout(function(){\n\t\tclearInterval(slideInterval);\n\t},2000);\n}", "run() {\n\t\tthis.update();\n\n\t\t// scroll to starting position;\n\t\tthis.slider.scrollLeft = this.startPos;\n\t\tthis.scrollOffset = this.startPos;\n\t}", "function hsClickScroll()\n {\n var imageOffset = self.getOffsetRect(this).top; \n var clientOffset = (docElement.clientHeight-hs.maxHeight) / 2;\n window.scrollTo(0,imageOffset-clientOffset);\n }", "function setScrolling()\n {\n scrolling = true;\n }", "function animateSlide(element, direction)\n{\n var slideContainer = $(element).parent().parent().find(\".slide-img-container\");\n var slideCount = $(slideContainer).children().length;\n var currentImg;\n var currentImgIndex = 0;\n $(slideContainer).find(\".slide-img\").each(function()\n {\n if($(this).css(\"opacity\") == \"1\")\n {\n currentImg = $(this);\n }\n if (currentImg == null)\n {\n currentImgIndex++;\n }\n });\n\n var newImgIndex = currentImgIndex + direction;\n\n if (newImgIndex < 0 || newImgIndex >= slideCount)\n {\n return;\n }\n\n var backArrow = $(element).parent().parent().find(\".work-arrows-container .back-arrow\");\n if (newImgIndex != 0)\n {\n $(backArrow).css(\"opacity\", \"1\");\n $(backArrow).css(\"cursor\", \"pointer\");\n }\n else\n {\n $(backArrow).css(\"opacity\", \"0.3\")\n $(backArrow).css(\"cursor\", \"initial\");\n }\n\n var forwardArrow = $(element).parent().parent().find(\".work-arrows-container .forward-arrow\");\n if (newImgIndex != slideCount - 1)\n {\n $(forwardArrow).css(\"opacity\", \"1\");\n $(forwardArrow).css(\"cursor\", \"pointer\");\n }\n else\n {\n $(forwardArrow).css(\"opacity\", \"0.3\")\n $(forwardArrow).css(\"cursor\", \"initial\");\n }\n\n var newImg = $(slideContainer).children().eq(newImgIndex);\n\n $(currentImg).css(\"opacity\", \"0\");\n $(newImg).css(\"opacity\", \"1\");\n\n $(\".scroll-imgs .slide-img\").css(\"background-position\", \"0% \" + laptopScrollTop + \"px\");\n}", "function _forwardThumbnailScroll() {\n\t\tif (thumbindex < 0) {\n\t\t\tstopSlideshow();\n\n\t\t\tvar\n\t\t\t\tvw = _safeWidth(thumbsBar),\n\t\t\t\ttw = _safeWidth(thumbs);\n\t\t\tvar pos = _getRTLPosition(thumbs); // current left offset of thumbs ribbon w.r.t. left edge of viewer\n\t\t\tvar minpos = vw - tw; // maximum negative value permitted as left offset w.r.t. left edge of viewer\n\n\t\t\tif (tw + pos < vw) { // right end of ribbon is to the right of right edge of viewer\n\t\t\t\t_updateThumbnailNavigation();\n\t\t\t} else {\n\t\t\t\tvar target = {};\n\t\t\t\ttarget[rtlpos] = minpos;\n\t\t\t\tthumbs.animate(target, -4 * (minpos - pos), 'linear', _updateThumbnailNavigation);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.70670897", "0.675597", "0.67098963", "0.6574764", "0.6327665", "0.61983526", "0.6159656", "0.61009616", "0.60126805", "0.5959501", "0.59357655", "0.592107", "0.5913941", "0.58752733", "0.5864747", "0.58629566", "0.5848337", "0.5841379", "0.5838567", "0.58115864", "0.57982445", "0.57882947", "0.57611233", "0.5761054", "0.5746845", "0.5739977", "0.5739232", "0.5739195", "0.5722003", "0.5719188", "0.5690871", "0.5689083", "0.5683521", "0.56763726", "0.56637645", "0.5642414", "0.5642338", "0.5634555", "0.563223", "0.5628197", "0.5628197", "0.5626826", "0.5620358", "0.5620327", "0.5617936", "0.5614855", "0.5606159", "0.5605793", "0.56004804", "0.5594405", "0.55828726", "0.5582829", "0.55719185", "0.5569089", "0.5568928", "0.5553201", "0.5550528", "0.55292517", "0.55231994", "0.55228513", "0.55192477", "0.55192477", "0.55181915", "0.5512307", "0.55043983", "0.54975265", "0.5495804", "0.5491943", "0.548728", "0.54764754", "0.5474658", "0.5470709", "0.5467061", "0.54659873", "0.5451667", "0.5442283", "0.5441454", "0.5440372", "0.5438201", "0.5434303", "0.5428761", "0.54258555", "0.54258555", "0.54258555", "0.5411721", "0.5410964", "0.5402643", "0.5401736", "0.5401736", "0.53956664", "0.539453", "0.539453", "0.53944653", "0.53888583", "0.53838146", "0.53799623", "0.5365057", "0.5353262", "0.5351457", "0.5350198" ]
0.6808054
1
WIN OR TIE GAME?
function winCheck() { if (winGameVertical(0,0) == true || winGameHorizontal(0,0) == true || winGameLeftToRight(2,0) == true || winGameRightToLeft(0,0) == true) { gamewon = true; if (symbol == playerOne.symbol) { P1Wins.innerHTML = (Number(P1Wins.textContent) + 1); turn.textContent = "Player " + playerOne.name + " is the winner!"; } else { P2Wins.innerHTML = (Number(P2Wins.textContent) + 1); turn.textContent = "Player " + playerTwo.name + " is the winner!"; } fillBoard(); tictacbingo = false; symbol = "O"; } else if (symbol == playerOne.symbol) { turn.textContent = "Your turn player " + playerTwo.name + ": O"; } else { turn.textContent = "Your turn player " + playerOne.name + ": X"; } return gamewon }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "winGame() {\n gameWon();\n }", "function votewin() {\n if (!win()) {\n // not win\n night();\n } else {\n // win\n end();\n }\n}", "checkForWin() {\n if (this.numMafia <= 0) { this.gameState = TOWN_WIN; }\n if (this.getInnocentPlayerCount() <= 0) { this.gameState = MAFIA_WIN; }\n }", "function winOrLoseScreen(){\n if (!win){\n GameOverGraphic()\n BGM.pause()\n } else {\n youWinGraphic()\n BGM.pause()\n }\n }", "function win(tie) {\n if (true) {\n let message = document.querySelector('.message')\n screenWin.style.display = 'block';\n screenStart.style.display = 'none';\n if (tie) {\n message.textContent = \"I'ts a Draw\";\n screenWin.classList.add('screen-win-tie');\n } else if (player2.classList.contains('active')) {\n screenWin.classList.add('screen-win-one');\n changeWinner();\n } else {\n screenWin.classList.add('screen-win-two');\n changeWinner();\n }\n }\n }", "function gameWin() {\n\tplayCounter++;\n\twinCount++;\n\tconsole.log(\"You won!\");\n\tif (playCounter < 3) {\n\t\tgame.state.start('win');\n\t}\n\telse {\n\t\tgame.state.start('complete');\n\t}\n}", "function DoWin() {\n\tif (!winning) {\n\t\tMarkWonLevel();\n\t\tObtainPlayEndLevelSound();\n\t\tagaining = false;\n\t\tif (unitTesting){\n\t\t\treturn void nextLevel();\n\t\t}\n\t\twinning = true, timer = 0\n\t}\n}", "function win() {\n\ttime.Stop();\n\talive = false;\n\t\n\tstatistics.addGame(difficulty, statistics.state.win);\n\tbest = statistics.addSeconds(difficulty, statistics.state.win, seconds);\n\tstatistics.addDiscovered(difficulty, statistics.state.win, calculateDiscoveredPercent());\n\t\n\t// DIe Statistics speichern\n\tPersistanceManager.saveStatistics(statistics);\n\t\n\tmessage(\"Sie haben gewonnen!<br>\" +\n\t\t\t(best ? \"Neue Bestzeit <br>\" : \"\") +\n\t\t\t\"Schwierigkeit: \" + $('#difficulty :selected').text() + \" <br>\" +\n\t\t\t\"Benötigte Zeit: \" + timeCalculator(seconds) + \" <br>\" +\n\t\t\t\"Aufgedeckte Felder: \" + percCalculator(calculateDiscoveredPercent()) + \"%\");\n}", "function Win(){\n\t\tif (p1lives == 0){\n\t\t\tscreen = 8;\n\t\t}else if(p2lives == 0){\n\t\t\tscreen = 8;\n\t\t}\n\t}", "function winGame() {\n\tflashColor();\n\tturnCounter.innerHTML = \"WIN!\";\n\ton = false;\n\twin = true;\n}", "function gameWon() {\n if (winGame == true) {\n endScreen();\n }\n}", "function checkWin(x, y, player) {\r\n\t//on part du principe que l'on gagne\r\n\tvar verticalWin = true;\r\n\tvar horizontalWin = true;\r\n\tvar diagonaleDroite = true;\r\n\tvar diagonaleGauche = true;\r\n\tvar egality = true;\r\n\t\r\n\tfor(i=0; i<3; i++) {\r\n\t\tif(morpion[x][i] != player) {verticalWin = false};\r\n\t\tif(morpion[i][y] != player) {horizontalWin = false};\r\n\t\tif(morpion[i][i] != player) {diagonaleGauche = false};\r\n\t\tif(morpion[2-i][i] != player) {diagonaleDroite = false};\r\n\t\tfor(j=0; j<3; j++) {if(morpion[i][j] == 0) {egality = false}}; //tant que toutes les cases ne sont pas joués egalité possible\r\n\t}\r\n\t\r\n\tif(verticalWin || horizontalWin || diagonaleDroite || diagonaleGauche){ //si gagné\r\n\t\tgameEnded(player); \r\n\t} else if(egality) { //sinon si egalité\r\n\t\tgameEnded(0)\r\n\t};\r\n}", "function win() {\n wins++;\n startGame();\n}", "checkWin() {\n // If computer or player 2 wins\n if (this.score1 >= 50) {\n // Clear the interval\n clearInterval(this.timeInterval);\n // Change the page state to the winning state\n this.changeState('win');\n // If multiplyer is not being played then computer wins\n if (!this.multiplayer) {\n // Display computer won\n this.winner.textContent = 'Computer Wins!';\n\n // Else player 2 wins\n } else {\n // Display player 2 won\n this.winner.textContent = 'Player 2 Wins!';\n }\n\n // If computer or player 2 wins\n } else if (this.score2 >= 50) {\n // Clear the interval\n clearInterval(this.timeInterval);\n // Change the page state to the winning state\n this.changeState('win');\n // Display player 1 won\n this.winner.textContent = 'Player 1 Wins!';\n }\n }", "function youWin(){\n\t\t$('#winOrLose').text(youWon);\n\t\tgamesWon++;\n\t\t$('#wins').text(gamesWon);\n\t\tnewGame();\n\t}", "async win(game, data) {\n\t\tthis._won = true;\n\t}", "win(opponent) {}", "async win(game, data) {\n\t\tthis._won = true;\n\t\tthis._won_time = data.time;\n\t}", "function winGame() {\n stopTimer();\n toggleModal();\n}", "function winGame() {\n flashColor();\n turnCounter.innerHTML = \"WIN!\";\n on = false;\n win = true;\n}", "function win() {\r\n if(playerHasSword===true && playerHasSelfConfidence===true && playerHasShortBlade===true && playerHasWD40===true && currentlocation===10) {\r\n var msg = \"You crawl through the ductwork and see your target. Quickly jumping down, you wound him with the short blade. He lashes out and strikes you back while drawing his sword. You draw the Sword of Aquilius and attack. After a brief battle, LaFontanue knocks the sword from your hand and prepares to run your through. At the last second, you extend your hidden blade and plunge it into his throat, killing him. Your mission is complete. Congratulations.\";\r\n updateText(msg);\r\n }\r\n }", "function playerWin() {\n game.isPlayersTurn = false;\n holdButtonFunctons = true;\n updateLED('WIN!');\n blinkLED(3);\n setTimeout(function() {\n holdButtonFunctons = false;\n startGame();\n }, 4000);\n}", "function conForWin() {\n\n\tif ( bx1.hasClass('I-turn') && bx2.hasClass('I-turn') && bx3.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx1.hasClass('U-turn') && bx2.hasClass('U-turn') && bx3.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx4.hasClass('I-turn') && bx5.hasClass('I-turn') && bx6.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx4.hasClass('U-turn') && bx5.hasClass('U-turn') && bx6.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx7.hasClass('I-turn') && bx8.hasClass('I-turn') && bx9.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx7.hasClass('U-turn') && bx8.hasClass('U-turn') && bx9.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx1.hasClass('I-turn') && bx4.hasClass('I-turn') && bx7.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx1.hasClass('U-turn') && bx4.hasClass('U-turn') && bx7.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx5.hasClass('I-turn') && bx2.hasClass('I-turn') && bx8.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx5.hasClass('U-turn') && bx2.hasClass('U-turn') && bx8.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx6.hasClass('I-turn') && bx9.hasClass('I-turn') && bx3.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx6.hasClass('U-turn') && bx9.hasClass('U-turn') && bx3.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx1.hasClass('I-turn') && bx5.hasClass('I-turn') && bx9.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx1.hasClass('U-turn') && bx5.hasClass('U-turn') && bx9.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n\n\telse if ( bx5.hasClass('I-turn') && bx7.hasClass('I-turn') && bx3.hasClass('I-turn') ) {\n\t\twinMsg(\"I\");\n\t} else if ( bx5.hasClass('U-turn') && bx7.hasClass('U-turn') && bx3.hasClass('U-turn') ) {\n\t\twinMsg(\"U\");\n\t}\n}", "function checkWinOrLose() {\n if (squares.length === 0) {\n state = `win`;\n console.log(\"win\");\n } else if (balls.length === 0) {\n state = `lose`;\n }\n}", "function check() {\n if (win(player)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (win(computer)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (\n (player.length == 5 && computerTurn === true) ||\n (computer.length == 5 && computerTurn === false)\n ) {\n playFlag = false;\n winner.innerHTML = 'Draw';\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n }\n playGame();\n}", "function checkForWin() {\n var winner = true;\n var youWin = document.getElementById(\"win\");\n for (var i = 0; i < board.cells.length; i++) {\n if (board.cells[i].isMine === true && board.cells[i].isMarked === false) {\n return \"\";\n }\n if (board.cells[i].isMine === false && board.cells[i].hidden === true) {\n return \"\";\n }\n }\n lib.displayMessage(\"You win!\");\n youWin.play();\n document.getElementById(\"fireworks.wav\").play();\n }", "function isGameOver (){\n if (whoWon()) return true\n return false\n}", "function displayWin() {\n\tif (modeGOT) {\n\t\t$txt.style.color = \"skyblue\";\n\t\t$txt.innerHTML = \"Frog King\".toUpperCase();\n\t\t$gotOstMain.pause();\n\t} else {\n\t\t$txt.style.color = \"green\";\n\t\t$txt.innerHTML = \"Bravo !\".toUpperCase();\n\t\t$ostMain.pause();\n\t}\n\t$ostWin.play();\n}", "function checkWin () {\n if (p1.score > p2.score) {\n $('#hero-player-1').stop()\n $('#hero-player-1').removeClass('onechop onebreathe')\n setTimeout(function () {\n $('h1').text('Player One Wins!')\n }, 1000)\n } else if (p1.score < p2.score) {\n $('#hero-player-2').stop()\n $('#hero-player-2').removeClass('twochop twobreathe')\n setTimeout(function () {\n $('h1').text('Player Two Wins!')\n }, 1000)\n } else {\n $('h1').text(`It's a draw!`)\n }\n}", "function checkGameStatus() {\r\n\tnumTurns++; //count turns\r\n\t\r\n\t//check for tie\r\n\tif (numTurns == 9) {\r\n\t\tgameStatus = \"Tie Game\";\r\n\t}//numTurns\r\n\t\r\n\t//check window\r\n\tif (checkWin()) {\r\n\t\tgameStatus = currentPlayer + \" wins!\";\r\n\t}//check wins\r\n\r\n\t//switch current player\r\n\tcurrentPlayer = (currentPlayer == \"X\" ? \"O\" : \"X\" );\r\n}//checkGameStatus", "function win() {\n winner.play();\n $(\"#outcome\").show().text(\"Winner!\")\n wins++;\n $(\"#wins\").text('Wins: ' + wins);\n gameReset();\n }", "function show_win(){\n alert(' You Win !!');\n game_end();\n}", "function youWin() {\n\tif (countMatch === 8) {\n\n\t\tendOfGame();\n\t\tconsole.log(\"You Win\");\n\t}\n}", "function winAll(){\n\t\tif (playerOneWin === 3) {\n\t\t\talert('Player One Wins! Click ok to restart.');\n\t\t\tlocation.reload();\n\t\t} else if (playerTwoWin === 3) {\n\t\t\talert('Player Two Wins! Click ok to restart');\n\t\t\tlocation.reload();\n\t\t}\n\t}", "function checkWin() {\n var tieGame = true;\n\n for (var combo in lines) {\n if (lines[combo].length === 3) {\n if (lines[combo][0] === lines[combo][1] && lines[combo][1] === lines[combo][2]) {\n winner = lines[combo][0];\n setTimeout(endOfGame(winner + ' won the game!'), 700);    \n tieGame = false;\n win = true;\n         canMove = false;      \n }\n } else {\n tieGame = false;\n }\n }\n if (tieGame) {\n setTimeout(endOfGame('It was a Tie Game!'), 700);\n win = true;\n     canMove = false;  \n }\n }", "function gameWinState() {\n crazySpace.update();\n }", "function checkWin(){\n\t//ROW WIN CONDITIONS\nif (oneV === twoV && twoV === threeV && oneV === threeV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\tconsole.log(whoPlayerTemp);\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (fourV === fiveV && fourV === sixV && fiveV === sixV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (sevenV === eightV && sevenV === nineV && eightV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//COLUMN WIN CONDITIONS\n\t} else if (oneV === fourV && oneV === sevenV && fourV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (twoV === fiveV && twoV === eightV && fiveV === eightV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === sixV && threeV === nineV && sixV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t//CROSS WIN CONDITIONS\n\t} else if (oneV === fiveV && oneV === nineV && fiveV === nineV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t} else if (threeV === fiveV && threeV === sevenV && fiveV === sevenV) {\n\tconsole.log('WINNER');\n\twhoPlayerTemp = (whoPlayer+'Wins');\n\t\tif (whoPlayerTemp === \"playerOneWins\") {\n\t\t\tplayerOneWins += 1;\n\t\t} else {\n\t\t\tplayerTwoWins +=1;\n\t\t}\n\t}\n\t$('#p2Score').text(playerTwoWins);\n\t$('#p1Score').text(playerOneWins);\n\t// checkTie();\n\tbestOfFiveWinner();\n}", "function winOrLose(winCounter, lives) {\n if (winCounter == randomWord.length) {\n $('.theWord').text(randomWord.toUpperCase());\n $('#winModal').modal('show');\n gamesWon++;\n $('#smart')[0].play();\n newGame();\n } else if (lives === 0) {\n $('.theWord').text(randomWord.toUpperCase());\n $('#doh')[0].play();\n $('#loseModal').modal('show');\n newGame();\n }\n}", "function winner(snowBall0,floor){\n //win.play();\n //boy.animations.play('win');\n soundWin.play();\n soundMainTheme.stop();\n game.state.start('GameOver');\n\n}", "function winGame() {\n flashColor();\n roundCount.innerHTML = \"WIN!\";\n power = false;\n win = true;\n startOver = setTimeout(() => {\n play();\n }, 5000);\n}", "function winGame() {\n if (matched.length === 8) { \n stopTimer();\n toggleModal();\n } \n}", "function checks() {\n if (beaverIndex === lynxIndex) {\n alert('Game Over: Lynx got you')\n startGame()\n }\n if (beaverIndex === lodgeIndex) {\n alert('You Win! Safe in Lodge')\n startGame()\n }\n }", "function checkForWin() {\r\n if (game_1.isWinningState(board)) {\r\n var winner = game_1.detectWinner(board);\r\n view_1.displayGameOver(winner);\r\n }\r\n else if (game_1.isDrawState(board)) {\r\n view_1.displayGameOver(null);\r\n }\r\n}", "function playGame(){\n const userChoice = getUserChoice('paper');\n const computerChoice = getComputerChoice();\n console.log('You selected: ' + userChoice);\n console.log('The computer selected: ' + computerChoice);\n \n console.log(determineWinner(userChoice, computerChoice));\n }", "function trollBattle() {\r\n\t// initial prompt question for the user stored in a variable\r\n\tvar action = window.prompt(\"Your walking through the forest. BAM! Troll jumps from out the bush\\nDo You FIGHT\\nDo You RUN\\nDo You BRIBE to be left alone\").toUpperCase();\r\n\t\r\n\t// swtich statement to handle the initial choice\r\n\tswitch(action) {\r\n\t\tcase \"FIGHT\":\r\n\t\t\tvar smart = window.prompt(\"Are your smarter then a troll? (YES or NO)\").toUpperCase();\r\n\t\t\tvar strong = window.prompt(\"Are you stronger then a troll? (YES or NO)\").toUpperCase();\r\n\t\t\t// if statment analyzes user respones\r\n\t\t\tif(smart === \"YES\" || strong === \"YES\") {\r\n\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"You can either be smarter or stronger then a troll to survive!<br/> YOu Live to fight another day!\";\r\n\t\t\t//clear any bad messages from the page\r\n\t\t\tdocument.getElementById(\"death\").innerHTML = \"\";\r\n\t\t\t//playthe winning \r\n\t\t\tdocument.getElementById(\"win\").play();\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"death\").innerHTML = \"your not strong or smart!<br/>why did u fight u have died...\";\r\n\t\t\t\t//clear any messages\r\n\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"\";\r\n\t\t\t\t//loseing sound\r\n\t\t\t\tdocument.getElementById(\"die\").play();\r\n\t\t\t}\r\n\t\t break;\r\n\t\t\t\r\n\t\tcase \"RUN\":\r\n\t\t\tvar fast = window.prompt(\"can u run fast? (YES or NO)\").toUpperCase();\r\n\t\t\t// if statement analyzes the user respones\r\n\t\t\tif(fast === \"YES\") {\r\n\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"your speed help you get away<br/>next time u might not be so lucky\";\r\n\t\t\t//clear any bad messages from the page\r\n\t\t\tdocument.getElementById(\"death\").innerHTML = \"\";\r\n\t\t\t//playthe winning \r\n\t\t\tdocument.getElementById(\"win\").play();\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"death\").innerHTML = \"you where not fast enough <br/>the troll got u and ate your face\";\r\n\t\t\t\t//clear any messages\r\n\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"\";\r\n\t\t\t\t//loseing sound\r\n\t\t\t\tdocument.getElementById(\"die\").play();\t\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t \r\n\r\n\t\tcase \"BRIBE\":\r\n\t\t\tvar money = window.prompt(\"you have to pay the troll-toll. do u have money to pay? (YES or NO)\").toUpperCase();\r\n\t\t\tif(money === \"YES\") {\r\n\t\t\t\tvar amount = window.prompt(\"how much money do u have?\\n(Please Enter A Numeric Value)\");\r\n\t\t\t\t\r\n\t\t\t\t//convert string to int\r\n\t\t\t\tamount = parseInt(amount);\r\n\t\t\t\tif(amount > 5) {\r\n\t\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"nice! u were able to pay the troll-toll! it was only 5 bucks tho hahah \";\r\n\t\t\t\r\n\t\t\t\t\tdocument.getElementById(\"death\").innerHTML = \"\";\r\n\t\t\t \r\n\t\t\t\t\tdocument.getElementById(\"win\").play();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdocument.getElementById(\"death\").innerHTML = \"troll need more money then that!<br/>u die...the troll ate your face\";\r\n\t\t\t\t\r\n\t\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"\";\r\n\t\t\t\t\r\n\t\t\t\t\tdocument.getElementById(\"die\").play();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdocument.getElementById(\"death\").innerHTML = \"you have no money<br/>u die...\";\r\n\t\t\t\t//clear any messages\r\n\t\t\t\tdocument.getElementById(\"result\").innerHTML = \"\";\r\n\t\t\t\t//loseing sound\r\n\t\t\t\tdocument.getElementById(\"die\").play();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\r\n\t\tdefault:\r\n\t\t\twindow.alert(\"enter a valid choice!\");\r\n\t\t\ttrollBattle();\r\n\t\t\tbreak;\r\n\t}\r\n}", "function win(){\n level++;\n createLevel(level);\n return false;\n}", "function gameOver1(trio) {\n\tif (!trio) {\n\t\tconsole.log(\"This game is a draw.\");\n\t} else {\n\t\tconsole.log(trio.winner+\" wins!\")\n\t}\n}", "displayWinner() {\n var winningPiece = game.isXTurn ? 'x' : 'o'\n if(game.singleplayer || game.vsAi)\n game.winner = winningPiece\n else\n {\n if(game.player === winningPiece)\n game.winner = game.username\n else\n game.winner = game.opponent\n }\n\n\n game.saveBoard()\n\n game.state.start('win')\n }", "function checkWin() {\n if(total == random) {\n playAudio(winSound);\n win++;\n $(\"#win\").text(win); \n collectCrystals();\n resetValues();\n } \n else if(total > random) {\n playAudio(loseSound);\n loss++;\n $(\"#loss\").text(loss); \n resetValues();\n }\n }", "function checkWin() {\n if ((userGuess === \"r\") && (opponentGuess === \"s\")) {\n wins++;\n } else if ((userGuess === \"r\") && (opponentGuess === \"p\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"r\")) {\n losses++;\n } else if ((userGuess === \"s\") && (opponentGuess === \"p\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"r\")) {\n wins++;\n } else if ((userGuess === \"p\") && (opponentGuess === \"s\")) {\n losses++;\n } else if (userGuess === opponentGuess) {\n ties++;\n }\n}", "function youWin() {\n if (ballCount >= balls.length) {\n audio.volume = 0\n youWinSound.play()\n youWinOverlay()\n }\n }", "function winOrLose()\n{\n\tif(blood<0)\n\t{\n\t\twinlose = 1;\n\t\tfill(255);\n\t\ttextSize(38);\n\t\ttext(\"You Lose\", width/2-60, height/2);\n\t\ttextSize(20);\n\t\ttext(\"R replay, N next\", width/2-60, height/2+40);\n\t\tnoLoop();\n\t}\n\tif(score>30)\n\t{\n\t\twinlose = 2;\n\t\tfill(255);\n\t\ttextSize(38);\n\t\ttext(\"You Win\", width/2-60, height/2);\n\t\ttextSize(20);\n\t\ttext(\"R replay, N next\", width/2-60, height/2+40);\n\t\tnoLoop();\n\t}\n}", "function winInform (letterWon, isDraw){\n gameOver = true;\n if (isDraw == undefined){\n //Win 1\n if (letterWon == \"X\" && playerIsX == true){\n $(\"#win-celebrate\").html(\"You won!\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 1\");\n setTimeout(resetBoard(), 1000);\n //Win 2\n } else if (letterWon == \"X\" && playerIsX == false){\n $(\"#win-celebrate\").html(\"You lost :/\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 2\");\n setTimeout(resetBoard(), 1000);\n //Win 3\n } else if (letterWon == \"O\" && playerIsX == false){\n $(\"#win-celebrate\").html(\"You won!\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 3\");\n setTimeout(resetBoard(), 1000);\n //Win 4\n } else if (letterWon == \"O\" && playerIsX == true){\n $(\"#win-celebrate\").html(\"You lost :/\");\n $(\"#win-celebrate\").show(\"fast\");\n console.log(\"Win 4\");\n setTimeout(resetBoard(), 1000);\n }\n } else {\n $(\"#win-celebrate\").html(\"Draw!\");\n $(\"#win-celebrate\").show(\"fast\");\n setTimeout(resetBoard(), 1000);\n }\n}", "function win(){\n //logic for if the game is over\n //return who won the game of if its a draw\n var winner2 = win1(sendObj.Board);\n if (winner2 != \"none\"){\n if(winner2 == \"draw\"){\n sendObj.info = \"It's a draw!\";\n return true;\n }else{\n sendObj.info = winner2 + \" wins!\";\n return true;\n }\n }\n}", "function startGame() {\n if(!presence.ballIsSpawned) {\n fill(start.color.c, start.color.saturation, start.color.brightness);\n stroke(start.color.c, start.color.saturation, start.color.brightness)\n if((windowWidth < 600) && (windowHeight < 600)) {\n textSize(20);\n text(\"PRESS ENTER TO START GAME\", windowWidth/4.2, windowHeight/2.5);\n textSize(15);\n text(\"(First to 7 Wins)\", windowWidth * 0.41, windowHeight * 0.47);\n }\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(30)\n text(\"PRESS ENTER TO START GAME\", windowWidth * 0.35, windowHeight/2.5);\n textSize(20);\n text(\"(First to 7 Wins)\", start.textX + start.textX * 0.265, windowHeight * 0.44);\n }\n if(mode == 'single'){\n if((windowWidth > 601) && (windowHeight > 601)){\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08);\n textSize(18);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.2, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR TWO PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n if((windowWidth < 600) && (windowHeight < 600)){\n text(\"Mode: \" + mode, windowWidth * 0.8, windowHeight * 0.08);\n textSize(14);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.01, start.textY + start.textY * 0.04);\n textSize(12);\n text(\"PRESS SHIFT FOR TWO PLAYER\", windowWidth * 0.35, start.textY + start.textY * 0.16);\n defaultBallSpeed = 4;\n }\n }\n if(mode == 'two'){\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(20);\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08)\n textSize(18);\n text(\"USE Q, A, P, L TO MOVE\", windowWidth * 0.43, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR ONE PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n }\n \n start.color.c += 1;\n if(start.color.c > 359) {\n start.color.c = 0;\n }\n }\n }", "function checkWin() {\n\n}", "function checkWin() {\n \n if (liveMafia > (getAll().length - liveMafia))\n\treturn \"Mafia\";\n else if (liveMafia == 0) \n\treturn \"Villagers\";\n else\n\treturn null;\n}", "function processWin() {\n gamesWon++;\n updateGamesWon();\n updateGameResult(\n `YOU WON!...The letter was '${gameLetter.toUpperCase()}'.`);\n updateMessage(\"Congratulations! Let's go again.\");\n resetGame();\n}", "function checkWin() {\n if (userScore === numToMatch) {\n wins++;\n $(\"#wins\").text(\"Success: \" + wins);\n reset();\n } else if (userScore > numToMatch) {\n losses++\n $(\"#losses\").text(\"Fails: \" + losses);\n reset();\n }\n }", "function checkWinOrLoss() {\n if (totalScore === randomNumToGuess) { // We have a winner\n wins++;\n initializeGame()\n }\n else if (totalScore > randomNumToGuess) { // We have a loser\n losses++;\n initializeGame();\n }\n else {\n updateUI;\n }\n }", "function winGame() {\n // show screens\n $(\"#gameScreen1\").hide();\n $(\"#store\").hide();\n $(\"#upgrade\").hide();\n $(\"#gameScreen2\").show();\n\n $(\"#numSquareGeneratorsOwned1\").text(squares.amountOwned - 1 + \" x\");\n $(\"#numCircleGeneratorsOwned1\").text(circles.amountOwned - 1 + \" x\");\n $(\"#numTriangleGeneratorsOwned1\").text(triangles.amountOwned - 1 + \" x\");\n $(\"#numDiamondGeneratorsOwned1\").text(diamonds.amountOwned - 1 + \" x\");\n $(\"#finalTimeValue\").text(timeElapsed);\n }", "function checkIfWin(){\n console.log(\"check win:\");\n if (counterNumber == goalNumber) {\n wins += 1;\n alert(\"You won!\");\n startGame();\n }\n\n if (counterNumber > goalNumber) {\n losses += 1;\n alert(\"You lost. If you're having trouble, you can pay to help your chances via micro-transactions. Coming soon!\");\n startGame();\n }\n}", "setGameWon() {\n if (!this.isGameWon) {\n this.isGameWon = true;\n stopSong();\n playGameWin();\n }\n }", "function runGame() {\n\t// DISPLAY WELCOME BANNER\n\n\t// STORE INITIAL GAME STATE\n\n\t// WHILE LOOP FOR WHEN GAME IS NOT WON\n}", "function joinGameAsPlayer() {\n // check if ingame true\n\n}", "function checkGameStatus() {\r\n\tnumTurns++;\r\n\t\r\n\t//check win\r\n\tif (checkWin()) {\r\n\t\tgameStatus = currentPlayer + \" Wins!\";\r\n\t\t\r\n\t}\r\n\t\r\n\t//chec for tie\r\n\tif (numTurns == 9) {\r\n\t\tgameStatus = \"Tie Game\";\r\n\t\t\r\n\t}//numTurns\r\n\t\t\r\n\t//switch current player\r\n\tcurrentPlayer = (currentPlayer == \"X\" ? \"O\" : \"X\");\r\n\t\r\n\t//game is over\t\r\n\tif(gameStatus != \"\") {\r\n\t\tsetTimeout(function() { showLightBox(gameStatus, \"Game Over.\");}, 500);\r\n\t\t\r\n\t}\r\n\t\r\n} //check game status", "function game(playerSelection){\n\tif (computerWinOrLoseChoiceGlobal === 1){\n\t\twin(playerSelection);\n\t}\n\telse if (computerWinOrLoseChoiceGlobal === 2){\n\t\tlose(playerSelection);\n\t}\n\telse {\n\t\ttie(playerSelection);\n\t}\n}", "function gameovercheck() {\n\t\tif (lives === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"GAME OVER\", width/2 - 120, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t\telse if (brickcount === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"YOU WIN!\", width/2 - 95, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t}", "function checkIfGameEnded() {\r\n if (chances == 10) gameOver();\r\n if (win == true) winner();\r\n}", "function app(time){\n if (time - lastFrameTime < FMT) {\n requestAnimationFrame(app);\n return;\n }\n\n if (rightPressed){\n player.move('E');\n } else if(leftPressed){\n player.move('W');\n } else if(upPressed){\n player.move('S');\n } else if(downPressed){\n player.move('N');\n } \n\n //Winning condition and event\n\n if(mazemap[player.pos.x][player.pos.y] === side['stairs']) {\n const audioWin = new Audio('audio/win.wav');\n audioWin.play();\n document.getElementById('win').style.display = 'block';\n document.getElementById('win').innerHTML = 'You WIN! <br> Press R to start a new game';\n return;\n }\n\n lastFrameTime = time;\n\n requestAnimationFrame(app);\n}", "function checkIfWin() {\n let isWon = true;\n arr.forEach((x) => {\n x.forEach((y) => {\n if (y.randomNum !== 0 && y.revealed === false) {\n isWon = false;\n }\n });\n });\n if (isWon) {\n setWin(true);\n setHeading(\":D CONGRATS! THERE`S NO BLOWIN YA! :D\");\n }\n }", "function winCondition() {\n var ctx = hangmanGame.canvas.getContext(\"2d\");\n\n if (counter < 3) {\n ctx.font = ctx.font = \"125px Rock Salt\";\n ctx.textAlign = \"center\";\n ctx.fillStyle = \"#f2042c\";\n ctx.fillText(`YOU WIN!`, 400, 250);\n } else {\n resetAll();\n }\n\n if (hangmanGame.frameCount === 50) {\n counter++;\n }\n}", "function win() {\r\nwins++;\r\nreset();\r\n}", "function winCheck() {\n if (userScore === computerPick) {\n wins++;\n $(\"#wins\").html(\"Wins: \" + wins);\n alert(\"Winning isn’t everything, it’s the ONLY thing\");\n newGame();\n }\n\n else if (userScore > computerPick) {\n losses++;\n $(\"#losses\").html(\"Losses: \" + losses);\n alert(\"...if you ain't first, you're last\");\n newGame();\n };\n }", "check_GameOver() {\n if (this.model.winner == 0) {\n if (this.currentPlayerBot == 0) {\n this.scene.undo_play = false;\n this.state = 'WAIT_UNDO';\n }\n else\n this.state = 'CHANGE_PLAYER';\n }\n else{\n this.state = 'GAME_OVER';\n this.scene.showGameMovie = false;\n this.view.incWinsPlayer(this.model.winner);\n }\n }", "function checkWin() {\n if (globalHiddenlist.indexOf(\" _ \") < 0 && guessesCount > 0) {\n document.querySelector(\"#gameStatus\").innerHTML = \"YOU WON!\"\n isGameon = false\n }\n else if (guessesCount == 0) {\n document.querySelector(\"#gameStatus\").textContent = \"You Lost, hold this L\"\n //document.getElementById(\"imgL\").src = \"./assets/images/L.jpg\"\n endWord()\n isGameon = false\n }\n}", "function win() {\n if (squares[4].classList.contains('man')) {\n result.innerHTML = 'I am Inevitable 😍'\n squares[index].classList.remove('man')\n clearInterval(timerId)\n document.removeEventListener('keyup', moveman)\n }\n }", "function checkGame(stopFlag, t){\n let player=t==='red' ? 'Player-1' : 'Player-2';\n if(stopFlag){ \n stopTimer();\n showWinMessage(player);\n gameCount++;\n turn= gameCount % 2 === 0 ? 'red' : 'yellow';\n playGame();\n } else {\n playGame();\n }\n}", "function winCondition(sprite){\n if (playerGroup.length == 1) {\n endNextFrame = 1\n }\n}", "function userWinOrLose() {\n if (result > randomNum) {\n losses++;\n console.log(\"user lost\");\n // alert(\"You lost! Try again.\");\n initializeGame();\n }\n\n if (result === randomNum) {\n wins++;\n console.log(\"user won\");\n // alert(\"You won! Great job. Best out of 5?\");\n initializeGame();\n }\n}", "function winn(currentMove) {\n if (\n (box[0].innerText == currentMove && box[1].innerText == currentMove && box[2].innerText == currentMove) ||\n (box[3].innerText == currentMove && box[4].innerText == currentMove && box[5].innerText == currentMove) ||\n (box[6].innerText == currentMove && box[7].innerText == currentMove && box[8].innerText == currentMove) ||\n (box[0].innerText == currentMove && box[3].innerText == currentMove && box[6].innerText == currentMove) ||\n (box[1].innerText == currentMove && box[4].innerText == currentMove && box[7].innerText == currentMove) ||\n (box[2].innerText == currentMove && box[5].innerText == currentMove && box[8].innerText == currentMove) ||\n (box[0].innerText == currentMove && box[4].innerText == currentMove && box[8].innerText == currentMove) ||\n (box[2].innerText == currentMove && box[4].innerText == currentMove && box[6].innerText == currentMove)) {\n\n alert(currentMove + ' wins!');\n refr();\n } else if (moveCount == 9) {\n alert('Tie Game!');\n refr();\n }\n }", "function gameWin() {\n puzzleEnd(true)\n }", "function checkWin()\r\n{\r\n if(userTurn[userTurn.length-1]===computerTurn[userTurn.length-1])\r\n {\r\n if(userTurn.length===computerTurn.length)\r\n {\r\n turn.innerHTML=\"LEVEL PASSED\";\r\n currentScore++;\r\n setTimeout(computer,1500);\r\n }\r\n }\r\n else{\r\n gameOver();\r\n }\r\n}", "checkForWin() {\n const phraseList = document.querySelector('#phrase').firstElementChild.children;\n let correctGuesses = 0;\n for (let i=0; i<phraseList.length; i++) {\n if (phraseList[i].className === 'show') {\n correctGuesses += 0;\n } else if (phraseList[i].className === 'hide space') {\n correctGuesses += 0;\n } else {\n correctGuesses -= 1;\n }\n }\n if (correctGuesses === 0) {\n this.gameOver('win');\n }\n }", "function gameIsDraw(game) {\n return game.winner === undefined && game.turn === 9;\n}", "function winScreen() {\n\tctx.fillStyle = \"#0000FF\";\n\tctx.fillRect(0,0,canvas.width,canvas.height);\n\tctx.fillStyle = \"#FFFFFF\";\n\tctx.fillRect(canvas.width/2 - 120,320,240,140);\n\tctx.font = \"72px Arial\";\n\tctx.fillText(\"GAME OVER\", 60, 160);\n\tctx.fillText(\"WINNER\", 100, 260);\n\tctx.font = \"48px Arial\";\n\tctx.fillStyle = \"black\";\n\tctx.fillText(\"REPLAY\", 200, 400);\n}", "checkIfWin() {\n if (this.score === 10) {\n this.started = false;\n allEnemies = [];\n showWinModal();\n }\n }", "function playDoor(door)\n{\n numCloseDoors--;\n if (numCloseDoors === 0) {\n gameOver('win');\n } else if (isBot(door)) {\n gameOver();\n }\n\n}", "function winOrLoss (game, team) {\n\tvar resH = game['Home Score']; // home score\n\tvar resA = game['Away Score']; // away score\n\tteam.played++;\n\tif (resH===resA){\n\t\tteam.drew++;\n\t}\n\telse if (resH>resA && game['Home Team'] === teamName){\n\t\tteam.won++;\n\t}\n\telse if (resH<resA && game['Away Team'] === teamName){\n\t\tteam.won++;\n\t}\n}", "function win () {\n\tconsole.log( 'You win!' );\n}", "function gameOver(hasWon) {\r\n isGameEnded = true;\r\n timeRecord = clock.getElapsedTime();\r\n isGameAnimation = true;\r\n backgroundMusic.stop();\r\n if (hasWon) {\r\n displayText(\"You've Won\", 1, 5, -Math.PI /4);\r\n isWon = true;\r\n winFSX.play();\r\n } else {\r\n displayText(\"Game Over\", 1, 5, -Math.PI /4);\r\n isWon = false;\r\n loseFSX.play();\r\n }\r\n}", "function winCheck(){\n //Checks CPU Character\n if (computerChar === \"roy\"){\n \n //Checks Health of CPU Character\n if (roy.health < 1 && roy.fight === true){\n $(\".roy-small\").addClass('grayScale')\n alert(\"Knockout!\")\n slotTwoFull = false;\n roy.fight = false;\n roy.inUse = false;\n playerKOs++\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\".fight-cpu\").hide();\n if (playerKOs<3){\n alert(\"Pick a new opponent!\")}\n stop;\n }\n }\n\n if (computerChar === \"ridley\"){\n if (ridley.health < 1 && ridley.fight === true){\n $(\".ridley-small\").addClass('grayScale')\n alert(\"Knockout!\")\n slotTwoFull = false;\n ridley.fight = false;\n ridley.inUse = false;\n playerKOs++\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\".fight-cpu\").hide();\n if (playerKOs<3){\n alert(\"Pick a new opponent!\")}\n stop;\n }\n }\n\n if (computerChar === \"cloud\"){\n if (cloud.health < 1 && cloud.fight === true){\n $(\".ridley-small\").addClass('grayScale')\n alert(\"Knockout!\")\n slotTwoFull = false;\n cloud.fight = false;\n cloud.inUse = false;\n playerKOs++\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\".fight-cpu\").hide();\n if (playerKOs<3){\n alert(\"Pick a new opponent!\")}\n stop;\n }\n }\n\n if (computerChar === \"incineroar\"){\n if (incineroar.health < 1 && incineroar.fight === true){\n $(\".ridley-small\").addClass('grayScale')\n alert(\"Knockout!\")\n slotTwoFull = false;\n incineroar.fight = false;\n incineroar.inUse = false;\n playerKOs++\n $(\"#cpu-health\").html();\n $(\"#cpu-attack\").html();\n $(\".fight-cpu\").hide();\n if (playerKOs<3){\n alert(\"Pick a new opponent!\")}\n stop;\n \n }\n }\n if (playerKOs === 3){\n alert(\"You won and knocked out all the other fighters!\");\n reset();\n }\n}", "function startGame() {\n showGuessesRemaining();\n showWins();\n}", "function checkWin() {\n const guessableLetters = document.querySelectorAll(\".letter\");\n const guessedLetters = document.querySelectorAll(\".show\");\n const overlay = document.getElementById('overlay');\n const overlayText = document.querySelector('.title');\n if (guessedLetters.length === guessableLetters.length){\n overlay.className = \"win\";\n overlayText.textContent = 'That was stupendous! The message was \"' + message + '\".';\n startButton.textContent = \"Play again?\";\n $(overlay).fadeIn(2500);\n } else if (missed === 5) {\n overlay.className = \"lose\";\n overlayText.innerHTML = '<p>Sorry bro, but that was awful. It should have said: \"' + message + '.\" <br><br>Redeem yourself?</You>';\n startButton.textContent = \"Giving up was never an option.\";\n $(overlay).fadeIn(2000);\n }\n }", "function isWin() {\n\t//only after the game has been started and shuffling that we judge\n\tif (gameon && shuffling) {\n\t\tfor (var i = 0; i < squares.length; i++) {\n\t\t\tif (squares[i].position !== squares[i].identity) return false;\n\t\t}\n\t\treturn true;\n\t}\n}", "update() {\n // On every win\n win();\n // If player goes outside\n this.outsideCanvas();\n }", "function checkWin() {\n if (gLevel.SIZE === 4) {\n if (gGame.markedCount <= 2 && gGame.markedCount + gGame.shownCount === gLevel.SIZE ** 2) {\n var elBtn = document.querySelector('button')\n elBtn.innerText = '😎'\n elBtn.style.backgroundColor = 'green'\n gGame.isOn = false\n clearInterval(intID)\n }\n } else if (gLevel.SIZE === 8) {\n if (gGame.markedCount <= 12 && gGame.markedCount + gGame.shownCount === gLevel.SIZE ** 2) {\n var elBtn = document.querySelector('button')\n elBtn.innerText = '😎'\n elBtn.style.backgroundColor = 'green'\n gGame.isOn = false\n clearInterval(intID)\n }\n } else if (gLevel.SIZE === 12) {\n if (gGame.markedCount <= 30 && gGame.markedCount + gGame.shownCount === gLevel.SIZE ** 2) {\n var elBtn = document.querySelector('button')\n elBtn.innerText = '😎'\n elBtn.style.backgroundColor = 'green'\n gGame.isOn = false\n clearInterval(intID)\n\n }\n }\n}", "function playDoor(num) {\n numClosedDoors -= 1;\n if (numClosedDoors===0){\n gameOver('win');\n } else if(isBot(num)){\n gameOver();\n }\n}", "function game(){\n var player1 = rockPaperScissors();\n var player2 = rockPaperScissors();\n var options = ['rock', 'paper', 'scissors'];\n\n if (player1 > player2 && player1 - player2 != 2){\n render(options[player1], options[player2], 'player1');\n } else if (player2 > player1 && player2 - player1 != 2){\n render(options[player1], options[player2], 'player2');\n } else if (player1 === player2){\n render(options[player1], options[player2], 'draw');\n }\n}", "function isUserWon() {\n\n var flag = false;\n\n function drawWinText(user) {\n var x = 320;\n var y = 250;\n drawText(user + ' Won!!', x, y);\n drawText('Click to replay...', x, y + 30);\n }\n\n if (userScore >= WINNIG_SCORE) {\n drawWinText(USER_1);\n flag = true;\n } else if (computerScore >= WINNIG_SCORE) {\n drawWinText(USER_2);\n flag = true;\n }\n\n return flag;\n }", "function win () { \n style = { font: \"65px Arial\", fill: \"#fff\", align: \"center\" };\n game.add.text(game.camera.x+325, game.camera.y+150, \"You Win!\", style);\n button = game.add.button(game.camera.x+275, game.camera.y+250, 'reset-button', actionOnResetClick, this);\n button = game.add.button(game.camera.x+475, game.camera.y+250, 'contact-button', actionOnContactClick, this); \n // The following lines kill the players movement before disabling keyboard inputs\n player.body.velocity.x = 0;\n setTimeout(game.input.keyboard.disabled = true, 1000); \n // Plays the victory song \n victory.play('');\n // When the Reset button is clicked, it calls this function, which in turn calls the game to be reloaded.\n // Here we display the contact and replay button options, calling either respective function\n function actionOnResetClick () {\n gameRestart();\n }\n\n // When the contact button is clicked it redirects through to contact form\n function actionOnContactClick () {\n\n window.location = (\"/contacts/\" + lastName)\n \n } \n }" ]
[ "0.74927545", "0.74479127", "0.74200004", "0.73133266", "0.7248724", "0.72431815", "0.72077996", "0.7194075", "0.7175416", "0.70965385", "0.7077904", "0.7045506", "0.70189595", "0.6998817", "0.69928575", "0.69695824", "0.69667375", "0.69662374", "0.69612616", "0.6946095", "0.69076425", "0.6885175", "0.6879927", "0.6873546", "0.68649983", "0.684635", "0.68440676", "0.68364286", "0.68209344", "0.681859", "0.6804241", "0.68036824", "0.68005526", "0.67991513", "0.67659754", "0.67651874", "0.67557967", "0.67465025", "0.67442304", "0.6743778", "0.6724191", "0.67231274", "0.6713189", "0.6707359", "0.66996425", "0.66986614", "0.6695672", "0.6695072", "0.66938", "0.6693467", "0.66859394", "0.668497", "0.66810524", "0.66786987", "0.6678125", "0.6676564", "0.6674707", "0.6671192", "0.66656697", "0.6665573", "0.66633695", "0.6657121", "0.66544753", "0.66518843", "0.6651063", "0.6647795", "0.6645576", "0.6644992", "0.6641385", "0.6638673", "0.66334146", "0.66319114", "0.6631123", "0.6626171", "0.6618647", "0.6616265", "0.6615934", "0.6612294", "0.66089535", "0.66089165", "0.6603721", "0.6596085", "0.659308", "0.65855104", "0.656536", "0.6565227", "0.65639675", "0.6563023", "0.6558788", "0.6551832", "0.6551761", "0.6550247", "0.6547054", "0.65433097", "0.65433073", "0.65407956", "0.65342796", "0.6534215", "0.6529648", "0.65262794", "0.6525671" ]
0.0
-1
if winCheck finds a win, THEN: prevent more moves from being made.
function fillBoard() { for (row=0; row < 3; row++) { for (column=0; column < 3; column++) { if (gameboard[row][column].textContent == "") { gameboard[row][column].textContent = " "; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkForWin() {\n if ((this.state.availCells.length <= 4) && (this.state.winner === '')) {\n this.winCheck()\n } else {\n this.nextTurn()\n }\n }", "function checkWin(){\n if ((board.top.col1===board.top.col2 && board.top.col3===\"X\") || (board.top.col1===board.top.col2 && board.top.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.middle.col1===board.middle.col2 && board.middle.col3===\"X\") || (board.middle.col1===board.middle.col2 && board.middle.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.bottom.col1===board.bottom.col2 && board.bottom.col3===\"X\") || (board.bottom.col1===board.bottom.col2 && board.bottom.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.top.col1===board.middle.col2 && board.bottom.col3===\"X\") || (board.top.col1===board.middle.col2 && board.bottom.col3===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n if ((board.top.col3===board.middle.col2 && board.bottom.col1===\"X\") || (board.top.col3===board.middle.col2 && board.bottom.col1===\"O\")){\n running = false;\n console.log(\"Someone won!\");\n };\n}", "function winCheck() {\n\tif(matches === 8){\n\t\ttimerEnd();\n\t\taddRating(moves);\n\t\tpopUpModal();\n\t\tpopUp.classList.remove('display-none');\n\t}\n}", "function checkWin(turn) {\n\t\tif (\n\t\t board[0] === board[1] && board[0] === board[2] ||\n\t\t board[0] === board[3] && board[0] === board[6] ||\n\t\t board[0] === board[4] && board[0] === board[8] ||\n\t\t board[1] === board[4] && board[1] === board[7] ||\n\t\t board[2] === board[4] && board[2] === board[6] ||\n\t\t board[2] === board[5] && board[2] === board[8] ||\n\t\t board[3] === board[4] && board[3] === board[5] ||\n\t\t board[6] === board[7] && board[2] === board[8]\n\t\t ) {\n\t\t\tupdateBoard();\n\t\t\tboard = [1,2,3,4,5,6,7,8,9];\n\t\t\tturnNumber = 1;\n\t\t\tplayerTurn = true;\n\t\t\tplayer = turn ? 'Player \"X\"': 'Player \"O\"';\n\t\t\tconsole.log(player + 'won');\n\t\t\tupdateBoard();\n\t\t\tpopup(player);\n\t\t}\n\t}", "function checkForWin () {\n for (i = 0; i < board.cells.length; i ++){\n if (board.cells[i['isMine']]===true && board.cells[i['isMarked']]===false){\n return\n }\n else if (board.cells[i['isMine']]===true && board.cells[i['hidden']]===true) {\n return\n }\n lib.displayMessage('You win!')\n\n }\n\n}", "function checkMoves() {\n if (picked.length !== null) {\n if (opponentPicked.length !== null) {\n checkWinner();\n }\n }\n }", "function checkForWin () {\n for (var i = 0; i < board.cells.length; i++) {\n if (!board.cells[i].isMine && board.cells[i].hidden) {return}\n if (board.cells[i].isMine && !board.cells[i].isMarked) {return}\n }\nlib.displayMessage('no rabies for you!')\n }", "function checkForWin() \n{\n /*console.log(blacksPieces.length+whitesPieces.length+ \"possiblePlace.length = \" + possiblePlaces.length)*/\n /* Here we check to see if the gameboard is full */\n if( (blacksPieces.length + whitesPieces.length) == 64 || (whitePlayer.numberOfPossible == 0 && blackPlayer.numberOfPossible == 0) )\n {\n if (blacksPieces.length > whitesPieces.length)\n {\n divider.style.display = \"none\";\n for (let i = 0; i < blackTurntext.length; i++) { \n blackTurntext[i].style.color = \"white\";\n whiteTurnText[i].style.display = \"none\";\n blackTurntext[i].textContent = \"BLACK WINS!\";\n }\n \n }\n else if(blacksPieces.length < whitesPieces.length)\n {\n divider.style.display = \"none\";\n for (let i = 0; i < blackTurntext.length; i++) { \n whiteTurnText[i].style.color = \"white\";\n blackTurntext[i].style.display = \"none\";\n whiteTurnText[i].textContent = \"White WINS!\";\n }\n }\n }\n /* Here we check to see if neither player can move. */\n \n /* if( possiblePlaces.length == 0 ) \n {\n /*switch to other player POV to check possible moves\n turn = !turn;\n if (turn) {\n playerPieces = whitesPieces;\n } \n else {\n playerPieces = blacksPieces;\n }\n resetPossibleMoves();\n if( possiblePlaces.length == 0 )\n {\n if (blacksPieces.length > whitesPieces.length)\n {\n divider.style.display = \"none\";\n for (let i = 0; i < blackTurntext.length; i++) { \n blackTurntext[i].style.color = \"white\";\n whiteTurnText[i].style.display = \"none\";\n blackTurntext[i].textContent = \"BLACK WINS!\";\n }\n \n }\n else if(blacksPieces.length < whitesPieces.length)\n {\n divider.style.display = \"none\";\n for (let i = 0; i < blackTurntext.length; i++) { \n whiteTurnText[i].style.color = \"white\";\n blackTurntext[i].style.display = \"none\";\n whiteTurnText[i].textContent = \"White WINS!\";\n }\n }\n else\n {\n divider.style.display = \"none\";\n for (let i = 0; i < blackTurntext.length; i++) \n { \n whiteTurnText[i].style.color = \"white\";\n blackTurntext[i].style.display = \"none\";\n whiteTurnText[i].textContent = \"DRAW\";\n `` }\n ``}\n }\n /*switch back to original player\n turn = !turn;\n if (turn) {\n playerPieces = whitesPieces;\n } \n else {\n playerPieces = blacksPieces;\n }\n resetPossibleMoves();\n } */\n}", "function checkForWin () {\n for (let cell of board.cells) {\n if (cell.isMine) {\n if (!cell.isMarked) {\n return false;\n }\n } else {\n if(cell.hidden) {\n return false;\n }\n }\n }\n // setEndTime\n endTime = new Date().getTime()\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!')\n // Play win audio\n document.getElementById(\"audio_win\").play()\n // reveal all mines after win\n revealMines()\n removeListeners()\n return true;\n}", "checkForWin() {\n if (this.numMafia <= 0) { this.gameState = TOWN_WIN; }\n if (this.getInnocentPlayerCount() <= 0) { this.gameState = MAFIA_WIN; }\n }", "function checkWin(player) {\n // Variables to keep track of win, start at true and are proved false\n var horizontalWin = true;\n var verticalWin = true;\n var d1Win = true;\n var d2Win = true;\n\n // Check horizontally\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Check each column at the same row value\n if(!boxes[row][cIndex].classList.contains(player)) {\n horizontalWin = false;\n }\n }\n\n // Check vertically\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n // Check each row at the same column value\n if(!boxes[rIndex][column].classList.contains(player)) {\n verticalWin = false;\n }\n }\n\n // Check if the latest piece was placed in a position that could win\n // diagonally\n if((row === column) || (Math.abs(row - column) === NUM_ROWS - 1)) {\n for(var d = 0; d < NUM_ROWS; d++) {\n // Check diagonally from top left to bottom right\n if(!boxes[d][d].classList.contains(player)) {\n d1Win = false;\n }\n\n // Check diagonally from bottom left to top right\n if(!boxes[NUM_ROWS - d - 1][d].classList.contains(player)) {\n d2Win = false;\n }\n }\n }\n\n // Couldn't have won diagonally\n else {\n d1Win = false;\n d2Win = false;\n }\n\n //console.log(\"H: \" + horizontalWin + \", V: \" + verticalWin + \", D: \" + d1Win + \", \" + d2Win);\n\n // Player wins\n if(horizontalWin || verticalWin || d1Win || d2Win) {\n if(player === xClass) {\n victoryText.textContent = \"X Player Wins!\";\n // Increase score of X player\n xScore.textContent = Number(xScore.textContent) + 1\n }\n else {\n victoryText.textContent = \"O Player Wins!\";\n // Increase score of O player\n oScore.textContent = Number(oScore.textContent) + 1\n }\n\n $(victoryText).show('slow');\n gameOver = true;\n return true;\n }\n\n // If all spaces are taken and nobody has won\n if(boxCount === NUM_ROWS * NUM_COLS) {\n victoryText.textContent = \"Cat's Game\";\n $(victoryText).show('slow');\n gameOver = true;\n }\n\n // Didn't win... yet\n return false;\n\n }", "function checkForWin() {\r\n // You can use this function call to declare a winner (once you've\r\n // detected that they've won, that is!)\r\n // lib.displayMessage('You win!')\r\n for (let i = 0; i < board.cells.length; i++) {\r\n const cell = board.cells[i];\r\n if ((cell.isMine && !cell.isMarked) || (!cell.isMine && cell.hidden)) {\r\n return;\r\n }\r\n }\r\n lib.displayMessage(\"You win!\");\r\n}", "function checkWinCondition() {\n debug(\"checkWinCondition\");\n if (cardListMatch.length === 16) {\n stopTime();\n createModal();\n showModal();\n cardListMatch.splice(0, 50);\n }\n }", "function checkWin(movesArray, name){\n\t\t\n\t\tfor(var i = 0; i < winningPossibilities.length; i++){\n\t\t winCounter = 0;\n\t\t for(var j = 0; j < winningPossibilities[i].length; j++){\n\t\t if(movesArray.indexOf(winningPossibilities[i][j]) !== -1){\n\t\t winCounter++\n\t\t }\n\t\t if(winCounter === 4) {\n\t\t\t $turnText.html('Game Over, ' + name + ' wins!');\n\t\t\t removeRedandYellowListeners();\n\t\t\t bell.play();\n\t\t }\n\t\t }\n\t\t}\n\t}", "checkWin(board, rows = 10, cols = 10) {\n var swept = true;\n for (var r = 0; r < rows; r ++) {\n for (var c = 0; c < cols; c++) {\n if (!board[r][c].mine && !board[r][c].visible) {\n swept = false;\n return;\n }\n }\n }\n return swept;\n }", "function checkWin() {\n return Winning_combinations.some(combination => {\n return combination.every( index => {\n if (move % 2 !== 0) {\n return cells[index].classList.contains('x');\n }\n else {\n return cells[index].classList.contains('o');\n }\n })\n })\n}", "function checkForWin () {\n var numOfCells = board.cells.length\n var clearedSquares = 0\n var markedMines = 0\n var totalMines = 0\n \n for (k=0; k < numOfCells; k++){\n var checkCell = board.cells[k]\n // first count how many mines are present\n if (checkCell.isMine == true) {\n totalMines ++\n }\n //check to see if cell is NOT mine and is visible\n if (checkCell.isMine == false && checkCell.hidden == false){\n clearedSquares++\n }\n //check to see if is mine and is marked\n if (checkCell.isMine == true && checkCell.isMarked == true){\n markedMines ++\n }\n }\n var notMines = numOfCells - totalMines\n\n //console log tests\n console.log(\"wincheck\")\n console.log(clearedSquares,\" cleared squares out of total number of non mines\",notMines)\n console.log(markedMines, \"marked mines out of \",totalMines)\n\n\n if (clearedSquares == notMines || markedMines == totalMines){\n lib.displayMessage('You win!')\n var applause = document.getElementById(\"applause\")\n var applauseFlag = true;\n if (applauseFlag == true) {\n applause.pause();\n applause.curretTime = 0;\n applause.play();\n applauseFlag = false;\n }\n }\n \n}", "function checkForWin () {\n for (i = 0; i < board.cells.length; i++) {\n if(\n board.cells[i].isMine && !board.cells[i].isMarked){\n return}\n else if (\n board.cells[i].isMarked && !board.cells[i].hidden){\n return}\n }\n\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!')\n}", "function checkForWin () {\n\n for(var i = 0; i < board.cells.length; i++){\n if(board.cells[i].isMine == true){ //if mine exists not marked, board not finished\n if(board.cells[i].isMarked != true){\n return\n }\n } else if(board.cells[i].hidden == true){ //not mine and hidden = not finished\n return\n }\n }\n\n lib.displayMessage('You win!')\n return\n}", "function checkForWin () {\nfor(var x = 0; x<board.cells.length;x++){\nif(board.cells[x].isMine === true && board.cells[x].isMarked === false){\n\treturn;\n\t}else if(board.cells[x].isMine === false && board.cells[x].hidden === true){\n\t\treturn;\n\t}\n\n}\n\t\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!')\n}", "function checkWin() {\n\t\tif (pairsRemain === 0) {\n\t\t\t\ttimerOff();\n\t\t\t\topenModal();\n\t\t};\n}", "function winn(currentMove) {\n if (\n (box[0].innerText == currentMove && box[1].innerText == currentMove && box[2].innerText == currentMove) ||\n (box[3].innerText == currentMove && box[4].innerText == currentMove && box[5].innerText == currentMove) ||\n (box[6].innerText == currentMove && box[7].innerText == currentMove && box[8].innerText == currentMove) ||\n (box[0].innerText == currentMove && box[3].innerText == currentMove && box[6].innerText == currentMove) ||\n (box[1].innerText == currentMove && box[4].innerText == currentMove && box[7].innerText == currentMove) ||\n (box[2].innerText == currentMove && box[5].innerText == currentMove && box[8].innerText == currentMove) ||\n (box[0].innerText == currentMove && box[4].innerText == currentMove && box[8].innerText == currentMove) ||\n (box[2].innerText == currentMove && box[4].innerText == currentMove && box[6].innerText == currentMove)) {\n\n alert(currentMove + ' wins!');\n refr();\n } else if (moveCount == 9) {\n alert('Tie Game!');\n refr();\n }\n }", "function checkWin() {\n checkWinCount += 1;\n\n if (Math.abs(gameBoard[0] + gameBoard[1] + gameBoard[2]) === 3){\n winner(); \n } else if (Math.abs(gameBoard[3] + gameBoard[4] + gameBoard[5]) === 3){\n winner(); \n } else if(Math.abs(gameBoard[6] + gameBoard[7] + gameBoard[8]) === 3){\n winner(); \n } else if(Math.abs(gameBoard[0] + gameBoard[3] + gameBoard[6]) === 3){\n winner();\n } else if(Math.abs(gameBoard[1] + gameBoard[4] + gameBoard[7]) === 3){\n winner();\n } else if(Math.abs(gameBoard[2] + gameBoard[5] + gameBoard[8]) === 3){\n winner(); \n } else if(Math.abs(gameBoard[0] + gameBoard[4] + gameBoard[8]) === 3){\n winner();\n } else if(Math.abs(gameBoard[2] + gameBoard[4] + gameBoard[6]) === 3){\n winner();\n } else if (checkWinCount === 9){\n drawMatch();\n }\n}", "checkForWinner() {\n if (this.primaryWinConditionsCheck()) {\n this.endGame();\n }\n }", "function checkBoard() {\n\n\tfor (var w = 0; w < 3; w++) {\n\t\tif (board[w]+board[w+3]+board[w+6]==3 || board[3*w]+board[3*w+1]+board[3*w+2]==3 || board[0]+board[4]+board[8]==3 || board[2]+board[4]+board[6]==3) {\n\t\t\tvar info = isHumanTimes?\"You Win, unbelieveble\":'You lose'\n\t\t\tif (confirm(info+', continue?') == true) {\n \t\t\t\t\treset();\n \t\t\t\t\treturn;\n\t\t\t\t} else {\n \t\t\t\treturn;\n\t\t\t\t}\t\n\t\t}\n\t\tif (board[w]+board[w+3]+board[w+6]==30 || board[3*w]+board[3*w+1]+board[3*w+2]==30 || board[0]+board[4]+board[8]==30 || board[2]+board[4]+board[6]==30) {\n\t\t\tvar info = !isHumanTimes?\"You Win, unbelieveble\":'You lose'\n\t\t\tif (confirm(info+', continue?') == true) {\n \t\t\t\t\treset();\n \t\t\t\t\treturn;\n\t\t\t\t} else {\n \t\t\t\treturn;\n\t\t\t\t}\t\n\t\t}\n\t}\n\tfor (var v = 0; v < 9; v++) {\n\t\tif (board[v] === 0){\n\t\t\treturn;\n\t\t} \n\t\telse if (v === 8) {\n\t\t\t\tvar info = 'Draw, continue?'\n\t\t\t\tif (confirm(info) == true) {\n \t\t\t\t\treset();\n \t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tgameover = false;\n \t\t\t\treturn;\n\t\t\t\t}\t\n\t\t}\n\t}\n}", "function checkWin(checkAgainst){\n //strategy: forEach the winstates and check if either the player or the cpu has all of the points in a given winstate, if a player or CPU has TWO points in a given winstate, checkWin returns the third point in the winstate for a block or a victory\n //console.log('checking wins against ' + checkAgainst);\n \n //{console.log('turn: '+turns+' checkwin running with '+checkAgainst);}\n var counter=0;\n var winmove='';\n var foundwin=false;\n if(playertestflag=true){console.log('testing for player win on turn: '+turns);}\n winstates.forEach(function(test){\n if(playertestflag=true){console.log('testing: '+test);}\n counter=0;\n var moveArr=[];\n //console.log('checking: '+test);\n for(var i=0;i<checkAgainst.length;i++){\n // console.log('I am comparing '+test+'with '+checkAgainst[i]);\n if(playertestflag=true){console.log('checking:'+checkAgainst[i]);}\n if (test.indexOf(checkAgainst[i])>-1){\n if(playertestflag=true){console.log('found match: '+checkAgainst[i]);}\n // console.log(checkAgainst[i]+ ' is a part of '+test);\n \n counter++;\n \n if(playertestflag=true){console.log('found match: '+checkAgainst[i]+'count: '+counter);}\n if(counter>1){\n // console.log('i found a potential winning move and am checking if it is available');\n if(playertestflag=true){console.log('I am running checkavl against'+test);}\n if((checkavl(test).length>0)){\n moveArr=checkavl(test);\n if(playertestflag=true){console.log('writing to moveArr '+ moveArr+' with length: '+moveArr.length);}\n }\n //console.log('potential winmove, still looking for third: '+moveArr);\n //console.log('checkwin found a potential match on winstate: '+test+' match value: '+checkAgainst[i]+' counter: '+counter+' moveArr: '+moveArr);\n }\n }\n else{\n if(counter>1){\n //console.log('checkwin found a potential winning move: '+checkAgainst[i]);\n }\n }\n if(counter==2){\n //console.log('move here to win or block: ' + moveArr);\n if(foundwin===false){\n if( moveArr[0]!==undefined){\n winmove=moveArr[0];\n \n console.log('winmove has been written as:' +winmove);\n console.log('wrote undefined')\n }\n }\n }\n if (counter==3){\n // console.log('Win! - this is running - the next line should be true');\n winmove=true;\n // console.log(winmove);\n foundwin=true;\n \n } }\n \n });\n \n if(turns>3){\n // console.log('turn: '+turns+' checkwin returning'+winmove);\n }\n console.log('did I find a win?'+foundwin);\n console.log('I will return'+winmove)\n return winmove; \n}", "function checkForWin () {\n \n for (let index =0; index < board.cells.length; index++){\n if (board.cells[index].isMine && !board.cells[index].isMarked){\n return \n }\n if (board.cells[index].isMarked && !board.cells[index].isMine && board.cells[index].hidden) {\n return\n }\n if (!board.cells[index].isMine && board.cells[index].hidden) {\n return\n }\n }\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n var audio = document.getElementsByClassName(\"win\")[0];\n audio.play();\n lib.displayMessage('You win!')\n}", "isWinner() {\n let resetGame = false;\n if (moveMadeCount > this.minWinnerCheckMove) {\n this.checkWinningPattern();\n\n if (!this.win && moveMadeCount == this.maxMove) {\n draw.classList.remove('d-none');\n resetGame = true;\n } else if (this.win) {\n this.declareWinner();\n let view = new View();\n view.checkRemainingBoxes();\n resetGame = true;\n }\n }\n return resetGame;\n }", "function checkWin() {\n if (sticks.get(2).disks.length === 8 && !isWon) {\n alphaBG = 0;\n drawWinAnimation();\n }\n}", "function checkForWin () {\n for (var j = 0; j < boardSize.length; i++){\n if ((boardSize[j].isMine) && (boardSize[j].hidden) === true){\n } else if ((boardSize[j].isMine) && (boardSize[j].isMarked) === true){\n } else {\n return;\n }\n }\n lib.displayMessage('You win!');\n\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n // lib.displayMessage('You win!')\n}", "function checkForWin () {\nvar unhiddenCells = board.cells.filter(cell => {\n return ((cell.isMine && !cell.isMarked) || (!cell.isMine && cell.isHidden))\n})\nif (unhiddenCells.length === 0) {\n lib.displayMessage('You win!')\n }\n}", "function hasWon(puzzle)\n{\n var i = 0;\n for (var r = 0; r < 4; r++) \n {\n for (var c = 0; c < 4; c++) \n {\n if (i < puzzle.length)\n {\n var currentRow = parseInt(puzzle[i].style.top, 10) / 100;\n var currentCol = parseInt(puzzle[i].style.left, 10) / 100;\n if (currentRow != r || currentCol != c)\n { \n return false;\n }\n i++;\n }\n }\n }\n $(\"text\").removeClassName(\"lose\");\n $(\"text\").addClassName(\"win\");\n $(\"text\").innerHTML = \"You've solved the puzzle in \" + moves + \" moves!\";\n moves = 0;\n return true;\n}", "function _checkMoves() {\n\t\t\n\t\t// iterate through the rows\n\t\tfor(row = 0; row < _rows; row++) {\n\t\t\t\n\t\t\t// iterate through the cols\n\t\t\tfor (col = 0; col < _cols; col++) {\n\t\t\t\t\n\t\t\t\t// check top and bottom\n\t\t\t\tif(row - 1 >= 0 && typeof _board[row - 1][col] !== \"undefined\"\n\t\t\t\t && row + 1 < _rows && typeof _board[row + 1][col] !== \"undefined\"){\n\t\t\t\t\t\n\t\t\t\t\tif(_board[row - 1][col] === _board[row][col] && _board[row + 1][col] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check left and right\n\t\t\t\tif(col - 1 >= 0 && typeof _board[row][col - 1] !== \"undefined\"\n\t\t\t\t && col + 1 < _cols && typeof _board[row][col + 1] !== \"undefined\"){\n\t\t\t\t\t\n\t\t\t\t\tif(_board[row][col - 1] === _board[row][col] && _board[row][col + 1] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// check diagonals\n\t\t\t\tif(col - 1 >= 0 && col + 1 < _cols && row - 1 >= 0 && row + 1 < _rows){\n\n\t\t\t\t\tif(typeof _board[row - 1][col - 1] !== \"undefined\"\n\t\t\t\t\t && typeof _board[row + 1][col + 1] !== \"undefined\"\n\t\t\t\t\t && _board[row - 1][col - 1] === _board[row][col] \n\t\t\t\t\t && _board[row + 1][col + 1] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if(typeof _board[row - 1][col + 1] !== \"undefined\"\n\t\t\t\t\t && typeof _board[row + 1][col - 1] !== \"undefined\"\n\t\t\t\t\t && _board[row - 1][col + 1] === _board[row][col] \n\t\t\t\t\t\t&& _board[row + 1][col - 1] === _board[row][col]) {\n\t\t\t\t\t\t_winnerFound = true;\n\t\t\t\t\t\t_winner = _board[row][col];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// if winner was found, then break out of loop\n\t\t\tif(_winnerFound) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "checkWin(c){\n if ((arr[0][0]==c && arr[0][1]==c && arr[0][2]==c)\n || (arr[1][0]==c && arr[1][1]==c && arr[1][2]==c)\n || (arr[2][0]==c && arr[2][1]==c && arr[2][2]==c)\n || (arr[0][0]==c && arr[1][0]==c && arr[2][0]==c)\n || (arr[0][1]==c && arr[1][1]==c && arr[2][1]==c)\n || (arr[0][2]==c && arr[1][2]==c && arr[2][2]==c)\n || (arr[0][0]==c && arr[1][1]==c && arr[2][2]==c)\n || (arr[0][2]==c && arr[1][1]==c && arr[2][0]==c)){\n\n if(c=='x')\n {\n console.log(\"Player won\");\n } \n else {\n console.log(\"System won\");\n }\n showGame();\n check=false;\n }\n\n }", "function botMoveChecker(winCondition, player, decision){\n for (var i = 0; i < winCondition.length; i++)\n {\n var winningComb = winCondition[i].filter(function(value){\n return player.indexOf(value) != -1;\n })\n\n var winningMove = winCondition[i].filter(function(value){\n return player.indexOf(value) == -1;\n })\n\n var winningMoveNewIndex = getNewIndex(winningMove[0]);\n\n if (winningComb.length == 2 && !areaTaken(winningMoveNewIndex))\n {\n return fatalBlow = winningMove;\n break;\n }\n\n // Decision is true when player makes trap/odd moves\n if (decision && winningComb.length == 1)\n {\n var moveOne = Math.abs(botMoves.last() - winningMove[0]);\n var moveTwo = Math.abs(botMoves.last() - winningMove[1]);\n var winningComb = getNewIndex(winningComb[0]);\n var winningMoveOne = winningMove[0];\n var winningMoveTwo = winningMove[1];\n\n var moveToTake = moveOne > moveTwo ? winningMove[0] : winningMove[1];\n if (areaTaken(winningComb) && !areaTaken(winningMoveOne) && !areaTaken(winningMoveTwo))\n {\n // Hacky solution to bot's only weakness\n var indexOne = getNewIndex(1);\n var indexEight = getNewIndex(8);\n\n fatalBlow = (areaTaken(indexOne) && areaTaken(indexEight) && gameBoard.length == 5) ? 6 : moveToTake;\n break;\n }\n else if (areaTaken(winningMoveOne) && areaTaken(winningMoveTwo))\n {\n var indexThree = getNewIndex(3);\n fatalBlow = areaTaken(indexThree) ? 1 : 3\n }\n }\n }\n }", "function CheckWin(plays) {\n\t\tif (oplays.length + xplays.length == 9) {\n\t\t\tconsole.log(\"DRAW!\");\n\t\t\treturn true;\n\t\t}\n\t\t\treturn false;\n\t}", "function checkForWinner(move) {\n\t\tvar result = false;\n\t\tif (checkRow(1,2,3, move) || \n\t\t\tcheckRow(4,5,6, move) || \n\t\t\tcheckRow(7,8,9, move) ||\n\t\t\tcheckRow(1,4,7, move) ||\n\t\t\tcheckRow(2,5,8, move) ||\n\t\t\tcheckRow(3,6,9, move) ||\n\t\t\tcheckRow(1,5,9, move) ||\n\t\t\tcheckRow(3,5,7, move)) {\n\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}", "function checkForWin() {\n\n var d = $vast.MathUtil.getPointDistance(mainPlayer.x, mainPlayer.y, goal.x, goal.y);\n if (d <= 1) {\n mainPlayer.setPosition(64, 64);\n }\n }", "function _checkWin() {\n\t//add X to score\n\t_score += 50;\n\t_bossScore += 50;\n\t$score.text(_score);\n\n\t_hideItems();\n\tvar newCutScene = '<div class=\"cutSceneBg\"></div>';\n\t$('.gameboard').append(newCutScene);\n\tvar newVid = _cutSceneVids[_currentCharger - 1];\n\t$('.cutSceneBg').append(newVid);\n\t$('.cutSceneBg').fadeIn('fast');\n\t$('.cutScene')[0].play();\n\t_clockRate = 0;\n\t$('.cutScene')[0].addEventListener('ended', function() {\n\t\t$('.cutScene')[0].removeEventListener('ended');\n\t\t$('.cutSceneBg').fadeOut('fast', function() {\n\t\t\tvar left = 'only ' + (_numChargers - _currentCharger + 1) + ' chargers left!';\n\t\t\t$game.statusUpdate({message:left,input:'status',screen: true,log:false});\n\t\t\t_clockRate = 1;\n\t\t\t$('.cutSceneBg').remove();\n\t\t});\n\t\tif(_currentCharger >= 4 && _bossScore === 200) {\n\t\t\t_pause = true;\n\t\t\t_currentSlide = 4;\n\t\t\t_addContent();\n\t\t\t$bossArea.show();\n\t\t} else {\n\t\t\t_placeCharger();\n\t\t}\n\t});\n}", "function check_win() {\n var moved = false;\n check_counts(\"O\"); //gets the counts of O's to see if can win\n\n if (countdiag1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + i);\n }\n }\n if (countdiag2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 2 + 2);\n }\n }\n\n if (countcol0 == 2) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3);\n }\n }\n if (countcol1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 1);\n }\n }\n if (countcol2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i * 3 + 2);\n }\n }\n if (countrow0 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(i);\n }\n }\n if (countrow1 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(3 + i);\n }\n }\n if (countrow2 == 2 && !moved) {\n for (i = 0; i < 3; i++) {\n moved = take_space(6 + i);\n }\n }\n return moved;\n}", "checkWin() {\n let i = this.character.y / BLOCK_SIZE;\n let j = this.character.x / BLOCK_SIZE;\n if (this.blocks[i][j] instanceof ExitBlock && this.bugs.length === 0) {\n this.setGameWon();\n return;\n }\n }", "function checkWhoWins()\r\n{\r\n var winCount = 0;\r\n\r\n if(blankSpot.up == null)\r\n winCount++;\r\n else\r\n {\r\n if(!isMyTurn(Board[blankSpot.up].state) )\r\n winCount++;\r\n }\r\n\r\n if(blankSpot.down == null)\r\n winCount++;\r\n else\r\n {\r\n if(!isMyTurn(Board[blankSpot.down].state) )\r\n winCount++;\r\n }\r\n\r\n if(blankSpot.right == null)\r\n winCount++;\r\n else\r\n {\r\n if(!isMyTurn(Board[blankSpot.right].state) )\r\n winCount++;\r\n }\r\n\r\n if(blankSpot.left == null)\r\n winCount++;\r\n else\r\n {\r\n if(!isMyTurn(Board[blankSpot.left].state) )\r\n winCount++;\r\n }\r\n if(winCount == 4)\r\n {\r\n setTimeout(function(){\r\n alert(notTurn()+\" WINS!\");\r\n }, 100);\r\n return true;\r\n }\r\n return false;\r\n}", "function checkForWin() {\n // Create a loop through all the board cells\n for (var i = 0; i < board.cells.length; i++) {\n // If there is a mine and it hasn't been flagged exit loop\n if (board.cells[i].isMine === true && board.cells[i].isMarked === false)\n return;\n\n // if every mine is marked but there are still cells hidden exit loop\n if (board.cells[i].isMine === false && board.cells[i].hidden === true)\n return;\n }\n\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!');\n}", "function checkWin() {\n checkCombination(button1, button2, button3);\n checkCombination(button4, button5, button6);\n checkCombination(button7, button8, button9);\n checkCombination(button1, button4, button7);\n checkCombination(button2, button5, button8);\n checkCombination(button3, button6, button9);\n checkCombination(button1, button5, button9);\n checkCombination(button3, button5, button7);\n }", "checkForWin() {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n const _win = cells =>\n cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.height &&\n x >= 0 &&\n x < this.width &&\n this.board[y][x] === this.currPlayer\n );\n\n\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n // get \"check list\" of 4 cells (starting here) for each of the different\n // ways to win\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n // find winner (only checking each win-possibility as needed)\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n }", "function checkForWin() {\n var hiddenBlanks = 0;\n var unMarkedMines = 0;\n\n for(var b = 0; b < board.cells.length; b++){\n if(board.cells[b].hidden == true && board.cells[b].isMine == false){\n hiddenBlanks++;}\n if(board.cells[b].isMine == true && board.cells[b].isMarked == false){\n unMarkedMines++;}\n }\n if(hiddenBlanks == 0 && unMarkedMines == 0){\n lib.displayMessage('You win!');\n }\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n for (let y = 0; y < HEIGHT; y++) { // loops through columns\n for (let x = 0; x < WIDTH; x++) { // loops through rows\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]]; // coordinates assigned to this constant will check for a horizontal win\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]]; // coordinates assigned to this constant will check for a vertical win\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]]; // coordinates assigned to this constant will check for a diagonal win moving to the right\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]]; // coordinates assigned to this constant will check for a diagonal win moving to the left\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) { // if any of the coordinates pass _win(), then the game is over.\n return true;\n }\n }\n }\n}", "function checkForWinner(move) {\n\tvar result = false;\n\tif (checkRow(1, 2, 3, move) || checkRow(4, 5, 6, move) ||\n\t\tcheckRow(7, 8, 9, move) || checkRow(1, 4, 7, move) ||\n\t\tcheckRow(2, 5, 8, move) || checkRow(3, 6, 9, move) ||\n\t\tcheckRow(1, 5, 9, move) || checkRow(3, 5, 7, move)) {\n\n\t\tresult = true;\n\t};\n\treturn result;\n}", "function winDetection(item) {\n\n //keep track of moves to determine a draw\n moveCount++\n\n //id of the current item\n var itemId = $(item).attr(\"id\");\n\n //store the current counter\n var counter = $(item).attr(\"data-counter\"); // e.g. X / O\n\n //possible winning combinations based on counter location\n var winningCombos = {\n \"one\": [[\"two\", \"three\"], [\"five\", \"nine\"], [\"four\", \"seven\"]],\n \"two\": [[\"one\", \"three\"], [\"five\",\"eight\"]],\n \"three\": [[\"one\", \"two\"], [\"five\", \"seven\"], [\"six\", \"nine\"]],\n \"four\": [[\"one\", \"seven\"], [\"five\",\"six\"]],\n \"five\": [[\"four\", \"six\"], [\"two\", \"eight\"], [\"one\", \"nine\"], [\"three\",\"seven\"]],\n \"six\": [[\"three\", \"nine\"], [\"four\", \"five\"]],\n \"seven\": [[\"one\", \"four\"], [\"three\", \"five\"], [\"eight\", \"nine\"]],\n \"eight\": [[\"seven\", \"nine\"],[\"two\", \"five\"]],\n \"nine\": [[\"three\",\"six\"], [\"seven\",\"eight\"], [\"one\", \"five\"]]\n }\n\n var winner = false;\n\n winningCombos[itemId].forEach(function(item){\n\n if ( $(\"#\" + item[0]).attr(\"data-counter\") === counter && $(\"#\" + item[1]).attr(\"data-counter\") === counter ) {\n\n\n winner = true;\n\n // $(\"#\" + itemId).addClass(\"canvas-result\");\n // $(\"#\" + item[0]).addClass(\"canvas-result\");\n // $(\"#\" + item[1]).addClass(\"canvas-result\");\n\n gameBoard.hide();\n gameEnd = true;\n\n if (counter === playerCounter) {\n resultText.text(\"Winner!\").addClass(\"win\").removeClass(\"lose draw\");\n\n } else {\n resultText.text(\"Sorry, you lost!\").addClass(\"lose\").removeClass(\"win draw\");\n }\n\n return true;\n\n }\n\n return false;\n });\n\n if (moveCount === 9) {\n gameBoard.hide();\n gameEnd = true;\n\n resultText.text(\"It's a draw!\").addClass(\"draw\").removeClass(\"lose win\");\n resultsContainer.slideToggle(600);\n\n } else if (winner) {\n resultsContainer.slideToggle(600);\n }\n\n\n }", "checkWin() {\n let field = this.state.fields;\n if(field[0] != null) {\n if (\n this.areEqual(field[0], field[1], field[2]) ||\n this.areEqual(field[3], field[4], field[5]) ||\n this.areEqual(field[6], field[7], field[8]) ||\n this.areEqual(field[0], field[3], field[6]) ||\n this.areEqual(field[1], field[4], field[7]) ||\n this.areEqual(field[2], field[5], field[8]) ||\n this.areEqual(field[0], field[4], field[8]) ||\n this.areEqual(field[2], field[4], field[6])\n ) {\n this.setState({\n win: true\n });\n } \n }\n\n //Hide 'next turn' information\n if(this.state.counter === 9) {\n this.setState({\n hidden: 'none'\n })\n }\n }", "function winChecker () {\n for (let subCombo of winCombo) {\n let xCount = 0; // count of 3 signifies win \n let oCount = 0;\n for (let num of subCombo) {\n if (xLog.includes(num)) {\n xCount = xCount + 1;\n } else if (oLog.includes(num)){\n oCount = oCount + 1; \n }\n }\n console.log('half way through win check func')\n if (xCount == 3) {\n gameStatus.textContent = playerNameX + \" wins!\";\n showWin(subCombo);\n setTimeout(() => {location.reload(); }, 1500)\n } else if (oCount == 3) {\n gameStatus.textContent = playerNameO + \" wins!\";\n setTimeout(() => {location.reload(); }, 1500);\n showWin(subCombo);\n } else if (moveCount.length === 9) {\n gameStatus.textContent = \"It's a draw\";\n setTimeout(() => {location.reload(); }, 1500);\n } \n }\n}", "checkForWin() {\n const _win = (cells) => {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.HEIGHT &&\n x >= 0 &&\n x < this.WIDTH &&\n this.board[y][x] === this.currPlayer\n );\n };\n\n for (let y = 0; y < this.HEIGHT; y++) {\n for (let x = 0; x < this.WIDTH; x++) {\n // get \"check list\" of 4 cells (starting here) for each of the different\n // ways to win\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n // find winner (only checking each win-possibility as needed)\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n }", "function checkRoundWinner() {\n var activePlayer = players[activePlayerIndex];\n var boardScores = getCurrentBoardRowScores();\n var winningScoreValue = activePlayer.scorePoints * 3;\n var isWinningCombination = boardScores.indexOf(winningScoreValue) > 0;\n\n if (isWinningCombination) {\n activePlayer.winningRounds++;\n return $(document).trigger('roundWinner', activePlayer);\n } else {\n return boardHasEmptySpaces() ? switchActivePlayer() : setTimeout(clearBoard, 800);\n }\n}", "function winCheck (){\n var winCombos = [\n [0,1,2],\n [3,4,5],\n [6,7,8],\n [0,3,6],\n [1,4,7],\n [2,5,8],\n [0,4,8],\n [2,4,6]\n ]\n\n //win check\n for (var i=0; i < winCombos.length; i++) {\n var winCombo = winCombos[i]\n // if (board !== (winCombos[0,1,2,3,4,5,6,7])){\n var square1 = board[winCombo[0]]\n var square2 = board[winCombo[1]]\n var square3 = board[winCombo[2]]\n console.log(square1, square2, square3)\n\n if (square1 !== '' && square1 === square2 && square2 === square3){\n win = square1\n }\n\n }\n\n // tie check\n if (!win) {\n tie = true\n for (var i=0; i < board.length; i++) {\n if(board[i] === '') {\n tie = false\n }\n\n }\n }\n\n }", "function winCheck() {\n //win conditions: 3 vertical, 3 horizontal, or 3 diagonal\n if ((cell1.innerHTML == 'X' && cell2.innerHTML == 'X' && cell3.innerHTML == 'X') || (cell4.innerHTML == 'X' &&\n cell5.innerHTML =='X' && cell6.innerHTML == 'X') || (cell7.innerHTML == 'X' && cell8.innerHTML == 'X' &&\n cell9.innerHTML == 'X') || (cell1.innerHTML == 'X' && cell4.innerHTML == 'X' && cell7.innerHTML == 'X') ||\n (cell2.innerHTML == 'X' && cell5.innerHTML == 'X' && cell8.innerHTML == 'X') || (cell3.innerHTML == 'X' &&\n cell6.innerHTML == 'X' && cell9.innerHTML == 'X') || (cell1.innerHTML == 'X' && cell5.innerHTML == 'X' &&\n cell9.innerHTML == 'X') || (cell3.innerHTML == 'X' && cell5.innerHTML == 'X' && cell7.innerHTML == 'X')) {\n //displays the message to the victor\n log(\"Congratulations, player 1(X) has won. Please refresh the page to start again.\");\n document.getElementById('game-board').style.pointerEvents = 'none';\n return;\n } else if ((cell1.innerHTML == 'O' && cell2.innerHTML == 'O' && cell3.innerHTML == 'O') ||\n (cell4.innerHTML == 'O' && cell5.innerHTML =='O' && cell6.innerHTML == 'O') || (cell7.innerHTML == 'O' &&\n cell8.innerHTML == 'O' && cell9.innerHTML == 'O') || (cell1.innerHTML == 'O' && cell4.innerHTML == 'O' &&\n cell7.innerHTML == 'O') || (cell2.innerHTML == 'O' && cell5.innerHTML == 'O' && cell8.innerHTML == 'O') ||\n (cell3.innerHTML == 'O' && cell6.innerHTML == 'O' && cell9.innerHTML == 'O') || (cell1.innerHTML == 'O' &&\n cell5.innerHTML == 'O' && cell9.innerHTML == 'O') || (cell3.innerHTML == 'O' &&\n cell5.innerHTML == 'O' && cell7.innerHTML == 'O')) {\n //disables each table cell click event\n document.getElementById('game-board').style.pointerEvents = 'none';\n log(\"Congratulations, player 2(O) has won. Please refresh the page to start again.\");\n return;\n //if there is a tie, will display this message\n } else if (moveCount >= 9) {\n log(\"Tie, please refresh the page.\");\n document.getElementById('game-board').style.pointerEvents = 'none';\n return;\n }\n}", "checkForWin() {\n if (!this.grid.lastPlacedChip) {\n return;\n }\n const connections = this.grid.getConnections({\n baseChip: this.grid.lastPlacedChip,\n minConnectionSize: Game.winningConnectionSize\n });\n if (connections.length > 0) {\n // Mark chips in only the first winning connection, and only mark the\n // first four chips of this connection (since only a connect-four is\n // needed to win\n connections[0].length = Game.winningConnectionSize;\n connections[0].forEach((chip) => {\n chip.winning = true;\n });\n this.winner = this.grid.lastPlacedChip.player;\n this.winner.score += 1;\n this.emit('game:declare-winner', this.winner);\n this.endGame();\n }\n }", "function check() {\n if (playerOrder[playerOrder.length - 1] !== order[playerOrder.length - 1])\n good = false;\n\n if (playerOrder.length == 6 && good) {\n winGame();\n }\n /*------------If wrong answers----------*/\n if (good == false) {\n flashColor();\n turnCounter.innerHTML = \"NO!\";\n setTimeout(() => {\n play();\n\n }, 800);\n\n noise = false;\n }\n /*------------If good answer but not win game move to the other level----------*/\n if (turn == playerOrder.length && good && !win) {\n turn++;\n playerOrder = [];\n compTurn = true;\n flash = 0;\n turnCounter.innerHTML = turn;\n intervalId = setInterval(gameTurn, 800);\n }\n\n}", "function checkForWinner(move) {\r\n var result = false;\r\n if (checkRow(1, 2, 3, move) || checkRow(4, 5, 6, move) || checkRow(7, 8, 9, move) || checkRow(1, 4, 7, move) || checkRow(2, 5, 8, move) || checkRow(3, 6, 9, move) || checkRow(1, 5, 9, move) || checkRow(3, 5, 7, move)) {\r\n result = true;\r\n }\r\n return result;\r\n}", "function checkForWin() {\n var isWinner = true\n\n for (let i = 0; i < board.cells.length; i++) {\n var cell = board.cells[i]\n\n if (cell.isMine && !cell.isMarked || cell.hidden && !cell.isMine) {\n isWinner = false\n }\n }\n\n if (isWinner) {\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n lib.displayMessage('You win!');\n winAudio.play();\n }\n}", "function winnerCheck(move) {\r\n var flag = false;\r\n if (checkRow(1, 2, 3, move) ||\r\n checkRow(4, 5, 6, move) ||\r\n checkRow(7, 8, 9, move) ||\r\n checkRow(1, 4, 7, move) ||\r\n checkRow(2, 5, 8, move) ||\r\n checkRow(3, 6, 9, move) ||\r\n checkRow(1, 5, 9, move) ||\r\n checkRow(3, 5, 7, move)) {\r\n flag = true;\r\n }\r\n return flag;\r\n}", "function winCheck() {\n\n // Traverses the entire grid and checks for any discrepancy between the current grid and the answer grid, if there is then the player has not won yet\n for (var row = 0; row < 9; row++) {\n for (var col = 0; col < 9; col++) {\n if (grid[row][col].textContent != answerGrid[row][col]) {\n return false;\n }\n }\n }\n return true;\n}", "function checkWin() {\n var i,x,y,v;\n for(i=0; i<81; i++) {\n x = parseInt(spaces[i].dataset.x, 10);\n y = parseInt(spaces[i].dataset.y, 10);\n v = spaces[i].value;\n if ( !v || !valid(x, y, v)) {\n return;\n }\n }\n sudoku.classList.add('winner');\n }", "function checkWinner() {\n\tlet arrOfX = [];\n\tlet arrOfO = [];\n\ttd.map((curr, index) => {\n\t\tcurr = curr.innerHTML;\n\t\tif (curr === 'X') {\n\t\t\tarrOfX.push(index);\n\t\t} else if (curr === 'O') {\n\t\t\tarrOfO.push(index);\n\t\t}\n\t});\n\n\tfor (let i = 0; i < winCombo.length; i++) {\n\t\tif (arrOfX.length >= 3 && winCombo[i].every((elem) => arrOfX.indexOf(elem) > -1)) {\n\t\t\tendGame = true;\n\t\t\tplScore.innerHTML = Number(plScore.innerHTML) + 1;\n\t\t\tmsgPl.style.opacity = 1;\n\t\t\tbreak;\n\t\t} else if (arrOfO.length >= 3 && winCombo[i].every((elem) => arrOfO.indexOf(elem) > -1)) {\n\t\t\tendGame = true;\n\t\t\taiScore.innerHTML = Number(aiScore.innerHTML) + 1;\n\t\t\tendGameChecker();\n\t\t\tmsgAi.style.opacity = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (arrOfX.length === 5 && arrOfO.length === 4) {\n\t\tif (!endGame) {\n\t\t\tdrScore.innerHTML = Number(drScore.innerHTML) + 1;\n\t\t\tmsgDr.style.opacity = 1;\n\t\t}\n\t}\n}", "checkForWin() {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n const _win = cells =>\n cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < this.height &&\n x >= 0 &&\n x < this.width &&\n this.board[y][x] === this.currPlayer\n );\n\n for (let y = 0; y < this.height; y++) {\n for (let x = 0; x < this.width; x++) {\n // get \"check list\" of 4 cells (starting here) for each of the different\n // ways to win\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n // find winner (only checking each win-possibility as needed)\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n }", "function checkForWin() {\n // define a win\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n // if the y and x coordinates are vaild playable coordinates within the grid return true else return false\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // TODO: read and understand this code. Add comments to help you.\n // determining a win with four of the same pieces vertically, horizonally, diagDR, diagDL\n for (let y = 0; y < HEIGHT; y++) {\n for (let x = 0; x < WIDTH; x++) {\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "function checkWin() {\n var tieGame = true;\n\n for (var combo in lines) {\n if (lines[combo].length === 3) {\n if (lines[combo][0] === lines[combo][1] && lines[combo][1] === lines[combo][2]) {\n winner = lines[combo][0];\n setTimeout(endOfGame(winner + ' won the game!'), 700);    \n tieGame = false;\n win = true;\n         canMove = false;      \n }\n } else {\n tieGame = false;\n }\n }\n if (tieGame) {\n setTimeout(endOfGame('It was a Tie Game!'), 700);\n win = true;\n     canMove = false;  \n }\n }", "function winChecker(gameField){\r\n if (gameField[0][0] === gameField[0][1] && gameField[0][1] === gameField[0][2] && gameField[0][0] != \"\" ) {\r\n document.getElementById('winner').innerHTML = gameField[0][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n\r\n if (gameField[1][0] === gameField[1][1] && gameField[1][1] === gameField[1][2] && gameField[1][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[1][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n\r\n if (gameField[2][0] === gameField[2][1] && gameField[2][1] === gameField[2][2] && gameField[2][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[2][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][0] === gameField[1][0] && gameField[1][0] === gameField[2][0] && gameField[0][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][1] === gameField[1][1] && gameField[1][1] === gameField[2][1] && gameField[0][1] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][1] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][2] === gameField[1][2] && gameField[1][2] === gameField[2][2] && gameField[0][2] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][2] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][0] === gameField[1][1] && gameField[1][1] === gameField[2][2] && gameField[0][0] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][0] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n if (gameField[0][2] === gameField[1][1] && gameField[1][1] === gameField[2][0] && gameField[0][2] != \"\") {\r\n document.getElementById('winner').innerHTML = gameField[0][2] + \" wins!\";\r\n disableAllbuttons();\r\n showButton(\"new_game\");\r\n return true;\r\n }\r\n return false;\r\n}", "function checkWin(x, y, player) {\r\n\t//on part du principe que l'on gagne\r\n\tvar verticalWin = true;\r\n\tvar horizontalWin = true;\r\n\tvar diagonaleDroite = true;\r\n\tvar diagonaleGauche = true;\r\n\tvar egality = true;\r\n\t\r\n\tfor(i=0; i<3; i++) {\r\n\t\tif(morpion[x][i] != player) {verticalWin = false};\r\n\t\tif(morpion[i][y] != player) {horizontalWin = false};\r\n\t\tif(morpion[i][i] != player) {diagonaleGauche = false};\r\n\t\tif(morpion[2-i][i] != player) {diagonaleDroite = false};\r\n\t\tfor(j=0; j<3; j++) {if(morpion[i][j] == 0) {egality = false}}; //tant que toutes les cases ne sont pas joués egalité possible\r\n\t}\r\n\t\r\n\tif(verticalWin || horizontalWin || diagonaleDroite || diagonaleGauche){ //si gagné\r\n\t\tgameEnded(player); \r\n\t} else if(egality) { //sinon si egalité\r\n\t\tgameEnded(0)\r\n\t};\r\n}", "function checkForWin() {\n\t// check four cells to see if they're all color of current player\n\t// • cells: list of four (y, x) cells\n\t// • returns true if all are legal coordinates & all match currPlayer\n\tfunction _win(cells) {\n\t\treturn cells.every(([y, x]) =>\n\t\t\ty >= 0 &&\n\t\t\ty < HEIGHT &&\n\t\t\tx >= 0 &&\n\t\t\tx < WIDTH &&\n\t\t\tboard[y][x] === currPlayer\n\t\t);\n\t}\n\n\tfor (let y = 0; y < HEIGHT; y++) {\n\t\tfor (let x = 0; x < WIDTH; x++) {\n\t\t\t// get \"check list\" of 4 cells (starting here) for each of the different ways to win\n\t\t\tconst horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n\t\t\tconst vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n\t\t\tconst diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n\t\t\tconst diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n\n\t\t\t// find winner (only checking each win-possibility as needed)\n\t\t\tif (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) return true;\n\t\t}\n\t}\n}", "checkWinner(move) \n {\n let result = false;\n if (this.checkRow(1, 2, 3, move) || \n this.checkRow(4, 5, 6, move) ||\n this.checkRow(7, 8, 9, move) ||\n this.checkRow(1, 4, 7, move) ||\n this.checkRow(2, 5, 8, move) ||\n this.checkRow(3, 6, 9, move) ||\n this.checkRow(1, 5, 9, move) ||\n this.checkRow(3, 5, 7, move)) \n {\n result = true;\n }\n\n return result;\n }", "function checkForWin(movesArray, name){\n\t// Loop over the array for winning combinations\n\tfor (i = 0; i < winningCombinations.length; i++) {\n\t\t// reset the winCounter each time\n\t\twinCounter = 0;\n\t\t// loop over each individual array\n\t\tfor (var j = 0; j < winningCombinations[i].length; j++) {\n\t\t\t// If the number in the winning array (?) is a number, add to the winCounter\n\t\t\t if(movesArray.indexOf(winningCombinations[i][j]) !== -1){\n\t\t\t\twinCounter++; \n\t\t\t}\n\t\t\t// If the win counter gets to three, the game is over.\n\t\t\t// QUESTION - It looks like three wins does not communicate X or Y\n\t\t\tif(winCounter === 3) {\n\t\t\t\t// Alert with who wins\n\t\t\t\talert('Game over, ' + name + 'wins!'); \n\t\t\t\t// Clear board\n\t\t\t\tresetBoard(); \n\t\t\t}\n\t\t}\n\t}\n}", "function checkWin() {\n if (currentSquare === finishPoint) {\n gameState = false;\n changeAllSquareColor('green');\n gameRound += 1;\n\n $('.displayRound').text(\"Round: \" + gameRound)\n\n $('.sidePannel').css(\"margin\", \"100px 0px\")\n\n resetGame();\n };\n}", "function checkWinningCondition() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\toverlay();\n\t} else {\n\t\treturn false;\n\t}\n}", "function win() {\n\t\"use strict\";\n \n\t//horizontal checks\n\tif (arrayofmoves[1] === arrayofmoves[2] && arrayofmoves[2] === arrayofmoves[3]) {\n\t\twinprint();\n\t} else if (arrayofmoves[4] === arrayofmoves[5] && arrayofmoves[5] === arrayofmoves[6]) {\n\t\twinprint();\n\t} else if (arrayofmoves[7] === arrayofmoves[8] && arrayofmoves[8] === arrayofmoves[9]) {\n\t\twinprint();\n\t\n\t\n\t//vertical checks\n } else if (arrayofmoves[1] === arrayofmoves[4] && arrayofmoves[4] === arrayofmoves[7]) {\n\t\twinprint();\n\t} else if (arrayofmoves[2] === arrayofmoves[5] && arrayofmoves[5] === arrayofmoves[8]) {\n\t\twinprint();\n\t} else if (arrayofmoves[3] === arrayofmoves[6] && arrayofmoves[6] === arrayofmoves[9]) {\n\t\twinprint();\n\t\n\t\n\t//diagonal checks\n } else if (arrayofmoves[1] === arrayofmoves[5] && arrayofmoves[5] === arrayofmoves[9]) {\n\t\twinprint();\n\t} else if (arrayofmoves[3] === arrayofmoves[5] && arrayofmoves[5] === arrayofmoves[7]) {\n\t\twinprint();\n\t}\n}", "function checkPossibleMoves()\n{\n\tif(squares[0].innerHTML && squares[1].innerHTML && squares[2].innerHTML && squares[3].innerHTML &&\n\tsquares[4].innerHTML && squares[5].innerHTML && squares[6].innerHTML && squares[7].innerHTML && squares[8].innerHTML){\n\t\treturn true;\n\t}\n}", "function checkWin(currentPlayer) {\n return winCombos.some((combination) => {\n return combination.every((index) => {\n return SQUARES[index].classList.contains(currentPlayer.getSign());\n });\n });\n }", "function checkWin(player, cpu) {\n if (moveSet.length === 0){\n $(\"#winner\").html(\"<h1>It's a Tie</h1>\");\n $(\"#gameOver\").show();\n $(\"#board\").hide();\n }\n var winConditions = [[1,2,3],[4,5,6],[7,8,9],[1,4,7],[2,5,8],[3,6,9],[1,5,9],[3,5,7]];\n for (var j = 0;j < winConditions.length; j++){\n if (containsAll(winConditions[j],player) === true){\n $(\"#winner\").html(\"<h1>Player Wins</h1>\");\n $(\"#gameOver\").show();\n $(\"#board\").hide();\n }\n };\n for (var j = 0;j < winConditions.length; j++){\n if (containsAll(winConditions[j],cpu) === true){\n $(\"#winner\").html(\"<h1>CPU Wins</h1>\");\n $(\"#gameOver\").show();\n $(\"#board\").hide();\n }\n };\n function containsAll(needles, haystack){\n for(var i = 0; i < needles.length; i++){\n if($.inArray(needles[i], haystack) == -1) {\n return false;\n }\n }\n return true;\n };\n }", "function isWinningMove() {\n var hori = count(0, -1) + count(0, 1) - 1;\n var vert = count(-1, 0) + count(1, 0) - 1;\n var diag = count(1, -1) + count(-1, 1) - 1;\n var antd = count(1, 1) + count(-1, -1) - 1;\n // console.log(\"horizontal: \" + hori);\n // console.log(\"vertical: \" + vert);\n // console.log(\"diagonal: \" + diag);\n // console.log(\"anti-diagonal: \" + antd);\n if (hori >=4 | vert >= 4 | diag >= 4 | antd >= 4) {\n return true;\n }\n else return false;\n }", "function checkWin() {\n if (\n cells[0].textContent === cells[1].textContent &&\n cells[1].textContent === cells[2].textContent &&\n cells[0].textContent === cells[2].textContent &&\n cells[0].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\"; \n \n } else if (\n cells[3].textContent === cells[4].textContent &&\n cells[4].textContent === cells[5].textContent &&\n cells[3].textContent === cells[5].textContent &&\n cells[3].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n }\n // all other win combos\n else if (\n cells[6].textContent === cells[7].textContent &&\n cells[7].textContent === cells[8].textContent &&\n cells[6].textContent === cells[8].textContent &&\n cells[6].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[0].textContent === cells[3].textContent &&\n cells[3].textContent === cells[6].textContent &&\n cells[0].textContent === cells[6].textContent &&\n cells[0].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[1].textContent === cells[4].textContent &&\n cells[4].textContent === cells[7].textContent &&\n cells[1].textContent === cells[7].textContent &&\n cells[1].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[2].textContent === cells[5].textContent &&\n cells[5].textContent === cells[8].textContent &&\n cells[2].textContent === cells[8].textContent &&\n cells[2].textContent !== \"\"\n ) {\n console.log('You Won!'); \n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n //return winningMsg.innerText = \"It's a draw\";\n } else if (\n cells[0].textContent === cells[4].textContent &&\n cells[4].textContent === cells[8].textContent &&\n cells[4].textContent === cells[8].textContent &&\n cells[0].textContent !== \"\"\n ) {\n //return winningMsg.innerText = nonActivePlayer + \" won!\";\n console.log('You Won!'); \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n } else if (\n cells[2].textContent === cells[4].textContent &&\n cells[4].textContent === cells[6].textContent &&\n cells[2].textContent === cells[6].textContent &&\n cells[2].textContent !== \"\"\n ) {\n console.log('You Won!');\n //return winningMsg.innerText = nonActivePlayer + \" won!\"; \n } else if (turnCounter === 9) {\n console.log(\"It's a draw\");\n }\n }", "function getWinningMove() {\n var winPos = false;\n var opPos = false;\n //console.log(possibleWins);\n //console.log(possibleWinsOp);\n\n //This loop analyses if the AI has two consecutive Os\n for (var i = 0; i < possibleWinsOp.length; i++) {\n for (var j = 0; j < oponentStack.length; j++) {\n possibleWinsOp[i] = possibleWinsOp[i].filter(function(value) {\n return value !== oponentStack[j];\n })\n }\n\n if (possibleWinsOp[i].length == 1 && possibleWinsOp[i][0] !== -1) {\n //console.log(\"Turning on opPos\");\n //console.log(possibleWinsOp);\n opPos = true;\n var draw = possibleWinsOp[i][0].toString().split(\"\");\n draw.push('#');\n draw = draw.reverse();\n //console.log(\"Drawing winning 0 at \" + draw);\n //console.log(possibleWinsOp);\n drawFigure(draw.join(\"\"), ai);\n\n //The oponent will have won the game when this happens\n //so prompt properly.\n alert(\"Lost brah.\");\n location.reload(false);\n }\n }\n\n //This for loop analyses if the oponent has two consecutive\n //Xs\n if (!opPos) {\n var replacer = -2;\n for (var i = 0; i < possibleWins.length; i++) {\n\n for (var j = 0; j < playStack.length; j++) {\n possibleWins[i] = possibleWins[i].filter(function(value) {\n return value !== playStack[j];\n })\n }\n\n if (possibleWins[i].length == 1 && possibleWins[i][0] !== -1) {\n replacer = possibleWins[i][0];\n //console.log(\"Turning on winPos\");\n //console.log(\"Winning combination \" + possibleWins[i]);\n //console.log(possibleWins);\n winPos = true;\n var draw = possibleWins[i][0].toString().split(\"\");\n oponentStack.push(possibleWins[i][0]);\n draw.push(\"#\");\n draw = draw.reverse();\n drawFigure(draw.join(\"\"), ai);\n\n //Now we are goign to mark this value as not a possible win.\n }\n\n }\n //Proper filter.\n for (var i = 0; i < possibleWins.length; i++) {\n for (var j = 0; j < possibleWins[i].length; j++) {\n if (possibleWins[i][j] === replacer) {\n possibleWins[i][j] = -1;\n }\n }\n }\n\n }\n\n //If there are no consecutive Xs or Os, just play wherever.\n if (!winPos && !opPos) {\n //console.log(\"No winning possibilities for each side.\");\n for (var i = 0; i < possibleWinsOp.length; i++) {\n if (possibleWinsOp[i].length == 2) {\n\n if (possibleWinsOp[i][0] !== -1) {\n var draw = possibleWinsOp[i][0].toString().split(\"\");\n oponentStack.push(possibleWinsOp[i][0]);\n draw.push('#');\n draw = draw.reverse();\n drawFigure(draw.join(\"\"), ai);\n break;\n\n } else if (possibleWinsOp[i][1] !== -1) {\n\n var draw = possibleWinsOp[i][1].toString().split(\"\");\n oponentStack.push(possibleWinsOp[i][1]);\n draw.push('#');\n draw = draw.reverse();\n drawFigure(draw.join(\"\"), ai);\n break;\n }\n\n }\n }\n }\n\n}", "function check() {\n if (playerOrder[playerOrder.length - 1] !== order[playerOrder.length - 1])\n score = false;\n if (playerOrder.length == 20 && score) {\n winGame();\n }\n if (score == false) {\n flashColor();\n roundCount.innerHTML = \"NO!\";\n setTimeout(() => {\n roundCount.innerHTML = round;\n clearColor();\n\n if (strictButton) {\n play();\n } else {\n compRound = true;\n flash = 0;\n playerOrder = [];\n score = true;\n intervalId = setInterval(gameRound, 800);\n }\n }, 800);\n if (muteButton == false)\n muteButton = false;\n }\n if (round == playerOrder.length && score && !win) {\n round++;\n playerOrder = [];\n compRound = true;\n flash = 0;\n roundCount.innerHTML = round;\n intervalId = setInterval(gameRound, 800);\n }\n}", "function checkForWin() {\n let youWin = true;\n for (let i = 0; i < board.cells.length; i++) {\n if (board.cells[i].isMine === true && board.cells[i].ismarked === false) {\n youWin = false;\n }\n if (board.cells[i].isMine !== true && board.cells[i].hidden === true) {\n youWin = false;\n // console.log(youWin)\n }\n }\n // detected that they've won.\n if (youWin) {\n lib.displayMessage(\"You win!\");\n }\n}", "function checkIfPossibleWin(futureGridVals, checkSymbol) {\r\n return ((futureGridVals[0] == checkSymbol && futureGridVals[1] == checkSymbol && futureGridVals[2] == checkSymbol) ||\r\n (futureGridVals[3] == checkSymbol && futureGridVals[4] == checkSymbol && futureGridVals[5] == checkSymbol) ||\r\n (futureGridVals[6] == checkSymbol && futureGridVals[7] == checkSymbol && futureGridVals[8] == checkSymbol) ||\r\n (futureGridVals[0] == checkSymbol && futureGridVals[3] == checkSymbol && futureGridVals[6] == checkSymbol) ||\r\n (futureGridVals[1] == checkSymbol && futureGridVals[4] == checkSymbol && futureGridVals[7] == checkSymbol) ||\r\n (futureGridVals[2] == checkSymbol && futureGridVals[5] == checkSymbol && futureGridVals[8] == checkSymbol) ||\r\n (futureGridVals[0] == checkSymbol && futureGridVals[4] == checkSymbol && futureGridVals[8] == checkSymbol) ||\r\n (futureGridVals[2] == checkSymbol && futureGridVals[4] == checkSymbol && futureGridVals[6] == checkSymbol));\r\n}", "function check() {\n if (win(player)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (win(computer)) {\n playFlag = false;\n displayWinner();\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n } else if (\n (player.length == 5 && computerTurn === true) ||\n (computer.length == 5 && computerTurn === false)\n ) {\n playFlag = false;\n winner.innerHTML = 'Draw';\n setTimeout(() => {\n resetGame();\n }, 2000);\n return;\n }\n playGame();\n}", "function checkForWin (evt) {\n mineCount = 0 \n x = 0\n hiddenCount = 0\n\n for(let i = 0; i < board.cells.length; i ++){\n\n if(board.cells[i].isMine){ \n mineCount ++\n }\n if(board.cells[i].hidden ){\n x++\n hiddenCount = x\n }\n }\n\n for(let i = 0; i < board.cells.length; i ++){\n\n if (board.cells[i].isMarked != true && board.cells[i].isMine == true){\n return\n }\n\n if(board.cells[i].isMine != true && board.cells[i].hidden == true){\n return\n }\n }\n\n lib.displayMessage('You win!')\n\n\n\n // console.log(mineCount)\n // console.log(hiddenCount)\n\n // let foundCount = 0\n // for(let i = 0; i < board.cells.length; i ++){ \n\n // if (board.cells[i].isMarked == true && board.cells[i].isMine == true){\n // foundCount ++\n // }\n // if(foundCount == mineCount){\n // console.log(\"win\")\n\n // }\n // if(hiddenCount == mineCount ){\n // console.log(\"win\")\n // }\n \n // }\n\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\n // lib.displayMessage('You win!')\n}", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every( //check every cell on the board for a 1 or 2 (piece played)\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n for (var y = 0; y < HEIGHT; y++) { \n for (var x = 0; x < WIDTH; x++) {\n var horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]]; //horizonal win\n var vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]]; //vertical win\n var diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]]; //diagonal to the right win\n var diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]]; //diagonal to the left win\n\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) { //if any of these win situations are true, return true\n return true;\n }\n }\n }\n}", "function win()\n{\n //horizontal win checks\n if((boxes[0].val + boxes[1].val + boxes[2].val) == 3 || (boxes[0].val + boxes[1].val + boxes[2].val) == 15)\n {\n console.log('someone win');\n line(boxes[0].xpos,boxes[0].ypos+50,boxes[2].xpos+100,boxes[2].ypos+50)\n end = true;\n }\n if((boxes[3].val + boxes[4].val + boxes[5].val) == 3 || (boxes[3].val + boxes[4].val + boxes[5].val) == 15)\n {\n console.log('someone win');\n line(boxes[3].xpos,boxes[3].ypos+50,boxes[5].xpos+100,boxes[5].ypos+50)\n end = true;\n }\n if((boxes[6].val + boxes[7].val + boxes[8].val) == 3 || (boxes[6].val + boxes[7].val + boxes[8].val) == 15)\n {\n console.log('someone win');\n line(boxes[6].xpos,boxes[6].ypos+50,boxes[8].xpos+100,boxes[8].ypos+50)\n end = true;\n }\n \n //vertical win checks\n if((boxes[0].val + boxes[3].val + boxes[6].val) == 3 || (boxes[0].val + boxes[3].val + boxes[6].val) == 15)\n {\n console.log('someone win');\n line(boxes[0].xpos+50,boxes[0].ypos,boxes[6].xpos+50,boxes[6].ypos+100)\n end = true;\n }\n if((boxes[1].val + boxes[4].val + boxes[7].val) == 3 || (boxes[1].val + boxes[4].val + boxes[7].val) == 15)\n {\n console.log('someone win');\n line(boxes[1].xpos+50,boxes[1].ypos,boxes[7].xpos+50,boxes[7].ypos+100)\n end = true;\n }\n if((boxes[2].val + boxes[5].val + boxes[8].val) == 3 || (boxes[2].val + boxes[5].val + boxes[8].val) == 15)\n {\n console.log('someone win');\n line(boxes[2].xpos+50,boxes[2].ypos,boxes[8].xpos+50,boxes[8].ypos+100)\n end = true;\n }\n //diagonal win check \n if((boxes[0].val + boxes[4].val + boxes[8].val) == 3 || (boxes[0].val + boxes[4].val + boxes[8].val) == 15)\n {\n console.log('someone win');\n line(boxes[0].xpos,boxes[0].ypos,boxes[8].xpos+100,boxes[8].ypos+100)\n end = true;\n }\n if((boxes[2].val + boxes[4].val + boxes[6].val) == 3 || (boxes[2].val + boxes[4].val + boxes[6].val) == 15)\n {\n console.log('someone win');\n line(boxes[2].xpos+100,boxes[2].ypos,boxes[6].xpos,boxes[6].ypos+100)\n end = true;\n }\n \n \n}", "function checkWinner() {\n if (matchCount !== shapes.length) {\n\t\treturn;\n }\n\n\ttimer.stop();\n\n let ticks = timer.getTicks();\n let timeSpent = timer.getTime(ticks);\n MemoryStorage.setItem(Date.now(), ticks);\n\n showModal();\n}", "function checkWin(symb){\n\t\t\tconsole.dir(self.squares);\n\t\t\t//check if all squares occupied\n\t\t\tvar allSquaresTaken = self.squares.every(function(i){\n\t\t\t\treturn i.symbol !== \" \";\n\t\t\t});\n\t\t\t// check columns\n\t\t\tif((symb === self.squares[0].symbol && symb === self.squares[3].symbol && symb === self.squares[6].symbol) || (symb === self.squares[1].symbol && symb === self.squares[4].symbol && symb === self.squares[7].symbol) || (symb === self.squares[2].symbol && symb === self.squares[5].symbol && symb === self.squares[8].symbol)){\n\t\t\t\tself.stats.message = symb + \" wins!\";\n\t\t\t\tself.stats.gameEnd = true;\n\t\t\t\tself.stats.$save();\n\t\t\t}\n\t\t\t// check rows\n\t\t\telse if ((symb === self.squares[0].symbol && symb === self.squares[1].symbol && symb === self.squares[2].symbol) || (symb === self.squares[3].symbol && symb === self.squares[4].symbol && symb === self.squares[5].symbol) || (symb === self.squares[6].symbol && symb === self.squares[7].symbol && symb === self.squares[8].symbol)){\n\t\t\t\tself.stats.message = symb + \" wins!\";\n\t\t\t\tself.stats.gameEnd = true;\n\t\t\t\tself.stats.$save();\n\t\t\t}\n\t\t\t//check diagonals\n\t\t\telse if ((symb === self.squares[0].symbol && symb === self.squares[4].symbol && symb === self.squares[8].symbol) || (symb === self.squares[2].symbol && symb === self.squares[4].symbol && symb === self.squares[6].symbol)){\n\t\t\t\tself.stats.message = symb + \" wins!\";\n\t\t\t\tself.stats.gameEnd = true;\n\t\t\t\tself.stats.$save();\n\t\t\t}\n\t\t\t//check for tie\n\t\t\telse if (allSquaresTaken){\n\t\t\t\tself.stats.message = \"It's a tie!\";\n\t\t\t\tself.stats.gameEnd = true;\n\t\t\t\tself.stats.$save();\n\t\t\t}\n\t\t}//function checkWin END", "function checkWin(board, win){\n const first = board[win[0]];\n\n if(!first){\n return false;\n }\n for(let i = 1; i < win.length; i++){\n if(first !== board[win[i]]){\n return false;\n }\n }\n return true;\n}", "checkForWin() {\n const phraseList = document.querySelector('#phrase').firstElementChild.children;\n let correctGuesses = 0;\n for (let i=0; i<phraseList.length; i++) {\n if (phraseList[i].className === 'show') {\n correctGuesses += 0;\n } else if (phraseList[i].className === 'hide space') {\n correctGuesses += 0;\n } else {\n correctGuesses -= 1;\n }\n }\n if (correctGuesses === 0) {\n this.gameOver('win');\n }\n }", "function checkIfWin() {\n let isWon = true;\n arr.forEach((x) => {\n x.forEach((y) => {\n if (y.randomNum !== 0 && y.revealed === false) {\n isWon = false;\n }\n });\n });\n if (isWon) {\n setWin(true);\n setHeading(\":D CONGRATS! THERE`S NO BLOWIN YA! :D\");\n }\n }", "function win(){\n var wincheck = new Array();\n\n let row1 = arrSum(squares, 0, 3, 1);\n wincheck.push(row1)\n\n let row2 = arrSum(squares, 3, 6, 1);\n wincheck.push(row2)\n\n let row3 = arrSum(squares, 6, squares.length, 1);\n wincheck.push(row3)\n\n let col1 = arrSum(squares, 0, squares.length, 3);\n wincheck.push(col1)\n\n let col2 = arrSum(squares, 1, squares.length, 3);\n wincheck.push(col2)\n\n let col3 = arrSum(squares, 2, squares.length, 3);\n wincheck.push(col3)\n\n let dia1 = arrSum(squares, 0, squares.length, 4);\n wincheck.push(dia1)\n\n let dia2 = arrSum(squares, 2, squares.length-1, 2);\n wincheck.push(dia2)\n\n let owin = wincheck.filter(word => word == 0);\n let xwin = wincheck.filter(word => word == 3);\n\n let stat = document.getElementById('status');\n\n if (owin.length > 0 && xwin.length == 0){\n //console.log(\"Congratulations! O is the Winner!\")\n stat.textContent = \"Congratulations! O is the Winner!\";\n stat.classList.add('you-won');\n }\n\n else if (xwin.length > 0 && owin.length == 0){\n //console.log(\"Congratulations! X is the Winner!\")\n stat.textContent = \"Congratulations! X is the Winner!\";\n stat.classList.add('you-won');\n }\n\n else{\n //stat.textContent = \"Move your mouse over a square and click to play an X or an O.\";\n //stat.classList.remove('you-won');\n }\n}", "function isWin() {\n\t//only after the game has been started and shuffling that we judge\n\tif (gameon && shuffling) {\n\t\tfor (var i = 0; i < squares.length; i++) {\n\t\t\tif (squares[i].position !== squares[i].identity) return false;\n\t\t}\n\t\treturn true;\n\t}\n}", "function winConditions() {\n let notADraw = false;\n display();\n\n function compareVariables(a, b, c) {\n if (a === b && b === c && c === a) {\n if (a === AIside) {\n notADraw = true;\n AIWins();\n } else if (a === humanSide) {\n notADraw = true;\n playerWins();\n } else {\n return; // Do nothing\n }\n }\n }\n\n function testForDraw(movesQuantity) {\n if (movesQuantity === 9 && !notADraw) {\n drawItis();\n }\n }\n\n // Testing all win conditions\n compareVariables(arr[0], arr[1], arr[2]);\n compareVariables(arr[3], arr[4], arr[5]);\n compareVariables(arr[6], arr[7], arr[8]);\n compareVariables(arr[0], arr[3], arr[6]);\n compareVariables(arr[1], arr[4], arr[7]);\n compareVariables(arr[2], arr[5], arr[8]);\n compareVariables(arr[0], arr[4], arr[8]);\n compareVariables(arr[2], arr[4], arr[6]);\n // Checking if it is a draw\n testForDraw(moves);\n }", "function checkForWin(){\n let winner = document.createElement('p');\n rightSpace.appendChild(winner);\n if((oSquaresClicked.length>=3)||(xSquaresClicked.length>=3)){\n if(oSquaresClicked.indexOf(leftWin[0,1,2]|| vertMidWin[0,1,2]|| rightWin[0,1,2]|| topWin[0,1,2]|| horMidWin[0,1,2]|| lowWin[0,1,2]|| rightLeftCrossWin[0,1,2]|| rightLeftCrossWin)>-1){\n winner.textContent = \"O WINS!\";\n console.log(\"Player O wins!\");\n removeClick();\n }\n }else if(xSquaresClicked.indexOf(leftWin[0,1,2]|| vertMidWin[0,1,2]|| rightWin[0,1,2]|| topWin[0,1,2]|| horMidWin[0,1,2]|| lowWin[0,1,2]|| rightLeftCrossWin[0,1,2]|| rightLeftCrossWin)>-1){\n winner.textContent = \"X WINS!\"\n console.log(\"Player X wins!\");\n removeClick();\n }else if(squaresClicked.length === 9){\n //no winner game\n console.log(\"Stalemate!\");\n winner.textContent = \"TIE\";\n removeClick();\n }\n addEventListener('click', removeClick);\n }", "function checkForWin() {\n function _win(cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every(\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n // \n // iterate through y axis\n for (let y = 0; y < HEIGHT; y++) {\n // while going through x axis\n for (let x = 0; x < WIDTH; x++) {\n // coordinates for a horizontal win\n let horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n // coordinates for a vertical win\n let vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n // coordinates for a diagonal right win\n let diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n // coordinates for diagonal left win\n let diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n// if a win in any direction return true\n if (_win(horiz) || _win(vert) || _win(diagDR) || _win(diagDL)) {\n return true;\n }\n }\n }\n}", "findLegalMoves(board, onlyCaptures = false) {\n let opponent = board.players[this.color].opponent,\n { x, y } = this,\n repeat = false;\n\n this.legalMoves = [];\n this.attackSquares = [];\n do {\n x += this.moves.x;\n y += this.moves.y;\n if (x >= 0 && x <= 7 && y >= 0 && y <= 7) {\n // Pawn captures\n if (!repeat) {\n if (x >= 1) {\n this.attackSquares.push({ x: x - 1, y });\n if (board.pieces[x - 1][y] && board.pieces[x - 1][y].color === opponent) {\n this.legalMoves.push(new Move({ x: this.x, y: this.y }, { x: x - 1, y }, this, board.pieces[x - 1][y]));\n if (y === 0 || y === 7) this.promoteMove({ x, y });\n super.check(board.pieces[x - 1][y], board);\n }\n }\n if (x <= 6) {\n this.attackSquares.push({ x: x + 1, y });\n if (board.pieces[x + 1][y] && board.pieces[x + 1][y].color === opponent) {\n this.legalMoves.push(new Move({ x: this.x, y: this.y }, { x: x + 1, y }, this, board.pieces[x + 1][y]));\n if (y === 0 || y === 7) this.promoteMove({ x, y });\n super.check(board.pieces[x + 1][y], board);\n }\n }\n if (this.isChecking) {\n board.players[opponent].blockSquares = [];\n }\n // En Passant capture\n if (board.enPassant && y === board.enPassant.y && (board.enPassant.x === x - 1 || board.enPassant.x === x + 1)) {\n if (board.pieces[board.enPassant.x][board.enPassant.y - this.moves.y]?.color !== this.color) {\n this.legalMoves.push(new Move({ x: this.x, y: this.y }, { x: board.enPassant.x, y: board.enPassant.y }, this, board.pieces[board.enPassant.x][board.enPassant.y - this.moves.y]));\n this.legalMoves[this.legalMoves.length - 1].enPassant = board.enPassant;\n }\n }\n\n // Repeat to make the pawn double move(if on the start line)\n if (this.y === 1 || this.y === 6) {\n repeat = true;\n }\n } else {\n // This is the double move\n repeat = false;\n }\n\n if (board.pieces[x][y]) {\n repeat = false;\n } else {\n if (!onlyCaptures) {\n // Move to empty square\n this.legalMoves.push(new Move({ x: this.x, y: this.y }, { x, y }, this, false));\n if (y === 0 || y === 7) this.promoteMove({ x, y });\n this.legalMoves[this.legalMoves.length - 1].enPassant = !repeat;\n }\n }\n } else {\n // Can't move more because I'm on the edge of the board\n repeat = false;\n }\n } while (repeat);\n }", "function checkWin(){\r\n\tlet cb = []; //current Board\r\n\tcb[0] = \"\"; //not going to use\r\n\tcb[1] = document.getElementById(\"one\").innerHTML;\r\n\tcb[2] = document.getElementById(\"two\").innerHTML;\r\n\tcb[3] = document.getElementById(\"three\").innerHTML;\r\n\tcb[4] = document.getElementById(\"four\").innerHTML;\r\n\tcb[5] = document.getElementById(\"five\").innerHTML;\r\n\tcb[6] = document.getElementById(\"six\").innerHTML;\r\n\tcb[7] = document.getElementById(\"seven\").innerHTML;\r\n\tcb[8] = document.getElementById(\"eight\").innerHTML;\r\n\tcb[9] = document.getElementById(\"nine\").innerHTML;\r\n\t\r\n\t//top row \r\n\tif(cb[1] != \"\" && cb[1] == cb[2] && cb[2] == cb[3]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t//middle row\r\n\tif(cb[4] != \"\" && cb[4] == cb[5] && cb[5] == cb[6]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t//bottem row\r\n\tif(cb[7] != \"\" && cb[7] == cb[8] && cb[8] == cb[9]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t//first collum\r\n\tif(cb[1] != \"\" && cb[1] == cb[4] && cb[4] == cb[7]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t//second collum\r\n\tif(cb[2] != \"\" && cb[2] == cb[5] && cb[5] == cb[8]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t//third collum\r\n\tif(cb[3] != \"\" && cb[3] == cb[6] && cb[6] == cb[9]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t//digonal left going down\r\n\tif(cb[1] != \"\" && cb[1] == cb[5] && cb[5] == cb[9]) {\r\n\t\treturn true;\r\n\t}//if\r\n\t\r\n\t\r\n\t//digonal right going down\r\n\tif(cb[3] != \"\" && cb[3] == cb[5] && cb[5] == cb[7]) {\r\n\t\treturn true;\r\n\t}//if\r\n\r\n\telse{\r\n\t\t\t\t//check for tie\r\n\t\tif(numTurns == 9){\r\n\t\t\tgameStatus = \"Game Tie\";\r\n\t\t}//numTurns\r\n\t}//else\r\n\t\r\n\r\n\r\n}//check win", "function noMoreMoves() {\n if (isEmpty($('#boneyard img'))) {\n if (game.enemy.enemyHP <= 0) {\n if (changingLevels) {\n return;\n }\n changingLevels = true;\n var waitTime = 1200;\n if (animating) {\n waitTime = 3000;\n }\n setTimeout(function () {\n if (roundCount === 20) {\n message(\"YOU WIN\");\n setNewGame();\n return;\n }\n roundCount++;\n message(\"ROUND \" + (roundCount));\n\n setTimeout(function () {\n roundData[roundCount - 2] = game.thisRound;\n game = newGame();\n }, 2000);\n }, waitTime);\n }\n else {\n aura = 0;\n animating = true;\n setTimeout(function () {\n message(\"GAME OVER\");\n setNewGame();\n }, 1000);\n }\n }\n}", "function checkForWin () {\n // You can use this function call to declare a winner (once you've\n // detected that they've won, that is!)\nconsole.log(board.cells)\n for(cell in board.cells) {\n // if cells that are mines are not marked, return\n if (board.cells[cell].isMine === true) {\n if (board.cells[cell].isMarked !== true)\n return\n }\n // if cells that are hidden aren't marked, return\n if (board.cells[cell].isMine === false) {\n if (board.cells[cell].hidden === true || board.cells[cell].isMarked === true) {\n return\n }\n }\n }\n // otherwise, display win message! \n lib.displayMessage('You win!')\n document.getElementById('claps').play();\n showRestartGame()\n}" ]
[ "0.7271911", "0.72370684", "0.72306937", "0.72039825", "0.7156855", "0.71302634", "0.71044135", "0.70923954", "0.70907706", "0.70544285", "0.701905", "0.7010281", "0.70058864", "0.69997317", "0.6994093", "0.6987053", "0.6963083", "0.6952513", "0.69363093", "0.6926301", "0.69241035", "0.6920501", "0.69160163", "0.69102705", "0.6908201", "0.68824553", "0.687525", "0.6860293", "0.68533856", "0.6850232", "0.684536", "0.6844343", "0.681437", "0.6807945", "0.6804558", "0.6788515", "0.6785041", "0.6779772", "0.6779522", "0.67739975", "0.67725956", "0.6764477", "0.6758779", "0.6754904", "0.67360115", "0.6733212", "0.6730669", "0.6725309", "0.67203397", "0.6717631", "0.67137533", "0.6707655", "0.67004454", "0.66953504", "0.6690111", "0.6687418", "0.6684218", "0.66831285", "0.667292", "0.66726565", "0.6663878", "0.66594255", "0.6657783", "0.665617", "0.6637366", "0.66373134", "0.6637148", "0.66257435", "0.6625423", "0.66223633", "0.6622067", "0.6621874", "0.6618132", "0.6614737", "0.6614157", "0.6608204", "0.6607641", "0.6597122", "0.65931326", "0.6592383", "0.6590577", "0.65888673", "0.6585847", "0.65733826", "0.6573316", "0.65714383", "0.65694004", "0.6565455", "0.6557968", "0.6555202", "0.6547001", "0.6545433", "0.6544917", "0.654221", "0.6540102", "0.6540097", "0.653873", "0.6531427", "0.6529496", "0.6524484", "0.6524241" ]
0.0
-1
Fill board with moderator
fillModerator(grid) { for (var x = 0; x < this.nCols; x++) { for (var y = 0; y < this.nRows; y++) { grid[x][y] = new Moderator(x, y, this); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyBoard(){\n g_wall = new Wall(g_newBoard,0,0);\n reset();\n}", "function setNewGame() {\n const fieldsArr = board.fields;\n\n for (let i = 0; i <= 64; i++) {\n let startPostion = fieldsArr[i];\n let piece = false;\n\n if (i >= 8 && i <= 15) {\n piece = new Pawn('pawn', 'black', i);\n }\n\n else if (i >= 48 && i <= 55) {\n piece = new Pawn('pawn', 'white', i);\n } \n \n else {\n continue;\n }\n\n if (piece) {\n startPostion.pawn = piece;\n startPostion.td.appendChild(piece.element); \n }\n }\n }", "fillInBoard(pieces) {\r\n for (let piece of pieces) {\r\n this.fillAt(piece.row, piece.col, piece);\r\n }\r\n }", "populateBoard() {\n for (let col = 0; col < this.board.getSize(); col++) {\n for (let row = 0; row < this.board.getSize(); row++) {\n // Check the empty candy position (hole), fill with new candy\n if (this.board.getCandyAt(row, col) == null) {\n this.board.addRandomCandy(row, col);\n }\n }\n }\n }", "function makeBoard() {\n //Make an empty array for board propert cells\n board.cells = [];\n for (let rowNum = 0; rowNum < gridSize; rowNum++) {\n for (let colNum = 0; colNum < gridSize; colNum++) {\n board.cells.push({\n row: rowNum,\n col: colNum,\n isMine: Math.round(Math.random() >= 0.7),\n isMarked: false,\n hidden: true,\n });\n }\n }\n}", "fillAt(row, col, piece) {\r\n this.board[row][col] = piece;\r\n }", "function boardGenerator() {\n for (var i = 0; i < boardSize; i++) {\n for (var j = 0; j < boardSize; j++) {\n board.cells.push({\n row: i,\n col: j,\n isMine: randomMines(),\n hidden: true,\n });\n }\n }\n}", "function setPiece() {\n clearCompleteRows();\n\n // To prevent dis-orientation, keep\n // the column where the user left it,\n // otherwise, put the new piece near\n // the top of the playfield.\n GameData.row = 3;\n GameData.activePiece = generatePiece();\n GameData.activePiece.reset();\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "setBoardPosition() {\n\n this.forEach((arr, rowIndex) => {\n arr.forEach((block, colIndex) => {\n\n if (block === 0) return;\n\n let absPos = this._getAbsolutePosition(rowIndex, colIndex);\n\n this.board[absPos.row][absPos.col] = this.pieceType;\n });\n });\n }", "function lockPiece() {\n\tpiece.matrix.forEach(function (value, index, matrix) {\n\t\t// console.log('value:', value, 'index:', index);\n\t\tif (value == piece.id)\n\t\t\tboard = board.subset(\n\t\t\t\tmath.index(index[0] + piece.top, index[1] + piece.left),\n\t\t\t\tpiece.id\n\t\t\t);\n\t});\n}", "initBoard () {\n\t\tthis.clearBoard();\n\t\t/* Init piece-list */\n\t\t/* White */\n\t\tthis.pieces = [\n\t\t\tnew Lance(COLOR.WHITE, position.toIdx(1, 'a')),\n\t\t\tnew Knight(COLOR.WHITE, position.toIdx(2, 'a')),\n\t\t\tnew Silver(COLOR.WHITE, position.toIdx(3, 'a')),\n\t\t\tnew Gold(COLOR.WHITE, position.toIdx(4, 'a')),\n\t\t\tnew King(COLOR.WHITE, position.toIdx(5, 'a')),\n\t\t\tnew Gold(COLOR.WHITE, position.toIdx(6, 'a')),\n\t\t\tnew Silver(COLOR.WHITE, position.toIdx(7, 'a')),\n\t\t\tnew Knight(COLOR.WHITE, position.toIdx(8, 'a')),\n\t\t\tnew Lance(COLOR.WHITE, position.toIdx(9, 'a')),\n\t\t\tnew Rook(COLOR.WHITE, position.toIdx(2, 'b')),\n\t\t\tnew Bishop(COLOR.WHITE, position.toIdx(8, 'b')),\n\t\t];\n\t\tfor (let i = 1; i <= NUM_COLS; i++) {\n\t\t\tthis.pieces.push(new Pawn(COLOR.WHITE, position.toIdx(i, 'c')));\n\t\t}\n\t\t/* Black */\n\t\tthis.pieces = this.pieces.concat([\n\t\t\tnew Lance(COLOR.BLACK, position.toIdx(1, 'i')),\n\t\t\tnew Knight(COLOR.BLACK, position.toIdx(2, 'i')),\n\t\t\tnew Silver(COLOR.BLACK, position.toIdx(3, 'i')),\n\t\t\tnew Gold(COLOR.BLACK, position.toIdx(4, 'i')),\n\t\t\tnew King(COLOR.BLACK, position.toIdx(5, 'i')),\n\t\t\tnew Gold(COLOR.BLACK, position.toIdx(6, 'i')),\n\t\t\tnew Silver(COLOR.BLACK, position.toIdx(7, 'i')),\n\t\t\tnew Knight(COLOR.BLACK, position.toIdx(8, 'i')),\n\t\t\tnew Lance(COLOR.BLACK, position.toIdx(9, 'i')),\n\t\t\tnew Rook(COLOR.BLACK, position.toIdx(2, 'h')),\n\t\t\tnew Bishop(COLOR.BLACK, position.toIdx(8, 'h')),\n\t\t]);\n\t\tfor (let i = 1; i <= NUM_COLS; i++) {\n\t\t\tthis.pieces.push(new Pawn(COLOR.BLACK, position.toIdx(i, 'g')));\n\t\t}\n\n\t\t/* Put pieces on board */\n\t\tthis.pieces.forEach((piece) => {\n\t\t\tthis.putPiece(piece, piece.pos);\n\t\t});\n\t}", "function llenarTablero() {\n\tfillBoard();\n}", "function populateBoard() {\n let newArr = Array(64).fill(null);\n let len = 64;\n let i = 0;\n for (i = 0; i < len; ++i){\n // White\n if(i == 0 || i == 7){\n newArr[i] = 'white/rook' // Position Rook\n }\n if(i == 1 || i == 6){\n newArr[i] = 'white/knight' // Position Knight(Horse; to avoid confusion)\n }\n if(i == 2 || i == 5){\n newArr[i] = 'white/bishop' // Position Bishop\n }\n if(8 <= i && i <= 15){\n newArr[i] = 'white/pawn' // Position Pawn\n }\n if(i == 4){\n newArr[i] = 'white/queen' // Position Queen\n }\n if(i == 3){\n newArr[i] = 'white/king' // Position King\n }\n\n // Black\n if(i == 56 || i == 63){\n newArr[i] = 'black/rook' // Position Rook\n }\n if(i == 57 || i == 62){\n newArr[i] = 'black/knight' // Position Knight(Horse; to avoid confusion)\n }\n if(i == 58 || i == 61){\n newArr[i] = 'black/bishop' // Position Bishop\n }\n if(48 <= i && i <= 55){\n newArr[i] = 'black/pawn' // Position Pawn\n }\n if(i == 59){\n newArr[i] = 'black/queen' // Position Queen\n }\n if(i == 60){\n newArr[i] = 'black/king' // Position King\n }\n }\n return newArr;\n}", "function initMinesweeperBot(){\n bot = new Bot(ms_row_size, ms_col_size, ms_grid_revealed, ms_mine_num);\n}", "populateBoard() {\n // add a bubble at every row, col\n for (let row = 0; row < this.rows; row++) {\n for (let col = 0; col < this.cols; col++) {\n let pos = this.getBubbleLocAt(row, col);\n this.pieces[row][col] = this.drawBubbleAt(pos.x, pos.y, row, col);\n }\n }\n this.pieces.forEach(row => {\n row.forEach(bubble => {\n bubble.getNeighbors();\n });\n });\n }", "function fillBoard() {\n var x, y, type;\n jewels = [];\n\n for (x = 0; x < cols; x++) {\n jewels[x] = [];\n for (y = 0; y < rows; ++y) {\n type = randomJewel();\n\n // Ensure that no chains are created on the initial board fill\n while ((type === getJewel(x - 1, y) && type === getJewel(x - 2, y)) ||\n (type === getJewel(x, y - 1) && type === getJewel(x, y - 2))) {\n type = randomJewel();\n }\n\n jewels[x][y] = type;\n }\n }\n\n // Recursively fill if the generated board has no moves\n if (!hasMoves()) {\n fillBoard();\n }\n }", "function UpdateBoard(){\n for(var i = 0; i < activeBlock.shapeMatrix[0].length; ++i){\n for(var j = 0; j < activeBlock.shapeMatrix[0].length; ++j){\n if(activeBlock.shapeMatrix[i][j] != 0){\n board[activeBlock.position.y + i][activeBlock.position.x + j] = activeBlock.shapeMatrix[i][j];\n\n }\n }\n }\n updateGrid();\n}", "function resetBoard() {\n board = [];\n $(__BOARD__).children().remove();\n let nbTilesBuilt = 0;\n let arrayTmp = [];\n board.push(arrayTmp);\n let index1D = 0;\n let index2D = -1;\n while(nbTilesBuilt < nbTiles) {\n if(index2D !== 0 && index2D % (nbColumns - 1) === 0) {\n arrayTmp = [];\n board.push(arrayTmp);\n index1D++;\n index2D = 0;\n } else {\n index2D++;\n }\n arrayTmp.push(__BLACK_TILE_CLASS__);\n $(__BOARD__).append(\"<div data-index-1d='\" + index1D + \"' data-index-2d='\" + index2D + \"' class='\" + __BLACK_TILE_CLASS__ +\n \"' style='width:\"+ sizeTile +\"px; height:\"+ sizeTile +\"px;'></div>\");\n nbTilesBuilt++;\n }\n}", "function setMines(board, row, col) {\r\n var shuffledCoords = getSuffledCoords(board);\r\n\r\n for (var idx = 0; idx < gLevel.MINES; idx++) {\r\n var { i, j } = shuffledCoords.pop();\r\n\r\n // This condition ensures that on our first click we do not get a mine\r\n if (i === row && j === col) {\r\n idx--;\r\n continue;\r\n }\r\n\r\n board[i][j].isMine = true;\r\n }\r\n}", "function updateBoard(player, approvedMove){\n let activeCell;\n for(let i = 1; i <= 100; i++){\n activeCell = document.getElementById(i);\n if(approvedMove[i]){\n activeCell.classList.remove('permission');\n }\n if(i === player.colIdWarrior){\n if (activeCell.className === 'knife') {\n activeCell.classList.remove('knife');\n activeCell.classList.add(player.weapon);\n player.weapon = 'knife';\n } else if (activeCell.className === 'star') {\n activeCell.classList.remove('star');\n activeCell.classList.add(player.weapon);\n player.weapon = 'star';\n } else if (activeCell.className === 'star2') {\n activeCell.classList.remove('star2');\n activeCell.classList.add(player.weapon);\n player.weapon = 'star2';\n } else if (activeCell.className === 'tool') {\n activeCell.classList.remove('tool');\n activeCell.classList.add(player.weapon);\n player.weapon = 'tool';\n } else if (activeCell.className === 'sword') {\n activeCell.classList.remove('sword');\n activeCell.classList.add(player.weapon);\n player.weapon = 'sword';\n } else {\n }\n\n activeCell.style.backgroundImage = `url('img/${player.img}.png'), url('img/${player.weapon}.png')`;\n }\n }\n }", "function setUpBoard () {\n makeCrystalScores();\n makeCrystalButtons();\n }", "function updateBoard() {\n // Clear the canvas\n board.clear();\n\n // Draw older gen ghosts\n var colors = [\"#777777\", \"#999999\", \"#BBBBBB\", \"#DDDDDD\", \"#EEEEEE\"];\n for (var gen = 0; gen < genGhosts.length; gen++) {\n drawGen(genGhosts[gen], colors[gen]);\n }\n\n // Draw current gen\n drawGen(currentGen, \"#555555\");\n }", "function resetBoard() {\n\tgame.score = 0;\n\tgame.dot.exists = false;\n\tworms = new Array();\n\n\tfor (var i = 0; i < game.players; i++) {\n\t\tworms.push(new Object());\n\t\tworms[i].direction = \"none\";\n\t\tworms[i].previousCells = new Array();\n\t\tworms[i].length = 1;\n\t\tworms[i].movedThisTurn = false; \n\t\tworms[i].cachedMove = 'none';\n\t\tworms[i].maxSize = 100;\n\n\t\tgame.dots = new Array();\n\t\tgame.foodOut = false;\n\t\t\n\t\tworms[i].position = new Object();\n\t\tworms[i].position.x = 1 + Math.floor(Math.random()*(game.grid.width/game.grid.size - 2));\n\t\tworms[i].position.y = 1 + Math.floor(Math.random()*(game.grid.height/game.grid.size - 2));\n\t}\t\n}", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "tick() {\n let newBoard = this.makeBoard();\n let oldBoard = this.board;\n for(let z = 0; z<oldBoard.length; z++){\n let minArr = oldBoard[z];\n for(let x = 0; x<minArr.length; x++){\n if(this.livingNeighbors(z,x) < 2){\n newBoard[z][x] = 0;\n }\n else if(this.livingNeighbors(z,x) > 3){\n newBoard[z][x] = 0;\n }\n else if(oldBoard[z][x] === 0 && this.livingNeighbors(z,x) === 3){\n newBoard[z][x] = 1;\n } else {\n newBoard[z][x] = oldBoard[z][x]\n }\n }\n }\n this.board = newBoard;\n }", "function expandRoom(rm){\n\t\tlet xMin = randInt(-1,0);\n\t\tlet xMax = randInt(1,2);\n\t\tlet yMin = randInt(-1,0);\n\t\tlet yMax = randInt(1,2);\n\t\tfor (let n = xMin; n < xMax; n++){\n\t\t\tfor (let p = yMin; p<yMax;p++){\n\t\t\t\tdungeon[rm.x+n][rm.y+p] = roomNum;\n\t\t\t}\n\t\t}\n\t\troomNum++;\n\t}", "function resetBoard()\n{\n\tfor(let i = 0; i < allChips.length; i++)\n\t{\n\t\tfor(let j = 0; j < 6; j++)\n\t\t{\n\t\t\tallChips[i][j] = 0;\n\t\t}\n\t}\n}", "function buildBoard(){\n\t \t\tvar mineCount = 0;\n\t \t\tfor (var i = 0; i < ROWS; i+=1) {\n\t\t\t\tfor (var j = 0; j < COLS; j+=1) {\n\t\t\t\t\tvar x_shift = Math.floor(0.5*start) + i*stepW;\n\t\t\t\t\tvar y_shift = Math.floor(0.5*start) + j*stepH;\n\t\t\t\t\tvar circleCol = randomColorGenerator(x_shift,y_shift);\n\t\t\t\t\tvar invertedCol = getInvertedColors(circleCol);\n\t\t\t\t\tvar myCircle = new Path.Circle(new Point(x_shift+circleSize,y_shift+circleSize),circleSize).fillColor = circleCol;\n\t\t\t\t\t//initialise space object\n\n\n\t\t\t\t\tvar spaceObj = {\n\t\t\t\t\t\t\t\t\tindex: n, \n\t\t\t\t\t\t\t\t\tcolor: circleCol,\n\t\t\t\t\t\t\t\t\toutline: invertedCol,\n\t\t\t\t\t\t\t\t\tcircleRef: myCircle,\n\t\t\t\t\t\t\t\t\tpos_x: 0, pos_y: 0, \n\t\t\t\t\t\t\t\t\tholdsMine: 0, \n\t\t\t\t\t\t\t\t\tadjacentNeighbours: 0, \n\t\t\t\t\t\t\t\t\tclicked: false,\n\t\t\t\t\t\t\t\t\tflagged: false,\n\t\t\t\t\t\t\t\t\tneighbourIndexList: []\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\tspaceObj.pos_x = x_shift+circleSize;\n\t\t\t\t\tspaceObj.pos_y = y_shift+circleSize;\n\t\t\t\t\tspaceObj.holdsMine = assignMine();\n\n\t\t\t\t\tif(spaceObj.holdsMine){\n\t\t\t\t\t\tmineCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tspaces.push(spaceObj);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tplayerStats.totalMines = mineCount;\n\t\t\tplayerStats.flags = mineCount;\n\t \t}", "function initBoards() {\n let boardIds = [\"playerboard\", \"enemyboard\"]\n let rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'];\n // init grey spaces\n for (let boardId of boardIds) {\n let board = document.getElementById(boardId);\n let id = boardId[0];\n for (let row of rows) {\n for (let col = 0; col < 10; col++) {\n let div = document.createElement(\"div\");\n div.id = `${id}${row}${col}`;\n div.className = \"opaque\";\n if (boardId === \"enemyboard\") {\n div.onclick = () => handleBoardClick(div.id);\n }\n board.appendChild(div);\n }\n }\n }\n}", "function resetBoard() {\n\t\tboard = new Array(9);\n\t}", "function setUpComputerBoard(computer){\n let row, column\n for(let i = 0; i < AMOUNT_SHIPS; i++){\n //Checks to prevent same coordinate from being chosen\n do{\n row = getRandomGridValue()\n column = getRandomGridValue()\n } while(hasShip(computer.grid, row, column))\n computer.grid[row][column] = 1\n }\n}", "function resetRiddleBoard(){\n $(\"#riddleBoard\").replaceWith(originalRiddleBoard.clone());\n currentPlayer = player2;\n\n }", "generateBoard() {\n for (let i = 0; i < this.rows; i++) {\n let row = [];\n for (let i = 0; i < this.cols; i++) row.push(new Tile(0, false));\n this.tiles.push(row);\n }\n this.setMines();\n }", "function setMinesRandomly() {\n for (var i = 0; i < gLevel.MINES; i++) {\n var rowIdx = getRandomInt(0, gLevel.SIZE)\n var colIdx = getRandomInt(0, gLevel.SIZE)\n while (gBoard[rowIdx][colIdx].cellContent === gMINE) {\n rowIdx = getRandomInt(0, gLevel.SIZE)\n colIdx = getRandomInt(0, gLevel.SIZE)\n }\n gBoard[rowIdx][colIdx].cellContent = gMINE;\n gBoard[rowIdx][colIdx].isMine = true;\n\n }\n}", "updateBoard() {\n var tempBoard = this.duplicateBoardWithoutActive()\n var allMovesValid = true\n var x, y\n for (y = 0; y < Y_SPACES; y++) {\n for (x = 0; x < X_SPACES; x++) {\n if (this.board[y][x].activePiece) {\n let valid = this.validPlacement(x, y+1, tempBoard)\n if(valid) {\n tempBoard[y+1][x] = this.board[y][x]\n } else {\n allMovesValid = false\n }\n }\n }\n }\n if (allMovesValid){\n this.board = tempBoard.slice() \n this.tetrinoQuadrant.startY += 1\n } else {\n this.setInactiveTetrinos()\n }\n }", "newTile(board) {\n let num = this.getRandom(this.boardSize);\n let r = Math.random();\n do {\n num = this.getRandom(this.boardSize);\n } while (board[num] != 0);\n if (r < 0.9) {\n board[num] = 2;\n } else {\n board[num] = 4;\n }\n }", "function joinBoard(board, player) {\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n board[y + player.position.y][x + player.position.x] = value;\n }\n });\n });\n}", "function create2DBoard(cols, rows) {\n board.cells = [];\n for(var i = 0; i < cols; i++) {\n for(var j = 0; j < rows; j++) {\n var index = i * rows + j;\n board.cells[index] = [];\n board.cells[index].col = i;\n board.cells[index].row = j;\n board.cells[index].hidden = true;\n if(Math.random() < 0.3) {\n board.cells[index].isMine = true;\n } else {\n board.cells[index].isMine = false;\n } \n } \n }\n return board; \n}", "function resetBoard() {\n [app.hasFlippedCard, app.lockBoard] = [false, false];\n [app.firstCard, app.secondCard] = [null, null];\n}", "function setBoard(player) {\n // set board\n board.classList.remove(X_CLASS);\n board.classList.remove(O_CLASS);\n board.classList.add(player);\n}", "function updateBoard(){\n draw(levelMap);\n\n /*\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 1;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 2;\n\n if(player.getCurrentPosition().y == levelMap.length - 1) player.setGoalReached(true);\n if(enemy.getCurrentPosition().y == 0) enemy.setGoalReached(true);\n\n draw(levelMap);\n\n //Clean the cells where the player was standed\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 0;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 0;\n\n //Read the x and y positions of player and enemy to put them in the board\n if(!player.getGoalReached()){\n player.setCurrentPosition(player.getCurrentPosition().x,player.getCurrentPosition().y+1);\n }\n\n if(!enemy.getGoalReached()){\n enemy.setCurrentPosition(enemy.getCurrentPosition().x,enemy.getCurrentPosition().y-1);\n }\n */\n}", "function initiateBoard(){\n\tblankx=wid-1;\n\tblanky=height-1;\n\tfor(i=0;i<=numTiles;i++) position[i]=i;\n}", "function fillboard() {\n // alert($(\"#level\").val())\n $level = $levels[$(\"#level\").val()]\n $boardWidth = $imgWidth * $level\n $boardHeight = $imgHeight * $level\n $(\"#board\").css({ \"width\": $boardWidth, \"height\": $boardHeight })\n placeHolesBoard($level)\n}", "_initialiseBoard(level) {\n let rows = level.rows, cols = level.cols;\n \n let board = GenerateGridOfSizeXYWithDefault(\n rows, \n cols, \n {...options.board.defaultCell});\n\n let i = 0, x = -1, y = -1;\n\n while (i < level.mines) {\n x = Math.floor(Math.random() * rows);\n y = Math.floor(Math.random() * cols);\n\n if (!board[x][y].isMine === true) {\n board[x][y] = {...board[x][y], isMine: true};\n board = this._incrementSurroundingCells(x, y, rows, cols, board);\n i++;\n }\n }\n\n return board;\n }", "function updateBoardData(box) {\n var parsedId = parseInt(box.id);\n for (var i = 0; i < game.board.length; i++) {\n if (i === parsedId) {\n game.board[i] = game.currentPlayer.id;\n }\n }\n}", "makeBoardOnScreen(){\n // Here we'll create a new Group\n for (var i=0; i < game.n; i++) {\n for (var j=0; j < game.n; j ++) {\n //initialize 2D array board to be empty strings\n for (var k=0; k < game.n; k++) {\n for (var l=0; l < game.n; l++) {\n //create square\n var square = game.addSprite(game.startingX + i*game.squareSize*3 + k*game.squareSize, game.startingY + j * game.squareSize*3 + l*game.squareSize, 'square');\n //allow square to respond to input\n square.inputEnabled = true\n //indices used for the 4D array\n square.bigXindex = i\n square.bigYindex = j\n square.littleXindex = k\n square.littleYindex = l\n //make have placePiece be called when a square is clicked\n square.events.onInputDown.add(game.placePiece, game)\n }\n }\n }\n }\n game.drawLines()\n }", "function showMines(board) {\r\n for (var i = 0; i < board.length; i++) {\r\n for (var j = 0; j < board[0].length; j++) {\r\n if (board[i][j].isMine) {\r\n var elCell = document.querySelector(`[data-i=\"${board[i][j].i}\"][data-j=\"${board[i][j].j}\"]`);\r\n elCell.classList.remove('main-border')\r\n elCell.classList.add('main-border-inverted')\r\n board[i][j].isShown = true;\r\n elCell.innerHTML= MINE;\r\n\r\n }\r\n\r\n }\r\n }\r\n console.log('updated board', board);\r\n return board;\r\n}", "function addPiece(board, column){\n\n if (board[column].full === false){\n\n for (var i=0; i<6; i++){\n\n if (board[column].content[i].value === 0){\n if (turn1 === true){\n board[column].content[i].value = 1; \n }\n else if(turn1 === false){\n board[column].content[i].value = 2;\n };\n\n if (i === 5){\n board[column].full = true;\n }\n return\n }\n }\n }\n}", "function setBoard(b){\n\tboard = b;\n}", "function updateBoard() {\n\t\tlet board_index = 0;\n\n\t\trows.forEach((row) => {\n\t\t\t// console.log(board_index);\n\t\t\twhile(row.firstChild) {\n\t\t\t\trow.removeChild(row.firstChild);\n\t\t\t}\n\t\t\tfor(i=0; i<3; i++) {\n\t\t\t\tlet box = document.createElement('div');\n\t\t\t\tbox.textContent = board[board_index];\n\t\t\t\tbox.className = `box-${board[board_index]}`;\n\t\t\t\trow.appendChild(box);\n\t\t\t\tboard_index++;\n\t\t\t\t// console.log(row.textContent);\n\t\t\t}\n\t\t});\n\t}", "function placePiece(row, col, color){\n //start and end are arrays with the starting and ending indices of the pieces boxing in those to be changed\n if(color == \"white\")\n { \n cells[row*8+col].innerHTML = '<w class=\"white-piece\" id=\"'+nextwhitePieceId+'\"></w>';\n //console.log(\"THIS IS CELL:\" + cells[row*8+col])\n whitesPieces = document.querySelectorAll(\"w\");\n board[row][col] = nextwhitePieceId;\n nextwhitePieceId+=2; \n }\n else{\n cells[row*8+col].innerHTML = '<b class=\"black-piece\" id=\"'+nextblackPieceId+'\"></b>';\n blacksPieces = document.querySelectorAll(\"b\");\n board[row][col] = nextblackPieceId;\n nextblackPieceId+=2;\n } \n replaceMiddlePieces(row,col)\n changePlayer(true);\n}", "function generateBoard() {\n var array = [], // 1-d array, with LxC, which will be ported to the main board at the end\n i, max = lines*collumns;\n \n // Put all mines in the beginning\n for (i = 0; i < max; i++) {\n if (i < mines) {\n array[i] = 1;\n }\n else {\n array[i] = 0;\n\t\t}\n }\n \n fisherYates(array); // Randomizes mine position\n \n makeBoard(array); // Passes 1-d array to 2-d board\n}", "function populateBoard(data) {\n var board = jeopardy.getJeopardyBoardElement();\n var categories = board.find('.category');\n\n for (var i in data) {\n var category_data = data[i];\n var category_column = categories[i];\n\n $(category_column).attr('data-category', category_data.name);\n var category_box = $(category_column).find('.category-name');\n category_box.html(\"<span>\" + category_data.name + \"</span>\")\n\n var questions_column = $(category_column).find('.question.box');\n\n var questions_data = category_data.questions;\n for (var j in questions_data) {\n if (questions_data[j].used) {\n clearQuestionBox($(questions_column[j]));\n continue;\n }\n var clue_box = $(questions_column[j]).find('.clue').first();\n clue_box.html(\"<span style='font-size:36px'>\" + questions_data[j].value + \"</span>\");\n clue_box.textfill();\n\n $(questions_column[j]).attr('data-value', questions_data[j].value);\n $(questions_column[j]).attr('data-category', category_data.name);\n }\n }\n }", "randomlyPopulateBoard() {\n let allCells = this.a.concat(this.b, this.v);\n for (let i = 0; i < this.board.length; i++) {\n for (let j = 0; j < this.board[i].length; j++) {\n let randIndex = Math.floor(Math.random() * allCells.length);\n this.board[i][j] = allCells.splice(randIndex, 1);\n }\n }\n }", "function addPosToBoard() {\r\n let blockPos = getPosOnBoard();\r\n blockPos.forEach(block => { //change the matching board pos to the colour code\r\n board[block.y][block.x] = currentTetromino.colourCode;\r\n });\r\n}", "function initiateGame() {\n fillBoard(1);\n}", "function update_board(id){\n\t \tvar t = $('#'+id);\n\t \tfor (var k = parseInt(t.attr('col'))-1; k < parseInt(t.attr('col'))+parseInt(t.attr('sizex'))-1; k++) {\n\t \t\tfor (var j = parseInt(t.attr('row'))-1; j < parseInt(t.attr('row'))+parseInt(t.attr('sizey'))-1; j++) {\n\t \t\t\tboard[k][j].occupied = 1;\n\t \t\t\tboard[k][j].tile = id;\n\t \t\t};\n\t \t};\n\t }", "function drawBoard() {\n $(\"#board\").html('');\n for (var i = 0; i < board.length; i++) {\n var rowDiv;\n if (i % DIM == 0) {\n rowDiv = $(\"<div>\").attr(\"id\", getRowId(i)).addClass(\"row\").appendTo(\"#board\");\n }\n\n $('<div/>')\n .attr(\"id\", getCellId(board[i]))\n .addClass(\"btn btn-primary\")\n .text(board[i])\n .appendTo(rowDiv)\n .css(\"width\", WIDTH).css(\"height\", HEIGHT)\n .on(\"click\", notifyClick);\n }\n\n // Hide the empty cell.\n $(\"#cell-0\").invisible();\n }", "printBoard() {\n console.log(\"<========== Board: Actual ==========>\")\n for (let i = 0; i < this.size; i++) {\n let row = '';\n for (let j = 0; j < this.size; j++) {\n let cell;\n if (this.isMine(i, j)) {\n cell = 'X';\n }\n else {\n cell = '.';\n }\n row += cell;\n }\n console.log(row)\n }\n\n console.log(\"<========== Board: What user sees ==========>\");\n for (let i = 0; i < this.size; i++) {\n let row = '';\n for (let j = 0; j < this.size; j++) {\n let cell;\n if (this.isMarked(i, j)) {\n cell = 'M';\n }\n else if (this.isNumbered(i, j)) {\n const num = this.getNumNeightborMines(i, j);\n cell = num === 0 ? '*' : num;\n }\n else {\n cell = '.';\n }\n row += cell;\n }\n console.log(row)\n }\n }", "function buildBoard(){\n self.ttt.boxes = [{select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"},\n {select: false, status: \"\"}];\n self.ttt.$save();\n }", "populate() {\n let elements = new Array(this.getBoardSize());\n let element, curr_col;\n this.board = [];\n\n for (let curr_row = 0; curr_row < this.num_rows; curr_row++) {\n this.board[curr_row] = new Array();\n\n while (this.board[curr_row].length < this.num_cols) {\n curr_col = this.board[curr_row].length;\n element = Math.floor(Math.random() * this.getBoardSize());\n\n if (!elements[element]) {\n this.board[curr_row].push(element);\n elements[element] = 1;\n if (element === 0) this.zero_pos = [curr_row, curr_col];\n if (this.isAtDesiredPos([curr_row, curr_col], element))\n this.num_at_desired_pos++;\n }\n }\n }\n console.log(this.zero_pos[0], this.zero_pos[1]);\n }", "function presetTileAssignmentEditMode() {\n const prefill = [];\n\n dashboardElements.forEach((d, i) => {\n const model = d?.query?.model;\n const view = d?.query?.view;\n const listeners = (d?.result_maker?.filterables || [])\n .filter((f) => {\n return f.model === model && f.view === view;\n })\n .map((m) => m.listen)\n .flat();\n\n // finding the index field is a bit tricky\n const [iField] = listeners.filter((f) => {\n return f.dashboard_filter_name === ctx?.filterPayload?.name && f.field === ctx?.filterPayload?.dimension;\n });\n\n if (iField) {\n prefill.push({\n dashboardElementId: d.id,\n dashboard_filter_name: ctx?.filterPayload.name,\n model,\n view,\n index: i,\n indexField: iField.field,\n });\n }\n });\n\n setTileAssignment(prefill);\n setPrefilled(true);\n }", "function modificarBotones(){\n\tbotones = obtenerBotones();\n\t//with forEach\n\tbotones.forEach(cambiarBoton);\n\n\t/* the old but always good way\n\tfor(var i =0; i < botones.length; i++){\n\t\tbotones[i].style.backgroundColor = \"#045fae\";\n\t}*/\n}", "function setBoard() {\n\n\t\tvar $parent = _$parent.find('#board-area');\n\t\tvar $input = $parent.find('#board-input');\n\t\tvar $btn = $parent.find('#board-write');\n\t \n\t\tajax('show');\n\t\tfunction ajax(action,val) {\n\n\t\t\t$.ajax({\n\t\t\t\ttype: 'GET',\n\t\t\t\tdataType: 'json',\n\t\t\t\turl : \"http://192.168.0.134:8888/tokyo/browser-insert/onigiri/data/board.php?act=\"+action+\"&content=\"+val,\n\t\t\t})\n\t\t\t.done(function(response) {\n\n\t\t\t\tvar json = $.parseJSON(response);\n\t\t\t\tif (json == null) return;\n\n\t\t\t\tconsole.log(json);\n\t\t\t\tvar html = \"\";\n\n\t\t\t\thtml += json['name'] + ':' + json['content'];\n\t\t\t\t$parent.append(html);\n\t\t\t});\n \n\t\t}\n\n\n\t\t$btn.on('click',function() {\n\n\t\t\tajax('write',$input.val());\n\n\t\t});\n\n\t}", "function buildBoard(size,minesAmount) {\n var board = [];\n for (var i =0; i< size; i++) {\n board[i] = [];\n for (var j =0; j< size; j++) {\n var char = 'hidden';\n var imgSet = '<img class=\"cellImg\"'+\n ' onmousedown=\"aboutToPress(this)\"'+\n ''+\n 'onmouseup=\"cancelPress(this)\"'+\n 'src=\"img/char_' + char + '.jpg\" alt=\"' + char + '\">'\n board[i][j] = {markAs : imgSet, contain : 'empty', visible : false, flagged: false};\n }\n }\n // Place mines in random location.\n var boardWithMines = placeMines(board,minesAmount);\n function placeMines(board,mines) {\n var minesCount = 0;\n while (minesCount < mines) {\n var i = Math.floor((Math.random() * board.length) + 0);\n var j = Math.floor((Math.random() * board.length) + 0);\n if (board[i][j].contain !== 'mine') {\n board[i][j].contain = 'mine';\n minesCount++;\n }\n }\n return board;\n }\n // checks where the mines where placed.\n setMinesNegsCount(board);\n function setMinesNegsCount(board) {\n board.forEach(function(rows, i) {\n rows.forEach(function(cellObj, j) {\n if (cellObj.contain !== 'mine') {\n var negNum = countNegs(i,j);\n cellObj.contain = negNum;\n }\n });\n });\n }\n // counts the mines near each cell and update the obj.\n function countNegs(cellI,cellJ) {\n var negs = 0;\n for (var i =cellI-1; i <= cellI+1; i++) {\n for (var j =cellJ-1; j <= cellJ+1; j++) {\n if ( i === cellI && j === cellJ ) continue;\n if ( i < 0 || i > board.length-1) continue;\n if ( j < 0 || j > board[0].length-1) continue;\n if (board[i][j].contain === 'mine') {negs++;}\n }\n }\n if (negs === 0) {negs = 'empty';}\n return negs;\n }\n return boardWithMines;\n}", "function board_pieces_setup(){\r\n\tif(game.num_of_players == 71 || game.num_of_players == 72)\r\n game.num_of_players = 7;\r\n\r\n if(game.num_of_players == 81 || game.num_of_players == 82)\r\n game.num_of_players = 8;\r\n\r\n\tif(game.num_of_players > 3) //since we only need 4+ players to run this check, bc 3 is the minimum number needed to play\r\n\t{\r\n\t\tbluePiece.position.set(sevenCenterX, pieceVisible, sevenCenterZ+DiceOffsetZ); //redrawing needed pieces visibly in Safe House\r\n\t}\r\n\tif(game.num_of_players > 4){\r\n\t\torangePiece.position.set(sevenCenterX+DiceOffsetX, pieceVisible, sevenCenterZ+DiceOffsetZ);\r\n\t}\r\n\tif(game.num_of_players > 5){\r\n\t\tpurplePiece.position.set(sevenCenterX-DiceOffsetX, pieceVisible, sevenCenterZ+DiceOffsetZ);\r\n\t}\r\n\tif(game.num_of_players > 6){\r\n\t\tyellowPiece.position.set(sevenCenterX+DiceOffsetX, pieceVisible, sevenCenterZ);\r\n\t}\r\n\tif(game.num_of_players > 7){\r\n\t\tblackPiece.position.set(sevenCenterX-DiceOffsetX, pieceVisible, sevenCenterZ-DiceOffsetZ);\r\n\t}\r\n\t//if 9th player added, follow suit\r\n}", "update_board(copy_board, action) {\n if (action.type == 'c') {\n copy_board[action.y1][action.x1].no_soldiers++;\n \n // If move action\n } else {\n copy_board[action.y1][action.x1].no_soldiers--;\n if(copy_board[action.y2][action.x2].faction != this.faction ) {\n // empty tile \n if(copy_board[action.y2][action.x2].soldiers == 0) {\n copy_board[action.y2][action.x2].no_soldiers++;\n copy_board[action.y2][action.x2].faction = this.faction;\n } else {\n copy_board[action.y2][action.x2].no_soldiers--;\n }\n } else {\n copy_board[action.y2][action.x2].no_soldiers++;\n }\n }\n }", "function makeBoard() {\n clearBoard();\n bombsFlagged = 0;\n cellsOpen = 0;\n updateNumBombs();\n // Now place the bombs on the board\n bombsToPlace = maxNumBombs;\n while (bombsToPlace != 0) {\n placeBombRandomLoc();\n bombsToPlace--; } }", "buildGameBoard() {\n // creating 2d array to act as game board\n this.board = [];\n for(var i = 0; i < this.num_rows; i++) {\n this.board[i] = [];\n for(var j = 0; j < this.num_cols; j++) {\n this.board[i][j] = \"*\";\n }\n }\n\n // populating game board\n var mine_placed;\n for(var i = 0; i < this.mine_count; i++) {\n mine_placed = false;\n do {\n var row = Math.floor(Math.random() * this.num_rows);\n var col = Math.floor(Math.random() * this.num_cols);\n if(this.board[row][col] == \"*\"){\n mine_placed = true;\n this.board[row][col] = \"M\";\n }\n } while (!mine_placed);\n }\n\n // generating adjacency counts\n var cur_mines;\n for (var i = 0; i < this.num_rows; i++) {\n for (var j = 0; j < this.num_cols; j++) {\n // if cell is a mine, don't need to generate count for it (duh)\n if (this.board[i][j] != \"M\") {\n cur_mines = 0;\n // go through all adjacent cells.\n for (var k = i-1; k <= i+1; k++) {\n for (var l = j-1; l <= j+1; l++) {\n // check is adjecent cell is within bounds\n if (k >= 0 && l >= 0 && k < this.num_rows && l < this.num_cols) {\n if (this.board[k][l] == \"M\") {\n cur_mines++;\n }\n }\n }\n }\n\n this.board[i][j] = cur_mines;\n }\n }\n }\n }", "placeMines(theBoard, theRow, theCol) {\n\n let { rows, cols, mines } = this.props;\n let r, c, m = 0;\n\n while (m < mines) {\n\n while (true) {\n\n r = this.getRandomInt(rows);\n c = this.getRandomInt(cols);\n\n /* make sure random x isnt intial click xpos */\n if (this.checkProximity(r, c, theRow, theCol)) {\n break;\n }\n }\n\n if (!(theBoard[r][c].mine)) {\n theBoard[r][c].mine = true;\n m++;\n }\n\n }\n\n return theBoard;\n }", "function arrangePieces(){\n\tif(playerColor == 0){\n\t\tboard[0][0] = 12;\n\t\tboard[0][7] = 12;\n\t\tboard[0][1] = 13;\n\t\tboard[0][6] = 13;\n\t\tboard[0][2] = 14;\n\t\tboard[0][5] = 14;\n\t\tboard[0][3] = 16;\n\t\tboard[0][4] = 15;\n\t\tfor(var i = 0; i < 8; i++){\n\t\t\tboard[1][i] = 11;\n\t\t}\n\t\tfor(var j = 0; j < 8; j++){\n\t\t\tboard[6][j] = 1;\n\t\t}\n\t\tboard[7][0] = 2;\n\t\tboard[7][7] = 2;\n\t\tboard[7][1] = 3;\n\t\tboard[7][6] = 3;\n\t\tboard[7][2] = 4;\n\t\tboard[7][5] = 4;\n\t\tboard[7][3] = 6;\n\t\tboard[7][4] = 5;\n\t} else {\n\t\tboard[0][0] = 2;\n\t\tboard[0][7] = 2;\n\t\tboard[0][1] = 3;\n\t\tboard[0][6] = 3;\n\t\tboard[0][2] = 4;\n\t\tboard[0][5] = 4;\n\t\tboard[0][3] = 5;\n\t\tboard[0][4] = 6;\n\t\tfor(var i = 0; i < 8; i++){\n\t\t\tboard[1][i] = 1;\n\t\t}\n\t\tfor(var j = 0; j < 8; j++){\n\t\t\tboard[6][j] = 11;\n\t\t}\n\t\tboard[7][0] = 12;\n\t\tboard[7][7] = 12;\n\t\tboard[7][1] = 13;\n\t\tboard[7][6] = 13;\n\t\tboard[7][2] = 14;\n\t\tboard[7][5] = 14;\n\t\tboard[7][3] = 15;\n\t\tboard[7][4] = 16;\n\t}\n}", "function setupBoard() {\n\tif (boardRows !== difficulty) {\n\t\tboard.innerHTML = \"\";\n\t\tboardRows = difficulty;\n\t\tfor (let i = 0; i <= difficulty; i++) {\n\t\t\tconst rowDiv = document.createElement('div');\n\t\t\trowDiv.className = 'row';\n\t\t\tfor (let i=0; i < 3; i++) {\n\t\t\t\tconst squareBorder = document.createElement('div');\n\t\t\t\tsquareBorder.className = 'square-border';\n\t\t\t\tconst squareInner = document.createElement('div');\n\t\t\t\tsquareInner.className = 'square';\n\t\t\t\tsquareBorder.appendChild(squareInner);\n\t\t\t\trowDiv.appendChild(squareBorder);\n\t\t\t}\n\t\t\tboard.appendChild(rowDiv);\n\t\t}\n\n\t\tsquareDivs = document.querySelectorAll('.square');\n\t\tsquareBorders = document.querySelectorAll('.square-border');\n\t\taddBoardListeners();\n\t}\n}", "lockPiece() {\n const { y: pieceY, x: pieceX, blocks } = this.activePiece;\n\n for (let y = 0; y < blocks.length; y++) {\n for (let x = 0; x < blocks[y].length; x++) {\n if (blocks[y][x]) {\n this.playfield[pieceY + y][pieceX + x] = blocks[y][x];\n }\n }\n }\n }", "function action_modal_editBoard(board_id){\n // Set interface..\n var boardInfo = boardList.find(function(oneInfo) {\n return oneInfo.id === board_id;\n });\n\n if(boardInfo) {\n $('#modalTitle').text('Edit board');\n $('#input-brdName').val(boardInfo.title);\n $('#input-description').val(boardInfo.description);\n if(boardInfo.public == 'false') {\n $('#chk-public').bootstrapToggle('off')\n }\n else {\n $('#chk-public').bootstrapToggle('on')\n }\n\n // Refresh collaborator list..\n var mineData = {\n email : userSelf.email,\n username : userSelf.username,\n right: \"MODIFY\"\n };\n collaboratorList = [];\n collaboratorList.push(mineData);\n\n $('#panel-collaborators').children('ul').html('');\n $('#input-addCollaborator').val('');\n for(var i in boardInfo.collaborators) {\n if(userSelf.email == boardInfo.collaborators[i].email)\n continue;\n\n addCollaboratorToCreateBoardModel(boardInfo.collaborators[i]);\n }\n\n $('#btn-addBoard').val('Save');\n $('#btn-addBoard').attr('onclick', \"javascript:action_editBoardInfo('\" + board_id + \"');\");\n\n $('#txt-addResult').text(\"\");\n\n // Modal dialog..\n $('#modal-addBoard').modal();\n }\n}", "function setMines(safeCol, safeRow) {\n let numMines = startingMines;\n while (numMines > 0) {\n const i = floor(random(0, numSquaresY));\n const j = floor(random(0, numSquaresX));\n\n if (!board[i][j].isMine && (Math.abs(i - safeRow) > 1 || Math.abs(j - safeCol) > 1)) {\n board[i][j].isMine = true;\n numMines--;\n }\n }\n \n findMines();\n}", "function initializeboard() {\n do{\n board = shuffleArray(board);\n } while(! isSolvable(board));\n }", "function updateBoardView() {\n // at first, clean the table\n $(\"td\").empty();\n // then append numbers to their conrespondding positions\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n if (all_numbers[i][j]) {\n showTile(i, j, all_numbers[i][j]);\n }\n has_merged[i][j] = false;\n }\n }\n}", "function resetBoard() {\n [hasFlippedCard, lockBoard] = [false, false];\n [firstCard, secondCard] = [null, null];\n }", "function testBoard() {\n let board = new Board();\n let index = board.coordToIndex(0, 0);\n board.playerBoard[index].value = 'HIT';\n board.prettyPrint(board.playerBoard);\n}", "createBoard() \n {\n document.getElementById(\"block1\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block2\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block3\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block4\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block5\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block6\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block7\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block8\").innerHTML = this.boardValue.Empty;\n document.getElementById(\"block9\").innerHTML = this.boardValue.Empty; \n }", "set board(value) {\n this._board = value;\n }", "resetBoard() {\n this._gameBoard = [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",];\n this._gameOver = false;\n this._tiedGame = false;\n this.changePlayer(); //alternate between starting players \n }", "function buildBoard() {\r\n var boardLength = gCurrLevel.boardSize\r\n var board = [];\r\n for (var i = 0; i < boardLength; i++) {\r\n board[i] = [];\r\n for (var j = 0; j < boardLength; j++) {\r\n var cell = {\r\n type: EMPTY,\r\n minesAroundCount: 0,\r\n isShown: false,\r\n isMine: false,\r\n isMarked: false,\r\n isCanClick: true\r\n }\r\n board[i][j] = cell;\r\n }\r\n }\r\n return board;\r\n}", "populateGameBoard(gameEngine, sheet) {\n //Populate each tile as dirt to begin.\n for (var i = 0; i < this.boardHeight; i++) {\n for (var j = 0; j < this.boardWidth; j++) {\n var tile = new Tile(gameEngine, sheet, this.startingX + (i * 64), this.startingY + (j * 64), i, j, 'dirt');\n this.gameBoard[i][j] = tile;\n }\n }\n this.generatePerimeter();\n this.generateObstacles(6, 4);\n this.placeExit(this.exitX, this.exitY);\n }", "updateBoard() {\r\n for (let tile in this.gameState.state) {\r\n if (this.gameState.state[tile] !== 0) {\r\n $(\"#\"+tile).html((this.gameState.state[tile] === 1) ? this.playerSymbols[0] : this.playerSymbols[1]);\r\n } else {\r\n $(\"#\"+tile).html(\"\");\r\n }\r\n }\r\n //Check for winner, otherwise check for no free spaces (tie)\r\n let winState = this.gameState.checkWin();\r\n if (winState.win) {\r\n this.winner(winState);\r\n } else if(this.gameState.freeSpaces().length === 0) {\r\n this.tie();\r\n }\r\n }", "function promoteQueens() {\n _pieces\n .filter(p => p.piece === PEAO && p.row === 0)\n .forEach(p => p.piece = RAINHA); \n}", "function refillBoard() {\n\n var maxIconsMissingFromCol = 0;\n\n for (var i = 0; i < BOARD_COLS; i++)\n {\n var iconsMissingFromCol = 0;\n\n for (var j = BOARD_ROWS - 1; j >= 0; j--)\n {\n var icon = getIcon(i, j);\n\n if (icon === null)\n {\n iconsMissingFromCol++;\n icon = icons.getFirstDead();\n icon.reset(i * ICON_SIZE_SPACED, -iconsMissingFromCol * ICON_SIZE_SPACED);\n icon.dirty = true;\n randomizeIconColor(icon);\n setIconPos(icon, i, j);\n tweenIconPos(icon, icon.posX, icon.posY, iconsMissingFromCol * 2);\n }\n }\n\n maxIconsMissingFromCol = Math.max(maxIconsMissingFromCol, iconsMissingFromCol);\n }\n\n game.time.events.add(maxIconsMissingFromCol * 2 * 100, boardRefilled);\n\n}", "function initMinesweeper(){\n initTopBar();\n //initGridAttributes();\n initGridFlags();\n initGrid();\n initMinesweeperBot();\n}", "function setBoard() {\n for (i = 0; i <= vessels.length; i++) {\n if (i % 2 === 0) {\n isShipInRangeH(vessels[i]);\n isShipInRangeHPlayerTwo(vessels[i]);\n }\n else if (i % 2 !== 0) {\n isShipInRangeV(vessels[i]);\n isShipInRangeVPlayerTwo(vessels[i]);\n }\n }\n}", "function revealMines(board) {\n for (let i = 0; i < board.length; i++) {\n for (let j = 0; j < board[0].length; j++) {\n if (board[i][j].isMine) {\n revealCell(board, { i: i, j: j }, MINE);\n }\n }\n }\n}", "function game_initBoard(){\n\t//get map from data.\n\tvar mapdata=data_map[GLOBAL['gid']].map;\n\tvar spawntiles=[];\n\tGLOBAL['board']=[];\n\t//copy data into a board of tile objects\n\tfor(var i=0;i<mapdata.length;i++){\n\t\tGLOBAL['board'][i]=[];\n\t\tfor(var j=0;j<mapdata[i].length;j++){\n\t\t\tvar tile={x:i,y:j,type:mapdata[i][j]};\n\t\t\ttile.color=Math.round(170+(Math.random()*30));\n\t\t\tif(tile.type==2){\n\t\t\t\tspawntiles.push(tile);\n\t\t\t}\n\t\t\tGLOBAL['board'][i][j]=tile;\n\t\t}\n\t}\n\tvar xmax=46*GLOBAL['board'].length;\n\tvar ymax=46*GLOBAL['board'][0].length;\n\t//share the board offset, and spawn tiles.\n\n\tGLOBAL['gamevars'].xoffset=Math.round(($('#game')[0].width-xmax)/2);\n\tGLOBAL['gamevars'].yoffset=Math.round(($('#game')[0].height-ymax)/2);\n\tGLOBAL['gamevars'].spawnpoints=spawntiles;\n}", "function updateBoard(board) {\n\tvar newBoard = copyArray(board);\n\tfor (var i = 0; i < getHeight(board); i++) {\n\t\tfor (var j = 0; j < getWidth(board); j++) {\n\t\t\tvar neighborCount = countNeighbors(board, j, i);\n\t\t\tif (neighborCount === 3) {\n\t\t\t\tnewBoard[j][i] = 1;\n\t\t\t}\n\t\t\telse if (neighborCount === 4){\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewBoard[j][i] = 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn newBoard;\n}", "function action_modal_addBoard() {\n // Initialize interface..\n $('#modalTitle').text('Create new board');\n $('#input-brdName').val('');\n $('#input-description').val('');\n $('#chk-public').bootstrapToggle('off');\n $('#input-addCollaborator').val('');\n $('#panel-collaborators').children('ul').html('');\n $('#btn-addBoard').val('Create');\n $('#btn-addBoard').attr('onclick', \"javascript:action_addBoardInfo();\");\n $('#txt-addResult').text('');\n\n // Initialize collaborator list..\n var mineData = {\n email : userSelf.email,\n username : userSelf.username,\n right: \"MODIFY\"\n };\n collaboratorList = [];\n collaboratorList.push(mineData);\n\n // Modal dialog..\n $('#modal-addBoard').modal();\n}", "function updateBoard(dataId, board, player){\n if(dataId == 0 || dataId == 1 || dataId == 2){\n board[0][dataId] = player;\n }else if(dataId == 3 || dataId == 4 || dataId == 5){\n board[1][dataId-3] = player;\n }else{\n board[2][dataId-6] = player;\n }\n}", "function makeNewBoard(board) {\n var oldBoard = $scope.gameBoard.slice(0);\n\n for (var i = oldBoard.length; i > 0; i--)\n {\n var randChar = oldBoard[Math.floor(Math.random() * oldBoard.length)];\n board.push(randChar);\n var index = oldBoard.indexOf(randChar);\n\n if (index > -1)\n oldBoard.splice(index, 1);\n }\n }", "function buildBoard() {\n var size = gLevel.size\n var board = [];\n for (var i = 0; i < size; i++) {\n var row = [];\n for (let j = 0; j < size; j++) {\n var cell = {\n minesAroundCount: 0,\n isShown: false,\n isMine: false,\n isUsedLife: false,\n isMarked: false,\n }\n row.push(cell)\n }\n board.push(row)\n }\n return board;\n}", "function buildBoard() {\n let board = [];\n let boardSize = gLevel.curr.SIZE;\n\n for (let i = 0; i < boardSize; i++) {\n board[i] = [];\n for (let j = 0; j < boardSize; j++) {\n board[i][j] = {\n minesAroundCount: null,\n isShown: false,\n isMine: false,\n isMarked: false,\n }\n }\n }\n return board;\n}", "function freeze() {\n for (let y = 0; y < 4; ++y) {\n for (let x = 0; x < 4; ++x) {\n if (current[y][x]) {\n board[y + currentY][x + currentX] = current[y][x];\n }\n }\n }\n freezed = true;\n}", "function resetBoard() {\n boardLock = false;\n [firstCard, secondCard] = [null, null];\n}", "function makeUnwritable(playerNumber){\n\t\tvar colNumber = playerNumber - 1;\n\t\t\n\t\tgetColumnCells(column).slice(7,10).removeClass(\"setMe\").css(\"background\",\"#EEE\");\n\t\t\n\t\tgetColumnCells(column).slice(17,19).removeClass(\"setMe\").css(\"background\",\"#EEE\");\n\t}" ]
[ "0.6520373", "0.6321369", "0.6300839", "0.6237424", "0.61506736", "0.6076635", "0.60347265", "0.600643", "0.59284896", "0.5926426", "0.59053224", "0.59016913", "0.58932483", "0.5882883", "0.5870567", "0.58621615", "0.5853807", "0.5834048", "0.58315206", "0.5778541", "0.57640344", "0.5759578", "0.5745149", "0.5740691", "0.5712641", "0.57104445", "0.57019895", "0.5682444", "0.56729436", "0.56722265", "0.5653243", "0.5650032", "0.56482667", "0.5641488", "0.5639996", "0.5634359", "0.56311804", "0.56253964", "0.5623921", "0.5619132", "0.56183684", "0.5602679", "0.559756", "0.55958664", "0.55928725", "0.5590202", "0.55840665", "0.55833524", "0.5581578", "0.5580955", "0.55754477", "0.55729514", "0.5566908", "0.55637866", "0.5557334", "0.55540705", "0.55425835", "0.5542041", "0.5538007", "0.5532036", "0.55287457", "0.5527348", "0.5524793", "0.5523528", "0.55185723", "0.5516742", "0.551568", "0.5503854", "0.5502643", "0.5500452", "0.5499807", "0.54918045", "0.5482982", "0.54794717", "0.5476464", "0.547291", "0.54719406", "0.5470807", "0.547034", "0.5468442", "0.5466873", "0.54628557", "0.544575", "0.5445458", "0.5442431", "0.5440741", "0.5438447", "0.5437068", "0.54349554", "0.54321873", "0.5429281", "0.54257196", "0.54252416", "0.5421512", "0.54192924", "0.54154056", "0.54122275", "0.5412105", "0.540543", "0.54022396" ]
0.72101647
0
Fill edges with walls
fillEdges(grid) { for (var x = 0; x < this.nCols; x++) { grid[x][0] = new Wall(x, 0, this); grid[x][this.nRows-1] = new Wall(x, this.nRows-1, this); } for (var y = 1; y < this.nRows-1; y++) { grid[0][y] = new Wall(0, y, this); grid[this.nCols-1][y] = new Wall(this.nCols-1, y, this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fill(edges,inner)\n{\n var r;\n var l;\n var d;\n var u;\n\n var count=0;\n var visited = new Set();\n var visit_later=new Set([intify(inner)]);\n while(visit_later.length != 0)\n {\n v = pointify(Array.from(visit_later)[0]);\n r = intify([v[0]+1,v[1]])\n l = intify([v[0]-1,v[1]])\n d = intify([v[0],v[1]+1])\n u = intify([v[0],v[1]-1])\n\n if(!visited.has(r) && !edges.has(r))\n visit_later.add(r)\n if(!visited.has(l) && !edges.has(l))\n visit_later.add(l)\n if(!visited.has(d) && !edges.has(d))\n visit_later.add(d)\n if(!visited.has(u) && !edges.has(u))\n visit_later.add(u)\n \n visited.add(intify(v));\n visit_later.delete(intify(v));\n\n count++;\n if(count > image.width * image.height * .5){console.log('Diverge');return visited;}\n \n }\n return visited;\n}", "function putWalls() {\n console.log(\"Walls\");\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n if (grid[i][j] != source && grid[i][j] != end) {\n if (random(1) < 0.1) {\n grid[i][j].wall = true;\n }\n }\n }\n }\n\n source.wall = false;\n end.wall = false;\n\n background(\"#FFFFFF\");\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n grid[i][j].showCell(color(\"#FFFFFF\"));\n }\n }\n\n source.showCell(color(\"#1a3da6\"));\n end.showCell(color(\"#fd1036\"));\n}", "function add_boundaries(clean_board) {\n\t// Top wall\n\tfor (var i = 3; i < clean_board[0].length; i += 2) {\n\t\tclean_board[0][i] = EDGE_CLOSED;\n\t}\n\t// Bottom wall\n\tfor (var i = 1; i < clean_board[0].length - 2; i += 2) {\n\t\tclean_board[clean_board.length - 1][i] = EDGE_CLOSED;\n\t}\n\t// Left and right walls\n\tfor (var i = 1; i < clean_board.length; i += 2) {\n\t\tclean_board[i][0] = EDGE_CLOSED;\n\t\tclean_board[i][clean_board[0].length - 1] = EDGE_CLOSED;\n\t}\n\treturn clean_board;\n}", "function addEdgeWalls(myWalls)\n{\n\tvar newWalls = myWalls;\n\n\tfor (var i = 0; i < dimX; i++)\n\t{\n\t\tnewWalls[i][0] = true;\n\t}\n\n\treturn newWalls;\n}", "function generate(width, height) {\n\t\n\t// initialize walls\n\tvar map = [];\n\tfor(var x=0;x<width;x++) {\n\t\tmap[x] = [];\n\t\tfor(var y=0;y<height;y++) {\n\t\t\tmap[x][y] = {visited:false, walls: {left:true,right:true,bottom:true,top:true}};\n\t\t}\n\t}\n\n\t// generate walls\n\tvar x = r.nextRange(0, width), y = r.nextRange(0, height);\n\tvar stack = [];\n\twhile(true) {\n\t\tmap[x][y].visited = true;\n\t\t// select the next room to visit\n\t\tvar nextRoomOptions = [];\n\t\tif(x>0 && map[x-1][y].visited == false)\n\t\t\tnextRoomOptions.push({x:x-1,y:y});\n\t\tif(x<width-1 && map[x+1][y].visited == false)\n\t\t\tnextRoomOptions.push({x:x+1,y:y});\n\t\tif(y>0 && map[x][y-1].visited == false)\n\t\t\tnextRoomOptions.push({x:x,y:y-1});\n\t\tif(y<width-1 && map[x][y+1].visited == false)\n\t\t\tnextRoomOptions.push({x:x,y:y+1});\n\t\tif(nextRoomOptions.length == 0) {\n\t\t\tif(stack.length == 0)\n\t\t\t\tbreak;\n\t\t\tvar spos = stack.pop();\n\t\t\tx = spos.x;\n\t\t\ty = spos.y;\n\t\t\tcontinue;\n\t\t}\n\t\tstack.push({x:x,y:y});\n\t\tvar nextPosition = r.choice(nextRoomOptions);\n\t\t// open up the wall between this and the next room\n\t\tif(nextPosition.x < x && y == nextPosition.y) {\n\t\t\tmap[x][y].walls.left = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.right = false;\n\t\t} else if(nextPosition.x > x && y == nextPosition.y) {\n\t\t\tmap[x][y].walls.right = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.left = false;\n\t\t} else if(nextPosition.x == x && nextPosition.y < y) {\n\t\t\tmap[x][y].walls.top = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.bottom = false;\n\t\t} else if(nextPosition.x == x && nextPosition.y > y) {\n\t\t\tmap[x][y].walls.bottom = false;\n\t\t\tmap[nextPosition.x][nextPosition.y].walls.top = false;\n\t\t}\n\n\t\tx = nextPosition.x;\n\t\ty = nextPosition.y;\n\t}\n\t// initialize blocks\n\tvar blocks = [];\n\tfor(var x=0;x<width*2+1;x++) {\n\t\tblocks[x] = [];\n\t\tfor(var y=0;y<height*2+1;y++) {\n\t\t\tblocks[x][y] = true;\n\t\t}\n\t}\n\t// populate blocks\n\tfor(var x=0;x<width;x++) {\n\t\tfor(var y=0;y<height;y++) {\n\t\t\tvar m = map[x][y];\n\t\t\tif(m.visited === false)\n\t\t\t\tcontinue;\n\t\t\tblocks[x*2+1][y*2+1] = false;\n\t\t\tif(x>0 && m.walls.left == false)\n\t\t\t\tblocks[(x*2)-1+1][y*2+1] = false;\n\t\t\tif(x<width-1 && m.walls.right == false)\n\t\t\t\tblocks[(x*2)+1+1][y*2+1] = false;\n\t\t\tif(y>0 && m.walls.top == false)\n\t\t\t\tblocks[x*2+1][(y*2)-1+1] = false;\n\t\t\tif(y<height-1 && m.walls.bottom == false)\n\t\t\t\tblocks[x*2+1][(y*2)+1+1] = false;\n\t\t}\n\t}\n\t// reduce blocks\n\t// creates more open areas instead of narrow corridors\n\t// removes blocks that has 3 free sides\n\tfor(var i=0;i<10;i++) {\n\t\tfor(var x=0;x<blocks.length;x++) {\n\t\t\tfor(var y=0;y<blocks[x].length;y++) {\n\n\t\t\t\tvar sides = 0;\n\n\t\t\t\tif(x>0 && blocks[x-1][y] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(y>0 && blocks[x][y-1] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(x<blocks.length-1 && blocks[x+1][y] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(y<blocks.length-1 && blocks[x][y+1] == false)\n\t\t\t\t\tsides++;\n\n\t\t\t\tif(sides>=3)\n\t\t\t\t\tblocks[x][y] = false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn blocks;\n}", "fillMap() {\n const layout = this.config.layout || [[]];\n\n // First pass to assign basic walls\n layout.forEach((row, y) => {\n row.forEach((col, x) => {\n if (col === 1) {\n this.groundLayer.putTileAt(TILES.FLOOR.BASIC, x, y);\n return;\n }\n\n const isWall = Object.values(getNeighbors(x, y))\n .reduce((a, pos) => isFloorTile(layout, pos) || a, false);\n\n if (isWall) {\n layout[y][x] = 2;\n }\n });\n });\n\n // Second pass to determine wall orientation\n layout.forEach((row, y) => {\n row.forEach((col, x) => {\n if (col < 2) {\n return;\n }\n\n const neighbors = getNeighbors(x, y);\n\n let wallHash = 0;\n if (isWallTile(layout, neighbors.t)) {\n wallHash |= WALL_FLAGS.TOP;\n }\n if (isWallTile(layout, neighbors.r)) {\n wallHash |= WALL_FLAGS.RIGHT;\n }\n if (isWallTile(layout, neighbors.b)) {\n wallHash |= WALL_FLAGS.BOTTOM;\n }\n if (isWallTile(layout, neighbors.l)) {\n wallHash |= WALL_FLAGS.LEFT;\n }\n\n switch (wallHash) {\n case 1:\n this.groundLayer.putTileAt(TILES.WALL.VERTICAL.CAP_BOTTOM, x, y);\n break;\n case 2:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.CAP_LEFT, x, y);\n break;\n case 3:\n this.groundLayer.putTileAt(TILES.CORNER.BOTTOM_LEFT, x, y);\n break;\n case 4:\n this.groundLayer.putTileAt(TILES.WALL.VERTICAL.CAP_TOP, x, y);\n break;\n case 5:\n this.groundLayer.putTileAt(TILES.WALL.VERTICAL.OPEN, x, y);\n break;\n case 6:\n this.groundLayer.putTileAt(TILES.CORNER.TOP_LEFT, x, y);\n break;\n case 7:\n this.groundLayer.putTileAt(TILES.T_CORNER.RIGHT, x, y);\n break;\n case 8:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.CAP_RIGHT, x, y);\n break;\n case 9:\n this.groundLayer.putTileAt(TILES.CORNER.BOTTOM_RIGHT, x, y);\n break;\n case 10:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.OPEN, x, y);\n break;\n case 11:\n this.groundLayer.putTileAt(TILES.T_CORNER.TOP, x, y);\n break;\n case 12:\n this.groundLayer.putTileAt(TILES.CORNER.TOP_RIGHT, x, y);\n break;\n case 13:\n this.groundLayer.putTileAt(TILES.T_CORNER.LEFT, x, y);\n break;\n case 14:\n this.groundLayer.putTileAt(TILES.T_CORNER.BOTTOM, x, y);\n break;\n case 15:\n this.groundLayer.putTileAt(TILES.T_CORNER.ALL, x, y);\n break;\n default:\n this.groundLayer.putTileAt(TILES.WALL.HORIZONTAL.CAP_BOTH, x, y);\n }\n });\n });\n }", "triangleFanFill(seedEdge) {\n var currentEdge = seedEdge;\n do {\n var isTriangle = currentEdge.next.next == currentEdge.prev;\n if (isTriangle) break;\n\n currentEdge = this.insertBoundaryTriangle(currentEdge);\n } while (!isTriangle);\n this.closeTriangleBound(currentEdge);\n }", "function createWalls(map)\n{\n //var n = [];\n for (var y = 0; y < map.length; y++)\n {\n for (var x = 0; x < map[0].length; x++)\n {\n if (map[y][x] === 1 && map[y][x] !== 2)\n {\n if (y > 0 && y < map.length - 1 && x > 0 && x < map[0].length - 1)\n {\n if (map[y][x + 1] === 0 || map[y + 1][x] === 0)\n map[y][x] = 2;\n if (map[y][x - 1] === 0 || map[y - 1][x] === 0)\n map[y][x] = 2;\n }\n if (y === 0) {\n if (map[y + 1][x] === 0)\n map[y][x] = 2;\n }\n if (y === map.length - 1) {\n if (map[y - 1][x] === 0)\n map[y][x] = 2;\n }\n if (x === 0) {\n if (map[y][x + 1] === 0)\n map[y][x] = 2;\n }\n if (x === map[0].length - 1) {\n if (map[y][x - 1] === 0)\n map[y][x] = 2;\n }\n }\n }\n }\n}", "function create_wall() {\r\n\t\t/*wall = {\r\n\t\tx: Math.round(Math.random()*(w-cw)/cw),\r\n\t\ty: Math.round(Math.random()*(h-cw)/cw),\r\n\t\t};*/\r\n\t\tvar p,\r\n\t\tq,\r\n\t\tr,\r\n\t\ts;\r\n\t\tvar interseca = false;\r\n\t\tvar length = 10; //\r\n\t\twall_array = []; //Empty array to start with\r\n\r\n\t\tvar walll = new Wall(0, 0, w, 0);\r\n\t\twall_array.push(walll);\r\n\t\twalll = new Wall(w, 0, w, h);\r\n\t\twall_array.push(walll);\r\n\t\twalll = new Wall(0, 0, 0, h);\r\n\t\twall_array.push(walll);\r\n\t\twalll = new Wall(0, h, w, h);\r\n\t\twall_array.push(walll);\r\n\t\tfor (var i = length - 1; i >= 0; i--) {\r\n\r\n\t\t\tdo { //finchè non esce un muro che non si interseca con gli altri\r\n\t\t\t\tinterseca = false;\r\n\t\t\t\tp = Math.round(Math.random() * (w - cw));\r\n\t\t\t\tq = Math.round(Math.random() * (h - cw));\r\n\t\t\t\tr = Math.round(Math.random() * (w - cw));\r\n\t\t\t\ts = Math.round(Math.random() * (h - cw));\r\n\r\n\t\t\t\tfor (var k = 0; k < wall_array.length && !interseca; k++) {\r\n\t\t\t\t\t//\tvar c = wall_array[k];\r\n\t\t\t\t\tinterseca = interseca || intersects(wall_array[k].x1, wall_array[k].y1, wall_array[k].x2, wall_array[k].y2, p, q, r, s);\r\n\t\t\t\t}\r\n\t\t\t} while (interseca);\r\n\r\n\t\t\t//wall_array.push({x: Math.round(Math.random()*(w-cw)/cw), y: Math.round(Math.random()*(h-cw)/cw)});\r\n\r\n\t\t\tvar walll = new Wall(p, q, r, s);\r\n\t\t\twall_array.push(walll);\r\n\t\t\t//wall_array.push({x: Math.round(Math.random()*(w-cw)), y: Math.round(Math.random()*(h-cw))});// FARE I MURI come matrice o disegnarli come righe memorizzandoli a coppie di punti\r\n\r\n\t\t}\r\n\r\n\t\t//This will create a cell with x/y between 0-44\r\n\t\t//Because there are 45(450/10) positions accross the rows and columns\r\n\t}", "function\ninit_maze(w1, h1)\n{\n var i, j, vedges, hedges;\n var x, y, t, inc, xoff, yoff;\n\n vedges = (w1-1)*h1; /* number of vertical edges */\n hedges = (h1-1)*w1; /* number of horizontal edges */\n redges = edges = vedges + hedges; /* number of removable edges */\n perimeters = 2*w1 + 2*h1;\n vertices = (w1+1)*(h1+1);\n groups = w1*h1;\n\n /* allocate edge array */\n edge = []\n for(i = 0; i < edges; i++)\n edge.push(new Edge())\n\n /* fill in the vertical edges */\n for (i=0; i<vedges; i++) {\n x = Math.floor(i%(w1-1)); /* convert edge number to column */\n y = Math.floor(i/(w1-1)); /* and row */\n j = Math.floor(y*w1 + x); /* convert to cell number */\n edge[i].cell1 = j;\n edge[i].cell2 = j+1;\n edge[i].vertex1 = Math.floor(y*(w1+1) + x+1); /* convert to vertex number */\n edge[i].vertex2 = Math.floor((y+1)*(w1+1) + x+1);\n edge[i].valid = true;\n edge[i].draw = true;\n }\n for (i=vedges; i<edges; i++) {\n j = Math.floor(i - vedges); /* convert to cell number */\n x = Math.floor(j%w1); /* convert edge number to column */\n y = Math.floor(j/w1); /* and row*/\n edge[i].cell1 = j;\n edge[i].cell2 = j + w1;\n edge[i].vertex1 = Math.floor((y+1)*(w1+1) + x); /* convert to vertex number */\n edge[i].vertex2 = Math.floor((y+1)*(w1+1) + x+1);\n edge[i].valid = true;\n edge[i].draw = true;\n }\n\n /* allocate perimeter */\n perimeter = []\n for(var i = 0; i < perimeters; i++)\n perimeter.push(new Edge())\n\n /* fill in horizontal perimeter */\n for (i=0; i<w1; i++) {\n perimeter[2*i].cell1 = i;\n perimeter[2*i].cell2 = i;\n perimeter[2*i].vertex1 = i;\n perimeter[2*i].vertex2 = i + 1;\n perimeter[2*i].valid = true;\n perimeter[2*i].draw = true;\n perimeter[2*i+1].cell1 = Math.floor(i + h1*w1);\n perimeter[2*i+1].cell2 = Math.floor(i + h1*w1);\n perimeter[2*i+1].vertex1 = Math.floor(i + h1*(w1+1));\n perimeter[2*i+1].vertex2 = Math.floor(i + h1*(w1+1) + 1);\n perimeter[2*i+1].valid = true;\n perimeter[2*i+1].draw = true;\n }\n /* fill in vertical perimeter */\n for (i=w1; i<w1+h1; i++) {\n j = i-w1;\n perimeter[2*i].cell1 = Math.floor(j*w1);\n perimeter[2*i].cell2 = Math.floor(j*w1);\n perimeter[2*i].vertex1 = j*(w1+1);\n perimeter[2*i].vertex2 = (j+1)*(w1+1);\n perimeter[2*i].valid = true;\n perimeter[2*i].draw = true;\n perimeter[2*i+1].cell1 = Math.floor((j+1)*w1 - 1);\n perimeter[2*i+1].cell2 = Math.floor((j+1)*w1 - 1);\n perimeter[2*i+1].vertex1 = Math.floor((j+1)*(w1+1) - 1);\n perimeter[2*i+1].vertex2 = Math.floor((j+2)*(w1+1) - 1);\n perimeter[2*i+1].valid = true;\n perimeter[2*i+1].draw = true;\n }\n\n //Verticies handled on a per-object basis, no need to generate vertexes as the maze is built. Generated here for debug only.\n /* allocate vertex array */\n vertex = []\n for(var i = 0; i < vertices; i++)\n vertex.push(vec2())\n\n /* figure out the spacing between vertex coordinates. we want\n square cells so use the minimum spacing */\n inc = (3.6/w1)*10;\n t = (3.6/h1)*10;\n if (t < inc) {\n inc = t;\n }\n /* determine the required offsets to center the maze using the\n spacing calculated above */\n xoff = Math.floor((4.0-w1*inc)/2 - 2.0);\n yoff = Math.floor((4.0-h1*inc)/2 - 2.0);\n /* fill in the vertex array */\n for (i=0; i<vertices; i++) {\n x = Math.floor(i%(w1+1));\n y = Math.floor(i/(w1+1));\n vertex[i][0] = x*inc + xoff;\n vertex[i][1] = y*inc + yoff;\n }\n\n /* allocate the group table */\n group = []\n\n /* set the group table to the identity */\n for (i=0; i<groups; i++) {\n group[i] = i;\n }\n}", "floodFill() {\n for(var i = 0; i < this.neighbourCells.length; i++){\n var neighbor = this.neighbourCells[i];\n if(neighbor != undefined){\n if (!neighbor.revealed && !neighbor.isFlag) {\n neighbor.reveal();\n }\n }\n } \n }", "function resetWalls() {\n\n wallSet.clear();\n reset();\n}", "function generateAdjacentWalls(i) {\n var adjacent = [];\n var emptyAdjacent = [];\n if (isAdjacent(i, upFrom(i))) {\n adjacent.push(upFrom(i));\n }\n if (isAdjacent(i, downFrom(i))) {\n adjacent.push(downFrom(i));\n }\n if (isAdjacent(i, leftFrom(i))) {\n adjacent.push(leftFrom(i));\n }\n if (isAdjacent(i, rightFrom(i))) {\n adjacent.push(rightFrom(i));\n }\n for (var i = 0; i < adjacent.length; i++) {\n if (board[adjacent[i]].length === 0) {\n emptyAdjacent.push(adjacent[i]);\n }\n }\n for (var i = 0; i < emptyAdjacent.length; i++) {\n maybePutWallInTile(emptyAdjacent[i], 40);\n }\n }", "function\nstep_maze()\n{\n var i, j, k, o, n;\n\n /* randomly select one of the the remaining walls */\n k = Math.floor(Math.random()*redges);\n /* scan down the edge array till we find the kth removeable edge */\n for (i=0; i<edges; i++) {\n if (edge[i].valid == true) {\n if (k == 0) {\n edge[i].valid = false;\n n = group[edge[i].cell1];\n o = group[edge[i].cell2];\n /* if the cells are already connected don't remove the wall */\n if (n != o) {\n edge[i].draw = false;\n done = true;\n /* fix up the group array */\n for (j=0; j<groups; j++) {\n if (group[j] == o) {\n group[j] = n;\n }\n if (group[j] != n) {\n done = false; /* if we have more than one\n group we're not done */\n }\n }\n }\n break;\n } else {\n k--;\n }\n }\n }\n redges--; /* decriment the number of removable edges */\n /* if we're done, create an entrance and exit */\n if (done) {\n for (j=0; j<2; j++) {\n /* randomly select a perimeter edge */\n k = Math.floor(Math.random()*(perimeters-j));\n for (i=0; i<perimeters; i++) {\n if (k == 0) {\n if (perimeter[i].valid == true) {\n perimeter[i].draw = false;\n break;\n }\n }\n else {\n k--;\n }\n }\n }\n }\n}", "repaint() {\n this.fill_color = background_color;\n this.wall_color = wall_color;\n maze_buff.strokeCap(SQUARE);\n maze_buff.background(this.fill_color);\n\n // Go over all cells in the grid and repaint their left and top walls\n for (let row = 0; row < this.row_count; ++row) {\n for (let col = 0; col < this.col_count; ++col) {\n if (this.has_left_wall(row, col))\n this.vertical_wall(col-1, col, row, row, true);\n else\n this.vertical_wall(col-1, col, row, row, false);\n if (this.has_top_wall(row, col))\n this.horizontal_wall(col, col, row-1, row, true);\n else\n this.horizontal_wall(col, col, row-1, row, false);\n }\n }\n // Then go over the right column to do its right wall\n for (let row = 0; row < this.row_count; ++row) {\n if (this.has_right_wall(row, this.col_count-1))\n this.vertical_wall(this.col_count-1, this.col_count, row, row, true);\n else\n this.vertical_wall(this.col_count-1, this.col_count, row, row, false);\n }\n // And go over the bottom row to do its bottom wall\n for (let col = 0; col < this.col_count; ++col) {\n if (this.has_bot_wall(this.row_count-1, col))\n this.horizontal_wall(col, col, this.row_count-1, this.row_count, true);\n else\n this.horizontal_wall(col, col, this.row_count-1, this.row_count, false);\n }\n }", "function set_edges() {\n\n dragrect.style(\"stroke\", \"black\");\n\n // Edging goes top, right, bottom, left\n // As a rectangle has 4 sides, there are 2^4 = 16 cases to handle.\n\n\n var numRepeats = Math.floor(rect_geom.width / 4);\n var gap = rect_geom.width - 4 * numRepeats;\n var edge = \"2,2,\".repeat(numRepeats) + gap + \",0\";\n\n var dashArray = \"\";\n\n if (rect_geom.top_fixed){\n dashArray += edge;\n } else {\n dashArray += \"0,\" + rect_geom.width;\n }\n\n if (rect_geom.right_fixed){\n dashArray += \",\" + rect_geom.height + \",0\";\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.height;\n }\n\n if (rect_geom.bottom_fixed){\n dashArray += \",\" + edge;\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.width;\n }\n\n if (rect_geom.left_fixed){\n dashArray += \",\" + rect_geom.height + \",0\";\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.height;\n }\n\n dragrect.style(\"stroke-dasharray\", dashArray);\n common_geom.update_formula();\n }", "reset(){\n this.vertices.forEach(vertex => {\n vertex.color = 'w';\n vertex.isWall = false;\n vertex.distance = Number.MAX_SAFE_INTEGER;\n vertex.parent = null;\n });\n }", "function restoreWalls() {\n if (!wallsAreRemoved) {\n return;\n }\n\n if (container_) {\n self.remove(container_);\n }\n\n let leftSize = neighborSizes[corner_].left;\n let rightSize = neighborSizes[corner_].right;\n\n shedWalls[cornerNeighbors[corner_].left].geometry.clip.pop();\n shedWalls[cornerNeighbors[corner_].right].geometry.clip.pop();\n\n if (neighborSizes[corner_].left <= width_) {\n shedWalls[cornerNeighbors[corner_].afterLeft].geometry.clip.pop();\n }\n\n if (neighborSizes[corner_].right <= width_) {\n shedWalls[cornerNeighbors[corner_].beforeRight].geometry.clip.pop();\n }\n\n innerWalls_ = [];\n\n shedColumns_[corner_].visible = true;\n\n if (leftSize <= width_) {\n let nextContainer = (corner_ < 3) ? corner_ + 1 : 0;\n shedColumns_[nextContainer].visible = true;\n }\n\n if (rightSize <= width_) {\n let previousCorner = (corner_ > 0) ? corner_ - 1 : 3;\n shedColumns_[previousCorner].visible = true;\n }\n\n wallsAreRemoved = false;\n }", "function generateWallTiles(upAndDown,nodeArray,wallNodes){\n var wallDensity = $('#wallDensity').val();\n wallDensity = Number(wallDensity);\n while (wallNodes.length<(maxRow*maxRow*wallDensity)){\n if (!upAndDown){\n isWall = (Math.floor(Math.random()*((maxRow*maxRow-1)-0+1))+0);\n while ((isWall % maxRow == 0) || ((isWall-(maxRow-1))%maxRow == 0) || (isWall == maxRow-1)){\n isWall = (Math.floor(Math.random()*((maxRow*maxRow-1)-0+1))+0);}\n for (var i=0; i<nodeArray.length; i++){\n if (nodeArray[i].id == isWall){\n nodeArray[i].isAWall = true;\n nodeArray[i].backgroundcolor = 'black';\n wallNodes.push(isWall);\n }\n }}\n else{\n isWall = (Math.floor(Math.random()*((maxRow*maxRow-(maxRow+1))-maxRow+1)) + maxRow);\n for (var i=0; i<nodeArray.length; i++){\n if (nodeArray[i].id == isWall){\n nodeArray[i].isAWall = true;\n nodeArray[i].backgroundcolor = 'black';\n wallNodes.push(isWall);\n }\n }}\n }\n return nodeArray\n}", "function fillBlanks() {\n for (var r = 0; r < n; r++)\n for (var c = 0; c < n + r + 1; c++) {\n var p = v[5] + dx*c + dl*r;\n drawPoly(p, p + dl, p + dl + dr, p + dr, yellow);\n }\n for (var r = n; r < 2*n - 1; r++)\n for (var c = r - n + 1; c < 2*n; c++) {\n var p = v[5] + dx*c + dl*r;\n drawPoly(p, p + dl, p + dl + dr, p + dr, yellow);\n }\n}", "function initializeEdges() {\n edges = [\n [5, 0, 1],\n [2, 0, 2],\n [10, 0, 3],\n [7, 1, 4],\n [4, 2, 5],\n [1, 1, 3],\n [5, 2, 3],\n [6, 3, 4],\n [3, 3, 6],\n [11, 3, 5],\n [13, 4, 6],\n [9, 5, 6]\n ]\n}", "function generateGraph(size = Math.ceil(Math.random()*20)+10){ \r\n clearTimeout(currTimeout);\r\n clearTimeout(explore);\r\n clearTimeout(draw);\r\n\r\n size = parseInt(size);\r\n if(size % 2 == 0) size += 1;\r\n\r\n $(function(){\r\n $(\"#currSize\").text(size);\r\n $(\"#sizeInput\").attr(\"placeholder\", size + \" (Odd number 1-101)\");\r\n });\r\n \r\n //console.log(size);\r\n var cellWidth = canvSize/size;\r\n var cellHeight = canvSize/size;\r\n //console.log(cellWidth);\r\n\r\n matrix = new Array();\r\n for(var i=0; i<size; i++){\r\n matrix[i] = new Array();\r\n for(var j=0; j<size; j++){\r\n matrix[i][j] = 0;\r\n // context.fillStyle = (matrix[i][j] == 0) ? \"#000000\" : \"#FFFFFF\";\r\n // context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n }\r\n }\r\n\r\n \r\n innerWalls(1, size-2, 1, size-2, true); //marks interior walls as 1\r\n outerWalls(size); //exterior walls are 1\r\n\r\n for(var i=0; i<size; i++){ //drawing walls\r\n for(var j=0; j<size; j++){\r\n context.fillStyle = (matrix[i][j] == 1) ? \"#000000\" : \"#FFFFFF\";\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"#000000\";\r\n context.fillRect(i*cellWidth,j*cellHeight, 1, cellHeight);\r\n context.fillRect(i*cellWidth,j*cellHeight, cellWidth, 1);\r\n context.fillRect((i+1)*cellWidth-1,j*cellHeight-1, 1, cellHeight);\r\n context.fillRect(i*cellWidth,(j+1)*cellHeight, cellWidth, 1);\r\n\r\n context.fillStyle = \"green\";\r\n context.font = cellWidth/2 + \"px Arial\";\r\n //context.fillText(\"Test\", i*cellWidth, j*cellHeight+(cellHeight/1.5));\r\n }\r\n }\r\n context.fillStyle = \"red\";\r\n context.fillRect(cellWidth, cellHeight, cellWidth, cellHeight);\r\n context.fillRect(cellWidth*(size-2), cellWidth*(size-2), cellWidth, cellHeight);\r\n\r\n context.fillStyle = \"black\";\r\n\r\n\r\n \r\n}", "function removeWalls() {\n if (wallsAreRemoved) {\n return;\n }\n\n let leftSize = neighborSizes[corner_].left;\n let rightSize = neighborSizes[corner_].right;\n\n if (width_ != depth_) {\n shedWalls[cornerNeighbors[corner_].left].geometry.clip.push(-leftSize * 0.5, ((leftSize == width_) ? width_ : depth_) - leftSize * 0.5);\n shedWalls[cornerNeighbors[corner_].right].geometry.clip.push(rightSize * 0.5 - ((leftSize == width_) ? depth_ : width_), rightSize * 0.5);\n } else {\n shedWalls[cornerNeighbors[corner_].left].geometry.clip.push(-leftSize * 0.5, width_ - leftSize * 0.5);\n shedWalls[cornerNeighbors[corner_].right].geometry.clip.push(rightSize * 0.5 - width_, rightSize * 0.5);\n }\n\n if (leftSize <= width_) {\n shedWalls[cornerNeighbors[corner_].afterLeft].geometry.clip\n .push(-rightSize * 0.5, ((width_ != depth_) ? tools.ft2cm(4) : INNER_WALL_SIZE_12) - rightSize * 0.5);\n }\n\n if (rightSize <= width_) {\n shedWalls[cornerNeighbors[corner_].beforeRight].geometry.clip\n .push(leftSize * 0.5 - ((width_ != depth_) ? tools.ft2cm(4) : INNER_WALL_SIZE_12), leftSize * 0.5);\n }\n\n shedColumns_[corner_].visible = false;\n\n if (leftSize <= width_) {\n let nextContainer = (corner_ < 3) ? corner_ + 1 : 0;\n shedColumns_[nextContainer].visible = false;\n }\n\n if (rightSize <= width_) {\n let previousCorner = (corner_ > 0) ? corner_ - 1 : 3;\n shedColumns_[previousCorner].visible = false;\n }\n\n wallsAreRemoved = true;\n }", "wallSides(){\n this.boundaries = [];\n for (var i=0; i<this.grid.length; i++){\n for (var j=0; j<this.grid[i].length; j++){\n if(this.grid[i][j] === 1 || this.grid[i][j] === 2 || this.grid[i][j] === \"D\"){\n this.boundaries.push({top: 50*j, \n down: 50*j+50,\n left: 50*i,\n right: 50*i+50})\n }\n }\n } \n }", "function buildSideFaces() {\n\n var layeroffset = 0;\n sidewalls( contour, layeroffset );\n layeroffset += contour.length;\n\n for ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n ahole = holes[ h ];\n sidewalls( ahole, layeroffset );\n\n //, true\n layeroffset += ahole.length;\n\n }\n\n }", "function drawWalls(ctx, walls, height) {\n height = height || 40;\n\n // XXX: This function merges a lot of responsibilities and should\n // probably be split out or refactored to be better.\n\n // A \"wall\" has an \"x\", its X position, a \"label\" (which is usually a\n // multiple of the X position -- we scale the band up for demonstration\n // purposes), whether the wall is \"selected\" (used for the walkthrough),\n // and whether the wall is \"open\" (used for the walkthrough -- this means)\n // it draws the fill to the wall position but doesn't draw the wall itself.\n\n function drawWall(w) {\n if (w.open) return;\n\n ctx.save();\n\n if (w.selected)\n ctx.fillStyle = ctx.strokeStyle = 'red';\n else\n ctx.fillStyle = ctx.strokeStyle = 'black';\n\n ctx.textAlign = 'center';\n ctx.textBaseline = 'hanging';\n ctx.fillText(w.label, w.x, height);\n\n ctx.beginPath();\n ctx.lineWidth = 2;\n ctx.moveTo(w.x, 0);\n ctx.lineTo(w.x, height);\n ctx.stroke();\n ctx.restore();\n }\n\n function drawFill(w1, w2) {\n var x1 = w1.x, x2 = w2.x;\n\n var fillPad = 6;\n var w = x2 - x1;\n var y1 = fillPad;\n var h = height - fillPad * 2;\n\n ctx.beginPath();\n ctx.rect(x1, y1, w, h);\n ctx.save();\n ctx.fill();\n ctx.restore();\n\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y1);\n ctx.moveTo(x1, y1+h);\n ctx.lineTo(x2, y1+h);\n ctx.save();\n ctx.lineWidth = 2;\n ctx.strokeStyle = '#666';\n ctx.setLineDash([5, 5]);\n ctx.stroke();\n ctx.restore();\n }\n\n for (var i = 0; i < walls.length; i += 2) {\n var w1 = walls[i], w2 = walls[i+1];\n if (w1 && w2) drawFill(w1, w2);\n if (w1) drawWall(w1);\n if (w2) drawWall(w2);\n }\n }", "function set_edges() {\n }", "function fill() {\n\n let newPoints = [];\n\n for (let s = 1; s < waypoints.length; s++) {\n let vector = new Vector(waypoints[s - 1], waypoints[s]);\n\n let numPointsFit = Math.round(Math.ceil(vector.magnitude / fSpacing));\n\n vector = vector.normalize().scale(fSpacing);\n\n for (let i = 0; i < numPointsFit; i++) {\n newPoints.push(waypoints[s - 1].add(vector.scale(i)));\n }\n }\n\n newPoints.push(waypoints[waypoints.length - 1]);\n\n points = newPoints;\n}", "findingEdges(playedFloodBoard) {\n let cornorColor = playedFloodBoard[0][0];\n let dimension = playedFloodBoard.length;\n let findEdges = true;\n let x = 0,\n y = 0;\n let originColor = [[0, 0]];\n let edges = [];\n let expanding = [[0, 0]];\n\n let present = [];\n while (findEdges) {\n let tempExpanding = [];\n expanding.forEach(arr => {\n x = arr[0];\n y = arr[1];\n let holdTempXY = this.getValidIndexArray(x, y, dimension);\n\n holdTempXY.forEach(arr => {\n if (playedFloodBoard[arr[0]][arr[1]] == cornorColor) {\n present = originColor.filter(index =>\n _.isEqual(index, [arr[0], arr[1]])\n );\n if (present.length == 0) {\n tempExpanding.push([arr[0], arr[1]]);\n originColor.push([arr[0], arr[1]]);\n }\n } else {\n present = edges.filter(index => _.isEqual(index, [arr[0], arr[1]]));\n if (present.length == 0) {\n edges.push([arr[0], arr[1]]);\n }\n }\n });\n });\n expanding = tempExpanding;\n if (expanding.length == 0) {\n findEdges = false;\n }\n }\n\n this.edges = edges;\n this.originColor = originColor;\n }", "function initializeWalls() {\n walls_board = [\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, WALL, 0, 0, 0, 0, 0, 0, 0],\n [0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, WALL, 0, 0, 0, 0, WALL, WALL, 0],\n [0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, WALL, WALL, WALL, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, WALL, WALL, WALL, WALL, 0, 0, 0],\n [0, 0, 0, 0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, WALL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, WALL, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, WALL, WALL, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n ];\n}", "function wallMaker() {\n\tvar height = mapArrays.length;\n // Because it's a square we only need to check the length of one line.\n var width = mapArrays[0].length;\n var bottomRowY = mapArrays.length-1;\n var lastColumnX = mapArrays[0].length - 1;\n // A little callback function created inside wallMaker so that we don't have to repeat the same 3 commands.\n function waller(wallThis) {\n wallThis.canMove = false;\n wallThis.description = \"A wall\";\n \twallThis.terrainType = \"wall\";\n wallThis.symbol = \"^\";\n wallThis.color = \"wall\";\n // Or whatever symbol we want to set it to.\n }\n // Walls the top row.\n for(var idx = 0; idx < width; idx++) {\n \tvar toWall = mapArrays[0][idx];\n waller(toWall);\n }\n // Walls the bottom row.\n for(var idx = 0; idx < width; idx++) {\n \tvar toWall = mapArrays[bottomRowY][idx];\n waller(toWall);\n }\n // Walls the sides. Ignores the top and bottom rows since they're already done.\n for(var idx = 1; idx < height-1; idx++) {\n \tvar toWall1 = mapArrays[idx][0];\n var toWall2 = mapArrays[idx][lastColumnX];\n waller(toWall1);\n waller(toWall2);\n }\n}", "drawWall() {\n this.cxt.fillStyle = '#2E1E1E'\n for (let i = 0, l = this.wallCount; i < l; i++) {\n const position = this.getRandomPosition(0, 0)\n this.cxt.fillRect(position[0] * this.count, position[1] * this.count, this.count, this.count)\n this.wallMap[position] = 1\n }\n }", "function createOuterWalls()\r\n{\r\n // Overview for testing purposes\r\n // changeCamera();\r\n // Material that the rest are cloned off of\r\n let g = new THREE.BoxGeometry(40, 20, 1);\r\n let tex = new THREE.TextureLoader().load('./resources/cornwall.jpg');\r\n tex.wrapS = THREE.RepeatWrapping;\r\n tex.wrapT = THREE.RepeatWrapping;\r\n tex.repeat.set(4, 1);\r\n let m = new THREE.MeshLambertMaterial( { map: tex} );\r\n\r\n let c1 = new THREE.Mesh(g, m);\r\n c1.position.z = -20;\r\n // scene.add(c1);\r\n // walls.push(c1);\r\n\r\n // Clone all boundaries off that boundary\r\n let northBoundary = c1.clone();\r\n northBoundary.position.z = -100;\r\n northBoundary.scale.x = 5;\r\n northBoundary.scale.y = 1;\r\n northBoundary.scale.z = 1;\r\n scene.add(northBoundary);\r\n walls.push(northBoundary);\r\n\r\n let southBoundary = northBoundary.clone();\r\n southBoundary.position.z = 100;\r\n scene.add(southBoundary);\r\n walls.push(southBoundary);\r\n\r\n let eastBoundary = northBoundary.clone();\r\n eastBoundary.position.x = 100;\r\n eastBoundary.position.z = 0;\r\n eastBoundary.rotateY(Math.PI/2);\r\n scene.add(eastBoundary);\r\n walls.push(eastBoundary);\r\n\r\n let westBoundary = eastBoundary.clone();\r\n westBoundary.position.x = -100;\r\n scene.add(westBoundary);\r\n walls.push(westBoundary)\r\n\r\n let test = c1.clone();\r\n test.position.z = -85;\r\n test.position.x = -80;\r\n scene.add(test);\r\n walls.push(test);\r\n let test2 = test.clone();\r\n // test2.rotateY(Math.PI / 180)\r\n test.position.z = -86;\r\n scene.add(test2);\r\n walls.push(test2);\r\n}", "function breakWalls(currCell, joinCell) {\r\n if (currCell.x === joinCell.x) {\r\n if (currCell.y > joinCell.y) {\r\n joinCellsY.push({ x: currCell.x, y: currCell.y - unit });\r\n } else if (currCell.y < joinCell.y) {\r\n joinCellsY.push({ x: joinCell.x, y: joinCell.y - unit });\r\n }\r\n } else if (currCell.y === joinCell.y) {\r\n if (currCell.x > joinCell.x) {\r\n joinCellsX.push({ x: currCell.x - unit, y: currCell.y });\r\n } else if (currCell.x < joinCell.x) {\r\n joinCellsX.push({ x: joinCell.x - unit, y: joinCell.y });\r\n }\r\n }\r\n}", "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "function buildSideFaces() {\n\n\t \t\tvar layeroffset = 0;\n\t \t\tsidewalls( contour, layeroffset );\n\t \t\tlayeroffset += contour.length;\n\n\t \t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t \t\t\tahole = holes[ h ];\n\t \t\t\tsidewalls( ahole, layeroffset );\n\n\t \t\t\t//, true\n\t \t\t\tlayeroffset += ahole.length;\n\n\t \t\t}\n\n\t \t}", "function buildSideFaces() {\r\n\r\n\t\tvar layeroffset = 0;\r\n\t\tsidewalls( contour, layeroffset );\r\n\t\tlayeroffset += contour.length;\r\n\r\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\tahole = holes[ h ];\r\n\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t//, true\r\n\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t}\r\n\r\n\t}", "_floodFillOutside(x, y) {\r\n x = this._mod(x)\r\n if (!this._safeCell(x, y)) return\r\n var cell = this.grid[x][y]\r\n if (cell === undefined) return\r\n if (x%2 !== y%2 && cell !== 2) return\r\n this.grid[x][y] = undefined\r\n\r\n // @Performance: Why is this ordered TLBR?\r\n this._floodFillOutside(x, y + 1)\r\n this._floodFillOutside(x + 1, y)\r\n this._floodFillOutside(x, y - 1)\r\n this._floodFillOutside(x - 1, y)\r\n }", "edges() {\r\n if (this.pos.x > width) {\r\n this.pos.x = 0;\r\n this.updatePrev();\r\n }\r\n if (this.pos.x < 0) {\r\n this.pos.x = width;\r\n this.updatePrev();\r\n }\r\n if (this.pos.y > height) {\r\n this.pos.y = 0;\r\n this.updatePrev();\r\n }\r\n if (this.pos.y < 0) {\r\n this.pos.y = height;\r\n this.updatePrev();\r\n }\r\n\r\n }", "connectPath() {\n this.entities.node = {}\n this.entities.path = {}\n this.geo.indexes.forEach((i) => (this.entities.square[i] = true))\n const { makeWalls, walls } = this.options\n\n // walls generated by makeWalls are not stored in options.walls\n makeWalls(this)\n Object.assign(this.entities.wall, walls)\n\n if (this.options.nodes.length === 0) {\n this.options.nodes = getCorners(this, 3)\n }\n const nodes = this.options.nodes.slice() // clone because we might add one to it\n const first_xy = this.geo.index2xy(nodes[0])\n const last_xy = this.geo.index2xy(nodes[nodes.length - 1])\n this.start1 = nodes[0]\n this.start2 = nodes[nodes.length - 1]\n const half = Math.floor(nodes.length / 2)\n nodes.forEach((index, i) => {\n this.entities.node[index] = i >= half ? 2 : 1\n })\n if (nodes.length > 2 && vector.magnitude(vector.subtract(first_xy, last_xy)) < 8) {\n // nodes wrap around board\n nodes.push(nodes[0])\n this.start2 = nodes[half]\n }\n let last_node = nodes[0]\n // TODO this will break if not orthogonal\n // probably need to insert extra nodes into the temporary list of nodes\n nodes.slice(1).forEach((node) => {\n const xy1 = this.geo.index2xy(last_node)\n const xy2 = this.geo.index2xy(node)\n const dindex = this.geo.floorDindex(last_node - node)\n range(vector.magnitude(vector.subtract(xy1, xy2))).forEach((i_step) => {\n const index = node + i_step * dindex\n this.entities.path[index] = dindex\n })\n last_node = node\n })\n }", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function Cell(i, j) {\r\n this.i = i;\r\n this.j = j;\r\n this.walls = [true, true, true, true]; // top right bottom left\r\n\r\n this.visited = false;\r\n\r\n this.show = function() {\r\n var x = this.i * w;\r\n var y = this.j * w;\r\n stroke(255, 255, 25);\r\n\r\n if (this.walls[0]) { // top\r\n line(x , y , x + w, y ); \r\n }\r\n if (this.walls[1]) { // right \r\n line(x + w, y , x + w, y + w); \r\n }\r\n if (this.walls[2]) { // bottom\r\n line(x + w, y + w, x , y + w);\r\n }\r\n if (this.walls[3]) { // left\r\n line(x , y + w, x , y );\r\n }\r\n \r\n if (this.visited) {\r\n noStroke();\r\n fill(255, 0, 255, 100);\r\n rect(x, y, w, w);\r\n }\r\n }\r\n\r\n this.checkNeighbors = function() {\r\n var neighbors = [];\r\n\r\n var top = grid[index(i , j - 1)];\r\n var right = grid[index(i + 1, j )];\r\n var bottom = grid[index(i , j + 1)];\r\n var left = grid[index(i - 1, j )];\r\n\r\n if (top && !top.visited) {\r\n neighbors.push(top);\r\n }\r\n if (right && !right.visited) {\r\n neighbors.push(right);\r\n }\r\n if (bottom && !bottom.visited) {\r\n neighbors.push(bottom);\r\n }\r\n if (left && !left.visited) {\r\n neighbors.push(left);\r\n }\r\n\r\n if (neighbors.length > 0) {\r\n var r = floor(random(0, neighbors.length));\r\n return neighbors[r];\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n this.hightlight = function() {\r\n var x = this.i * w;\r\n var y = this.j * w;\r\n noStroke();\r\n fill(100, 100, 255, 100);\r\n rect(x, y, w, w);\r\n }\r\n}", "function walls() {\n var ball;\n for (var i = 0; i < balls.length; i++) {\n ball = balls[i]\n \n if (ball.x - BALL_RADIUS < 0) {\n ball.x = BALL_RADIUS;\n ball.vx = -ball.vx;\n }\n if (ball.y - BALL_RADIUS < 0) {\n ball.y = BALL_RADIUS;\n ball.vy = -ball.vy;\n }\n if (ball.x + BALL_RADIUS > CANVAS_WIDTH) {\n ball.x = CANVAS_WIDTH - BALL_RADIUS;\n ball.vx = -ball.vx;\n }\n if (ball.y + BALL_RADIUS > CANVAS_HEIGHT) {\n ball.y = CANVAS_HEIGHT - BALL_RADIUS;\n ball.vy = -ball.vy;\n }\n }\n}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\t}", "function buildSideFaces() {\n\t\n\t\t\t\tvar layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\t\n\t\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\t\n\t\t\t\t\tahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\t\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\t\n\t\t\t\t}\n\t\n\t\t\t}", "function buildSideFaces() {\r\n\r\n\t\t\tvar layeroffset = 0;\r\n\t\t\tsidewalls( contour, layeroffset );\r\n\t\t\tlayeroffset += contour.length;\r\n\r\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\r\n\r\n\t\t\t\tahole = holes[ h ];\r\n\t\t\t\tsidewalls( ahole, layeroffset );\r\n\r\n\t\t\t\t//, true\r\n\t\t\t\tlayeroffset += ahole.length;\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function fillHole (i, j, count, dir) {\n\n\tvar that = this;\n\n\t// update the matrix and gems\n\tif (dir === \"horizontal\") {\n\t\t// update (0~i, j - count + 1) ~ (0~i, j), move down one step\n\t\tfor (var row = i - 1; row >= 0; row--) {\n\t\t\tfor (var col = j; col >= j - count + 1; col--) {\n\t\t\t\tvar theGem = matrix[row][col];\n\t\t\t\t// update the gem\n\t\t\t\tvar gemy = theGem.style.y;\n\n\t\t\t\tsetTimeout((function () {\n\t\t\t\t\ttheGem.updateOpts({\n\t\t\t\t\t\ty: gemy + IMG_SIZE\n\t\t\t\t\t});\n\t\t\t\t}).call(that), 350);\n\n\t\t\t\tanimate(theGem).now({y: gemy}, 0, animate.easeIn).then({y: theGem.style.y}, 350, animate.easeIn);\n\t\t\t\tmatrix[row + 1][col] = theGem;\n\t\t\t}\n\t\t}\n\t}\n\tif (dir === \"vertical\") {\n\t\t// update (0, j) ~ (i - count, j)\n\t\tfor (var row = i - count; row >= 0; row--) {\n\t\t\tvar theGem = matrix[row][j];\n\t\t\tvar gemy = theGem.style.y;\n\n\t\t\tsetTimeout((function () {\n\t\t\t\ttheGem.updateOpts({\n\t\t\t\t\ty: gemy + IMG_SIZE * count\n\t\t\t\t});\n\t\t\t}).call(that), 450);\n\n\t\t\tanimate(theGem).now({y: gemy}, 0, animate.easeIn).then({y: theGem.style.y}, 450, animate.easeIn);\n\t\t\tmatrix[row + count][j] = theGem;\n\t\t}\n\t}\n\n\taddNewGems.call(this, i, j, count, dir);\n}", "populateEdges() {\n\n let tag = 0;\n this.organisms = [];\n\n for (let i = 0; i < this.grid.length; i++) {\n let temp = new Organism(tag, i);\n if (i >= rows &&\n i % (rows) !== 0 &&\n (i + rows + 1) % (rows) !== 0 &&\n i < this.grid.length - rows) {\n temp.alive = false;\n }\n this.organisms.push(temp);\n tag++;\n }\n }", "function createWalls5() {\n return [].concat.apply([], [wall({x: 150, y: 550, w: 50, h: 50}, false), wall({x: 145, y: 200, w: 50, h: 250}, false),\n wall({x: 250, y: 200, w: 100, h: 50}, false), wall({x: 405, y: 200, w: 100, h: 50}, false), wall({x: 560, y: 200, w: 100, h: 50}, false),\n wall({x: 715, y: 200, w: 100, h: 50}, false), wall({x: 750, y: 100, w: 50, h: 50}, false), wall({x: 300, y: 250, w: 50, h: 200}, false), wall({x: 405, y: 250, w: 50, h: 200}, false)]);\n}", "function setNeighbors() {\n\tvar width = tiles[0].length - 1;\n\tvar height = tiles.length - 1;\n\tfor(y = 1; y < height; y++) {\n\t\tfor(x = 1; x < width; x++) {\n\t\t\ttiles[y][x].addNeighbors( tiles[y][x-1]);\n\t\t\ttiles[y][x].addNeighbors( tiles[y+1][x]);\n\t\t\ttiles[y][x].addNeighbors( tiles[y][x+1]);\n\t\t\ttiles[y][x].addNeighbors( tiles[y-1][x]);\t\t\n\t\t}\n\t}\n}", "function addWalls() {\n let allWallNodes = document.querySelectorAll('.wall-node');\n allWallNodes.forEach((wallNode) => {\n visitedNodes.add(wallNode.id)\n });\n }", "function buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\t\t}", "function createHorizontalWalls()\r\n{\r\n // Material to clone into all wall shapes\r\n let v = getWall(); v.rotateY(Math.PI/0);\r\n v.position.x = -50;\r\n v.position.z = -85;\r\n v.scale.x = 3;\r\n addWall(v);\r\n\r\n let h1 = getWall();\r\n h1.position.x = -77\r\n h1.position.z = -72;\r\n h1.scale.x = 3;\r\n addWall(h1);\r\n\r\n let h2 = getWall();\r\n h2.position.x = -56;\r\n h2.position.z = -57;\r\n h2.scale.x = 9;\r\n addWall(h2);\r\n\r\n let h3 = getWall();\r\n h3.position.x = 33;\r\n h3.position.z = -85;\r\n h3.scale.x = 10;\r\n addWall(h3);\r\n \r\n let v1 = getWall(); v1.rotateY(Math.PI/2);\r\n v1.position.x = -34;\r\n v1.position.z = -74;\r\n v1.scale.x = 3;\r\n addWall(v1);\r\n\r\n let h4 = getWall();\r\n setWall(h4, 27, -72);\r\n h4.scale.x = 9;\r\n\r\n let v2 = getWall();\r\n setWall(v2, 39, -31, true)\r\n v2.scale.x = 11\r\n\r\n let h5 = getWall();\r\n setWall(h5, 23, -30); \r\n h5.scale.x = 15;\r\n\r\n let v3 = getWall();\r\n setWall(v3, 69, -53, true);\r\n v3.scale.x = 1.5;\r\n\r\n let v4 = getWall();\r\n setWall(v4, 14, -55, true);\r\n v4.scale.x = 3;\r\n\r\n let v5 = getWall();\r\n setWall(v5, -78, -25, true);\r\n v5.scale.x = 4.5;\r\n \r\n let v6 = getWall();\r\n setWall(v6, -18, -13, true);\r\n v6.scale.x = 3\r\n\r\n let v7 = getWall();\r\n setWall(v7, -38, -30, true);\r\n v7.scale.x = 2;\r\n\r\n let h6 = getWall();\r\n setWall(h6, 59, 80);\r\n h6.scale.x = 5;\r\n\r\n let h7 = getWall();\r\n setWall(h7, -55, 51);\r\n h7.scale.x = 6;\r\n\r\n let h8 = getWall();\r\n setWall(h8, -18, -9);\r\n h8.scale.x = 8;\r\n\r\n let v9 = getWall();\r\n setWall(v9, -54, 50, true);\r\n v9.scale.x = 7;\r\n\r\n let v10 = getWall();\r\n setWall(v10, 69, 26, true);\r\n v10.scale.x = 5;\r\n\r\n let v11 = getWall();\r\n setWall(v11, 9, 40, true);\r\n v11.scale.x = 8;\r\n\r\n let h9 = getWall();\r\n setWall(h9, -23, 29);\r\n h9.scale.x = 4;\r\n\r\n let h10 = getWall();\r\n setWall(h10, -77, 34);\r\n h10.scale.x = 4.5;\r\n\r\n let v12 = getWall();\r\n setWall(v12, -77, 67, true);\r\n v12.scale.x = 3;\r\n\r\n let h11 = getWall();\r\n setWall(h11, 9, 65);\r\n h11.scale.x = 4;\r\n\r\n let v13 = getWall();\r\n setWall(v13, -34, 73, true);\r\n v13.scale.x = 2;\r\n\r\n let v14 = getWall();\r\n setWall(v14, 61, 89, true);\r\n v14.scale.x = 2;\r\n\r\n let h12 = getWall();\r\n setWall(h12, 60, -14);\r\n h12.scale.x = 4;\r\n\r\n let h13 = getWall();\r\n setWall(h13, 39, 39);\r\n h13.scale.x = 3.5;\r\n\r\n let v15 = getWall();\r\n setWall(v15, 49, 60, true);\r\n v15.scale.x = 2;\r\n\r\n let h14 = getWall();\r\n setWall(h14, -78, 17);\r\n h14.scale.x = 2;\r\n \r\n}", "function initalize_walls(WALL_NUM){\n \n // Array storing Walls in\n ftWallArray = new Array();\n \n // Temp wall index to keep track how many walls made so far\n var wallIndex = 0;\n\n // Make 5ft green walls\n for(var i = 0; i < WALL_NUM; i++){\n\n var ftWall = left_paper.freeTransform(\n wall = left_paper.rect(\n (ftShapeTab.attrs.size.x / 10.0) + ftShapeTab.attrs.x, \n (ftShapeTab.attrs.size.y / 5.0) + ftShapeTab.attrs.y,\n inches2pixles(8),\n inches2pixles(.25)).attr({\n fill:\"green\",\n opacity:1,\n stroke: 'green',\n 'stroke-width':5\n }).mouseover(function(){\n //Where I will change sam's wall to reflect change\n samWall.attr({fill:\"green\"});\n samWall.attr({height:samHeight*1});\n samWall.attr({y: samYPos - samHeight*1});\n })\n ,{scale:['axisX'] },\n function(ftWall,events){\n\n if(events == \"drag start\"){\n wall_drag_start(ftWall);\n }else if(events == \"drag end\"){\n wall_drag_end(ftWall);\n }else if(events == \"rotate\"){\n wall_rotate(ftWall);\n }else{\n wall_drag_move(ftWall);\n }\n });\n \n //Addtional fields for each wall object\n ftWall.idNumber = wallIndex;\n ftWall.idPair = null;\n\n //Hiding handlebars, will appear after moved\n ftWall.hideHandles({undrag:false});\n\n //Adding to Array\n ftWallArray[wallIndex] = ftWall;\n wallIndex ++;\n\n }//for 5ft\n \n\n // Make 8ft blue walls\n for(var i = 0; i < WALL_NUM; i++){\n\n var ftWall = left_paper.freeTransform(\n wall = left_paper.rect(\n (ftShapeTab.attrs.size.x / 10.0) + ftShapeTab.attrs.x, \n 2*(ftShapeTab.attrs.size.y / 5.0) + ftShapeTab.attrs.y,\n inches2pixles(8),\n inches2pixles(.25)).attr({\n fill:\"blue\",\n opacity:1,\n stroke: 'blue',\n 'stroke-width':5\n }).mouseover(function(){\n //Where I will change sam's wall to reflect change\n samWall.attr({fill:\"blue\"});\n samWall.attr({height:samHeight*1.5});\n samWall.attr({y: samYPos - samHeight*1.5});\n })\n\n ,{scale:['axisX'] },\n function(ftWall,events){\n if(events == \"drag start\"){\n wall_drag_start(ftWall);\n }else if(events == \"drag end\"){\n wall_drag_end(ftWall);\n }else if(events == \"rotate\"){\n wall_rotate(ftWall);\n }else{\n wall_drag_move(ftWall);\n }\n });\n \n //Addtional fields for each wall object\n ftWall.idNumber = wallIndex;\n ftWall.idPair = null;\n\n //Hiding handlebars, will appear after moved\n ftWall.hideHandles({undrag:false});\n\n //Adding to Array\n ftWallArray[wallIndex] = ftWall;\n wallIndex ++;\n\n }//for 8ft\n\n \n // Make 10ft red walls\n for(var i = 0; i < WALL_NUM; i++){\n\n var ftWall = left_paper.freeTransform(\n wall = left_paper.rect(\n (ftShapeTab.attrs.size.x / 10.0) + ftShapeTab.attrs.x, \n 3*(ftShapeTab.attrs.size.y / 5.0) + ftShapeTab.attrs.y,\n inches2pixles(8),\n inches2pixles(.25)).attr({\n fill:\"red\",\n opacity:1,\n stroke: 'red',\n 'stroke-width':5\n }).mouseover(function(){\n //Where I will change sam's wall to reflect change\n samWall.attr({fill:\"red\"});\n samWall.attr({height:samHeight*2});\n samWall.attr({y: samYPos - samHeight*2});\n })\n ,{scale:['axisX'] },\n function(ftWall,events){\n\n if(events == \"drag start\"){\n wall_drag_start(ftWall);\n }else if(events == \"drag end\"){\n wall_drag_end(ftWall);\n }else if(events == \"rotate\"){\n wall_rotate(ftWall);\n }else{\n wall_drag_move(ftWall);\n }\n });\n \n //Addtional fields for each wall object\n ftWall.idNumber = wallIndex;\n ftWall.idPair = null;\n\n //Hiding handlebars, will appear after moved\n ftWall.hideHandles({undrag:false});\n\n //Adding to Array\n ftWallArray[wallIndex] = ftWall;\n wallIndex ++;\n\n }//for 8ft\n \n // Return the array of walls\n return ftWallArray;\n\n }//init_walls", "function resetWalls() {\n let clearBtn = document.querySelector('.clear-board')\n clearBtn.addEventListener('click', () => {\n console.log('reset')\n let allWalls = document.querySelectorAll('.wall-node')\n let allVisited = document.querySelectorAll('.visited-node')\n let allPath = document.querySelectorAll('.path-node')\n\n allWalls.forEach((node) => {\n node.classList = 'unvisited'\n })\n allVisited.forEach((node) => {\n node.classList = 'unvisited'\n })\n allPath.forEach((node) => {\n node.classList = 'unvisited'\n })\n makeNodes();\n\n\n })\n}", "function makeWalls(){\n\tvar walls = [];\n\tfor (var i = 0; i < totalRows; i++){\n\t\tvar row = [];\n\t\tfor (var j = 0; j < totalCols; j++){\n\t\t\trow.push(true);\n\t\t}\n\t\twalls.push(row);\n\t}\n\treturn walls;\n}", "hWall(num, x, y){\n for(let w = 0; w < num; w++){\n wall = walls.create(TILE_WIDTH * x + (TILE_WIDTH * w), TILE_HEIGHT * y, 'wall');\n wall.body.immovable = true;\n }\n }", "updateWalls(id,wallsIn){\n\t\tfor(let x = 0; x < wallsIn.length;x++){\n\t\t\tthis.props.G.cells[id].walls[x] = wallsIn[x];\n\t\t}\n\t}", "function buildSideFaces() {\n\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\t\tlet layeroffset = 0;\n\t\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t\t//, true\n\t\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t\t}", "function mazeGen() {\r\n let visited = [];\r\n let neighbours = [];\r\n let fcell = {\r\n x: Math.floor((Math.random() * w) / space) * space,\r\n y: Math.floor((Math.random() * h) / space) * space,\r\n };\r\n visited.push(fcell);\r\n let newNeighbours = genNeighbours(fcell, neighbours);\r\n neighbours = neighbours.concat(newNeighbours);\r\n let currCell;\r\n let visNeighbours = [];\r\n let joinCell;\r\n while (neighbours.length > 0) {\r\n currCell = neighbours.splice(mazeRand(neighbours.length), 1)[0];\r\n newNeighbours = genNeighbours(currCell, neighbours);\r\n visNeighbours = [];\r\n //cannot use filter as unfiltered needs to be pushed in separate array\r\n newNeighbours.forEach((element) => {\r\n if (visited.some((e) => e.x === element.x && e.y === element.y))\r\n visNeighbours.push(element);\r\n else neighbours.push(element);\r\n });\r\n joinCell = visNeighbours[mazeRand(visNeighbours.length)];\r\n visited.push(currCell);\r\n breakWalls(currCell, joinCell);\r\n }\r\n}", "createEdges() {\n\n\t\tconst lines = this.edges;\n\t\tconst planes = this.planes;\n\t\tconst edgeMaterial = this.edgeMaterials[0];\n\t\tconst planeMaterial = this.planeMaterials[0];\n\t\tconst edges = this.hermiteData.edgeData.edges(this.cellPosition, this.cellSize);\n\n\t\tconst intersection = new Vector3();\n\n\t\tthis.clearEdges();\n\n\t\tfor(const edge of edges) {\n\n\t\t\tconst lineGeometry = new BufferGeometry();\n\t\t\tconst lineVertices = new Float32Array(6);\n\n\t\t\tedge.a.toArray(lineVertices);\n\t\t\tedge.b.toArray(lineVertices, 3);\n\n\t\t\tlineGeometry.setAttribute(\"position\", new BufferAttribute(lineVertices, 3));\n\t\t\tconst line = new Line(lineGeometry, edgeMaterial);\n\t\t\tlines.add(line);\n\n\t\t\tconst plane = new Mesh(new PlaneBufferGeometry(2, 2), planeMaterial);\n\t\t\tplane.position.copy(edge.computeZeroCrossingPosition(intersection));\n\t\t\tplane.lookAt(intersection.add(edge.n));\n\t\t\tplane.visible = false;\n\t\t\tplanes.add(plane);\n\n\t\t}\n\n\t}", "function removeWalls(a, b) {\r\n var x = a.i - b.i;\r\n var y = a.j - b.j;\r\n if (x === -1) {\r\n a.walls[1] = false;\r\n b.walls[3] = false;\r\n } else if (y === 1) {\r\n a.walls[0] = false;\r\n b.walls[2] = false;\r\n } else if (x === 1) {\r\n a.walls[3] = false;\r\n b.walls[1] = false;\r\n } else if (y === -1) {\r\n a.walls[2] = false;\r\n b.walls[0] = false;\r\n }\r\n}", "vWall(num, x, y){\n for(let w = 0; w < num; w++){\n wall = walls.create(TILE_WIDTH * x, TILE_HEIGHT * y + (TILE_HEIGHT * w), 'wall');\n wall.body.immovable = true;\n }\n }", "_floodFill(x, y, region) {\r\n x = this._mod(x)\r\n if (!this._safeCell(x, y)) return\r\n var cell = this.grid[x][y]\r\n if (cell === undefined) return\r\n if (cell !== 0) {\r\n region.setCell(x, y)\r\n }\r\n this.grid[x][y] = undefined\r\n\r\n // @Performance: Why is this ordered TLBR?\r\n this._floodFill(x, y + 1, region)\r\n this._floodFill(x + 1, y, region)\r\n this._floodFill(x, y - 1, region)\r\n this._floodFill(x - 1, y, region)\r\n }", "edges()\n\n{\n\tif (this.pos.x > windowWidth + 5) this.pos.x = 0;\n\tif (this.pos.x < 0) this.pos.x = windowWidth;\n\tif (this.pos.y > windowHeight + 5) this.pos.y = 0;\n\tif (this.pos.y < 0) this.pos.y = windowHeight;\n}", "function trimEdges({top, bottom, left, right}) {\n return {\n top: Math.max(top, 0),\n bottom: Math.min (bottom, map.height),\n left: Math.max (left, 0),\n right: Math.min (right, map.width),\n }\n }", "function constructMaze() {\n let wallMeshes = [];\n let floorMeshes = [];\n\n let width = 1;\n let height = 1;\n\n // rotations to get floor to wall orientation\n let leftRotation = vec3.fromValues(0, Math.PI / 2, 0);\n let rightRotation = vec3.fromValues(0, -Math.PI / 2, 0);\n let topRotation = vec3.fromValues(-Math.PI / 2, 0, 0);\n let bottomRotation = vec3.fromValues(Math.PI / 2, 0, 0);\n\n // floor rotation is just not rotating at all\n let floorRotation = vec3.fromValues(0, 0, 0);\n\n for (let i = 0; i < maze.sizeX; i++) {\n for (let j = 0; j < maze.sizeY; j++) {\n let isWall = maze.data[i][j] == 1;\n\n let left = i;\n let right = i + 1;\n let top = j + 1;\n let bottom = j;\n\n let centerX = i + 0.5;\n let centerY = j + 0.5;\n\n let floorZ = 0;\n let wallZ = 0.5;\n\n if (isWall) {\n // construct wall tile(s) here\n // contstruct a wall in every direction that has a free tile in it\n let drawLeft = i != 0 && maze.data[i-1][j] == 0;\n let drawRight = i != maze.sizeX - 1 && maze.data[i+1][j] == 0;\n let drawBottom = j != 0 && maze.data[i][j-1] == 0;\n let drawTop = j != maze.sizeY - 1 && maze.data[i][j+1] == 0;\n\n if (drawLeft) {\n let leftWallCenter = vec3.fromValues(left, centerY, wallZ);\n let leftWallShapeData = getQuadMesh(leftWallCenter, leftRotation, width, height);\n wallMeshes.push(leftWallShapeData);\n }\n if (drawRight) {\n let rightWallCenter = vec3.fromValues(right, centerY, wallZ);\n let rightWallShapeData = getQuadMesh(rightWallCenter, rightRotation, width, height);\n wallMeshes.push(rightWallShapeData);\n }\n if (drawBottom) {\n let bottomWallCenter = vec3.fromValues(centerX, bottom, wallZ);\n let bottomWallShapeData = getQuadMesh(bottomWallCenter, bottomRotation, width, height);\n wallMeshes.push(bottomWallShapeData);\n }\n if (drawTop) {\n let topWallCenter = vec3.fromValues(centerX, top, wallZ);\n let topWallShapeData = getQuadMesh(topWallCenter, topRotation, width, height);\n wallMeshes.push(topWallShapeData);\n }\n } else {\n let floorCenter = vec3.fromValues(centerX, centerY, floorZ);\n let floorShapeData = getQuadMesh(floorCenter, floorRotation, width, height);\n floorMeshes.push(floorShapeData);\n }\n }\n }\n\n return {\n wallMeshes: wallMeshes,\n floorMeshes: floorMeshes\n };\n}", "function addWallFeatures(data, wall, floor, wallBase) {\n for (var y = 0; y < data.length; y++) {\n for (var x = 0; x < data[0].length; x++) {\n if (data[y][x].s == wall && (!data[y + 1] || !data[y + 1][x] || !data[y + 1][x].s || (data[y + 1] && data[y + 1][x] && (data[y + 1][x].s == floor && !data[y + 1][x].i) ))) {\n data[y][x].s = wallBase;\n }\n }\n }\n}", "addMazeInnerWalls(level, gridSize, gridScale) {\n const toExclude = this.wallsToExclude(gridSize + 1, gridSize + 1, gridScale);\n let ex = 0;\n for(let i = 0; i < gridSize - 1; i++) {\n let x = i * gridScale;\n while (ex < toExclude.length && toExclude[ex].x < x) {\n ex++;\n }\n for (let j = 0; j < gridSize; j++) {\n let z = (j - 0.5) * gridScale;\n if (ex < toExclude.length && toExclude[ex].x == x) {\n while (ex < toExclude.length && toExclude[ex].z < z) {\n ex++;\n }\n if (ex < toExclude.length && toExclude[ex].z == z) {\n ex++;\n continue;\n }\n }\n const pos = new Vector3(x, level*gridScale, z);\n const normal = new Vector3(1, 0, 0);\n this.addWall(pos, normal, gridScale);\n }\n }\n ex = 0;\n for(let i = 0; i < gridSize; i++) {\n let x = (i - 0.5)*gridScale;\n while (ex < toExclude.length && toExclude[ex].x < x) {\n ex++;\n }\n for (let j = 0; j < gridSize - 1; j++) {\n let z = j*gridScale;\n if (ex < toExclude.length && toExclude[ex].x == x) {\n while (ex < toExclude.length && toExclude[ex].z < z) {\n ex++;\n }\n if (ex < toExclude.length && toExclude[ex].z == z) {\n ex++;\n continue;\n }\n }\n const pos = new Vector3(x, level*gridScale, z);\n const normal = new Vector3(0, 0, 1);\n this.addWall(pos, normal, gridScale);\n }\n }\n }", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length/3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls( contour, layeroffset );\n\t\tlayeroffset += contour.length;\n\n\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\tahole = holes[ h ];\n\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\n\t\t}\n\n\n\t\tscope.addGroup( start, verticesArray.length/3 -start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\n\n\t}", "function buildSideFaces() {\n\n\t\tvar start = verticesArray.length / 3;\n\t\tvar layeroffset = 0;\n\t\tsidewalls(contour, layeroffset);\n\t\tlayeroffset += contour.length;\n\n\t\tfor (h = 0, hl = holes.length; h < hl; h++) {\n\n\t\t\tahole = holes[h];\n\t\t\tsidewalls(ahole, layeroffset);\n\n\t\t\t//, true\n\t\t\tlayeroffset += ahole.length;\n\t\t}\n\n\t\tscope.addGroup(start, verticesArray.length / 3 - start, options.extrudeMaterial !== undefined ? options.extrudeMaterial : 1);\n\t}", "function Wall(p1,p2){\t\n\tthis.p1 = p1;\n\tthis.p2 = p2;\t\n\tthis.objwallside=[]; //store side for each object that can hit the wall\n\tthis.side = 1;\n\tthis.edge = false; // Wall does not have a free edge (i.e. perimeter wall would be false) \n}", "generatePerimeter() {\n for (var i = 0; i < this.boardHeight; i++) {\n for (var j = 0; j < this.boardWidth; j++) {\n if (i === 0 || j === 0 || i === (this.boardWidth - 1) || j === (this.boardHeight - 1)) {\n this.gameBoard[i][j].setType('wall');\n }\n }\n }\n }", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\t\t}", "function recursiveFlood(seed) {\n\t\t\tif (seed.land === 'forcedWater') {\n\t\t\t\tseed.land = 'forcedOcean';\n\t\t\t} else {\n\t\t\t\tseed.land = 'ocean';\n\t\t\t}\n\t\t\tfor (var key in seed.adjacent) {\n\t\t\t\tvar next = data.polys[seed.adjacent[key]];\n\t\t\t\tif (next.land !== 'land' && next.land !== 'ocean' && next.land !== 'forcedOcean') {\n\t\t\t\t\trecursiveFlood(next);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\tvar start = verticesArray.length / 3;\n\t\t\tvar layeroffset = 0;\n\t\t\tsidewalls( contour, layeroffset );\n\t\t\tlayeroffset += contour.length;\n\n\t\t\tfor ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\tahole = holes[ h ];\n\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t//, true\n\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t}\n\n\n\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t}", "function buildSideFaces() {\n\n\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\tlet layeroffset = 0;\n\t\t\t\tsidewalls( contour, layeroffset );\n\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\tfor ( let h = 0, hl = holes.length; h < hl; h ++ ) {\n\n\t\t\t\t\tconst ahole = holes[ h ];\n\t\t\t\t\tsidewalls( ahole, layeroffset );\n\n\t\t\t\t\t//, true\n\t\t\t\t\tlayeroffset += ahole.length;\n\n\t\t\t\t}\n\n\n\t\t\t\tscope.addGroup( start, verticesArray.length / 3 - start, 1 );\n\n\n\t\t\t}", "function updateWalls(sight, x, y) {\n // match the regex\n var matches = PATTERN_WALLS.exec(sight);\n \n // find all the doors\n if (matches != null) {\n // loop through each match, starting at first group\n for (var i = 1; i < matches.length; i++) {\n // make sure match existed\n if (matches[i]) {\n var match = matches[i].toLowerCase();\n switch (match) {\n case \"north\":\n removeWall(x, y, 'north');\n break;\n case \"east\":\n removeWall(x, y, 'east');\n break;\n case \"south\":\n removeWall(x, y, 'south');\n break;\n case \"west\":\n removeWall(x, y, 'west');\n break;\n default:\n console.log(\"Bad wall: '\" + match + \"' from '\" + sight + \"'.\");\n break;\n }\n }\n }\n } else {\n console.log(\"[Engram] [WARN] walls pattern did not match.\");\n }\n \n // add remaining spaces as walls\n if (maze[x][y].walls['north'] == WALL_UNKNOWN) {\n addWall(x, y, 'north');\n }\n if (maze[x][y].walls['south'] == WALL_UNKNOWN) {\n addWall(x, y, 'south');\n }\n if (maze[x][y].walls['east'] == WALL_UNKNOWN) {\n addWall(x, y, 'east');\n }\n if (maze[x][y].walls['west'] == WALL_UNKNOWN) {\n addWall(x, y, 'west');\n }\n}", "function removeWall(a, b) {\r\n switch( a.col - b.col){\r\n case 1:\r\n a.walls.left = false\r\n b.walls.right = false\r\n break\r\n case -1:\r\n a.walls.right = false\r\n b.walls.left = false\r\n }\r\n switch(a.row - b.row){\r\n case 1:\r\n a.walls.top = false\r\n b.walls.bottom = false\r\n break\r\n case -1:\r\n a.walls.bottom = false\r\n b.walls.top = false\r\n }\r\n}", "function RandomWalls(density = 0.3){\n ClearBoard();\n for(let i = 0; i < height*2+1; i++){\n for(let j = 0; j < width*2+1; j++){\n if(Math.round(Math.random()*10)/10 <= density){\n $('#'+i+'a'+j).attr('type','wall');\n }\n }\n }\n}", "function traceEdges(edges, border) {\n const loop = [];\n\n const visited = new Set3;\n\n // I can't simply draw from the first edge because the shuttle might have\n // holes (and hence multiple continuous edges).\n edges.forEach((x, y, dir) => {\n // console.log('v', x, y, dir);\n if (visited.has(x, y, dir)) return;\n\n if (loop.length) {\n // Add degenerate triangles.\n loop.push(loop[0], loop[1],\n loop[0], loop[1]);\n }\n const loopStart = loop.length;\n\n while (!visited.has(x, y, dir)) {\n visited.add(x, y, dir);\n // console.log('visiting', x, y, dir);\n const {dx, dy} = DIRS[dir];\n\n let x2, y2, dir2;\n if (edges.has(x, y, dir2=(dir+1)%4)) {\n // curves down ^|\n lineTo(loop, x, y, dir, border, -1);\n dir = dir2;\n } else if (edges.has(x2=x-dy, y2=y+dx, dir)) {\n // straight __\n x = x2; y = y2;\n } else if (edges.has(x2=x+dx-dy, y2=y+dy+dx, dir2=(dir+3)%4)) {\n // Curves in _|\n lineTo(loop, x, y, dir, border, 1);\n x = x2; y = y2; dir = dir2;\n } else {\n // Loops back on itself immediately. =\n // console.log('loopy');\n lineTo(loop, x, y, dir, border, 1);\n lineTo(loop, x-dy, y+dx, (dir+3)%4, border, 1);\n x = x+dx; y = y+dy; dir = (dir+2)%4;\n }\n }\n\n if (loopStart !== 0) {\n loop.push(loop[loopStart], loop[loopStart+1]);\n }\n // console.log('----- path closed', JSON.stringify(loop), loopStart);\n });\n\n // console.log(loop);\n return loop.length ? new Float32Array(loop) : null;\n }", "function makeBuilding(options) {\n \n var wallX = options.width / 2;\n var wallY = options.height;\n var wallZ = options.depth / 2;\n \n // collect walls\n var building = {};\n \n // south/noth walls\n [true, false].forEach(function (isSouth) {\n var wallTZ = isSouth ? -wallZ : wallZ;\n var wallGroup = new Group({\n addTo: options.addTo,\n translate: {\n z: wallTZ\n },\n });\n \n var wallPath = [{\n x: -wallX,\n y: -wallY\n }];\n \n if (options.gable == 'ns') {\n wallPath.push({\n x: 0,\n y: -wallY - wallX\n });\n }\n \n wallPath = wallPath.concat([{\n x: wallX,\n y: -wallY\n },\n {\n x: wallX,\n y: 0\n },\n {\n x: -wallX,\n y: 0\n },\n ]);\n \n // wall\n new Shape({\n path: wallPath,\n addTo: wallGroup,\n color: isSouth ? red : gold,\n });\n \n var windowColor = isSouth ? navy : red;\n var windowProperty = isSouth ? 'southWindows' : 'northWindows';\n handleWindows(options, windowProperty, wallGroup, windowColor);\n \n var wallProperty = isSouth ? 'southWall' : 'northWall';\n building[wallProperty] = wallGroup;\n \n });\n \n // east/west wall\n [true, false].forEach(function (isWest) {\n var wallGroup = new Group({\n addTo: options.addTo,\n translate: {\n x: isWest ? -wallX : wallX\n },\n rotate: {\n y: TAU / 4\n },\n });\n \n var wallPath = [{\n x: -wallZ,\n y: -wallY\n }];\n \n if (options.gable == 'ew') {\n wallPath.push({\n x: 0,\n y: -wallY - wallZ\n });\n }\n \n wallPath = wallPath.concat([{\n x: wallZ,\n y: -wallY\n },\n {\n x: wallZ,\n y: 0\n },\n {\n x: -wallZ,\n y: 0\n },\n ]);\n \n // wall\n new Shape({\n path: wallPath,\n addTo: wallGroup,\n color: isWest ? blue : white,\n });\n \n var windowColor = isWest ? navy : blue;\n var windowProperty = isWest ? 'westWindows' : 'eastWindows';\n handleWindows(options, windowProperty, wallGroup, windowColor);\n \n var wallProperty = isWest ? 'westWall' : 'eastWall';\n building[wallProperty] = wallGroup;\n });\n \n \n var roofMakers = {\n ns: function () {\n var y0 = -wallY - wallX;\n var roofPanel = new Shape({\n path: [{\n x: 0,\n y: y0,\n z: -wallZ\n },\n {\n x: 0,\n y: y0,\n z: wallZ\n },\n {\n x: wallX,\n y: -wallY,\n z: wallZ\n },\n {\n x: wallX,\n y: -wallY,\n z: -wallZ\n },\n ],\n addTo: options.addTo,\n color: gold,\n });\n roofPanel.copy({\n scale: {\n x: -1\n },\n color: navy,\n });\n },\n \n ew: function () {\n var y0 = -wallY - wallZ;\n var xA = options.isChurch ? -wallX + 8 : -wallX;\n var roofPanel = new Shape({\n path: [{\n z: 0,\n y: y0,\n x: xA\n },\n {\n z: 0,\n y: y0,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: xA\n },\n ],\n addTo: options.addTo,\n color: red,\n });\n roofPanel.copy({\n path: [{\n z: 0,\n y: y0,\n x: -wallX\n },\n {\n z: 0,\n y: y0,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: wallX\n },\n {\n z: wallZ,\n y: -wallY,\n x: -wallX\n },\n ],\n scale: {\n z: -1\n },\n color: navy,\n });\n },\n };\n \n var roofMaker = roofMakers[options.gable];\n if (roofMaker) {\n roofMaker();\n }\n \n return building;\n }" ]
[ "0.6780318", "0.665928", "0.6615446", "0.6555187", "0.6404461", "0.6328344", "0.62806356", "0.62559336", "0.622399", "0.620246", "0.6186758", "0.6156086", "0.6133909", "0.6103521", "0.60797733", "0.60089236", "0.5964475", "0.59593767", "0.595872", "0.5914151", "0.59028786", "0.5898894", "0.5881277", "0.5873556", "0.5868478", "0.58419293", "0.58416563", "0.583752", "0.583137", "0.58286786", "0.58142865", "0.58034265", "0.5796808", "0.5789122", "0.5787999", "0.578711", "0.5777795", "0.57768506", "0.5755907", "0.57371813", "0.5723952", "0.57234", "0.5721767", "0.5715478", "0.5715478", "0.5715478", "0.5715478", "0.5715478", "0.5715478", "0.5715478", "0.571511", "0.57148075", "0.5685406", "0.56790906", "0.5674591", "0.5670216", "0.56664354", "0.56603426", "0.56603426", "0.56603426", "0.5653867", "0.5653204", "0.56415117", "0.5634756", "0.5631492", "0.56297946", "0.56084245", "0.56080073", "0.5597756", "0.5596272", "0.55941826", "0.55839205", "0.5577712", "0.5575501", "0.55730546", "0.5567897", "0.55662155", "0.5554095", "0.5554095", "0.5554095", "0.5554095", "0.5554095", "0.5554095", "0.5554095", "0.5554095", "0.55481184", "0.5541879", "0.5539847", "0.5538932", "0.55336297", "0.5532326", "0.5532326", "0.5532326", "0.5532326", "0.55317307", "0.5518196", "0.55152804", "0.5511851", "0.5504527", "0.5497722" ]
0.76997936
0
Create reactor from genome's data
createReactorFromGenome(genome) { for (var x = 0; x < this.nCols; x++) { for (var y = 0; y < this.nRows; y++) { this.grid[x][y] = new TILE_MAP[genome.grid[x][y]](x, y, this); } } this.fillEdges(this.grid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mating (parent1, parent2) {\n // Create a child genome\n let child = new Genome();\n\n parent1.neurons.forEach(neuron => {\n child.pushNeuron(neuron.neuron);\n });\n\n parent1.synapses.forEach(synapse => {\n if (parent2.synapses.id == synapse.id) {\n child.pushSynapse(util.randBool() ? synapse.synapse : parent2.synapse.synapse);\n } else {\n child.pushSynapse(synapse.synapse);\n }\n });\n\n return child;\n }", "clone() {\n\t\tlet clonedGenes = [];\n\t\tfor(var g of this.genes) {\n\t\t\tclonedGenes.push( Rocket.createCommand(g.thrust, g.steering, g.duration) ); // Thrust, Steering, Duration\n\t\t}\n\t\treturn new DNA(clonedGenes);\n\t}", "constructor() {\r\n this.genes = new Array();\r\n DNA.target.forEach((d) => {\r\n let res = null;\r\n while (res == null) {\r\n res = generateSingleTimeTable(d.subjects, d.name);\r\n }\r\n this.genes.push(res);\r\n });\r\n }", "function Reactor(config) {\"use strict\";\n\t if (!(this instanceof Reactor)) {\n\t return new Reactor(config)\n\t }\n\t config = config || {}\n\n\t /**\n\t * The state for the whole cluster\n\t */\n\t this.state = Immutable.Map({})\n\t /**\n\t * Event bus that emits a change event anytime the state\n\t * of the system changes\n\t */\n\t this.__changeEmitter = new ChangeEmitter()\n\t /**\n\t * Holds a map of id => reactor instance\n\t */\n\t this.__stores = Immutable.Map({})\n\n\t this.__initialize(config)\n\t /**\n\t * Change observer interface to observe certain keypaths\n\t * Created after __initialize so it starts with initialState\n\t */\n\t this.__changeObsever = new ChangeObserver(this.state, this.__changeEmitter)\n\t }", "static from(data){\n return FlowFactory.getFlow(data);\n }", "newFromData( data = {}, make_dirty = false ) {\n let model = factory.make_reactive_model( this.modelDefinition, data, this._create_context(), false );\n // model._update_data( generated_data, null, true );\n return model\n }", "constructor( data ){\n this._emitter = new EventTarget();\n this._converters = new Map();\n this._dynamicProperties = false;\n this._data = data;\n }", "function createInitialPopulation() {\n //inits the array\n genomes = [];\n //for a given population size\n for (var i = 0; i < populationSize; i++) {\n //randomly initialize the 7 values that make up a genome\n //these are all weight values that are updated through evolution\n var genome = {\n //Genomes generation\n generation: clone(generation),\n //unique identifier for a genome\n id: makeid(6),\n //The weight of each row cleared by the given move. the more rows that are cleared, the more this weight increases\n rowsCleared: Math.random() - 0.5,\n //the absolute height of the highest column to the power of 1.5\n //added so that the algorithm can be able to detect if the blocks are stacking too high\n weightedHeight: Math.random() - 0.5,\n //The sum of all the column’s heights\n cumulativeHeight: Math.random() - 0.5,\n //the highest column minus the lowest column\n relativeHeight: Math.random() - 0.5,\n //the sum of all the empty cells that have a block above them (basically, cells that are unable to be filled)\n holes: Math.random() * 0.5,\n // the sum of absolute differences between the height of each column \n //(for example, if all the shapes on the grid lie completely flat, then the roughness would equal 0).\n roughness: Math.random() - 0.5,\n };\n //add them to the array\n genomes.push(genome);\n }\n evaluateNextGenome();\n}", "function getState(reactor, data) {\n\t\t var state = {}\n\t\t for (var key in data) {\n\t\t state[key] = reactor.evaluate(data[key])\n\t\t }\n\t\t return state\n\t\t}", "static create(time, dur, bones, morphs) {\nvar frame;\n//------\nframe = new CASFrame();\nframe.set(time, dur, bones, morphs);\nreturn frame;\n}", "function MakePulse(type, detail, origin) {\n var pulse = {\n type: type,\n detail: detail,\n origin: origin\n };\n\n return pulse;\n }", "function reproduce() {\n //Choose the best two bird in relation to their normalized fitness\n let brainA = pickOne();\n let brainB = pickOne();\n \n //Get the child from crossover the two parents\n let childBrain = brainA.crossover(brainB);\n \n //mutate the child with a 10% possibility to mutate\n childBrain.mutate(0.1);\n \n return new Bird(childBrain);\n}", "function GenericIEC(np, seeds, iecOptions)\n{\n var self = this;\n\n self.options = iecOptions || {};\n self.np = np;\n\n //we keep track of new nodes and connections for the session\n self.newNodes = {};\n self.newConnections = {};\n\n //we can send in a seed genome -- to create generic objects when necessary\n self.seeds = seeds;\n\n for(var s=0; s < seeds.length; s++)\n {\n var seed = seeds[s];\n for(var c =0; c < seed.connections.length; c++)\n {\n var sConn = seed.connections[c];\n var cid = '(' + sConn.sourceID + ',' + sConn.targetID + ')';\n self.newConnections[cid] = sConn;\n }\n }\n\n self.cloneSeed = function(){\n\n var seedIx = utilities.next(self.seeds.length);\n\n var seedCopy = NeatGenome.Copy(self.seeds[seedIx]);\n if(self.options.seedMutationCount)\n {\n for(var i=0; i < self.options.seedMutationCount; i++)\n seedCopy.mutate(self.newNodes, self.newConnections, self.np);\n }\n return seedCopy;\n };\n\n self.markParentConnections = function(parents){\n\n for(var s=0; s < parents.length; s++)\n {\n var parent = parents[s];\n for(var c =0; c < parent.connections.length; c++)\n {\n var sConn = parent.connections[c];\n var cid = '(' + sConn.sourceID + ',' + sConn.targetID + ')';\n self.newConnections[cid] = sConn;\n }\n }\n\n };\n\n\n //this function handles creating a genotype from sent in parents.\n //it's pretty simple -- however many parents you have, select a random number of them, and attempt to mate them\n self.createNextGenome = function(parents)\n {\n self.markParentConnections(parents);\n //IF we have 0 parents, we create a genome with the default configurations\n var ng;\n var initialMutationCount = self.options.initialMutationCount || 0,\n postXOMutationCount = self.options.postMutationCount || 0;\n\n var responsibleParents = [];\n\n switch(parents.length)\n {\n case 0:\n\n //parents are empty -- start from scratch!\n ng = self.cloneSeed();\n\n for(var m=0; m < initialMutationCount; m++)\n ng.mutate(self.newNodes, self.newConnections, self.np);\n\n //no responsible parents\n\n break;\n case 1:\n\n //we have one parent\n //asexual reproduction\n ng = parents[0].createOffspringAsexual(self.newNodes, self.newConnections, self.np);\n\n //parent at index 0 responsible\n responsibleParents.push(0);\n\n for(var m=0; m < postXOMutationCount; m++)\n ng.mutate(self.newNodes, self.newConnections, self.np);\n\n break;\n default:\n //greater than 1 individual as a possible parent\n\n //at least 1 parent, and at most self.activeParents.count # of parents\n var parentCount = 1 + utilities.next(parents.length);\n\n if(parentCount == 1)\n {\n //select a single parent for offspring\n var rIx = utilities.next(parents.length);\n\n ng = parents[rIx].createOffspringAsexual(self.newNodes, self.newConnections, self.np);\n //1 responsible parent at index 0\n responsibleParents.push(rIx);\n break;\n }\n\n //we expect active parents to be small, so we grab parentCount number of parents from a small array of parents\n var parentIxs = utilities.RouletteWheel.selectXFromSmallObject(parentCount, parents);\n\n var p1 = parents[parentIxs[0]], p2;\n //if I have 3 parents, go in order composing the objects\n\n responsibleParents.push(parentIxs[0]);\n\n //p1 mates with p2 to create o1, o1 mates with p3, to make o2 -- p1,p2,p3 are all combined now inside of o2\n for(var i=1; i < parentIxs.length; i++)\n {\n p2 = parents[parentIxs[i]];\n ng = p1.createOffspringSexual(p2, self.np);\n p1 = ng;\n responsibleParents.push(parentIxs[i]);\n }\n\n for(var m=0; m < postXOMutationCount; m++)\n ng.mutate(self.newNodes, self.newConnections, self.np);\n\n\n break;\n }\n\n //we have our genome, let's send it back\n\n //the reason we don't end it inisde the switch loop is that later, we might be interested in saving this genome from some other purpose\n return {offspring: ng, parents: responsibleParents};\n };\n\n}", "function init() {\n createDataReader('heartbeat', true);\n createDataReader('timing');\n createDataReader('telemetry');\n }", "function Reactor(config) {\"use strict\";\n\t\t if (!(this instanceof Reactor)) {\n\t\t return new Reactor(config)\n\t\t }\n\t\t config = config || {}\n\n\t\t this.debug = !!config.debug\n\n\t\t this.ReactMixin = createReactMixin(this)\n\t\t /**\n\t\t * The state for the whole cluster\n\t\t */\n\t\t this.__state = Immutable.Map({})\n\t\t /**\n\t\t * Holds a map of id => reactor instance\n\t\t */\n\t\t this.__stores = Immutable.Map({})\n\n\t\t this.__evaluator = new Evaluator()\n\t\t /**\n\t\t * Change observer interface to observe certain keypaths\n\t\t * Created after __initialize so it starts with initialState\n\t\t */\n\t\t this.__changeObserver = new ChangeObserver(this.__state, this.__evaluator)\n\t\t }", "init() {\n this._child = fork('./routes/src/worker/parser.js');\n this._child.on('message', (data) => {\n this._bk_data[0] = data.data[0];\n this._bk_data[1] = data.data[1];\n this._bk_data[2] = data.data[2];\n this._bk_data[3] = data.data[3];\n this._bk_data[4] = data.data[4];\n this._bk_data[5] = data.data[5];\n this._bk_data[6] = data.data[6];\n this._bk_data[7] = data.data[7];\n });\n }", "function TruckBuilder() {\n this.truck = null;\n \n this.step1 = function() {\n this.truck = new Truck();\n };\n \n this.step2 = function() {\n this.truck.addParts();\n };\n \n this.get = function() {\n return this.truck;\n };\n}", "function constructPipeline() {\n // console.log($rootScope.CSVdelim);\n // var separator = $rootScope.CSVdelim?$rootScope.CSVdelim:'\\\\,';\n var readDatasetFunct = new jsedn.List([\n new jsedn.sym('read-dataset'),\n new jsedn.sym('data-file')\n ]);\n\n pipeline = null;\n\n pipeline = new jsedn.List([\n jsedn.sym('defpipe'),\n jsedn.sym('my-pipe'),\n 'Grafter pipeline for data clean-up and preparation.',\n new jsedn.Vector([new jsedn.sym('data-file')]),\n new jsedn.List([jsedn.sym('->'), readDatasetFunct])\n ]);\n\n pipelineFunctions.map(function (arg) {\n pipeline.val[4].val.push(arg);\n });\n\n //(read-dataset data-file :format :csv)\n pipelineFunctions = new jsedn.List([]);\n return pipeline;\n}", "createDependency(data) {\n const source = data.source,\n target = data.target,\n fromSide = data.sourceTerminal.dataset.side,\n toSide = data.targetTerminal.dataset.side,\n type = (fromSide === 'left' ? 0 : 2) + (toSide === 'right' ? 1 : 0);\n return this.dependencyStore.add({\n from: source.id,\n to: target.id,\n type,\n fromSide,\n toSide\n })[0];\n }", "createDependency(data) {\n const\n source = data.source,\n target = data.target,\n fromSide = data.sourceTerminal.dataset.side,\n toSide = data.targetTerminal.dataset.side,\n type = (fromSide === 'left' ? 0 : 2) + (toSide === 'right' ? 1 : 0);\n\n return this.dependencyStore.add({\n from : source.id,\n to : target.id,\n type,\n fromSide,\n toSide\n })[0];\n }", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "makeData (callback) {\n\t\tthis.init(callback);\n\t}", "repopulate () {\n const nbToGenerate = this.populationSize - this.currentPopulation.length\n const newGenomes = Array(nbToGenerate).fill('').map(genome => new Genome(this.nbInput, this.nbOutput))\n this.currentPopulation = [...this.currentPopulation, ...newGenomes]\n }", "makeData (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tthis.adjustMarkers,\t\t\t// adjust those markers for a different commit\n\t\t\tthis.setData\t\t\t\t// set the data to be used in the request that will result in a message sent\n\t\t], callback);\n\t}", "function ChannelManager () {\n this.connections = {}\n this.replicators = {}\n\n this.set = function (otherMachineId, connName, datachannel) {\n var replicator = this.replicators[otherMachineId] = this.replicators[otherMachineId] ||\n new PouchReplicator('replicator', PouchDB, db, {batch_size: 50})\n\n replicator.addPeer(connName, datachannel)\n\n var connections = this.connections[otherMachineId] = this.connections[otherMachineId] || {}\n connections[connName] = datachannel\n\n replicator.on('endpeerreplicate', function () {\n for (var i in replicator.datachannels) {\n var dc = replicator.datachannels[i]\n dc.send('<received>')\n }\n app.ports.replication.send([otherMachineId, '<received>'])\n })\n\n datachannel.addEventListener('message', e => {\n console.log(connName + ' says: ' + e.data)\n if (e.data === '<received>') {\n app.ports.replication.send([otherMachineId, '<sent>'])\n db.compact()\n }\n })\n }\n\n this.cleanup = function (otherMachineId, connName) {\n var replicator = this.replicators[otherMachineId]\n if (!replicator) return\n replicator.removePeer(connName)\n }\n\n this.replicate = function () {\n console.log('replicating pouchdb to', Object.keys(this.replicators))\n for (var otherMachineId in this.replicators) {\n console.log('> replicating pouchdb to', otherMachineId)\n\n app.ports.replication.send([otherMachineId, '<replicating>'])\n\n var replicator = this.replicators[otherMachineId]\n replicator.replicate()\n }\n }\n}", "initReceptors() {\n\t\tthis.noteskin = new Noteskin(this.settings.noteskin);\n\t\tvar keys = this.notetrack.keyCount;\t\t// determined from level file\t\t\n\t\tthis.receptors = [];\t\t\t\t\t// hold receptors for reference\n\t\tfor (var k = 0; k < keys; k++) {\n\t\t\t// downscroll\n\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\tvar y = this.height-100;\n\t\t\t}\n\t\t\t// upscroll\n\t\t\telse {\n\t\t\t\tvar y = 100;\n\t\t\t}\n\t\t\tvar x = this.getAlignment(this.width/2, keys, 60, 10, k);\n\t\t\tthis.receptors[k] = new Receptor(30,x,y,this.noteskin);\n\t\t\tthis.stage.addChild(this.receptors[k].graphic);\n\t\t\tthis.stage.addChild(this.receptors[k].burstGraphic);\n\t\t\tthis.stage.addChild(this.receptors[k].mineBurstGraphic);\n\t\t}\n\t}", "createDependency() {\n const me = this,\n data = me.creationData,\n source = data.source,\n target = data.target,\n fromSide = data.sourceTerminal.dataset.side,\n toSide = data.targetTerminal.dataset.side,\n type = (fromSide === 'left' ? 0 : 2) + (toSide === 'right' ? 1 : 0);\n\n me.store.add({\n from: source.id,\n to: target.id,\n type,\n fromSide,\n toSide\n });\n }", "function constructTweens(container) {\n\n var i=0;\n var j;\n var k;\n var tw;\n var start, end;\n var end_time;\n var duration;\n var start_values, end_values;\n var from_data, to_data;\n var start_transparency, end_transparency;\n var meshes;\n UNDO_TWEENS = [];\n for ( i=0; i < container.tracks.length; i++ ) {\n if ( container.tracks[i] instanceof ContainerTrack ) {\n constructTweens( container.tracks[i] );\n }\n if ( container.tracks[i] instanceof ItemTrack ) {\n if ( container.tracks[i].type === \"camera\" ) {\n j=0;\n for ( j=0; j < container.tracks[i].tracks.length; j++ ) {\n if ( container.tracks[i].tracks[j].property === \"camera\") {\n k=1;\n for ( k=0; k < container.tracks[i].tracks[j].keys.length; k++ ) {\n start = k-1;\n if ( container.tracks[i].tracks[j].keys[k].segment === \"true\" || k === 0 ) {\n start = k;\n }\n end = k;\n var start_camera = container.tracks[i].tracks[j].keys[start];\n start_values = start_camera.values;\n var end_camera = container.tracks[i].tracks[j].keys[end];\n end_values = end_camera.values;\n duration = (end_camera.time - start_camera.time) * SPEED;\n from_data = {\n data: {\n object: defaultCamera,\n fov : {\n top: parseFloat(start_values[TOP]),\n bottom: parseFloat(start_values[BOTTOM]),\n left: parseFloat(start_values[LEFT]),\n right: parseFloat(start_values[RIGHT]),\n depth: parseFloat(start_values[DEPTH])\n },\n position : new THREE.Vector3(parseFloat(start_values[POSX]), parseFloat(start_values[POSY]), parseFloat(start_values[POSZ])),\n quaternion : new THREE.Quaternion(parseFloat(start_values[QX]), parseFloat(start_values[QY]), parseFloat(start_values[QZ]), parseFloat(start_values[QW])),\n center : new THREE.Vector3(parseFloat(start_values[ATX]), parseFloat(start_values[ATY]), parseFloat(start_values[ATZ])),\n scale : parseFloat(start_values[SCALE]),\n mc : start_values[ATD],\n event_callback: {\n type: event_type,\n callback: event_callback\n },\n }\n };\n to_data = {\n data: {\n object: defaultCamera,\n fov : {\n top: parseFloat(end_values[TOP]),\n bottom: parseFloat(end_values[BOTTOM]),\n left: parseFloat(end_values[LEFT]),\n right: parseFloat(end_values[RIGHT]),\n depth: parseFloat(end_values[DEPTH])\n },\n position : new THREE.Vector3(parseFloat(end_values[POSX]), parseFloat(end_values[POSY]), parseFloat(end_values[POSZ])),\n quaternion : new THREE.Quaternion(parseFloat(end_values[QX]), parseFloat(end_values[QY]), parseFloat(end_values[QZ]), parseFloat(end_values[QW])),\n center : new THREE.Vector3(parseFloat(end_values[ATX]), parseFloat(end_values[ATY]), parseFloat(end_values[ATZ])),\n scale : parseFloat(end_values[SCALE]),\n mc : end_values[ATD],\n event_callback: {\n type: event_type,\n callback: event_callback\n },\n }\n };\n if ( isInitalState( duration, start_values, end_values) ) {\n getAnimationAdapter().cameraInitialization(from_data.data);\n }\n else {\n tw = new TWEEN.Tween( from_data );\n tw.to( to_data, duration );\n tw.easing(TWEEN.Easing.Linear.None);\n tw.interpolation(getAnimationAdapter().cameraInterpolation);\n tw.delay( (container.tracks[i].tracks[j].keys[start].time) * SPEED);\n end_time = (container.tracks[i].tracks[j].keys[start].time) * SPEED + duration;\n if ( end_time > RUNNING_TIME ) RUNNING_TIME = end_time;\n ANIMATION_TWEENS.push(tw);\n }\n }\n }\n else {\n console.log(\"Don't yet support track type property \" + container.tracks[i].tracks[j].property);\n }\n }\n }\n else if ( container.tracks[i].type === \"selectionitem\" ) {\n if (DEBUG) console.log (\" Tween \" + container.tracks[i].selectionItem.sbomIdPath);\n for ( j=0; j < container.tracks[i].tracks.length; j++ ) {\n if ( container.tracks[i].tracks[j].property === \"color\") {\n for ( k=0; k < container.tracks[i].tracks[j].keys.length; k++ ) {\n start = k-1;\n if ( container.tracks[i].tracks[j].keys[k].segment === \"true\" || k === 0 ) {\n start = k;\n }\n end = k;\n var start_color = container.tracks[i].tracks[j].keys[start];\n start_values = start_color.values;\n var end_color = container.tracks[i].tracks[j].keys[end];\n end_values = end_color.values;\n duration = (end_color.time - start_color.time) * SPEED;\n meshes = getAnimationAdapter().getGeometryByPath(container.tracks[i].selectionItem.instance);\n if ( meshes === undefined || meshes.length === 0 ) {\n meshes = getAnimationAdapter().getGeometryByPath(container.tracks[i].selectionItem.sbomIdPath);\n }\n if ( meshes === undefined || meshes.length === 0 ) {\n console.log(\"Assembly not processed geometry\" + container.tracks[i].selectionItem.instance + \" nor \" + container.tracks[i].selectionItem.sbomIdPath + \" to change \" + container.tracks[i].tracks[j].property );\n }\n else {\n from_data = {\n data: {\n object: meshes,\n color: [parseFloat(start_values[0]), parseFloat(start_values[1]), parseFloat(start_values[2])]\n }\n };\n to_data = {\n data: {\n color: [parseFloat(end_values[0]), parseFloat(end_values[1]), parseFloat(end_values[2])]\n }\n };\n if ( isInitalState( duration, start_values, end_values) ) {\n getAnimationAdapter().colorInitialization(from_data.data);\n }\n else {\n tw = new TWEEN.Tween( from_data );\n tw.to( to_data, duration );\n tw.easing(TWEEN.Easing.Linear.None);\n tw.interpolation(getAnimationAdapter().colorInterpolation);\n tw.delay(container.tracks[i].tracks[j].keys[start].time * SPEED);\n end_time = (container.tracks[i].tracks[j].keys[start].time) * SPEED + duration;\n if ( end_time > RUNNING_TIME ) RUNNING_TIME = end_time;\n ANIMATION_TWEENS.push(tw);\n }\n }\n }\n }\n else if ( container.tracks[i].tracks[j].property === \"transparency\" ) {\n // This is the opacity of the object\n k=1;\n for ( k=0; k < container.tracks[i].tracks[j].keys.length; k++ ) {\n start = k-1;\n if ( container.tracks[i].tracks[j].keys[k].segment === \"true\" || k === 0 ) {\n start = k;\n }\n end = k;\n start_transparency = container.tracks[i].tracks[j].keys[start];\n start_values = start_transparency.values;\n end_transparency = container.tracks[i].tracks[j].keys[end];\n end_values = end_transparency.values;\n duration = (end_transparency.time - start_transparency.time) * SPEED;\n meshes = getAnimationAdapter().getGeometryByPath(container.tracks[i].selectionItem.instance);\n if ( meshes === undefined || meshes.length === 0 ) {\n meshes = getAnimationAdapter().getGeometryByPath(container.tracks[i].selectionItem.sbomIdPath);\n }\n if ( meshes === undefined || meshes.length === 0 ) {\n console.log(\"Assembly not processed geometry\" + container.tracks[i].selectionItem.instance + \" nor \" + container.tracks[i].selectionItem.sbomIdPath + \" to change \" + container.tracks[i].tracks[j].property );\n }\n else {\n from_data = {\n data: {\n object: meshes,\n transparency: parseFloat(start_values[0])\n }\n };\n to_data = {\n data: {\n transparency: parseFloat(end_values[0])\n }\n };\n if ( isInitalState( duration, start_values, end_values) ) {\n getAnimationAdapter().transparencyInitialization(from_data.data);\n }\n else {\n tw = new TWEEN.Tween( from_data );\n tw.to( to_data, duration );\n tw.easing(TWEEN.Easing.Linear.None);\n tw.interpolation(getAnimationAdapter().transparencyInterpolation);\n tw.delay(container.tracks[i].tracks[j].keys[start].time * SPEED);\n end_time = (container.tracks[i].tracks[j].keys[start].time) * SPEED + duration;\n if ( end_time > RUNNING_TIME ) RUNNING_TIME = end_time;\n ANIMATION_TWEENS.push(tw);\n }\n }\n }\n }\n else if ( container.tracks[i].tracks[j].property === \"visibility\" ) {\n k=1;\n for ( k=0; k < container.tracks[i].tracks[j].keys.length; k++ ) {\n start = k-1;\n if ( container.tracks[i].tracks[j].keys[k].segment === \"true\" || k === 0 ) {\n start = k;\n }\n end = k;\n var start_visibility = container.tracks[i].tracks[j].keys[start];\n start_values = start_visibility.values;\n var end_visibility = container.tracks[i].tracks[j].keys[end];\n end_values = end_visibility.values;\n duration = (end_visibility.time - start_visibility.time) * SPEED;\n meshes = getAnimationAdapter().getGeometryByPath(container.tracks[i].selectionItem.instance);\n if ( meshes === undefined || meshes.length === 0 ) {\n meshes = getAnimationAdapter().getGeometryByPath(container.tracks[i].selectionItem.sbomIdPath);\n }\n if ( meshes === undefined || meshes.length === 0) {\n console.log(\"Assembly not processed geometry\" + container.tracks[i].selectionItem.instance + \" nor \" + container.tracks[i].selectionItem.sbomIdPath + \" to change \" + container.tracks[i].tracks[j].property );\n }\n else {\n end_transparency = 0.0;\n if ( parseFloat(end_values[0]) == 1 ) end_transparency = 1.0;\n start_transparency = 0.0;\n if ( parseFloat(start_values[0]) == 1 ) start_transparency = 1.0;\n if ( meshes !== undefined && meshes !== null ) {\n from_data = {\n data: {\n object: meshes,\n visibility: toBoolean(start_values[0]),\n transparency: start_transparency\n }\n };\n to_data = {\n data: {\n visibility: toBoolean(end_values[0]),\n transparency: end_transparency\n }\n };\n if ( isInitalState( duration, start_values, end_values) ) {\n getAnimationAdapter().visibilityInitialization(from_data.data);\n }\n else {\n tw = new TWEEN.Tween( from_data );\n tw.to( to_data, duration );\n tw.easing(TWEEN.Easing.Linear.None);\n tw.interpolation(getAnimationAdapter().visibilityInterpolation);\n tw.delay(container.tracks[i].tracks[j].keys[start].time * SPEED);\n end_time = (container.tracks[i].tracks[j].keys[start].time) * SPEED + duration;\n if ( end_time > RUNNING_TIME ) RUNNING_TIME = end_time;\n ANIMATION_TWEENS.push(tw);\n }\n }\n }\n }\n }\n else if ( container.tracks[i].tracks[j].property === \"location\" ) {\n k=1;\n for ( k=0; k < container.tracks[i].tracks[j].keys.length; k++ ) {\n start = k-1;\n if ( container.tracks[i].tracks[j].keys[k].segment === \"true\" || k === 0 ) {\n start = k;\n }\n end = k;\n var start_location = container.tracks[i].tracks[j].keys[start];\n start_values = start_location.values;\n var end_location = container.tracks[i].tracks[j].keys[end];\n end_values = end_location.values;\n duration = (end_location.time - start_location.time) * SPEED;\n\n var group = getAnimationAdapter().getSelectedObject(container.tracks[i].selectionItem.instance);\n if ( group === undefined ) {\n group = getAnimationAdapter().getSelectedObject(container.tracks[i].selectionItem.sbomIdPath);\n }\n if ( group === undefined ) {\n console.log(\"Not processing geometry \" + container.tracks[i].selectionItem.instance + \" nor \" + container.tracks[i].selectionItem.sbomIdPath + \" to change \" + container.tracks[i].tracks[j].property );\n }\n else {\n var object = groups;\n var originalpositions = [];\n var originalQuaternions = [];\n var fps = [];\n var tps = [];\n for ( var ig = 0 ; ig < groups.length; ig++ ) {\n for ( var im = 0 ; im < groups[ig].children.length; im++ ) {\n originalpositions.push( new THREE.Vector3( groups[ig].children[im].position.x, groups[ig].children[im].position.y, groups[ig].children[im].position.z) );\n originalQuaternions.push( new THREE.Quaternion(groups[ig].children[im].quaternion.x, groups[ig].children[im].quaternion.y, groups[ig].children[im].quaternion.z, groups[ig].children[im].quaternion.w) );\n // The positions in the animation are relative to the parent, and so need to be rotated, clearly this is a hack for the moment\n var fp = new THREE.Vector3(parseFloat(start_values[POSX]), parseFloat(start_values[POSY]), parseFloat(start_values[POSZ]));\n var mat4 = new THREE.Matrix4();\n mat4.makeRotationFromQuaternion(getAnimationAdapter().getQuaternion(groups[ig].children[im]));\n mat4.setPosition(getAnimationAdapter().getPosition(groups[ig].children[im]));\n var rotmat4 = new THREE.Matrix4();\n rotmat4.copy(mat4);\n rotmat4.elements[12] = 0.0;\n rotmat4.elements[13] = 0.0;\n rotmat4.elements[14] = 0.0;\n fp.applyMatrix4(rotmat4);\n fps.push(fp);\n var tp = new THREE.Vector3(parseFloat(end_values[POSX]), parseFloat(end_values[POSY]), parseFloat(end_values[POSZ]));\n tp.applyMatrix4(rotmat4);\n tps.push(tp);\n }\n }\n\n from_data = {\n data: {\n object: object,\n startPosition : originalpositions,\n startQuaternion : originalQuaternions,\n position: fps,\n quaternion : new THREE.Quaternion(parseFloat(start_values[QX]), parseFloat(start_values[QY]), parseFloat(start_values[QZ]), parseFloat(start_values[QW])),\n center : new THREE.Vector3(parseFloat(start_values[ATX]), parseFloat(start_values[ATY]), parseFloat(start_values[ATZ])),\n scale : parseFloat(start_values[SCALE]),\n mc : start_values[ATD]\n }\n };\n to_data = {\n data: {\n position: tps,\n quaternion : new THREE.Quaternion(parseFloat(end_values[QX]), parseFloat(end_values[QY]), parseFloat(end_values[QZ]), parseFloat(end_values[QW])),\n center : new THREE.Vector3(parseFloat(end_values[ATX]), parseFloat(end_values[ATY]), parseFloat(end_values[ATZ])),\n scale : parseFloat(end_values[SCALE]),\n mc : end_values[ATD]\n }\n };\n if ( isInitalState( duration, start_values, end_values) ) {\n //getAnimationAdapter().locationInitialization(from_data.data, to_data.data);\n }\n else {\n if ( object !== null ) {\n tw = new TWEEN.Tween( from_data );\n tw.to( to_data, duration );\n tw.delay(container.tracks[i].tracks[j].keys[start].time * SPEED);\n tw.interpolation(getAnimationAdapter().seqLocationInterpolation);\n end_time = (container.tracks[i].tracks[j].keys[start].time) * SPEED + duration;\n if ( end_time > RUNNING_TIME ) RUNNING_TIME = end_time;\n ANIMATION_TWEENS.push(tw);\n }\n }\n }\n }\n }\n else {\n console.log(\"Don't yet support selection property \" + container.tracks[i].tracks[j].property);\n }\n }\n }\n else {\n console.log(\"Don't yet support track type \" + container.tracks[i].type);\n }\n }\n }\n }", "function createStreamFromRecordedResponses(data, responder) {\n const start = performance.now();\n let i = 0;\n let stopped;\n\n// Useful flag for debugging, sends all the data immediately\n// so you don't have to wait for everything to come through\nconst FAST = false;\n\n if (FAST) {\n setTimeout(() => {\n data.forEach(d => {\n responder(d.data);\n });\n });\n return { stop() {} };\n }\n\n // Run in a rAF loop rather than doing a bunch of setTimeout,\n // since it makes cleaning up easier\n (function frame() {\n if (!stopped) requestAnimationFrame(frame);\n const dt = performance.now() - start;\n\n while(i < data.length && data[i].t <= dt) {\n responder(data[i].data);\n i++;\n }\n })();\n\n\n return {\n stop: () => {\n stopped = true;\n }\n }\n}", "function createStreamFromRecordedResponses(data, responder) {\n const start = performance.now();\n let i = 0;\n let stopped;\n\n// Useful flag for debugging, sends all the data immediately\n// so you don't have to wait for everything to come through\nconst FAST = false;\n\n if (FAST) {\n setTimeout(() => {\n data.forEach(d => {\n responder(d.data);\n });\n });\n return { stop() {} };\n }\n\n // Run in a rAF loop rather than doing a bunch of setTimeout,\n // since it makes cleaning up easier\n (function frame() {\n if (!stopped) requestAnimationFrame(frame);\n const dt = performance.now() - start;\n\n while(i < data.length && data[i].t <= dt) {\n responder(data[i].data);\n i++;\n }\n })();\n\n\n return {\n stop: () => {\n stopped = true;\n }\n }\n}", "constructor() {\n this.pipeline = [];\n }", "static restore(data) {\n return new TextureAtlas({\n sourcePath: data.sourcePath\n });\n }", "reproduction() {\n // Refill the population with children from the mating pool\n for (var i = 0; i < this.population.length; i++) {\n // Sping the wheel of fortune to pick two parents\n var m = floor(noise(this.matingPool.length));\n var d = floor(noise(this.matingPool.length));\n // Pick two parents\n var mom = this.matingPool[m];\n var dad = this.matingPool[d];\n // console.log(mom);\n // Get their genes\n var momgenes = mom.getDNA();\n var dadgenes = dad.getDNA();\n // console.log(momgenes);\n // Mate their genes\n var child = momgenes.crossover(dadgenes);\n // Mutate their genes\n // console.log(child);\n\n child.mutate(this.mutationRate);\n // console.log('mutated', child);\n\n\n // Fill the new population with the new child\n this.population[i] = new Rose(child, 0, 0, w * .8, this.color);\n }\n this.generations++;\n }", "function newTransverseWaveGame() {\n var viewFactory = new InteractiveTransverseWaveViewFactory();\n var playDelay = 1000;\n var playerOptions = getCommonPlayerOptions(viewFactory, playDelay, 1, 5);\n var width = parseInt($('boardWidth').value);\n var height = parseInt($('boardHeight').value);\n var controlForm = $('gameOptions');\n var leftPlayer = parseInt(getSelectedRadioValue(controlForm.elements['leftPlayer']));\n var rightPlayer = parseInt(getSelectedRadioValue(controlForm.elements['rightPlayer']));\n var game = new TransverseWave(height, width);\n var players = [playerOptions[leftPlayer], playerOptions[rightPlayer]];\n var ref = new Referee(game, players, viewFactory, \"MainGameBoard\", $('messageBox'), controlForm);\n}", "getSources(sources, initProp) {\n let fromParent = initProp.from;\n this.I.set(fromParent.tagVal, [initProp]);\n this.sourcesReceived += 1;\n this.inputSignals.set(fromParent.tagVal, initProp.value);\n this.libs.reflectOnActor().newSource(initProp.value);\n sources.forEach((source) => {\n if (this.S.has(source.tagVal)) {\n this.S.get(source.tagVal).push(fromParent);\n }\n else {\n this.S.set(source.tagVal, [fromParent]);\n }\n });\n if (this.gotAllSources()) {\n let allSources = [];\n let sourceClocks = new Map();\n this.S.forEach((_, source) => {\n let tag = new this.libs.PubSubTag(source);\n allSources.push(tag);\n sourceClocks.set(source, 0);\n });\n this.lastProp.value = this.invokeStart();\n this.lastProp.sClocks = sourceClocks;\n if (this.amSink()) {\n let send = () => {\n this.parentRefs.forEach((ref) => {\n ref.getStart();\n });\n };\n this.sendToAllParents(send);\n this.ready = true;\n this.flushReady();\n }\n else {\n let send = () => {\n this.childRefs.forEach((ref) => {\n ref.getSources(allSources, this.lastProp);\n });\n };\n this.sendToAllChildren(send);\n }\n }\n }", "constructor(targetChromosome, popSize) {\n this.genePool = [];\n this.generationNumber = 0;\n this.targetChromosome = targetChromosome;\n\n // create genes with random codes and insert into gene pool\n for (var i = 0; i < popSize; i++) {\n var gene = new Gene();\n gene.generateCode(this.targetChromosome.length);\n this.genePool.push(gene);\n }\n }", "constructor() {\n this.parentPop = []; // Main population - invariant : always sorted, best indiv on the front\n this.matingPool = []; // Individuals chosen as parents are temporarily stored here\n this.childPop = []; // Child population for step 3 - 'produceOffspring'\n \n this.#fitsum = 0;\n \n // Init parentPop with new random individuals\n for (let i = 0; i < popsize; i++) {\n this.parentPop[i] = new Song();\n }\n }", "import(stream) {\n var self = this;\n stream.on('data', function (quad) {\n self.addQuad(quad);\n });\n return stream;\n }", "createChannel() {\n\t\t// Set the depends - add self aggs query as well with depends\n\t\tlet depends = this.props.depends ? this.props.depends : {};\n\t\tdepends['aggs'] = {\n\t\t\tkey: this.props.inputData,\n\t\t\tsort: this.props.sort,\n\t\t\tsize: this.props.size\n\t\t};\n\t\t// create a channel and listen the changes\n\t\tvar channelObj = manager.create(depends);\n\t\tchannelObj.emitter.addListener(channelObj.channelId, function(res) {\n\t\t\tlet data = res.data;\n\t\t\tlet rawData;\n\t\t\tif(res.method === 'stream') {\n\t\t\t\trawData = this.state.rawData;\n\t\t\t\trawData.hits.hits.push(res.data);\n\t\t\t} else if(res.method === 'historic') {\n\t\t\t\trawData = data;\n\t\t\t}\n\t\t\tthis.setState({\n\t\t\t\trawData: rawData\n\t\t\t});\n\t\t\tthis.setData(rawData);\n\t\t}.bind(this));\n\t}", "function create(collection) {\n return new RxReplicationState(collection);\n}", "_populateVoice(voiceIndex) {\n this._populateMeasureArray();\n const measures = this.measures;\n let measure = measures[0];\n let tickmap = measure.tickmapForVoice(this.destination.voice);\n let voice = this._populatePre(voiceIndex, measure, this.destination.tick, tickmap);\n let startSelector = JSON.parse(JSON.stringify(this.destination));\n this.measureIndex = 0;\n const measureVoices = [];\n measureVoices.push(voice);\n while (this.measureIndex < measures.length) {\n measure = measures[this.measureIndex];\n tickmap = measure.tickmapForVoice(this.destination.voice);\n this._populateNew(voice, voiceIndex, measure, tickmap, startSelector);\n if (this.noteIndex < this.notes.length && this.measureIndex < measures.length) {\n voice = {\n notes: []\n };\n measureVoices.push(voice);\n startSelector = {\n staff: startSelector.staff,\n measure: startSelector.measure,\n voice: voiceIndex,\n tick: 0\n };\n this.measureIndex += 1;\n startSelector.measure += 1;\n } else {\n break;\n }\n }\n this._populatePost(voice, voiceIndex, measure, tickmap, startSelector.tick);\n return measureVoices;\n }", "robot_rrt_planner_init() {\n\n\t\t// make sure the rrt iterations are not running faster than animation update\n\t\tthis.robot.cur_time = Date.now();\n\n\t\t// flag to continue rt iterations\n\t\tthis.robot.rrt_iterate = true;\n\t\tthis.robot.rrt_iter_count = 0;\n\t\t// initialize this.robot.connecting to false for (RRT-Connect)\n\t\tthis.robot.connecting = false;\n\t\t// generating path from q_init to _q_goal in T_ab\n\t\tthis.robot.generatingPathRRTConnect = false;\n\n\t\t// rrt step size\n\t\tthis.robot.eps = 0.4;\n\n\t\t// rrt* neighborhood size\n\t\tthis.robot.neighborhood = this.robot.eps * 2;\n\n\t\tthis.robot.thresh_rand = 0.4;\n\n\t\t// deal with margin when generate random \n\t\tthis.robot.margin_dist = 3;\n\n\t\tthis.robot.q_names = {}; // store mapping between joint names and q DOFs\n\t\tthis.robot.q_index = []; // store mapping between joint names and q DOFs\n\n\t\tthis.robot.rrt_alg = 2; // 0: basic rrt (OPTIONAL), 1: rrtConnect (REQUIRED), 2. rrtStar, 3. DFS\n\n\t\tthis.robot.search_result = \"starting\";\n\n\t\tthis.robot.search_stack = [];\n\n\t\t// starting base config\n\t\t// form configuration from base location and joint angles\n\t\tthis.robot.q_start_config = [\n\t\t\tthis.robot.origin.xyz[0],\n\t\t\tthis.robot.origin.xyz[1],\n\t\t\tthis.robot.origin.xyz[2],\n\t\t\tthis.robot.origin.rpy[0],\n\t\t\tthis.robot.origin.rpy[1],\n\t\t\tthis.robot.origin.rpy[2]\n\t\t];\n\n\t\tfor (const x in this.robot.joints) {\n\t\t\t// store mapping between joint names and q DOFs\n\t\t\t\t// accounts for base indices\n\t\t\tthis.robot.q_names[x] = this.robot.q_start_config.length;\n\t\t\tthis.robot.q_index[this.robot.q_start_config.length] = x;\n\t\t\tthis.robot.q_start_config = this.robot.q_start_config.concat(this.robot.joints[x].angle);\n\t\t}\n\n\t\t// set goal configuration as the zero configuration\n\t\tlet i; \n\t\tthis.robot.q_goal_config = new Array(this.robot.q_start_config.length);\n\t\tfor (i=0;i<this.robot.q_goal_config.length;i++) this.robot.q_goal_config[i] = 0;\n\n\t\tif (this.robot.rrt_alg === 1) { \n\t\t\t// initialize search tree from start configurations (RRT-based algorithms)\n\t\t\tthis.robot.T_a = this.initRRTConnect(this.robot.q_start_config);\n\t\t\t// also initialize search tree from goal configuration (RRT-Connect)\n\t\t\tthis.robot.T_b = this.initRRTConnect(this.robot.q_goal_config);\n\n\t\t\tthis.robot.q_init_node = this.robot.T_a.vertices[0];\n\t\t\tthis.robot.q_goal_node = this.robot.T_b.vertices[0];\n\t\t} else if (this.robot.rrt_alg === 2) { \n\t\t\t\n\t\t\tthis.robot.T = this.initRRTConnect(this.robot.q_start_config);\n\t\t}\n\t}", "async init (scene, data) {\n this.scene = scene\n this._engine = scene.getEngine()\n this.canvas = this._engine.getRenderingCanvas() \n this.objects = {}\n \n this.label = this.createLabel()\n console.log('dataaaaa//////// ', data)\n if (!data.electData) {\n this.electData = {\n ComponentParts: [], // name of parts\n ComponentToParts: [], // conect comp pins with part pins\n PartToPart: [], // conect part pins, nets\n PartToPartNames: [], // name of nets\n need: {}, // need pins settings\n pass: {}, // pass pins settings\n }\n }\n else {\n for (let key in data.electData) {\n this.electData[key] = data.electData[key]\n }\n }\n\n if (!data.assets) {\n data.compSize = [20, 20] // keep comp size\n data.nets = this.nets // keep nets details\n data.routing_data = [] // keep data of routes - 3d objects\n data.assets = [] // objects loaded\n }\n\n this.data.nets = this.nets = data.nets\n this.data.routing_data = data.routing_data\n this.data.assets = data.assets\n this.data.compSize = data.compSize\n \n this.scene.actionManager = new BABYLON.ActionManager(this.scene);\n this.scene.actionManager.registerAction(\n new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnEveryFrameTrigger, (evt) => {\n if (this.curentOpt !== 5) {\n return\n } \n\n if (this.lastPosition !== null) {\n const pos = this.getGroundPosition(evt)\n this.draw3dlines(pos, false)\n }\n }))\n\n this.addBoard()\n await this.importAssets(this.data.assets)\n\n this._engine.resize()\n }", "fork () {\n return new Microcosm({\n parent : this\n })\n }", "function createRopes() {\n var g = new THREE.CylinderGeometry(ropeThickness, ropeThickness, tableLength * 1.2);\n var gSide = new THREE.CylinderGeometry(ropeThickness, ropeThickness, 1);\n g.openended = true;\n gSide.openended =true;\n ropeTexture = new THREE.TextureLoader(manager).load(\n 'rope.jpg',\n function (txt) {\n ropeTexture = txt;\n ropeTexture.wrapT = THREE.RepeatWrapping;\n ropeTexture.wrapS = THREE.RepeatWrapping;\n ropeTexture.anisotropy = 4;\n ropeTexture.repeat.set(0.1, 2);\n var m = new THREE.MeshLambertMaterial({map: ropeTexture});\n rope = new THREE.Mesh(g, m);\n rope.rotation.z = Math.PI / 2;\n rope.rotation.x = Math.PI;\n rope.position.z = zPosition;\n rope.position.y = pulleyY + 17.5;\n rope.castShadow = true;\n setup.add(rope);\n\n leftRope = new THREE.Mesh(gSide, m);\n leftRope.rotation.y = Math.PI;\n leftRope.rotation.z = Math.PI;\n leftRope.position.x = leftPanX;\n leftRope.position.z = zPosition;\n leftRope.position.y = (pulleyY + (yHigh + yLow) / 2)/ 2;\n leftRope.scale.y = pulleyY - (yHigh + yLow) / 2;\n leftRope.castShadow = true;\n setup.add(leftRope);\n\n rightRope = new THREE.Mesh(gSide, m);\n rightRope.rotation.y = Math.PI;\n rightRope.position.x = rightPanX;\n rightRope.position.z = zPosition;\n rightRope.position.y = (pulleyY + (yHigh + yLow) / 2)/ 2;\n rightRope.scale.y = pulleyY - (yHigh + yLow) / 2;\n rightRope.castShadow = true;\n setup.add(rightRope);\n }\n );\n}", "function Chromatin(Paths, PathControls, ColorConvert, Proximities) {\n\t\treturn function(data, colors, view_settings, resolution_scale, settings) {\n\t\t\t// console.log(colors);\n\n\t\t\tvar defaults = {\n\t\t\t\tvisible: true,\n\t\t\t\tgenomeLength: 816394, // bactieria mycoplasma_pneumoniae_m129\n\t\t\t\tparticles: 0,\n\t\t\t\tparticleSegments: 40,\n\t\t\t\tcurveSegments: 1,\n\t\t\t\tradius: 15,\n\t\t\t\tradiusSegments: 16,\n\t\t\t\tendcap: false,\n\t\t\t\tpathClosed: false,\n\t\t\t\ttubed: true,\n\t\t\t\tresolution_scales : {\n\t\t\t\t\t\"2000\" : 1,\n\t\t\t\t\t\"10000\" : 1,\n\t\t\t\t\t\"50000\" : 5,\n\t\t\t\t\t\"100000\" : 5\n\t\t\t\t}\n\t\t\t};\t\t\n\t\t\tview_settings = view_settings || {};\n\t\t\tangular.extend(this, angular.copy(defaults), view_settings);\n\n\t\t\t//var chromBreaks = [];\n\t\t\tvar resolution = settings.segmentLength*settings.particleSegments;\n\t\t\t// ********************************************\n\t\t\t// * MODEL SCALE = 1unit : 1nanometer *\n\t\t\t// * 1 micrometer (µm) = 1000 nanometers (nm) *\n\t\t\t// ********************************************\n\t\t\t// Eukaryotic animal cells diamter == 20 µm (10 - 30 µm) = 10000 units radius\n\t\t\t// var cellRadius = 10000;\n\t\t\t// Nucleus diameter == 6 µm (3 - 10 micrometers) = 3000 units radius\n\t\t\t// var nucelusRadius = 20;\n\t\t\t// Chromatin diameter == 10nm\n\t\t\t//var pathLength = cubicPath.getLength();\n\t\t\tvar chromatinRadius = 5; // 10nm * 0.5\n\t\t\t// Chromatin density == 1080 BP : 11nm\n\t\t\tvar chromatinLength = this.genomeLength * 11 / 1080;\n\t\t\t//this.radius = (pathLength * chromatinRadius) / chromatinLength;\n\t\t\tthis.radius = resolution_scale*chromatinRadius;\n\t\t\t//console.log(this.radius);\n\t\t\t\n\t\t\t// Convert Data to Vector triplets\n\t\t\tvar geometry = getGeometry(data);\n\t\t\tfor (var g = geometry.vertices.length - 1; g >= 0; g--) {\n\t\t\t\tvar geometryColor = new THREE.Color(colors[g*20]);\n\t\t\t\tgeometry.colors.unshift(geometryColor);\n\t\t\t}\n\t\t\tgeometry.computeBoundingSphere();\n\t\t\t//geometry.center();\n\n\t//\t\t\tvar transparentMaterial = new THREE.MeshLambertMaterial({\n\t//\t\t\t transparent:true, \n\t//\t\t\t opacity:0.0\n\t//\t\t\t});\n\t\t\tvar solidMaterial = new THREE.MeshLambertMaterial({\n\t\t\t color: 0xffffff,\n\t\t //shading: THREE.FlatShading,\n\t\t //side: THREE.DoubleSide,\n\t\t wireframe: false,\n\t\t transparent: false,\n\t\t vertexColors: THREE.FaceColors, // CHANGED\n\t\t overdraw: true\n\t\t });\n\n\t\t\tvar simple_chrom_colors = ['#FF0000','#00FF00','#0000FF','#FFFF00','#00FFFF','#FF00FF','#C0C0C0','#808080','#800000','#808000','#008000','#800080','#008080','#000080','#A52A2A','#E9967A','#B8860B','#FFFF00','#006400','#98FB98','#2F4F4F','#40E0D0','#4682B4','#87CEFA','#DC143C','#FFD700','#F0E68C','#7CFC00','#00FF00','#00FF7F','#3CB371','#00FFFF','#AFEEEE','#6495ED','#87CEEB'];\n\t\t\tvar chromatinFiber = new THREE.Object3D(); // unmerged network\n\t\t\tvar i;\n\t\t\tvar colori = 0;\n\t\t\tvar chr_bins,pathControls,pathSegments,cubicPath,cubicGeom, chromatinGeometry, tubeMesh, newChromatinColor;\n\t\t\tvar j;\n\t\t\tvar offset = 0;\n\t\t\tvar fpart = 0;\n\t\t\tvar proximities = Proximities.get();\n\t\t\tsettings.facesParticle = [];\n\t\t\tfor (var l = 0 ; l < settings.chromosomeIndexes.length; l++) {\n\t\t\t\tchr_bins = Math.round((settings.chromEnd[l]-settings.chromStart[l])/resolution);\n\t\t\t\t//chromBreaks.push(offset);\n\t\t\t\n\t\t\t\t// Derive path controls from geometry vectors\n\t\t\t\t// var pathControls = getPathControls( geometry.vertices );\n\t\t\t\tvar model_points = geometry.vertices.slice(offset,offset+chr_bins);\n\t\t\t\tpathControls = PathControls.cubic(model_points, this.pathClosed);\n\t\t\t\t//pathControls = PathControls.simple(geometry.vertices.slice(offset,offset+chr_bins));\n\n\t\t\t\t// Set number of Particles\n\t\t\t\tif (this.particles === 0) this.particles += geometry.vertices.length; //pathControls.vertices.length - 1;\n\t\t\t\t// Derive chromatin geometry path segments\n\t\t\t\tpathSegments = chr_bins * this.particleSegments; // same as segmentsCount...\n\t\t\t\t\n\t\t\t\t/*** TODO: Calculate PathSegments based on number of base pairs in the model ***/\n\t\t\t\tcubicPath = Paths.cubicBezier(pathControls.vertices, pathSegments, this.pathClosed);\n\t\t\t\tcubicGeom = new THREE.Geometry().setFromPoints( cubicPath.getPoints() );\n\t\t\t\t\n\t\t\t\t//cubicGeom.name = \"cubicGeom\";\n\t\n\t\t\t\t// Generate Chromatin model\n\t\t\t\t\n\t\t\t\tif(view_settings.tubed) {\n\t\t\t\t\tchromatinGeometry = new THREE.TubeGeometry(cubicPath, pathSegments, this.radius, 8, this.pathClosed);\n\t\t\t\t\t\n\t\t\t\t tubeMesh = new THREE.Mesh(chromatinGeometry, solidMaterial);\n\t\t\t\t\t\n\t\t\t\t //var faces = chromatinGeometry.vertices.length;\n\t\t\t\t var faces = chromatinGeometry.faces.length;\n\t\t\t\t\tvar segment_lengths = [];\n\t\t\t\t\tfor (i = 0; i < model_points.length-1; i++) segment_lengths.push(distance(model_points[i+1],model_points[i]));\n\t\t\t\t\tvar total_length = 0;\n\t\t\t\t\tfor (i = 0; i < segment_lengths.length; i++) total_length += segment_lengths[i];\n\t\t\t\t\tvar facesParticle = [];\n\t\t\t\t\tfor (i = 0; i < chr_bins; i++) facesParticle.push([0,0]);\n\t\t\t\t\tfor (i = chr_bins-1; i >= 0; i--) {\n\t\t\t\t\t\t// we add right part of curve if not last particle\n\t\t\t\t\t\tif(i < chr_bins - 1 ) fpart = Math.round(((chromatinGeometry.faces.length)/16)*((segment_lengths[i]/2)/total_length));\n\t\t\t\t\t\t//if(i < chr_bins - 1 ) fpart = Math.round(((chromatinGeometry.vertices.length-8)/8)*((segment_lengths[i]/2)/total_length));\n\t\t\t\t\t\t// we add left part of curve if not first particle\n\t\t\t\t\t\tif(i > 0 ) fpart += Math.round(((chromatinGeometry.faces.length)/16)*((segment_lengths[i-1]/2)/total_length));\n\t\t\t\t\t\t//if(i > 0 ) fpart += Math.round(((chromatinGeometry.vertices.length-8)/8)*((segment_lengths[i-1]/2)/total_length)); \n\t\t\t\t\t\tfaces--;\n\t\t\t\t\t\tif(faces > 1) facesParticle[i][1]=faces;\n\t\t\t\t\t\telse facesParticle[i][1]=1;\n\t\t\t\t\t\tfaces -= Math.ceil(fpart*16); // segments have 8 faces\n\t\t\t\t\t\tif(faces > 0) facesParticle[i][0]=faces;\n\t\t\t\t\t\telse facesParticle[i][0]=0;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tsettings.facesParticle.push(facesParticle);\n\t\t\t\t\t\n\t\t\t\t\tchromatinGeometry.dynamic = true;\n\t\t\t\t\tchromatinGeometry.verticesNeedUpdate = true;\n\t\t\t\t\t\n\t\t\t\t\t//chromatinGeometry.center();\n\t\t\t\t\t\n\t\t\t\t //for(var k=0;k< chromatinGeometry.faces.length;k++) {\n\t\t\t\t \t//if(k%12) chromatinGeometry.faces[k].color.setRGB(1,0,0);\n\t\t\t\t \t//else chromatinGeometry.faces[k].color.setRGB(0,0,0);\n\t\t\t\t //\tchromatinGeometry.faces[k].color.setRGB(1,0,0);\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t /*for (i = 0; i < colors.length; i++) {\n\t\t\t\t \t//if(chromBreaks.indexOf(Math.floor(i/settings.particleSegments))>-1) {\n\t\t\t\t \tif(chromBreaks.indexOf(Math.floor(i/this.particleSegments))>-1) {\n\t\t\t\t \t\tfor (j = 0; j < 16; j++) {\n\t\t\t\t \t\t\tif(typeof tubeMesh.geometry.faces[i*16+j] !== 'undefined') tubeMesh.geometry.faces[i*16+j].materialIndex = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t \t} else {\n\t\t\t\t\t\t\tif(ColorConvert.testIfHex(colors[i]) || colors[i].indexOf('#')===0) {\n\t\t\t\t\t\t\t\tnewChromatinColor = new THREE.Color(colors[i]);\t \n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewChromatinColor = new THREE.Color(ColorConvert.nameToHex(colors[i]));\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\tfor (j = 0; j < 16; j++) {\n\t\t\t\t\t\t\t\tif(typeof tubeMesh.geometry.faces[i*16+j] !== 'undefined') tubeMesh.geometry.faces[i*16+j].color.set(newChromatinColor);\n\t\t\t\t\t\t\t}\n\t\t\t\t \t}\n\t\t\t\t\t}*/\n\t\t\t\t\tfor (i = 0; i < chromatinGeometry.faces.length; i++) {\n\t\t\t\t\t\tif(settings.chromosomeIndexes.length > 1) colors[Math.floor(colori/16)] = simple_chrom_colors[l];\n\t\t\t\t\t\tif(ColorConvert.testIfHex(colors[Math.floor(colori/16)]) || colors[Math.floor(colori/16)].indexOf('#')===0) {\n\t\t\t\t\t\t\tnewChromatinColor = new THREE.Color(colors[Math.floor(colori/16)]);\t \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tnewChromatinColor = new THREE.Color(ColorConvert.rgbToHex(colors[Math.floor(i/16)]));\n\t\t\t\t\t\t} \n\t\t\t\t\t\tfor (j = 0; j < 16; j++) {\n\t\t\t\t\t\t\tif(typeof chromatinGeometry.faces[i+j] !== 'undefined') chromatinGeometry.faces[i+j].color.set(newChromatinColor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolori++;\n\t\t\t\t\t}\n\t\t\t\t\ttubeMesh.geometry.__dirtyColors = true;\n\t\t\t\t\ttubeMesh.geometry.elementsNeedUpdate = true;\n\t\t\t\t tubeMesh.dynamic = true;\n\t\t\t\t tubeMesh.needsUpdate = true;\n\t\t\t\t \n\t\t\t\t\tchromatinFiber.add( tubeMesh );\n\t\t\t\t\t//chromatinFiber.userData = {display:'tube'};\n\t\n\t\t\t\t} else {\n\t\t\t\t\t// Rings\n\t\t\t\t\t\tchromatinGeometry = new THREE.Geometry(); // to calculate merged bounds\n\t\n\t\t\t\t\tfor ( i = 0 ; i < pathSegments; i++) {\n\t\t\t\t\t\t// cap if end segment\n\t\t\t\t\t\tthis.endcap = ( i === 0 || i === pathSegments - 1 ) ? false : true ;\n\t\t\t\t\t\t// color linked to scene scope\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar segmentColor = colors[i];\n\t\t\t\t\t\tvar segmentMaterial = new THREE.MeshLambertMaterial({\n\t\t\t\t\t\t\tcolor: segmentColor,\n\t\t\t\t\t\t\temissive: segmentColor,\n\t\t\t\t\t\t\tvertexColors: THREE.VertexColors,\n\t\t\t\t\t\t\topacity: 1.0, \n\t\t\t\t\t\t\ttransparent: false,\n\t\t\t\t\t\t\twireframe: false\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvar segment = segmentGeometry(cubicGeom.vertices[i], cubicGeom.vertices[i+1], this );\n\t\t\t\t\t\tchromatinGeometry.merge(segment);\n\t\t\t\t\t\tTHREE.GeometryUtils.center( chromatinGeometry );\n\t\n\t\t\t\t\t\tvar chromatinSegment = new THREE.Mesh(segment, segmentMaterial);\n\t\t\t\t\t\tchromatinSegment.name = \"segment-\" + (i + 1);\n\t\t\t\t\t\tchromatinFiber.add(chromatinSegment);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\n\t\t\t\tchromatinGeometry.computeBoundingSphere();\n\t\t\t\t//chromatinGeometry.computeBoundingBox();\n\t\t\t\toffset += chr_bins;\n\t\t\t}\n\t\t\t\n\t\t\t//tubeMesh.position.x -= objectCenter.x;\n\t\t\t//tubeMesh.position.y -= objectCenter.y;\n\t\t\t//tubeMesh.position.z -= objectCenter.z;\n\t\t\t\n\t\t\t//chromatinFiber.boundingSphere = chromatinGeometry.boundingSphere;\n\t\t\tchromatinFiber.boundingSphere = geometry.boundingSphere;\n\t\t\tchromatinFiber.name = \"Chromatin Fiber\";\n\t\t\t\n\t\t\treturn chromatinFiber;\n\t\t};\n\t}", "function CarBuilder() {\n this.car = null;\n \n this.step1 = function() {\n this.car = new Car();\n };\n \n this.step2 = function() {\n this.car.addParts();\n };\n \n this.get = function() {\n return this.car;\n };\n}", "newInstance(dna) {\n\n let newInd = new Individual(this.dnaLength, this.fitnessEvaluator);\n\n if (dna) {\n newInd.dna = [...dna];\n return newInd;\n }\n\n for (var g = 0; g < newInd.dnaLength; g++) {\n\n /* Generate XY positional values */\n let x1 = Math.random();\n let y1 = Math.random();\n let slope = Math.random();\n\n newInd.dna.push(new Gene(x1, y1, slope));\n }\n\n return newInd;\n\n }", "makeData (callback) {\n\t\tif (this.streamType === 'direct') {\n\t\t\tthis.skipFollow = true;\n\t\t\tthis.expectedVersion = 2;\n\t\t}\n\t\tthis.init(callback);\n\t}", "function buildStream(data) {\n // If we have no data - do nothing\n if (data.length === 0) {\n return null;\n }\n // Load the data into Javascript Objects\n data = JSON.parse(data);\n\n for (i = 0; i < data.length; i++) {\n\t\t\t\t\n\t\t\t\tvar post = createPost(data[i]);\n\n\t\t\t\t// each post has an array of replys - process those\n for (j = 0; j < data[i].Replys.length; j++) {\n appendReplyToParentObject(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreateReply(data[i].Replys[j]),\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tpost\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n }\n\t\t\tappendToDataStream(post);\n }\n}", "createGenomes(num, chromoLength, geneMin, geneMax) {\n\t\t\tfor(var i = 0; i < num; i++) {\n\t\t\t\tthis.population.push(new geneticAlg.Genome(chromoLength, geneMin, geneMax));\n\t\t\t}\n\t\t}", "function rainSetup() {\n for (let i = 0; i < rainAmount; i++) {\n drop[i] = new RainGenerator();\n }\n}", "function masterDataGenerator(){\n let theMasterArray = generateArgumentsArray()\n .map( (infoArray) => {\n return promiseThrottle.add(searchSkyscannerByDate.bind(this, ...infoArray))\n })\n Promise.all(theMasterArray)\n}", "import(stream) {\n stream.on('data', quad => {\n this.addQuad(quad);\n });\n return stream;\n }", "async init() {\n try {\n await this.fetchData();\n await this.buildMap(this._mapId);\n } catch (error) {\n this._notification.logError(error, 'RefugeeCampMap.init()');\n } finally {\n return this;\n }\n }", "function Lagomoro_Recorder() {\r\n this.initialize.apply(this, arguments);\r\n}", "constructor () {\n const s = this\n s.observer = sugoObserver(s._handler.bind(s), ReportServer.observerConfig)\n s.callers = {}\n\n // masterReporter が emit する\n s.masterReporter = new Module({})\n s.masterActor = sugoActor(Object.assign({\n key: MASTER_ACTOR.KEY,\n modules: {\n [MASTER_ACTOR.MODULE]: s.masterReporter\n }\n }, ReportServer.masterActorConifg))\n }", "function generateData() {\n return stream_layers(4,10+Math.random()*200,.1).map(function(data, i) {\n return {\n key: 'Portfolio ' + (i+1),\n values: data\n };\n });\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xd5676710;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.prevParticipant = args.prevParticipant;\n this.newParticipant = args.newParticipant;\n }", "_createGene()\n {\n let magnitude = Math.random() * (this.#maxJumpMagnitude - this.#minJumpMagnitude) + this.#minJumpMagnitude;\n let direction = Math.random() * (this.#maxJumpDirection - this.#minJumpDirection) + this.#minJumpDirection;\n\n return new Gene(magnitude, direction);\n }", "rebuild() {\r\n\t\tthis.noise = new Noise(this.traits.seed);\r\n\t\t\r\n\t\t//create terrains\r\n\t\tthis.terrains = TerrainSet.buildSet({\r\n\t\t\tnumTerrains: this.traits.numTerrains,\r\n\t\t\twaterHeight: this.traits.water,\r\n\t\t\tbaseColor: this.traits.baseColor,\r\n\t\t\taccColor: this.traits.accColor\r\n\t\t});\r\n\r\n\t\t//create halo texture\r\n\t\tthis._haloDirty = true;\r\n\r\n\t\tthis.clouds = this._makeClouds();\r\n\r\n\t\tif (this.traits.ring)\r\n\t\t\tthis.ring = this._makeRing();\r\n\t}", "function create(range, target, data) {\n return {\n range: range,\n target: target,\n data: data\n };\n }", "function create(range, target, data) {\n return {\n range: range,\n target: target,\n data: data\n };\n }", "function create(range, target, data) {\n return {\n range: range,\n target: target,\n data: data\n };\n }", "function Builder_sample(cubebox) {\n var i, j, k;// i RIGHE, j COLONNE, k indice per tenere il conto e scorrere l'array delle altezze data\n k = 0;\n //cube = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({ color: 0xff0000 }));\n var deep, diff;\n for (i = 0; i < groundNumBoxX; i++) {\n for (j = 0; j < groundNumBoxZ; j++) {\n\n cube = new THREE.Mesh(geometry, new THREE.MeshPhongMaterial({ color: 0xf00f0, shininess: 97, specular: 0x20202 }));\n cube.position.x = i;\n cube.position.z = j;\n\n var c = g = Math.floor(map_range(data[k], Math.min.apply(Math, data), Math.max.apply(Math, data), 0, 255));\n c = (c.toString(16).length < 2 ? \"0\" : \"\") + c.toString(16);\n cube.material.color.setHex(\"0X\" + c + \"\" + c + \"\" + c);\n\n cubebox.add(cube.clone());\n\n k++;\n }\n }\n\n}", "function Replayer(midiFile, synth) {\r\n var trackStates = [];\r\n var trackAccumulatedDelta = [{noteNumber:0,total:0,track:0}];\r\n var beatsPerMinute = 120;\r\n var millisecondsPerBeat= beatsPerMinute * 60000000;\r\n var ticksPerBeat = midiFile.header.ticksPerBeat;\r\n var channelCount = 16;\r\n\r\n\r\n var i;\r\n for (i = 0; i < midiFile.tracks.length; i++) {\r\n trackStates[i] = {\r\n 'nextEventIndex': 0,\r\n 'ticksToNextEvent': (\r\n midiFile.tracks[i].length ?\r\n midiFile.tracks[i][0].deltaTime :\r\n null\r\n )\r\n };\r\n }\r\n \r\n function Channel() {\r\n \r\n var generatorsByNote = {};\r\n var currentProgram = $synthService.PianoProgram; // NOT USED\r\n \r\n function noteOn(noteEvent) {\r\n if (generatorsByNote[noteEvent.event.noteNumber] && !generatorsByNote[noteEvent.event.noteNumber].released) {\r\n /* playing same note before releasing the last one. BOO */\r\n generatorsByNote[noteEvent.event.noteNumber].noteOff(); /* TODO: check whether we ought to be passing a velocity in */\r\n $rootScope.$broadcast('playmyband.midi.noteOffEvent',noteEvent);\r\n }\r\n //console.log('playing note' + note);\r\n $rootScope.$broadcast('playmyband.midi.noteEvent',noteEvent);\r\n var generator = currentProgram.createNote(noteEvent.event.noteNumber, noteEvent.event.velocity);\r\n synth.addGenerator(generator);\r\n generatorsByNote[noteEvent.noteNumber] = generator;\r\n }\r\n function noteOff(noteEvent) {\r\n if (generatorsByNote[noteEvent.event.noteNumber] && !generatorsByNote[noteEvent.event.noteNumber].released) {\r\n generatorsByNote[noteEvent.noteNumber].noteOff(noteEvent.event.velocity);\r\n }\r\n $rootScope.$broadcast('playmyband.midi.noteOffEvent',noteEvent);\r\n\r\n }\r\n function setProgram(programNumber) {\r\n console.debug(programNumber);\r\n currentProgram = $synthService.PianoProgram; // TODO --> custom programs PROGRAMS[programNumber] || $synthService.PianoProgram;\r\n }\r\n \r\n return {\r\n 'setProgram': setProgram,\r\n 'noteOn': noteOn,\r\n 'noteOff': noteOff\r\n };\r\n }\r\n \r\n var channels = [];\r\n for (i = 0; i < channelCount; i++) {\r\n channels[i] = new Channel();\r\n }\r\n \r\n var nextEventInfo;\r\n var samplesToNextEvent = 0;\r\n \r\n function getNextEvent() {\r\n var ticksToNextEvent = null;\r\n var nextEventTrack = null;\r\n var nextEventIndex = null;\r\n \r\n var i;\r\n for (i = 0; i < trackStates.length; i++) {\r\n if (trackStates[i].ticksToNextEvent !== null && (ticksToNextEvent === null || trackStates[i].ticksToNextEvent < ticksToNextEvent) ) {\r\n ticksToNextEvent = trackStates[i].ticksToNextEvent;\r\n nextEventTrack = i;\r\n nextEventIndex = trackStates[i].nextEventIndex;\r\n }\r\n }\r\n if (nextEventTrack !== null) {\r\n /* consume event from that track */\r\n var nextEvent = midiFile.tracks[nextEventTrack][nextEventIndex];\r\n if (midiFile.tracks[nextEventTrack][nextEventIndex + 1]) {\r\n trackStates[nextEventTrack].ticksToNextEvent += midiFile.tracks[nextEventTrack][nextEventIndex + 1].deltaTime;\r\n } else {\r\n trackStates[nextEventTrack].ticksToNextEvent = null;\r\n }\r\n trackStates[nextEventTrack].nextEventIndex += 1;\r\n /* advance timings on all tracks by ticksToNextEvent */\r\n for (i = 0; i < trackStates.length; i++) {\r\n if (trackStates[i].ticksToNextEvent !== null) {\r\n trackStates[i].ticksToNextEvent -= ticksToNextEvent;\r\n }\r\n }\r\n nextEventInfo = {\r\n 'ticksToEvent': ticksToNextEvent,\r\n 'event': nextEvent,\r\n 'track': nextEventTrack\r\n };\r\n var beatsToNextEvent = ticksToNextEvent / ticksPerBeat;\r\n var secondsToNextEvent = beatsToNextEvent / (beatsPerMinute / 60);\r\n //if (typeof(nextEvent.noteNumber) !== 'undefined') {\r\n //console.debug('track:' + nextEventTrack + 'last accumulated:' + trackAccumulatedDelta[trackAccumulatedDelta.length - 1].total + 'secondToNextEvet:' + (secondsToNextEvent * 1000));\r\n var millisecondsToNextEvent= beatsToNextEvent * millisecondsPerBeat;\r\n\r\n var nextAccumulatedDelta = trackAccumulatedDelta[trackAccumulatedDelta.length - 1].total + millisecondsToNextEvent;\r\n //console.log(nextEventTrack+') nextAccumulatedDelta: '+nextAccumulatedDelta);\r\n\r\n\r\n trackAccumulatedDelta[trackAccumulatedDelta.length] = { noteNumber : nextEvent.noteNumber, total : nextAccumulatedDelta, track : nextEventTrack}; \r\n nextEvent.accumulatedDelta=nextAccumulatedDelta;\r\n //}\r\n samplesToNextEvent += secondsToNextEvent * synth.sampleRate;\r\n } else {\r\n nextEventInfo = null;\r\n samplesToNextEvent = null;\r\n self.finished = true;\r\n }\r\n }\r\n \r\n getNextEvent();\r\n \r\n function generate(samples) {\r\n var data = new Array(samples*2);\r\n var samplesRemaining = samples;\r\n var dataOffset = 0;\r\n \r\n while (true) {\r\n if (samplesToNextEvent !== null && samplesToNextEvent <= samplesRemaining) {\r\n /* generate samplesToNextEvent samples, process event and repeat */\r\n var samplesToGenerate = Math.ceil(samplesToNextEvent);\r\n if (samplesToGenerate > 0) {\r\n synth.generateIntoBuffer(samplesToGenerate, data, dataOffset);\r\n dataOffset += samplesToGenerate * 2;\r\n samplesRemaining -= samplesToGenerate;\r\n samplesToNextEvent -= samplesToGenerate;\r\n }\r\n \r\n handleEvent();\r\n getNextEvent();\r\n } else {\r\n /* generate samples to end of buffer */\r\n if (samplesRemaining > 0) {\r\n synth.generateIntoBuffer(samplesRemaining, data, dataOffset);\r\n samplesToNextEvent -= samplesRemaining;\r\n }\r\n break;\r\n }\r\n }\r\n return data;\r\n }\r\n \r\n function handleEvent() {\r\n var event = nextEventInfo.event;\r\n switch (event.type) {\r\n case 'meta':\r\n switch (event.subtype) {\r\n case 'setTempo':\r\n beatsPerMinute = 60000000 / event.microsecondsPerBeat;\r\n millisecondsPerBeat= event.microsecondsPerBeat/1000;\r\n //console.log('\\n\\n\\nBeats per minute '+beatsPerMinute);\r\n }\r\n break;\r\n case 'channel':\r\n switch (event.subtype) {\r\n case 'noteOn':\r\n channels[event.channel].noteOn(nextEventInfo); \r\n break;\r\n case 'noteOff':\r\n channels[event.channel].noteOff(nextEventInfo);\r\n break;\r\n case 'programChange':\r\n //console.log('program change to ' + event.programNumber);\r\n channels[event.channel].setProgram(event.programNumber);\r\n break;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n function replay(audio) {\r\n console.log('replay');\r\n audio.write(generate(44100));\r\n setTimeout(function() {replay(audio);}, 10);\r\n }\r\n\r\n function isANoteThere(noteNumber, accumulatedDelta, marginOfError, track)\r\n {\r\n var isThere = false;\r\n var i = trackAccumulatedDelta.length;\r\n //start from the back, where more recent notes should match\r\n while (i--) {\r\n //for (var i = 0; i < trackAccumulatedDelta.length; i++) {\r\n var userNoteDif = Math.abs(trackAccumulatedDelta[i].total - accumulatedDelta);\r\n //console.debug('UserNoteDif:' + userNoteDif);\r\n if ( trackAccumulatedDelta[i].track === track &&\r\n trackAccumulatedDelta[i].noteNumber &&\r\n trackAccumulatedDelta[i].noteNumber>0 &&\r\n trackAccumulatedDelta[i].noteNumber === noteNumber && \r\n userNoteDif <= marginOfError) {\r\n isThere = true;\r\n break;\r\n } else if (userNoteDif > 10000) {\r\n //remove accumulated, no longer required. reduces comparisons on next note\r\n trackAccumulatedDelta.splice(i,1);\r\n //by now just stop\r\n break;\r\n }\r\n }\r\n return isThere;\r\n }\r\n \r\n var self = {\r\n 'replay': replay,\r\n 'generate': generate,\r\n 'finished': false,\r\n 'isANoteThere': isANoteThere\r\n };\r\n return self;\r\n }", "constructor(data) {\n this.data = data;\n this.rebuild_population();\n this.list_of_infoBoxData = [];\n }", "function DNA(genes){\n if (genes){\n this.genes = genes; //we can pass a genes object into the function directly\n }\n else{\n this.genes = [];\n\n for (var i = 0; i < lifespan; i++){\n this.genes[i] = p5.Vector.random2D();\n this.genes[i].setMag(forceMag);\n }\n }\n\n this.crossover = function(partner){\n var newgenes = [];\n var mid = floor(random(this.genes.length));\n\n for (i = 0; i < this.genes.length; i++){\n if (i > mid){\n newgenes[i] = this.genes[i];\n }\n else {\n newgenes[i] = partner.genes[i];\n }\n\n }\n return new DNA(newgenes);\n } //end of crossover function\n\n this.mutation = function(rate){\n for (i = 0; i < this.genes.length; i++){\n if (random(1) < rate){\n this.genes[i] = p5.Vector.random2D();\n }\n\n }\n\n } //end of mutation function\n} // end of DNA function", "_populatePre(voiceIndex, measure, startTick, tickmap) {\n const voice = {\n notes: []\n };\n let i = 0;\n let j = 0;\n let ticksToFill = tickmap.durationMap[startTick];\n // TODO: bug here, need to handle tuplets in pre-part, create new tuplet\n for (i = 0; i < measure.voices[voiceIndex].notes.length; ++i) {\n const note = measure.voices[voiceIndex].notes[i];\n // If this is a tuplet, clone all the notes at once.\n if (note.isTuplet) {\n const tuplet = measure.getTupletForNote(note);\n if (!tuplet) {\n continue; // we remove the tuplet after first iteration\n }\n const ntuplet = SmoTuplet.cloneTuplet(tuplet);\n voice.notes = voice.notes.concat(ntuplet.notes);\n measure.removeTupletForNote(note);\n measure.tuplets.push(ntuplet);\n ticksToFill -= tuplet.tickCount;\n } else if (ticksToFill >= note.tickCount) {\n ticksToFill -= note.tickCount;\n voice.notes.push(SmoNote.clone(note));\n } else {\n const duration = note.tickCount - ticksToFill;\n const durMap = smoMusic.gcdMap(duration);\n for (j = 0; j < durMap.length; ++j) {\n const dd = durMap[j];\n SmoNote.cloneWithDuration(note, {\n numerator: dd,\n denominator: 1,\n remainder: 0\n });\n }\n ticksToFill = 0;\n }\n if (ticksToFill < 1) {\n break;\n }\n }\n return voice;\n }", "function createFireDataStructure() {\n // Multiplica a largura pela altura pra saber a quantidade de pixels\n const numberOfPixels = fireWidth * fireHeight;\n\n // Preenche todas as posições do array com 0\n for (let i = 0; i < numberOfPixels; i++) {\n firePixelsArray[i] = 0;\n }\n}", "function initFire() {\n fire = new VolumetricFire(\n fireWidth,\n fireHeight,\n fireDepth,\n sliceSpacing,\n camera\n );\n\n // Feuer wird für die animate Funktion in ein Array gelegt\n fire_list.push(fire);\n fire_count++;\n}", "create(){\n\t\t\n\t\tthis.tp = \n\t\t\t[\n\t\t\t\t{x:22,y:-1,go: \"m7_scene\",xtp:9,ytp:11},\t\n\t\t\t\t{x:4,y:24,go: \"m9_scene\",xtp:32,ytp:0},\t\n\t\t\t]\n\t\t\t\n\t\t\t\n\t\tthis.eventMap = []\n\t\tthis.eventMap[13] ={tag: \"character\",\n\t\t\t\t\t\t atlas: \"atlas\",\n\t\t\t\t\t\t frame: \"enemie_1.png\",\n\t\t\t\t\t\t collide: true,\n\t\t\t\t\t\t\txOrigin:0,\n\t\t\t\t\t\t\tyOrigin:0,\n\t\t\t\t\t\t dialogue:[\n\t\t\t\t\t\t\t\"swwwig swwig!\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\txDialogue: 0,\n\t\t\t\t\t\t\tyDialogue:0,\n\t\t}\n\t\t\n\t\tthis.eventMap[9] ={tag: \"character\",\n\t\t\t\t\t\t atlas: \"atlas\",\n\t\t\t\t\t\t frame: \"enemie_2.png\",\n\t\t\t\t\t\t collide: true,\n\t\t\t\t\t\t\txOrigin:0,\n\t\t\t\t\t\t\tyOrigin:-64,\n\t\t\t\t\t\t dialogue:[\n\t\t\t\t\t\t\t\"GRRRR....\"\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\txDialogue: 0,\n\t\t\t\t\t\t\tyDialogue:0,\n\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\tthis.musicData = {\n\t\t\tname: \"music_bytes_the_retro_adventure\",\n\t\t\tvolume: 0.4,\n\t\t\tloop: true\n\t\t}\n\t\t\n\t\t\n\t\tthis.mapCreate();\n\t\tthis._create();\n\n\t\t\t\n\t\t\t\n\t}", "function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }", "function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }", "function createData() {\n \n var nodes = []\n d3.range(0,20).map(function(d,i) {\n nodes.push({\n id: d\n })\n })\n\n var links = []\n d3.range(0,25).map(function(d,i) {\n links.push({\n id: i,\n source: getRandomInt(0, 19),\n target: getRandomInt(0, 19)\n })\n })\n\n return {nodes: nodes, links: links}\n }", "constructor(...args) {\n super(...args);\n\n\n // The following values should get overridden when delta states are merged, but we set them here as a reference for you to see what variables this class has.\n\n // default values for private member values\n this.oreType = '';\n this.refineInput = 0;\n this.refineOutput = 0;\n this.refineTime = 0;\n this.tile = null;\n this.worked = 0;\n\n //<<-- Creer-Merge: init -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.\n // any additional init logic you want can go here\n //<<-- /Creer-Merge: init -->>\n }", "async function dataFlowsCreate() {\n const subscriptionId =\n process.env[\"DATAFACTORY_SUBSCRIPTION_ID\"] || \"12345678-1234-1234-1234-12345678abc\";\n const resourceGroupName = process.env[\"DATAFACTORY_RESOURCE_GROUP\"] || \"exampleResourceGroup\";\n const factoryName = \"exampleFactoryName\";\n const dataFlowName = \"exampleDataFlow\";\n const dataFlow = {\n properties: {\n type: \"MappingDataFlow\",\n description:\n \"Sample demo data flow to convert currencies showing usage of union, derive and conditional split transformation.\",\n scriptLines: [\n \"source(output(\",\n \"PreviousConversionRate as double,\",\n \"Country as string,\",\n \"DateTime1 as string,\",\n \"CurrentConversionRate as double\",\n \"),\",\n \"allowSchemaDrift: false,\",\n \"validateSchema: false) ~> USDCurrency\",\n \"source(output(\",\n \"PreviousConversionRate as double,\",\n \"Country as string,\",\n \"DateTime1 as string,\",\n \"CurrentConversionRate as double\",\n \"),\",\n \"allowSchemaDrift: true,\",\n \"validateSchema: false) ~> CADSource\",\n \"USDCurrency, CADSource union(byName: true)~> Union\",\n \"Union derive(NewCurrencyRate = round(CurrentConversionRate*1.25)) ~> NewCurrencyColumn\",\n \"NewCurrencyColumn split(Country == 'USD',\",\n \"Country == 'CAD',disjoint: false) ~> ConditionalSplit1@(USD, CAD)\",\n \"ConditionalSplit1@USD sink(saveMode:'overwrite' ) ~> USDSink\",\n \"ConditionalSplit1@CAD sink(saveMode:'overwrite' ) ~> CADSink\",\n ],\n sinks: [\n {\n name: \"USDSink\",\n dataset: { type: \"DatasetReference\", referenceName: \"USDOutput\" },\n },\n {\n name: \"CADSink\",\n dataset: { type: \"DatasetReference\", referenceName: \"CADOutput\" },\n },\n ],\n sources: [\n {\n name: \"USDCurrency\",\n dataset: {\n type: \"DatasetReference\",\n referenceName: \"CurrencyDatasetUSD\",\n },\n },\n {\n name: \"CADSource\",\n dataset: {\n type: \"DatasetReference\",\n referenceName: \"CurrencyDatasetCAD\",\n },\n },\n ],\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new DataFactoryManagementClient(credential, subscriptionId);\n const result = await client.dataFlows.createOrUpdate(\n resourceGroupName,\n factoryName,\n dataFlowName,\n dataFlow\n );\n console.log(result);\n}", "function ClinicalDataProxy(options)\n{\n\tvar self = this;\n\n\t// default options\n\tvar _defaultOpts = {\n\t\tservletName: \"api/clinicaldata\",\n\t\tsubService: {\n\t\t\tpatients: \"patients\"\n\t\t}\n\t};\n\n\t// merge options with default options to use defaults for missing values\n\tvar _options = jQuery.extend(true, {}, _defaultOpts, options);\n\n\t// call super constructor to init options and other params\n\tAbstractDataProxy.call(this, _options);\n\t_options = self._options;\n\n\t// cache\n\tvar _data = {};\n\n\t/**\n\t * Initializes with full data. Once initialized with full data,\n\t * this proxy class assumes that there will be no additional data.\n\t *\n\t * @param options data proxy options\n\t */\n\tfunction fullInit(options)\n\t{\n\t\t_data = options.data;\n\t}\n\n\tfunction getPatientData(samples, callback)\n\t{\n\t\t// TODO full init & cache...\n\n\t\tvar cancerStudyId;\n\t\tvar patientSampleMap = {};\n\t\tvar patientIds = [];\n\t\tvar querySession = null;\n\n\t\t// TODO we need to find a better way to plug portal data into MutationMapper!\n\t\t// workaround: since QuerySession is actually live in cBioPortal\n\t\t// we need to make sure that it doesn't break the standalone MutationMapper instances\n\t\ttry {\n\t\t\tquerySession = window.QuerySession;\n\t\t} catch (e) {\n\t\t\t// undefined reference: QuerySession\n\t\t}\n\n\t\tif (querySession) {\n\t\t\tcancerStudyId = querySession.cancer_study_ids[0];\n\t\t\tquerySession.getPatientSampleIdMap().then(function (patientSampleMap){\n for (var i = 0; i < samples.length; i++) {\n patientIds.push(patientSampleMap[samples[i]]);\n }\n makePatientData();\n });\n\t\t}\n\t\telse {\n\t\t\tcancerStudyId = window.cancer_study_id;\n makePatientData();\n\t\t}\n\n function makePatientData() {\n // no cancer study id or patient information...\n\t\t if (!cancerStudyId || _.size(patientIds) === 0)\n\t\t {\n\t\t\t callback(null);\n\t\t\t return;\n\t\t }\n\n\t\t var args = {study_id:cancerStudyId, attribute_ids:[\"12_245_PARTC_CONSENTED\"], patient_ids:patientIds};\n\t\t var arg_strings = [];\n\t\t for (var k in args) {\n\t\t\t if (args.hasOwnProperty(k)) {\n\t\t\t arg_strings.push(k + '=' + [].concat(args[k]).join(\",\"));\n\t\t\t }\n\t\t }\n\n\t\t var arg_string = arg_strings.join(\"&\") || \"?\";\n\n\t\t var ajaxOpts = {\n\t\t\t type: \"POST\",\n\t\t\t url: _options.servletName + \"/\" + _options.subService.patients,\n\t\t\t data: arg_string,\n\t\t\t dataType: \"json\",\n\t\t\t success: function(data) {\n\t\t\t\t callback(data);\n\t\t\t },\n\t\t\t error: function(data) {\n\t\t\t\t callback(null);\n\t\t\t }\n\t\t };\n\n\t\t self.requestData(ajaxOpts);\n }\n\t}\n\n\t// override required base functions\n\tself.fullInit = fullInit;\n\n\t// class specific functions\n\tself.getPatientData = getPatientData;\n}", "function init() {\n _create();\n _subMediator();\n }", "load(data) {\n const { id, message, authorName, authorPhoto, timestampUsec, authorExternalChannelId, } = data;\n // Basic information\n this.id = id;\n this.message = message.runs.map((r) => r.text).join(\"\");\n this.author = new _1.ChannelCompact({\n id: authorExternalChannelId,\n name: authorName.simpleText,\n thumbnails: authorPhoto.thumbnails,\n client: this.client,\n });\n this.timestamp = +timestampUsec;\n return this;\n }", "function createFireSource() {\n // percorre todas as colunas\n for (let column = 0; column <= fireWidth; column++) {\n // Cria um pixel \"fora da caixa\"\n const overflowPixelIndex = fireWidth * fireHeight;\n // Leva o pixel uma linha pra cima, e soma a coluna\n const pixelIndex = (overflowPixelIndex - fireWidth) + column;\n // Define a base como: 36\n firePixelsArray[pixelIndex] = 36;\n }\n}", "async createLocalPeerConnectionWithIceCandidates() {\n\n // CREATE CONNECTION\n const servers = { iceServers: STUN_SERVERS };\n await this.setState({ pc: new RTCPeerConnection(servers) });\n\n // EVENT TO GENERATE ICE CANDIDATES\n // event listener that is triggered as the RTC object receives it's ice\n // candidates and writes them to state\n this.state.pc.onicecandidate = event => {\n if (event.candidate) {\n this.setState({ ice: [...this.state.ice, event.candidate] });\n writeToFirebase(this.state.streamerId, ICE,\n JSON.stringify(event.candidate));\n } else {\n // console.log('All ice candidates have been received', time());\n }\n }\n }", "constructor({ audioCtx, spectro }) {\n this.audioCtx = audioCtx;\n this.spectro = spectro;\n this.masterGain = this.audioCtx.createGain();\n this.masterGain.gain.value = 0.3;\n\n this.mod = null;\n this.modGain = null;\n this.car = null;\n this.carGain = null;\n }", "function AbstractSolver(genomeSize) {\n var self = this\n\n var numGenes = genomeSize | 0\n if (!(numGenes > 0)) throw 'Bad genome size: ' + genomeSize\n\n\n /*\n * \n * mutable parameters\n * \n */\n\n this.paused = true\n\n this.population = 100\n this.maxSimultaneousCalls = 0\n\n this.mutationChance = 0.9\n this.crossoverChance = 0.3\n this.keepFittestCandidates = 3\n this.rankSelectionBias = 1.5\n\n\n\n /*\n * \n * Methods for client to implement\n * \n */\n\n this.initGene = function (index) {\n throw 'Client must override #initGene!'\n // return Math.random()\n }\n\n this.mutateGene = function (index, oldValue) {\n throw 'Client must override #mutateGene!'\n // return Math.random()\n }\n\n this.measureFitness = async function (genome) {\n throw 'Client must override #measureFitness!'\n // return genome.reduce((prev, val) => prev + val, 0)\n }\n\n this.afterGeneration = function () {\n // Client can optionally implement this\n }\n\n\n\n /*\n * \n * API\n * \n */\n\n this.generation = 0\n\n this.getCandidate = function (rank) {\n if (rank >= currGen.length) return null\n return {\n fitness: currGen[rank].fitness,\n genome: currGen[rank].genome.slice(),\n }\n }\n\n this.getProgress = function () {\n return [\n self.generation,\n countEntities(0),\n countEntities(1),\n countEntities(2),\n ]\n }\n\n\n\n\n\n /*\n * \n * internal state\n * \n */\n\n var currGen = [] // already evaluated, retained for querying \n var nextGen = [] // entities currently being evaluated\n\n function Entity(genome, fitness, state) {\n this.genome = genome\n this.fitness = fitness || 0\n this.state = state || 0\n }\n\n\n\n\n /*\n * \n * genome manipulating functions\n * \n */\n\n function clone(arr) {\n return arr.slice()\n }\n\n function mutate(arr) {\n var i = Math.floor(Math.random() * arr.length)\n arr[i] = self.mutateGene(i, arr[i])\n }\n\n function crossover(a, b) {\n var ix = 1 + Math.floor(Math.random() * (a.length - 2))\n return a.map((n, i) => (i < ix) ? n : b[i])\n }\n\n\n\n\n /*\n * \n * core implementation\n * \n */\n\n\n // top level function that drives everything\n\n setInterval(function pingSolver() {\n if (self.paused) return\n if (nextGen.length === 0) initPopulation()\n processPopulation()\n if (readyToEvolve()) evolveNewGeneration()\n }, 10)\n\n\n\n\n\n function initPopulation() {\n // called once at init time\n // fill population with entities with initialized genomes\n while (nextGen.length < self.population) {\n var genome = Array.from(Array(numGenes)).map(($, i) => {\n return self.initGene(i)\n })\n nextGen.push(new Entity(genome))\n }\n currGen = nextGen\n self.generation = 1\n }\n\n\n function countEntities(state) {\n return nextGen.reduce((prev, ent) => {\n return prev + ((ent.state === state) ? 1 : 0)\n }, 0)\n }\n\n\n function processPopulation() {\n // called every tick\n // look for entities who need evaluating\n // entity.state: 0=new, 1=pending, 2=evaluated\n var pending = countEntities(1)\n var maxCalls = self.maxSimultaneousCalls || self.population\n if (pending >= maxCalls) return\n // start new fitness calls\n nextGen.forEach(ent => {\n if (pending >= maxCalls) return\n if (ent.state !== 0) return\n ent.state = 1\n pending++\n self.measureFitness(ent.genome).then(result => {\n ent.fitness = result\n ent.state = 2\n })\n })\n }\n\n\n\n function readyToEvolve() {\n // called every tick\n var ready = nextGen.reduce((prev, ent) => {\n return prev + ((ent.state === 2) ? 1 : 0)\n }, 0)\n return (ready === nextGen.length)\n }\n\n\n\n function evolveNewGeneration() {\n // start a new generation - mutate, crossover, etc.\n // first sort fittest candidates to be first\n nextGen.sort((a, b) => b.fitness - a.fitness)\n // create new generation out of previous one\n currGen = nextGen\n nextGen = []\n while (nextGen.length < self.keepFittestCandidates) {\n var keep = currGen[nextGen.length]\n nextGen.push(new Entity(keep.genome, keep.fitness, keep.state))\n }\n while (nextGen.length < self.population) {\n nextGen.push(makeNewEntity(currGen))\n }\n // complete\n self.generation++\n self.afterGeneration()\n }\n\n\n\n\n function makeNewEntity(source) {\n var size = source.length\n var bias = self.rankSelectionBias\n var doCross = (Math.random() < self.crossoverChance)\n var doMut = (Math.random() < self.mutationChance)\n var a = source[selectRank(size, bias)]\n var genome = (doCross) ?\n crossover(a.genome, source[selectRank(size, bias)].genome) :\n clone(a.genome)\n if (doMut) mutate(genome)\n var ent = new Entity(genome)\n if (!(doCross || doMut)) {\n ent.fitness = a.fitness\n ent.state = a.state\n }\n return ent\n }\n\n\n\n}", "function buildTrainset() {\n trainset_ID = []; // clear all entries from previous round\n for (var i=0; i < object_ID.length; i++) {\n for ( var j=0; j < object_frequency[i]; j++ ) { // for each frequency...\n trainset_ID.push(object_ID[i]); // copy the object ID that many times\n }\n }\n randomizeArray(trainset_ID);\n}", "initGene() {\n for (let i = 0; i < this.length; i++) {\n const x = Math.random() * this.size;\n const y = Math.random() * this.size;\n this.gene[i] = [x, y];\n }\n }", "function createHolder(data) {\n\n var value = {data: data || {}};\n\n // Data holder instances\n var reactiveVar = new ReactiveVar();\n var store = new Freezer(value);\n\n // Setup in the reactive variable the correct value\n reactiveVar.set( store.get().data );\n\n // Setup listener for when the store updates\n store.on('update', () => {\n // This will trigger tracker autorun\n reactiveVar.set( store.get().data );\n });\n\n return [reactiveVar, store];\n}", "function DataEmitter() {\n}", "function init (log) {\n// Establish update loop\n const digest = createDigest(io.sockets)\n Observable.timer(0, 15).subscribe(() => {\n eventBus.put('updateAll', {})\n digest.send()\n })\n\n // Set up handlers to consume events from the bus and update the digest\n eventHandlers.forEach(([name, handler]) => {\n eventBus.get(name).subscribe(handler(digest))\n })\n\n // We will process these events when a client sends them\n const clientEvents = ['updateDirection']\n\n // configure websockets\n io.on('connection', socket => {\n socket.on('disconnect', () => {\n log(`User ${player.id} disconnected.`)\n eventBus.put('remove', {\n id: player.id\n })\n })\n\n // create a new player\n const player = saveBlob(createBlob(100, 100, 100))\n log(`User ${player.id} connected.`)\n\n // initialize the client\n socket.emit('initialize', {\n id: player.id,\n location: player.location,\n size: player.size,\n blobs: blobs\n })\n\n // route known events coming in on this socket to the main event bus\n clientEvents.forEach(type => socket.on(type, data => {\n eventBus.put(type, data)\n }))\n\n // let the world know what just happened!\n eventBus.put('newPlayer', player)\n })\n\n // Some error handling. It's unlikely that these will occur but when they do we want\n // to know about it.\n io.on('connect_error', data => {\n log('connect error!', data)\n })\n\n io.on('connect_timeout', () => {\n log('connect timeout!')\n })\n\n io.on('error', data => {\n log('error!', data)\n })\n\n return server\n}", "function processGenomeData(data) {\n // Grab the json object and point to it\n species = data;\n\n // Go through each species and make a link within each gene to the species that have that same gene\n species.forEach(function(s,i,species){\n s.className = s.name.toLowerCase();\n s.children = [];\n s.genes.forEach(function(g,ii, genes){\n g.speciesClass = s.className;\n g.connectedNodes = [];\n g.className = getGeneClassName(s.name, g.name);\n s.children.push(g);\n maxGeneLength = Math.max(g.length, maxGeneLength);\n if(!geneLinks[g.name]) {\n geneLinks[g.name] = {name: g.name, orgs:[s], genes:[g]};\n } else {\n geneLinks[g.name].orgs.push(s);\n geneLinks[g.name].genes.push(g);\n }\n });\n });\n\n species.forEach(function(s,i,species){\n s.links = [];\n s.genes.forEach(function(g,ii, genes){\n var gl = geneLinks[g.name];\n if(gl){\n for(var o = 0; o < gl.orgs.length; o++){\n if(gl.orgs[o] != s){\n var link = {type: s.name+\"-\"+ gl.orgs[o].name+\"-link\", source: g, target: gl.genes[o]};\n g.connectedNodes.push(gl.genes[o]);\n s.links.push(link);\n }\n }\n }\n });\n });\n\n var selectSpecies = [species[9], species[6], species[2], species[3]];\n drawGeneChart(selectSpecies);\n\n}", "interpolateMorphs(fa, fb, T) {\nvar AMOUNT, A_MORPH, A_MORPHS, B_MORPH, B_MORPHS, M_4CC, j, len, m, morph, morphs;\n//----------------\nA_MORPHS = fa.getMorphs();\nB_MORPHS = fb.getMorphs();\nmorphs = null;\nif (A_MORPHS.length === 0 && B_MORPHS.length === 0) {\nmorphs = A_MORPHS;\n} else {\nmorphs = this.makeMorphListWithExtras(fa, B_MORPHS);\n// Generate the new values for each of the frame A morphs.\nfor (m = j = 0, len = A_MORPHS.length; j < len; m = ++j) {\nA_MORPH = A_MORPHS[m];\nM_4CC = A_MORPH.getName();\nB_MORPH = fb.getMorph(M_4CC);\n// Use the frame A morph setting, unless frame B\n// also has an entry for this morph.\nmorph = A_MORPH;\nif (B_MORPH !== null) {\nAMOUNT = (A_MORPH.getAmount()) * (1 - T) + (B_MORPH.getAmount()) * T;\nmorph = CASMorph.create(M_4CC, AMOUNT);\n}\nmorphs[m] = morph;\n}\n}\nreturn morphs;\n}", "function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }", "function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }", "function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }", "function create(range, target, data) {\r\n return { range: range, target: target, data: data };\r\n }", "function initDoors()\n {\n var spawnPoint;\n function createDoor(i)\n {\n //Se crean puertas según los puntos de spawn del json\n spawnPoint = map.findObject(\"Objects\", obj => obj.name === \"Puerta \" + i);\n doors[i] = this.statics.create(spawnPoint.x + 16, spawnPoint.y + 16, \"door\").refreshBody();\n //Se asocia una callback al evento de colisión de Juan con las puertas\n //El guardia podrá atravesarlas\n that.physics.add.collider(juan, doors[i], function(){openDoor(i);}, null, this);\n }\n for(var i = 0; i < numDoors; i++)\n createDoor(i);\n }", "function openArtworks() {\n\tbuf = ''\n\tartworksReadStream.on('data', function (data) {\n\t\tbuf += data\n\t}).on('end', function () {\n\t\tlet undefinedData = 0\n\t\t_.each(JSON.parse(buf), function (obj) {\n\t\t\t_.each(obj, function (val, key) {\n\t\t\t\tif (key === 'creators') {\n\t\t\t\t\t_.each(val, function (creator) {\n\t\t\t\t\t\tif (_.isUndefined(artistsCounter.get(creator))) {\n\t\t\t\t\t\t\tundefinedData++\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tartistsCounter.set(creator, artistsCounter.get(creator) + 1)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\tconsole.log(`undefined data ${undefinedData}`)\n\t})\n\treturn artworksReadStream;\n}", "function createData(name, fluxToBurn, price, fluxBlocks, fluxPerYear, fluxApyPerYear, fluxPerYearValue) {\n return { name, fluxToBurn, price, fluxBlocks, fluxPerYear, fluxApyPerYear, fluxPerYearValue };\n}" ]
[ "0.5178849", "0.51047647", "0.47394875", "0.4737446", "0.46850276", "0.46726274", "0.46125326", "0.46085462", "0.45834824", "0.45480216", "0.45465487", "0.45460716", "0.45187247", "0.45109233", "0.45065793", "0.45057622", "0.44775924", "0.44625717", "0.43933642", "0.43859088", "0.43804368", "0.43804368", "0.43804368", "0.43804368", "0.43734488", "0.43510708", "0.4350646", "0.43152806", "0.4311808", "0.42970976", "0.42749283", "0.42749283", "0.42583132", "0.42567387", "0.4251521", "0.4240882", "0.42362258", "0.42343897", "0.4226713", "0.42234215", "0.4223276", "0.42174596", "0.42174304", "0.42141533", "0.42117643", "0.4209149", "0.42022905", "0.420131", "0.41946095", "0.4177372", "0.4176963", "0.41680786", "0.41657528", "0.41628456", "0.41589144", "0.4155496", "0.4154159", "0.41528413", "0.4152761", "0.41504538", "0.41500023", "0.41486028", "0.41475493", "0.41441384", "0.41441384", "0.41441384", "0.41435832", "0.4142756", "0.41413906", "0.4137166", "0.4134581", "0.41332394", "0.41318378", "0.4124159", "0.41230872", "0.41230872", "0.4122494", "0.41167343", "0.41146153", "0.41136026", "0.41119194", "0.41094106", "0.41092485", "0.41082403", "0.41076964", "0.41020972", "0.40995967", "0.40961155", "0.40960413", "0.4094759", "0.40932494", "0.40929127", "0.40922785", "0.409079", "0.409079", "0.409079", "0.409079", "0.40898424", "0.40885878", "0.40880075" ]
0.65718883
0
Returns the reactor's heat
getTotalHeat() { var totalHeat = 0; for (var x = 0; x < this.nCols; x++) { for (var y = 0; y < this.nRows; y++) { totalHeat += this.grid[x][y].heat; } } return totalHeat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stats(heat) {\r\n\t\t// If max hasn't been set yet or if the value is bigger, use the current value.\r\n\t\tif (typeof max === 'undefined' || heat > max) max = heat;\r\n\t\t// If min hasn't been set yet or if the value is smaller, use the current value.\r\n\t\tif (typeof min === 'undefined' || heat < min) min = heat;\r\n\r\n\t\t// Return the heat value again so we can daisy chain function calls.\r\n\t\treturn heat;\r\n\t}", "getCurrentHeatingCoolingState() {\n if (this.isMiotDeviceConnected()) {\n if (this.getDevice().isPowerOn()) {\n if (this.getDevice().isStatusHeating()) {\n return Characteristic.CurrentHeatingCoolingState.HEAT;\n } else if (this.getDevice().isCooling()) {\n return Characteristic.CurrentHeatingCoolingState.COOL;\n } else {\n return Characteristic.CurrentHeatingCoolingState.OFF;\n }\n }\n }\n return Characteristic.CurrentHeatingCoolingState.OFF;\n }", "getHeaterActiveState() {\n if (this.isMiotDeviceConnected()) {\n return this.getDevice().isHeating() ? Characteristic.Active.ACTIVE : Characteristic.Active.INACTIVE;\n }\n return Characteristic.Active.INACTIVE;\n }", "get temperature() {\n return (5 / 9) * (this.fahrenheit - 32);\n }", "energy(){\n\t\treturn this._energy;\n\t}", "function temperature() {\n var roll = dice.d(20);\n // Its a normal day\n if (roll < 15) {\n return 90 + dice.d(9);\n }\n // extreme heat\n if (roll > 17) {\n return 100 + dice.d(10);\n }\n // random heavy cold front\n if (roll > 14 && roll < 18) {\n return 95 - (dice.d(4) * 10);\n }\n}", "getHeaterCoolerActiveState() {\n if (this.isMiotDeviceConnected()) {\n return this.getDevice().isPowerOn() ? Characteristic.Active.ACTIVE : Characteristic.Active.INACTIVE;\n }\n return Characteristic.Active.INACTIVE;\n }", "getHeatMap() {\n\n if(this.activePollutant == null || this.stateDataArray == null || this.stateDataArray.length == 0) return null;\n\n switch(this.activePollutant.toUpperCase()) {\n\n case 'CARBON MONOXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['CO'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#f9fbe7\",\"#c0ca33\"]);\n break;\n\n case 'SULPHUR DIOXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['SO2'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#ffeda0\",\"#f03b20\"]);\n break;\n\n case 'NITROUS OXIDE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['NO2'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#fde0dd\",\"#c51b8a\"]);\n break;\n\n case 'OZONE' :\n return d3.scaleLinear()\n .domain([0,d3.max(this.stateDataArray, function(d) { if(d) return d['O3'] })])\n .interpolate(d3.interpolateRgb)\n .range([\"#ece2f0\",\"#1c9099\"]);\n\n default: return null;\n }\n \n }", "newPowerLevel(heat) {\n let base = Math.ceil((1 + Math.random()) * 100);\n let level = Math.pow(base, 1 + heat / 1200);\n if(level > 1000000000000000000) level = 1000000000000000000; // JS craps out if we go higher than this\n return level;\n\t}", "get Health() {\n return this.health;\n }", "get healthyColor() {}", "function Heater(actuatorID, actuatorName, actuatorDescription, actuatorCurrentState){\n\t\tActuator.call(this, actuatorID, actuatorName, actuatorDescription, actuatorCurrentState);\n\t}", "get physicalResist() {\n return this.Constitution;\n }", "get intensity() {}", "function HeaterCalc(volumeUnits){\n\t\n\tthis.volumeUnits =volumeUnits;\n\tthis.height = 0;\n\tthis.width = 0;\n\tthis.lenght = 0;\n\tthis.tempRise = 0;\n\tif(volumeUnits == 0.133){\n\t\t//volumeUnits is Feet set default temp Fahrenheit\n\t\tthis.tempUnits = 'F';\n\t}else{\n\t\t//volumeUnits is Meters set default temp Celsius\n\t\tthis.tempUnits = 'C';\n\t}\n\t\n\tthis.setDimensions = function(height,width,length){\n\t\tthis.height = height;\n\t\tthis.width = width;\n\t\tthis.lenght = length;\n\t};\n\n\tthis.setVolumeUnits = function(volumeUnits){\n\t\tthis.volumeUnits =volumeUnits;\n\t};\n\n\tthis.setTempUnits = function(tempUnits){\n\t\tthis.tempUnits = tempUnits;\n\t}\n\t\n\tthis.setTempRise = function(tempRise){\n\t\tthis.tempRise =tempRise;\n\t};\n\t\n\tthis.volume = function(){\n\t\tvar volume = this.height * this.width * this.lenght;\n\t\tif (isNaN(volume)) { \n\t\t\tvolume = \"\"; \n\t }\n\t\treturn volume;\n\t};\n\n\tthis.isVolumeUnitMeters = function(){\n\t\treturn this.volumeUnits > 1;\n\t}\n\n\tthis.c\n\n\t// For Metric height, width, and length always calculate back\n\t// to feet \"in the background\"\n\t// This feature obsoletes - Issue 10 The formula needs to be:\"\n\t// ([total cubic meters of tent/marquee]*2.6)*([Desired Rise in room temp]*1.8)\n\tthis.heatReq = function(){\n\t\tvar roomVolume = this.volume();\n\t\tif(roomVolume==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\t\tif(this.isVolumeUnitMeters()){\n\t\t\t// console.log(\"Metric Volume converting to Feet Volume\");\n\t\t\troomVolume = this.convertMetricToFeetVolume(this.volume());\n\t\t}\n\t\t//tempRise are now all calculated in Fahrenheit\n\t\tvar tempRiseInF = this.tempRise;\n\t\tif(this.tempUnits == 'C'){\n\t\t\t// console.log(\"Feet volume and Celsius calculation \"+this.tempRise);\n\t\t\t// console.log(\"Celsius to Farenheit \"+this.convertCelsiusToFarienheit(this.tempRise));\n\t\t\ttempRiseInF= this.convertCelsiusToFarienheit(this.tempRise);\n\t\t}\n\t\t// console.log(\"Feet volume and Farenheit calculation\");\n\t\treturn Math.round((FEETUNITS * roomVolume) * tempRiseInF);\n\t\t\n\t\t\t\n\t};\n\n\tthis.convertCelsiusToFarienheit = function(tempRiseCelsius) {\n\t\treturn tempRiseCelsius * 1.8;\n\t}\n\n\tthis.convertFarienheitToCelsius = function(tempRiseFarienheit) {\n\t\treturn tempRiseFarienheit / 1.8;\n\t}\n\n\tthis.convertMetricToFeet = function(meters) {\n\t\treturn meters * 3.2808;\n\t}\n\n\tthis.convertFeetToMetric = function(feet) {\n\t\treturn feet / 3.2808;\n\t}\n\n\tthis.convertMetricToFeetVolume = function(squareMeters) {\n\t\treturn squareMeters * 35.315;\n\t}\n\n\tthis.convertFeetToMetricVolume = function(squareFeet) {\n\t\treturn squareFeet / 35.315;\n\t}\n\t\n\tthis.myRound = function(value, places) {\n\t var multiplier = Math.pow(10, places);\n\n\t return (Math.round(value * multiplier) / multiplier);\n\t};\n\t\n\tthis.heatReqBtu = function(){\n\t\tif(this.heatReq()==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn this.heatReq();\n\t}\n\t\n\tthis.heatReqWatts = function(){\n\t\tif(this.heatReq()==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t//Imperial watts to btus ([calculated Watts required]*3.4121414799)/[btuh output available]\n\t\treturn this.heatReq()/3.4121414799;\n\t}\n\t\n\tthis.suggest = function(heater){\n\t\tif(this.heatReq()==\"\"){\n\t\t\treturn \"\";\n\t\t}\n\t\tvar realBtuhReq = this.heatReq();\n\t\t\n\t\tvar raw = realBtuhReq/heater;\n\t\treturn raw.toFixed(1);\n\t};\n\n\tthis.p80 = function(){\n\t\treturn this.suggest(PREMIER_80);\n\t};\n\t\n\tthis.p170 = function(){\n\t\treturn this.suggest(PREMIER_170);\n\t};\n\t\n\tthis.p350 = function(){\n\t\treturn this.suggest(PREMIER_350);\n\t};\n\t\n\tthis.t125 = function(){\n\t\treturn this.suggest(TRADESMAN_125);\n\t};\n\t\n\tthis.t170 = function(){\n\t\treturn this.suggest(TRADESMAN_170);\n\t};\n\t\n\tthis.t400 = function(){\n\t\treturn this.suggest(TRADESMAN_400);\n\t};\n\t\n\tthis.tk75 = function(){\n\t\treturn this.suggest(TRADESMAN_K75);\n\t};\n\t\n\tthis.tk125 = function(){\n\t\treturn this.suggest(TRADESMAN_K125);\n\t};\n\t\n\tthis.tk175 = function(){\n\t\treturn this.suggest(TRADESMAN_K175);\n\t};\n\t\n\tthis.tk210 = function(){\n\t\treturn this.suggest(TRADESMAN_K210);\n\t};\n\t\n\tthis.tk400 = function(){\n\t\treturn this.suggest(TRADESMAN_K400);\n\t};\n\t\n\tthis.tk650 = function(){\n\t\treturn this.suggest(TRADESMAN_K650);\n\t};\n\t\n\tthis.f500 = function(){\n\t\treturn this.suggest(FOREMAN_500);\n\t};\n\tthis.f750 = function(){\n\t\treturn this.suggest(FOREMAN_750);\n\t};\n\t\n\tthis.b400 = function(){\n\t\treturn this.suggest(BOSS_400);\n\t};\n\tthis.b1000 = function(){\n\t\treturn this.suggest(BOSS_1000);\n\t};\n\t\n\tthis.n200 = function(){\n\t\treturn this.suggest(NORSEMAN_200);\n\t};\n\tthis.n250 = function(){\n\t\treturn this.suggest(NORSEMAN_250);\n\t};\n\t\n\tthis.w100 = function(){\n\t\treturn this.suggest(WORKMAN_100);\n\t};\n\tthis.w225 = function(){\n\t\treturn this.suggest(WORKMAN_225);\n\t};\n\t\n\tthis.s15 = function(){\n\t\treturn this.suggest(SUNBLAST_15);\n\t};\n\tthis.s30 = function(){\n\t\treturn this.suggest(SUNBLAST_30);\n\t};\n\t\n\tthis.s35 = function(){\n\t\treturn this.suggest(SUNBLAST_35);\n\t};\n\tthis.s125 = function(){\n\t\treturn this.suggest(SUNBLAST_125);\n\t};\n\n}", "function getProbeFeatures(){\r\n\r\n\t\t\tvar list = [[settings.stimulus_large, settings.colorred, 0],\r\n\t\t\t\t\t\t[settings.stimulus_large, settings.colorred, 90],\r\n\t\t\t\t\t\t[settings.stimulus_large, settings.colorblue, 0],\r\n\t\t\t\t\t\t[settings.stimulus_large, settings.colorblue, 90]];\r\n\t\t\tvar weight = [0.25, 0.3125, 0.1875, 0.25];\r\n\t\t\tvar weighed_list = general.generateWeighedList(list, weight);\r\n\t\t\tvar random_num = general.rand(0, weighed_list.length-1);\r\n\t\t\treturn weighed_list[random_num];\r\n\t}", "get tileset() {\n return this._tileset;\n }", "get tileset() {\n return this._tileset;\n }", "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "get health(){ return this._health}", "updateHeaterState() {\n const temperatureThreshold = 3;\n const temperatureDifference = Math.abs(this.currentTemperature - this.goalTemperature);\n if (temperatureDifference >= temperatureThreshold) {\n if (this.currentTemperature > this.goalTemperature) {\n this.setHeaterState(OFF);\n } else {\n this.setHeaterState(ON);\n }\n }\n }", "function getHeaterState(){\n execFile('./scripts/heaterRead.sh', (error, stdout, stderr) => {\n if (error) {\n console.error('stderr', stderr);\n throw error;\n }\n console.log('heater ' + stdout);\n readData.heaterState = stdout\n }) \n}", "function heatGenerate(){\n for(var key in activeArray) {\n if(activeArray[key].heat < 100) {\n activeArray[key].heat += HEAT_PER_TICK;\n }\n var $fill;\n switch (enlarged) {\n case \"\":\n $fill = $(\"#\" + key + \" .gauge-fill\");\n break;\n case key:\n $fill = $(\"#inGame .gauge-fill\");\n break;\n default:\n $fill = $(\".mini-\" + key);\n }\n $fill.height(activeArray[key].heat + \"%\");\n $fill.css(\"background-color\", 'hsl(' + (120 - (activeArray[key].heat / 5 * 6)) + ', 100%, 50%)');\n totalHeat += activeArray[key].heat;\n }\n \n if(totalHeat > 0) {\n totalHeat = totalHeat < COOLANT_LEVEL ? 0 : totalHeat - COOLANT_LEVEL;\n }\n \n if(totalHeat >= MAX_HEAT){\n totalHeat = MAX_HEAT;\n loseGame();\n }\n var meterColour;\n meterColour = 'hsl(' + (120 - ((totalHeat/MAX_HEAT) * 120)) + ', 100%, 50%)';\n heatMeter.setAttribute(\"style\", \"background-position: \" + totalHeat/MAX_HEAT * -100 + \"% 0; \" +\n \"background-image: linear-gradient(to right, transparent, transparent 50%, \" + meterColour + \n \" 50%, \" + meterColour + \" 100%)\"); \n}", "get physicalResist() {\n return this.Constitution + this.armorRating;\n }", "function getTemperature() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * Temperature.read() / 65535.0;\n local c = (voltage - 0.5) * 100 ;\n local celsius = format(\"%.01f\", c);\n return(celsius);\n}", "get noiseSpread() {}", "get hue() { return this.hsl[0]; }", "get Fire() {\n return Math.round((this.fire) * this.Effects.Fire/modBase);\n }", "getEncounterCreatures(){\n if(this.randomEncounter != null){\n return this.randomEncounter.getCreatures();\n }\n }", "addHeat(data, heat) {\n\t\tif(!data) return;\n\t\tlet multiplier = 10 / Math.max(10, data.maxPopulation);\n let addedHeat = heat * Math.pow(1.05, data.resets) * multiplier;\n data.heat += addedHeat;\n console.log(`Heat increased by ${heat} to ${data.heat}`);\n\t}", "drawHeatLine(){\n\t\tif(this.hot){\n\t\t\tfill(255,0,0);\n\t\t}else{\n\t\t\tfill(0,255,0);\n\t\t}\n\t\tlet xwidth = map(this.heat, 0,100,0,width);\n\t\trect(0, 0, xwidth, 30 );\n\t}", "get DXT5Crunched() {}", "get effectiveDamage() {\n if (this._parent.isRangedHalfDamage) {\n return Math.floor(this._basicDamage / 2)\n } else if (this._parent.isShotgun) {\n return this._basicDamage * this._parent.shotgunDamageMultiplier\n } else if (this._parent.isExplosion) {\n return Math.floor(this._basicDamage / this._parent.explosionDivisor)\n } else {\n return this._basicDamage\n }\n }", "function getProperties() {\n // Format the payload.\n var properties = {\n rt: resourceTypeName,\n id: 'solar',\n tiltPercentage: tiltPercentage,\n lcd1: lcd1,\n lcd2: lcd2,\n simulationMode: simulationMode\n };\n\n debuglog('Send the response. tiltPercentage: ', tiltPercentage);\n return properties;\n}", "getCreatureTile() {\n return this.creatureTile;\n }", "getHarvestMultiplier() {\n let multiplier = 1;\n if (this.mulch === MulchType.Rich_Mulch) {\n multiplier = GameConstants.RICH_MULCH_MULTIPLIER;\n }\n else if (this.mulch === MulchType.Amaze_Mulch) {\n multiplier = GameConstants.AMAZE_MULCH_PRODUCE_MULTIPLIER;\n }\n multiplier *= this.auraHarvest();\n return multiplier;\n }", "get ShadowCascades() {}", "get saturation() { return this.hsl[1]; }", "get basicDamage() {\n if (this._viewId === 'all') return\n return this._calculators[this._viewId].basicDamage\n }", "function SmartPlantEater () {\n this.energy = 20\n this.didNotReproduceInPreviousTurn = true\n}", "function getHeatmap() {\n $http.get('/api/GetHeatmap').success(function(data) {\n TrackerMap.setHeatmap(data);\n });\n }", "function getHeatIndex(tempC, RH) {\n const T = tempC * (parseFloat(9) / parseFloat(5)) + 32;\n\n let feelsLikeF =\n -42.379 +\n 2.04901523 * T +\n 10.14333127 * RH -\n 0.22475541 * T * RH -\n 0.00683783 * T * T -\n 0.05481717 * RH * RH +\n 0.00122874 * T * T * RH +\n 0.00085282 * T * RH * RH -\n 0.00000199 * T * T * RH * RH;\n if (RH > 13 && T >= 80 && T <= 112) {\n feelsLikeF -= (13 - RH) / 4 * Math.sqrt((17 - Math.abs(T - 95)) / 17);\n } else if (RH > 85 && T >= 80 && T <= 87) {\n feelsLikeF -= (RH - 85) / 10 * ((87 - T) / 5);\n }\n const feelsLikeC = (feelsLikeF - 32) * (parseFloat(5) / parseFloat(9));\n return feelsLikeC.toFixed(1);\n}", "function CalculateHeatIndex(t, rh) {\n var tRounded = Math.floor(t + 0.5);\n\n // return null outside the specified range of input parameters\n if (tRounded < 76 || tRounded > 126)\n return null;\n if (rh < 0 || rh > 100)\n return null;\n\n // according to the NWS, we try this first, and use it if we can\n var tHeatEasy = 0.5 * (t + 61.0 + ((t - 68.0) * 1.2) + (rh * 0.094));\n\n // The NWS says we use tHeatEasy if (tHeatHeasy + t)/2 < 80.0\n // This is the same computation:\n if ((tHeatEasy + t) < 160.0)\n return tHeatEasy;\n\n // need to use the hard form, and possibly adjust.\n var t2 = t * t; // t squared\n var rh2 = rh * rh; // rh squared\n var tResult =\n -42.379 +\n (2.04901523 * t) +\n (10.14333127 * rh) +\n (-0.22475541 * t * rh) +\n (-0.00683783 * t2) +\n (-0.05481717 * rh2) +\n (0.00122874 * t2 * rh) +\n (0.00085282 * t * rh2) +\n (-0.00000199 * t2 * rh2);\n\n // these adjustments come from the NWA page, and are needed to\n // match the reference table.\n var tAdjust;\n if (rh < 13.0 && 80.0 <= t && t <= 112.0)\n tAdjust = -((13.0 - rh) / 4.0) * Math.sqrt((17.0 - Math.abs(t - 95.0)) / 17.0);\n else if (rh > 85.0 && 80.0 <= t && t <= 87.0)\n tAdjust = ((rh - 85.0) / 10.0) * ((87.0 - t) / 5.0);\n else\n tAdjust = 0;\n\n // apply the adjustment\n tResult += tAdjust;\n\n // finally, the reference tables have no data above 183 (rounded),\n // so filter out answers that we have no way to vouch for.\n if (tResult >= 183.5)\n return null;\n else\n return tResult;\n}", "get shadow() {\n return this.threeObject.shadow\n }", "get dryColor() {}", "async function getFuelData () {\n try {\n const genMixURL = config.apiURL + 'generation'\n const factorsURL = config.apiURL + 'intensity/factors'\n const factors = await exports.fetch(factorsURL);\n const genMix = await exports.fetch(genMixURL);\n const fuelData = {\n factors: factors.data,\n generation: genMix.data.generationmix\n }\n return fuelData;\n } catch (e) {\n throw e;\n }\n}", "function collectWheatSeeds()\n\t\t\t{\n\t\t\t\twheatSeedBank += randInt(1,3);\n\t\t\t\tif (randInt(1,20) == 1)\n\t\t\t\t{\n\t\t\t\t\twormBank += 5;\n\t\t\t\t}\n\t\t\t\taction(1,1,1);\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "get altStress () {\n if (this.peakIn = true) {\n return this._altStress *= this.kt;\n } else {\n return this._altStress;\n }\n }", "baseAmount() {return player.t.energy}", "getHealth() {\n let opsTotalHealth = this.operators.reduce((acc, o) => (acc + o.getHealth()), 0);\n let tmpH = this.health + opsTotalHealth / this.operators.length;\n return tmpH < 0 ? 0 : tmpH;\n }", "getYerushalmiMasechta() {\n return Daf.masechtosYerushlmi[this.masechtaNumber];\n }", "get legStretch() {}", "function init() {\n // Create a starting wheat plot\n var wheat = new Wheat();\n place(wheat, 0, 0);\n STATE.wheats += 1;\n\n // Setup the Menu for buying stuff\n var menu = new Menu('Farm Mall', [\n new BuyButton('Buy wheat', Wheat),\n new BuyButton('Buy pig', Pig),\n new BuyButton('Buy aqueduct', Aqueduct),\n new BuyButton('Upgrade tractor', tractorBonus),\n new BuyButton('Open Roth IRA', investmentBonus)\n ]);\n\n // Define a harvester which\n // regularly gives the player water\n // depending on how many aqueducts they own\n defineHarvester('water', function() {\n return 2 * STATE.aqueducts;\n }, 2000)\n\n // Define a harvester which uses up\n // water based on how much wheat the player has\n defineHarvester('water', function() {\n return -1 * STATE.wheats;\n }, 2000);\n\n // Define a harvester which\n // compounds the amount of money the player\n // has based on their investment return rate\n defineHarvester('money', function() {\n return STATE.resources.money * STATE.investment;\n }, 2000);\n\n meter1 = new Meter('Test Meter', 10);\n meter2 = new Meter('Another meter', 50);\n}", "function setHeat(state){\r\n if(ENV==\"devel\") digitalWrite(HEAT_PIN,state);\r\n else digitalWrite(HEAT_PIN,!state);\r\n}", "function getBreadFact() {\n return self.facts[Math.floor(Math.random() * self.facts.length)];\n }", "function computeColor(heat){\n\n /*\n var scaledForce = 50000 * heat;\n // clamp values to < 255\n if( Math.abs(scaledForce) > 255 ) {\n scaledForce = 255 * (scaledForce/Math.abs(scaledForce));\n }\n\n var ratio = 2 * (scaledForce+255) / 510;\n colors.b = ~~(Math.max(0, 255*(ratio - 1)));\n colors.r = ~~(Math.max(0, 255*(1 - ratio)));\n colors.g = 255 - colors.b - colors.r;\n */\n\n cycle+=0.1;\n if(cycle>100){\n cycle = 0;\n }\n colors.r = ~~(Math.sin(.3*cycle + 0) * 127+ 128);\n colors.g = ~~(Math.sin(.3*cycle + 2) * 127+ 128);\n colors.b = ~~( Math.sin(.3*cycle + 4) * 127+ 128);\n}", "get state() {\r\n return reactionState;\r\n }", "function fgetHum(id){\r\n\treturn this.shapes[id].hum;\r\n}", "get hour() {\n\t\treturn this.worldTime.getHours();\n\t}", "computeDamage(){\n return this._units.reduce((accum, curUnit) => accum + curUnit.computeDamage(), 0.0);\n }", "temperature() {\n this.setup();\n\n // in order to read multiple bytes the high bit of the sub address must be asserted\n return twos_comp(this.i2c_bus.read_word_data(this.addr, TEMP_OUT_L|0x80), 12);\n }", "get reaction () {\n\t\treturn this._reaction;\n\t}", "get hexMovers() {\n return this.grid.filter(hex=>hex.occupied);\n }", "function getTemp(herb) {\n for (var i = 0 ; i < state.props.length ; i++) {\n if (herb == state.props[i].Name) {\n return state.props[i].Temp\n }\n }\n }", "get magicResist() {\n return this.Spirit + this.magicArmorRating;\n }", "get stealChance() {\n return (this.Dexterity + this.Intelligence + this.Luck)/2\n }", "get powerRange(){\n return this.#powerRange;\n }", "function create_temperature_synth(){\n var bus_num = create_new_bus(context.destination);\n var convolver = add_convolution(bus_num);\n dry_wet(bus_num, 1, 10);\n var filter = add_filter(bus_num, \"lowpass\", 3000, 30);\n var mod1 = add_osc_modulator(bus_num, 0, 0, \"frequency\", 440, 4, 25)\n var mod2 = add_osc_modulator(bus_num, 0, 0, \"frequency\", 440, 2, 50)\n add_ADHSR_env(bus_num, 0.01, 0.2, 0, 0, 0.2);\n //add_osc_modulator(bus_num, 2, 0, \"frequency\", 1, 0.1, 75)\n set_bus_gain(bus_num, 0.03);\n return [buses[bus_num][0][0], convolver, filter, mod1, mod2]\n}", "function getTemperature() {\n try {\n var weatherJson = storage.readJSON('weather.json');\n var weather = weatherJson.weather;\n return \"Temp: \" + Math.round(weather.temp - 273.15);\n } catch (ex) {\n return \"\";\n }\n}", "function controlTemperature(now) {\n var requestedPower = state.power;\n var target = 72;\n\n // currently just supporting one control mode: manage enclosure temperature\n if (config.mode == constants.ENCLOSURE) {\n // control enclosure temperature\n target = state.enclosureTemp;\n } else if (config.mode == FERMENTATION) {\n // control the fermentation temperature\n // TODO Implement!\n var error = state.fermentationTemp - config.fermentationTemp;\n var target = config.fermentationTemp - (10 * error);\n if (target < config.minEnclosureTemp) {\n target = config.minEnclosureTemp;\n }\n }\n\n // due to considerable heat capacity in the refrigeration system, the enclosure\n // will continue to cool for a while after the power is turned off.\n if (target > config.targetEnclosureTemp + 1) {\n requestedPower = 1;\n } else if (target < config.targetEnclosureTemp) {\n requestedPower = 0;\n }\n\n return requestedPower;\n}", "static get POWER() { return { LOW: 10, MEDIUM: 50, HIGH: 90 }; }", "updateWaterAppearance() {\n const ellipseWidth = this.fluidBounds.width;\n const ellipseHeight = PERSPECTIVE_PROPORTION * ellipseWidth;\n const liquidWaterTopEllipse = Shape.ellipse(\n this.fluidBounds.centerX,\n this.fluidBounds.minY,\n ellipseWidth / 2,\n ellipseHeight / 2,\n 0,\n 0,\n Math.PI / 2,\n false\n );\n\n const halfWidth = this.fluidBounds.width / 2;\n const halfHeight = ellipseHeight / 2;\n const liquidWaterBodyShape = new Shape()\n .moveTo( this.fluidBounds.minX, this.fluidBounds.minY ) // Top left of the beaker body.\n .ellipticalArc( this.fluidBounds.centerX, this.fluidBounds.minY, halfWidth, halfHeight, 0, Math.PI, 0, false )\n .lineTo( this.fluidBounds.maxX, this.fluidBounds.maxY ) // Bottom right of the beaker body.\n .ellipticalArc( this.fluidBounds.centerX, this.fluidBounds.maxY, halfWidth, halfHeight, 0, 0, Math.PI, false )\n .close();\n\n this.liquidWaterBodyNode.setShape( liquidWaterBodyShape );\n this.liquidWaterTopNode.setShape( liquidWaterTopEllipse );\n }", "heal(otherHero) {\n // otherHero.health += this.power;\n otherHero.receiveHealth(this.power);\n console.log(`other hero has ${otherHero.health}`);\n }", "getDamageMultiplier (target) {\n return this.Config.DamageMultiplier;\n }", "function getDHT22(){\n\treturn JSON.stringify({\n\t\ttemperature: Math.floor(Math.random() * 33) + 22,\n\t\thumidity: Math.floor(Math.random() * 75) + 10\n\t});\t\n}", "get info() {\n if (this.quantity < 2) {\n return 'This wheat is almost gone!'\n } else if (this.quantity < 3) {\n return 'This wheat is running low'\n } else {\n return 'This is some nice wheat'\n }\n }", "onFood () {\r\n let tilePlants = this.tile.objs.filter(o => o.name === 'plant')\r\n if (tilePlants.length < 1) return false\r\n return tilePlants[0]\r\n }", "getPower() {\n console.log('getPower called');\n\n return this.getLampResURI()\n .then(response => {\n return response.power.value;\n });\n }", "function horizon() {\n var hrz = context.horizon();\n\n if (type === 'm') {\n return hrz.extent([0, 2])\n .colors(['black', 'black', 'teal', '#dd1144']);\n } else if (type === 'v') {\n return hrz;\n }\n }", "createHeatmapLayers() {\n const properties = [\"deaths\", \"kills\"];\n let heatmapConfig = assign({}, this.state.heatmapConfig);\n let heatmapLayers = {};\n\n heatmapConfig.gradient = { \".3\": \"yellow\", \".4\": \"orange\", \"1\": \"red\" };\n heatmapLayers = h337.create(heatmapConfig);\n\n this.setState({ heatmapLayers });\n }", "function getProperties() {\n var data = null;\n var obj = {\"ch-1\": 0, \"ch-2\": 0};\n\n if (mraa) {\n data = readJsonFromUart();\n } else {\n data = \"{\\\"ch-1\\\": \" + power1++ + \", \\\"ch-2\\\": \" + power2++ + \"}\";\n }\n if (data != null && data != \"\") {\n debuglog(data);\n hasUpdate = true;\n }\n\n try {\n obj = JSON.parse(data);\n }\n catch(e) {\n debuglog(\"Invalid data: \", e.message);\n }\n\n // Format the properties.\n var properties =\n {\n rt: resourceTypeName,\n id: 'power',\n power1: obj[\"ch-1\"],\n power2: obj[\"ch-2\"]\n };\n\n return properties;\n}", "static get properties() {\n return {\n ...super.properties,\n glitch: {\n type: Boolean,\n },\n red: {\n type: Boolean,\n reflect: true,\n },\n fadein: {\n type: Boolean,\n reflect: true,\n },\n glitchMax: {\n type: Number,\n attribute: \"glitch-max\",\n },\n glitchDuration: {\n type: Number,\n attribute: \"glitch-duration\",\n },\n };\n }", "getTrigger() {\n // getTrigger is used to filter out all tiles of the tilemap layer that it is run against\n // Creating a physics group to collide the player against obstacles to trigger events\n this.triggerGroup = this.physics.add.staticGroup();\n\n // Loop over each Tile\n this.obstacleLayer.forEachTile(tile => {\n if ( tile.index > 0 ) { // where to look up the actual tile index?\n // A sprite has it's origin at the center, so we place the sprite at the center of the tie\n const x = tile.getCenterX();\n const y = tile.getCenterY();\n const trigger = this.triggerGroup.create( x, y, 'grass-patch');\n\n // The map has spike tiles that have been rotated in Tiled (\"z\" key), so parse out that angle\n // to the correct body placement\n trigger.rotation = tile.rotation;\n if ( trigger.angle === 0 ) trigger.body;\n else if ( trigger.angle === -90 ) trigger.body;\n else if ( trigger.angle === 90 ) trigger.body;\n\n // Remove the original tile from the layer\n this.obstacleLayer.removeTileAt( tile.x, tile.y );\n }\n });\n }", "function randomEvent(){\n\tif(x2able && !powerX2 && !x2Show && random(100) < powerUpChance){\n\t\tx2Show = true;\n\t\treturn 1.0;\n\t}else if(slowable && !powerSlow && !slowShow && random(100) < powerUpChance){\n\t\tslowShow = true;\n\t\treturn 2.0;\n\t}else if(currentScore > bigThuTriggerScore && random(100) < bigThuChance){\n\t\treturn 3.0;\n\t}else if(currentScore > thuTypeTriggerScore && random(100) < venomThuChance){\n\t\treturn 4.0;\n\t}else if(currentScore > thuTypeTriggerScore && random(100) < cuteThuChance){\n\t\treturn 5.0;\n\t}else{\n\t\treturn 0.0;\n\t}\n}", "getGrowthMultiplier() {\n var _a;\n let multiplier = (_a = {\n [MulchType.Boost_Mulch]: GameConstants.BOOST_MULCH_MULTIPLIER,\n [MulchType.Amaze_Mulch]: GameConstants.AMAZE_MULCH_GROWTH_MULTIPLIER,\n [MulchType.Freeze_Mulch]: GameConstants.FREEZE_MULCH_MULTIPLIER,\n }[this.mulch]) !== null && _a !== void 0 ? _a : 1;\n if (this.stage() !== PlotStage.Berry) {\n multiplier *= this.auraGrowth();\n }\n else {\n multiplier *= this.auraDecay();\n // Handle Death Aura\n if (this.berry !== BerryType.Kasib) {\n multiplier *= this.auraDeath();\n }\n }\n return multiplier;\n }", "get image() {\n if (this.quantity < 3) {\n return 'sparse_wheat'\n } else {\n return 'wheat'\n }\n }", "function PrestigeValue(what) {\n var name = game.upgrades[what].prestiges;\n var equipment = game.equipment[name];\n var stat;\n if (equipment.blockNow) stat = \"block\";\n else stat = (typeof equipment.health !== 'undefined') ? \"health\" : \"attack\";\n var toReturn = Math.round(equipment[stat] * Math.pow(1.19, ((equipment.prestige) * game.global.prestige[stat]) + 1));\n return toReturn;\n}", "get DXT1Crunched() {}", "get armStretch() {}", "get power() {\n return this._power;\n }", "get DeferredSpecular() {}", "function isHot(){\n\t\tconsole.log(temperature_measurement);\n\t\tif((temperature >= 8 && temperature_measurement === \"c\") || (temperature >= 46.4 && temperature_measurement === \"f\")){\n\t\t\t$('table').addClass('glow');\n\t\t}\n\t}", "function getTemperature (event) {\n // read variables from the event\n let ev = JSON.parse(event.data);\n let evData = ev.data; // the data from the argon event: \"pressed\" or \"released\"\n let evDeviceId = ev.coreid; // the device id\n let evTimestamp = Date.parse(ev.published_at); // the timestamp of the event\n let alrtDevice = 0;\n\n // helper variables that we need to build the message to be sent to the clients\n let message = \"Verbindung zu deinem smarten Brandmelder ist aktiv.\";\n var floatValue = parseFloat(evData);\n var correctednewTempValue = ((floatValue - 4)*10)/10;\n let difference = correctednewTempValue-correctedoldTempValue;\n correctedoldTempValue = correctednewTempValue;\n let newTempValue = correctednewTempValue;\n if( difference > 0.5 ){\n alrtDevice = 1;\n }\n else{\n alrtDevice = 0;\n }\n // send data to all connected clients\n sendData(\"temperature\", newTempValue, message, evDeviceId, evTimestamp, alrtDevice);\n}", "predictDamage() {\n let dmg = this.getConstantDamage()[0]\n return dmg\n }", "redisStats(){\n return redis_stats;\n }", "function Healer(name, health, calm) {\n Hero.call(this, name, health);\n this.calm = calm;\n}", "get power() {\n\t\treturn this.__power;\n\t}", "heal(healthRestore) {\n if (this.health + healthRestore > 100) {\n this.health = 100;\n }\n else {\n this.health += healthRestore;\n }\n return this.health;\n }", "getHealthScore(halin) {\n return score.feedFreshness(halin, this);\n }", "energy() {\n let K = 0.;\n let U = 0.;\n \n for (let mass of this.masses) {\n K += mass.energy();\n }\n\n for (let con of this.connections)\n U += con.energy();\n\n return {E: K + U, K, U};\n }" ]
[ "0.5725281", "0.5705587", "0.5526374", "0.5522373", "0.55149597", "0.5491786", "0.5486443", "0.53699565", "0.5363011", "0.53147906", "0.5285283", "0.52120245", "0.5204996", "0.51845163", "0.51728326", "0.5164788", "0.5143756", "0.5143756", "0.51254344", "0.50591487", "0.5037834", "0.5037761", "0.5029355", "0.50229347", "0.49894607", "0.493903", "0.49153438", "0.48970053", "0.48827776", "0.487881", "0.4877564", "0.48763672", "0.486651", "0.48626497", "0.4860907", "0.48412514", "0.483994", "0.4838137", "0.48373005", "0.48259464", "0.48157346", "0.4805974", "0.47834864", "0.47810248", "0.47800648", "0.47712922", "0.4770751", "0.47694993", "0.4762624", "0.476025", "0.47596943", "0.4758201", "0.47421145", "0.47229546", "0.47220603", "0.47104546", "0.47079238", "0.47071627", "0.4704363", "0.47038838", "0.46994737", "0.46991935", "0.4696888", "0.46948957", "0.469341", "0.46929705", "0.46874985", "0.468673", "0.46801212", "0.46750614", "0.46713263", "0.46707538", "0.4668334", "0.46672127", "0.4660403", "0.46399668", "0.4632122", "0.4628888", "0.4625658", "0.46123537", "0.46037245", "0.45968512", "0.45948687", "0.45948052", "0.45946944", "0.45891485", "0.4585256", "0.45812568", "0.45775783", "0.45765197", "0.45748413", "0.4572351", "0.45622492", "0.45594716", "0.45581216", "0.4555006", "0.45504677", "0.4534533", "0.45280787", "0.45262268" ]
0.5792577
0
Create a glowing effect
glow(x, y, color) { if ((CONFIG.renderGlow) && !(this.heatOverlay)) { for (var i = 0; i < RENDER.gLayers; i++) { fill(color.r, color.g, color.b, round(255/RENDER.gLayers)); noStroke(); ellipse(x, y, (RENDER.gSize/RENDER.gLayers)*(i+1), (RENDER.gSize/RENDER.gLayers)*(i+1)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addGlowEffect()\n\t{\n\t\t// clear previous glow interval (if any)\n\t\tif (_glowInterval != null)\n\t\t{\n\t\t\tclearInterval(_glowInterval);\n\t\t}\n\n\t\t// create gradient color generator\n\t\tvar gradient = new Rainbow();\n\t\tvar range = 16;\n\t\tvar index = 0;\n\t\tgradient.setNumberRange(0, range - 1);\n\t\tgradient.setSpectrum(_options.highlightGradient[0].replace(\"#\", \"\"),\n\t\t _options.highlightGradient[1].replace(\"#\", \"\"));\n\n\t\t// convert positions to script positions\n\t\tvar scriptPositions = null;\n\n\t\t// set new interval\n\t\t_glowInterval = setInterval(function() {\n\t\t\tvar highlightCount = _.size(_highlighted);\n\n\t\t\tif (highlightCount > 0)\n\t\t\t{\n\t\t\t\t// TODO update script position each time _highlighted is updated\n\t\t\t\tif (scriptPositions == null ||\n\t\t\t\t scriptPositions.length != highlightCount)\n\t\t\t\t{\n\t\t\t\t\tscriptPositions = _scriptGen.highlightScriptPositions(_highlighted);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (scriptPositions != null &&\n\t\t\t scriptPositions.length > 0)\n\t\t\t{\n\t\t\t\tvar color = \"#\" + gradient.colorAt(index);\n\t\t\t\tvar script = _scriptGen.highlightScript(\n\t\t\t\t\tscriptPositions, color, _options, _chain);\n\n\t\t\t\t// convert array to a single string\n\t\t\t\tscript = script.join(\" \");\n\n\t\t\t\t// send script string to the app\n\t\t\t\t_3dApp.script(script);\n\n\t\t\t\tindex = (index + 1) % range;\n\t\t\t}\n\t\t}, 50);\n\t}", "function addGlowEffect(key){\n key.classList.add('glow')\n}", "function glow(el, col){\n\tel.attr('style', 'box-shadow: 0 0 4px ' + col +';');\n}", "function switchGlow() {\n\td3.selectAll('.exampleGlow')\n\t\t.style('filter', glowOn ? 'none' : 'url(#glow)');\n\tglowOn = glowOn ? false : true;\n}", "function glowBoth(x) {\n if(x.value === 1){\n \tif(state === 1){\n \t\tb.digitalWrite(LED2, b.HIGH);\n\t\tstate = 0;\t\n\t}\n\telse state = 1;\n }\n else state = 0;\n}", "function glowScreen(winner) {\n var x = 1;\n var stop = setInterval(function() {\n if (x % 2 === 0) $(\"body\").addClass(\"glow\" + winner);\n else $(\"body\").removeClass(\"glow\" + winner);\n x++;\n if (x === 100) clearInterval(stop);\n }, 100);\n}", "static impactLight()\n\t\t{\n\t\t\tthis.impact(ImpactFeedbackStyle.Light);\n\t\t}", "function drawWaterfall(){\n\t\t\n\t\t}", "function lightningGenerator() {\n\n let odds = random(0, 1);\n\n //FLASHING EFFECT//\n lightning.alpha = lightning.alpha - lightning.speed;\n lightingInside.alpha = lightingInside.alpha - lightingInside.speed;\n\n //PLAYS LIGHTNING AT ADJUSTABLE ODDS//\n if (odds > 0.998) {\n\n if (isOutside) {\n\n //EFFECTS ONLY OUTSIDE LIGHNING EFFECT//\n lightningSFX.setVolume(1);\n lightningSFX.play();\n lightning.alpha = 210;\n } else {\n\n //EFFECTS INSIDE AND OUTSIDE LIGHTNING EFFECT//\n lightningSFX.setVolume(0.3);\n lightningSFX.play();\n lightning.alpha = 210;\n lightingInside.alpha = 200;\n }\n\n }\n\n push();\n fill(lightning.color, lightning.alpha);\n rect(0, 0, width, height);\n pop();\n}", "function shadow() {\n // Moving mouse changes light direction\n let dirX = (mouseX / width - 0.5);\n let dirY = (mouseY / height - 0.5);\n\n // Adding directional light\n directionalLight(250, 250, 250, -dirX, -dirY, -1); // white\n}", "function removeGlowEffect(key){\n key.classList.remove('glow')\n}", "glow(){\n\n\t\tif(isInside(mouse_press, this.vertex) && (this.children.length == 0) && !isInside(mouse_drag, this.vertex)){\n\t\t\tstrokeWeight(2);\n\t\t\tstroke(255);\n\t\t\t\n\t\t\tif(this.origin_line.length != 0){\n\t\t\t\tline(this.origin_line[0].x, this.origin_line[0].y, this.origin_line[1].x, this.origin_line[1].y);\n\t\t\t}else return;\n\n\t\t}else if(isInside(mouse_press, this.vertex) && (this.children.length !== 0)){\n\t\t\tthis.children[0].glow();\n\t\t\tthis.children[1].glow();\n\n\t\t}else return;\n\t\n\t}", "function state2glow(b,state,det){\n\tb.removeClass(\"glow_red\");\n\tb.removeClass(\"glow_purple\");\n\tb.removeClass(\"glow_green\");\n\tb.removeClass(\"glow_yellow\");\n\n\n\tif(state==-1){ //disconnected\n\t\tb.addClass(\"glow_purple\");\n\t} else if(state>=1 && det>0){\n\t\tb.addClass(\"glow_red\");\n\t} else if(state>=1 && det==0){\n\t\tb.addClass(\"glow_yellow\");\n\t} else {\n\t\tb.addClass(\"glow_green\");\n\t};\n}", "drawLight(unit){}", "function drawBackground(moonColor, moonGlow) {\n fill(moonColor);\n strokeWeight(5);\n stroke(moonGlow);\n\n circle(30, 0, 60);\n //stars in the background layer\n fill(\"#e3cf5b\");\n noStroke();\n circle(300, 200, 10);\n circle(20, 240, 13);\n circle(350, 120, 18);\n circle(400, 370, 50);\n circle(110, 370, 26);\n}", "function transglow(element, value1, value2){\r\n element.css('-webkit-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('-moz-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('-ms-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('-o-transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n element.css('transition',('top ').concat((value1).toString(),'s ease-in-out, ','left ',(value2).toString(),'s ease-in-out'))\r\n }", "function drawThrownBottle() {\n timePassedSinceThrow = new Date().getTime() - lastThrowStarted;\n let gravity = Math.pow(9.81, timePassedSinceThrow / 200);\n throwBottle(timePassedSinceThrow, gravity);\n}", "function clearGlow() {\n if (window.ggbg) {\n window.ggbg = false;\n }\n if (clearedGlow) {\n return;\n } else if (window.gbgi && !clearedGlow) {\n window.gbgi.src = '';\n window.gbgi.onload = null;\n window.gbgi = null;\n if (window.gbgmc) {\n window.gbgmc = null;\n }\n clearedGlow = true;\n } else {\n setTimeout(clearGlow, 50);\n }\n }", "glowIn (time = DEFAULT_GLOW_IN_TIME, _labelGlow, tween) {\n\t\tthis.isInGlowState = true;\n\t\tlet _tween = VALIDATE.defaultArg(tween, this.arena.tween);\n\t\t_labelGlow = VALIDATE.defaultArg(_labelGlow, this.arena.tween.addUniqueLabel('glowInLabel'));\n\t\t_tween.to(this.glowLabel, time, { alpha: ONE }, _labelGlow);\n\t\tif (this.isSignMagnitude) {\n\t\t\t_tween.to(this.glowSignLabel, time, { alpha: ONE }, _labelGlow);\n\t\t}\n\t}", "bluer(){\n\t\tthis.multiplyColorValue(\"blue\", 1.2);\n\t}", "function drawShadow(character) {\n if (character.jump.active) {\n drawEllipse(\n character.position.x + 40,\n character.position.y + 29,\n 100 - character.breath.amount,\n 4);\n } else {\n drawEllipse(\n character.position.x + 40,\n character.position.y + 29,\n 160 - character.breath.amount,\n 6);\n }\n}", "function Light() {}", "renderLightbulb() {\n push();\n if (this.complete) {\n noStroke();\n fill(255, 255, 0, 10);\n ellipse(600, height / 2, 120, 120);\n fill(255, 255, 0, 20);\n ellipse(600, height / 2, 90, 90);\n fill(255, 255, 0);\n } else {\n stroke(0, 250, 255);\n strokeWeight(2);\n fill(50);\n }\n ellipse(600, height / 2, 70, 70);\n pop();\n }", "Blend() {}", "function green() {\n\tgreenButton.classList.add('glow');\n\tsetTimeout(function () {\n\t\tgreenButton.classList.remove('glow');\n\t}, 500);\n\tgreenAudio.play();\n}", "function glowshot(fbl, tbl){\n if(tbl.exploded==true)\n return;\n\n var counter = 0\n _this.time.addEvent({\n delay: 14,\n callback: function(){\n counter++;\n var dir = {x: tbl.x-fbl.x, y: tbl.y-fbl.y, z: tbl.z-fbl.z}\n var tmp = camera.create( fbl.x+(dir.x*0.1*counter), fbl.y+(dir.y*0.1*counter), fbl.z+(dir.z*0.1*counter), 'bullet');\n _this.time.addEvent({\n delay:75,\n callback: function(){\n bulletFinish(tmp);\n }\n })\n },\n repeat: 10\n });\n }", "greener(){\n\t\tthis.multiplyColorValue(\"green\", 1.2);\n\t}", "function WaterLight(a,b, s, inte){\n\t\n\t\tthis.x = a\n\t\tthis.y = b\n\t\tthis.size = s;\n\t\t//this.waveAni = [];\n\t//\tthis.intensity = inte;\n\t\tthis.lighting = Math.round(this.size/lightRes)\n\t\t//this.picAni = 0\n\t//\tfor(var i=0; i < this.size/40; i++) {\n\t\t\t//this.waveAni.push(20*i + rand(2) + 10)\n\t\t\t//this.x.push(a - 10 + rand(20));\n\t\t//}\n\t\t//this.slider = 0;\n\t\t//this.sliderS = 10;\n\t\tthis.draw = function(){\n\t\t\tlightRegion(this.x, this.y, this.lighting, 0.2 + Math.random()/10);\n\t\t/*\n\t\t\n\t\t\tthis.picAni += 1;\n\t\t\tif(this.picAni > 9) this.picAni = 0;\n\t\t\t//ctx.fillText(0.5 * Math.sin(this.picAni * Math.PI*2 / 10) + 0.5, \n\t\t\t/*ctx.globalAlpha = (0.5 * Math.sin(this.picAni * Math.PI*2 / 10) + 0.5)/2\n\t\t\tctx.drawImage(wBack1, this.x - 50, this.y - 100);\n\t\t\tctx.globalAlpha = (1- ctx.globalAlpha)/2\n\t\t\tctx.drawImage(wBack2, this.x - 50, this.y - 100);\n\t\t\t\n\t\t\tthis.slider+= this.sliderS\n\t\t\tif(this.slider > 20 || this.slider < -20) this.sliderS *= -1\n\t\t\t//ctx.drawImage(wBack1, this.x - 50 + this.slider, this.y - 100);\n\t\t\t//ctx.drawImage(wBack2, this.x - 50 - this.slider, this.y - 100);\n\t\t\t\n\t\t\tctx.strokeStyle = 'white'\n\t\t\tfor(var j=0; j < this.waveAni.length; j++){\n\t\t\t\tctx.globalAlpha = (1-(this.waveAni[j]/this.size))/this.intensity;\n\t\t\t\tfor(var i=0; i < 5; i++){\n\t\t\t\t\tctx.beginPath()\n\t\t\t\t\tctx.lineWidth = i/2\n\t\t\t\t\t//ctx.arc(this.x,this.y, i/2+ this.waveAni[j], Math.PI,0)\n\t\t\t\t\t//ctx.arc(this.x,this.y, i/2+ this.waveAni[j], Math.PI + Math.random()*(Math.PI/4),-Math.random()*(Math.PI/4))\n\t\t\t\t\t\n\t\t\t\t\t//ctx.arc(this.x + this.waveAni[j], this.y, i, Math.PI, Math.PI/2);\n\t\t\t\t\tctx.stroke();\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\t/*\n\t\t\t\t\tfor(var k=0.25; k < 6.25; k++){\n\t\t\t\t\tctx.globalAlpha = Math.random()/10\n\t\t\t\t\tctx.beginPath()\n\t\t\t\t\tctx.lineWidth = i/2\n\t\t\t\t\tctx.arc(this.x,this.y, i/2+ this.waveAni[j], -(k+0.5)*Math.PI/6, -k*Math.PI/6 )\n\t\t\t\t\tctx.stroke();\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.waveAni[j] *= 1.1\n\t\t\t\tif(this.waveAni[j] > this.size) this.waveAni[j] = 10+ rand(3)\n\t\t\t}\n\t\t\tctx.globalAlpha = 1\n\t\t\t*/\n\t\t}\n\t}", "function SpotLightShadow() {\n\t\tLightShadow.call(this);\n\t\tthis.renderTarget = new RenderTarget2D(this.mapSize.x, this.mapSize.y);\n\t\tvar map = this.renderTarget.texture;\n\t\tmap.generateMipmaps = false;\n\t\tmap.minFilter = WEBGL_TEXTURE_FILTER.LINEAR;\n\t\tthis.map = map;\n\t\tthis.depthMap = null;\n\t\tthis._lookTarget = new Vector3();\n\t\tthis._up = new Vector3(0, 1, 0);\n\t}", "function anim(cx, cy) {\n context.clearRect(0, 0, w, h); // clear frame\n context.shadowBlur = glow; // set \"glow\" (shadow)\n\n context.beginPath(); // draw circle\n context.arc(cx, cy, cx * 0.25, 0, 6.28);\n context.fill(); // fill and draw glow\n\n glow += dlt; // animate glow\n if (glow <= 0 || glow >= max) dlt = -dlt;\n\n requestAnimationFrame(anim); // loop\n }", "function Lightning(xs, ys, xf, yf, c, dm){\nvar lenX = xf-xs;\nvar lenY = yf-ys;\nvar lenR = Math.sqrt(lenX*lenX+lenY*lenY);\nvar p = {}\n\nthis.color = c || \"lightblue\";\nthis.dots = [];\nthis.beated = [];\nthis.dots.push(xs);\nthis.dots.push(ys);\nthis.dots.push(xs+lenR*(Math.random()*0.2-0.1)+lenX*0.3);\nthis.dots.push(ys+lenR*(Math.random()*0.2-0.1)+lenY*0.3);\nthis.dots.push(xf-lenR*(Math.random()*0.2-0.1)-lenX*0.3);\nthis.dots.push(yf-lenR*(Math.random()*0.2-0.1)-lenY*0.3);\nthis.dots.push(xf);\nthis.dots.push(yf);\nthis.isBeated = function(n){\n\tfor(var i = 0; i<this.beated.length; i++){\n\t\tif(this.beated[i] == n) return true;\n\t}\n\treturn false;\n}\nthis.damage = dm || 100+(LightningPower-1)*100/LightningPower;\nthis.end = false;\nthis.lightningJump = LightningJump;\nthis.action = function(){\t}\nthis.draw = function(){\n\tif( !this.end ){\n\t\tctx.beginPath();\n\t\tctx.moveTo(this.dots[0], this.dots[1]);\n\t\tfor(var n = 2; n<this.dots.length; n+=2)\n\t\t\tctx.lineTo(this.dots[n], this.dots[n+1]);\n\t\tctx.lineWidth = 4;\n\t\tctx.strokeStyle = this.color;\n\t\tctx.stroke();\n\t\tctx.lineWidth = 1;\n\t\tctx.strokeStyle = \"white\";\n\t\tctx.stroke();\n\t\t}\n\t}\n\tvar iter = this;\n\tsetTimeout(function(){\n\t\titer.end = true;\n\t\t}, 150);\n}", "function fakeLight(){\n pntLight = false;\n}", "triggerDrum(hammer) {\n TonePlayback.noteOn(TonePlayback.SYNTHDRUM, hammer.note, 10, 1/16, this._config.velocity);\n // this._synth.triggerAttackRelease(hammer.note, \"16n\");\n hammer.animatingGlow = true;\n var startcolor = Utils.decToRGB(Style.metronome.hammer.color, 100);\n var endcolor = this._hitColor;\n hammer.glowColor.r = startcolor.r;\n hammer.glowColor.g = startcolor.g;\n hammer.glowColor.b = startcolor.b;\n createjs.Tween.get(hammer.glowColor)\n .to({ r: endcolor.r, g: endcolor.g, b: endcolor.b }, 500)\n .to({ r: startcolor.r, g: startcolor.g, b: startcolor.b }, 500)\n .wait(100) // wait a few ticks, or the render cycle won't pick up the changes with the flag\n .call( function (scope) { scope.animatingGlow = false; } );\n\n var startcolor = Utils.decToRGB(Style.metronome.drum.color, 100);\n var endcolor = this._hitColor;\n this._tweenTargets.drum.props.r = startcolor.r;\n this._tweenTargets.drum.props.g = startcolor.g;\n this._tweenTargets.drum.props.b = startcolor.b;\n this._tweenTargets.drum.props.zPosition = -400;\n this._tweenTargets.drum.props.bumpscale = 0;\n this._tweenTargets.drum.animating = true;\n this._tweenTargets.drum.currentTween = createjs.Tween.get(this._tweenTargets.drum.props)\n .to({\n r: endcolor.r, g: endcolor.g, b: endcolor.b,\n bumpscale: 0.35,\n zPosition: -400 + hammer.direction * 50 }, 150)\n .to({\n r: startcolor.r, g: startcolor.g, b: startcolor.b,\n bumpscale: 0,\n zPosition: -400 }, 150)\n .wait(100) // wait a few ticks, or the render cycle won't pick up the changes with the flag\n .call( () => { this._tweenTargets.drum.animating = false; } );\n }", "function drawShadow(item) {\r\n\tvar lightTransformed = mult(inverse4(mvMatrix), lightPosition);\r\n\tmvMatrix = mult(mvMatrix, translate(lightTransformed[0], lightTransformed[1], lightTransformed[2])); // Set the shadow matrix based on the current lighting position\r\n\tsMatrix = mat4();\r\n\tsMatrix[3][3] = 0.0;\r\n\tsMatrix[3][1] = -1.0 / lightTransformed[1];\r\n\tmvMatrix = mult(mvMatrix, sMatrix);\r\n\tmvMatrix = mult(mvMatrix, translate(-lightTransformed[0], -lightTransformed[1], -lightTransformed[2]));\r\n\tvar scalar = -(10 + height) * 0.1;\r\n\t// Multiply in reverse order so it happens first\r\n\tmvMatrix = mult(translate(scalar * lightPosition[0], scalar * lightPosition[1], scalar * lightPosition[2]), mvMatrix); darkenLight();\r\n\titem.drawFunc(vec4(0, 0, 0, 1.0));\r\n\tresetLight();\r\n\tmvMatrix = stack.pop();\r\n\tstack.push(mvMatrix);\r\n}", "function light(){\n\n console.log('SHOW TIME');\n gsap.set(\"#light\",{display:\"block\", scale:.75, alpha:.25, transformOrigin:\"center center\"});\n\n lightTL.to(\"#light\",{duration:1, scale:1, aplha:1, yoyo:true, repeat:-1, ease:\"back.out\"});\n\n lightTL.play()\n }", "function glowBullet(){\n for(var i =0; i < bulletArrays.length; i++) {\n bulletArrays[i].style.backgroundImage = inactiveBackground;\n\n }\n bulletArrays[currentImage].style.backgroundImage = activeBackground;\n }", "function step() {\n TrafficLight.change();\n TrafficLight.draw(ctx);\n}", "function pulseBrightness() {\n\t\tstar.alpha = Math.sin(q);\t\t\t\t\t\t\t\t\t\t// calculate alpha with a sinewave\n\t\tq += 1/lifespan/190;\t\t\t\t\t\t\t\t\t\t\t// increment. lifespan is tuned to be in minutes\n\n\t\tif (cow.boostMultiplier > 0) {\t\t\t\t\t\t\t\t\t// click boost\n\t\t\tq += 1/lifespan/66;\t\t\t\t\t\t\t\t\t\t\t// Same calculations as normal, but faster. Click = 6% progress\n\t\t}\n\n\t\tif (q > 0.8 && sfxPlayed == false) {\t\t\t\t\t\t\t// play sfx when the shape is mostly visible\n\t\t\tswitch (shape) {\n\t\t\t\tcase 'star':\tplayAudio('./SFX/star' + rngRange(1,5), 'sfx', star.x);\t\tbreak;\n\t\t\t\tcase 'circle':\tplayAudio('./SFX/circle' + rngRange(1,5), 'sfx', star.x);\tbreak;\n\t\t\t\tdefault: break;\n\t\t\t}\n\t\t\tsfxPlayed = true;\n\t\t}\n\n\t\tif (q > 3.2) {\t\t\t\t\t\t\t\t\t\t\t\t\t// if star has faded out.. (3.14 is one sinwave cycle)\n\t\t\tstar.destroy(true);\t\t\t\t\t\t\t\t\t\t\t// kill it\n\t\t\tswitch (shape) {\t\t\t\t\t\t\t\t\t\t\t// add one shape to the player's inventory\n\t\t\t\tcase 'circle': cow.resourceCircles++; break;\t\t\t//\n\t\t\t\tcase 'star': cow.resourceStars++; break;\t\t\t\t//\n\t\t\t\tdefault: break;\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t}\n\t\t\tif (cow.endgameBarOwned == true){\n\t\t\t\tswitch (shape) {\t\t\t\t\t\t\t\t\t\t\t\t// Add shapes to the endgame bar counter\n\t\t\t\t\tcase 'circle': cow.resourceEndgameBarCircles++; break;\t\t//\n\t\t\t\t\tcase 'star': cow.resourceEndgameBarStars++; break;\t\t\t//\n\t\t\t\t\tdefault: break;\t\t\t\t\t\t\t\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdateResourceCounter(shape);\n\t\t\tcow[counter]--;\t\t\t\t\t\t\t\t\t\t\t\t// and remove the star from the capacity counter\n\t\t} else { setTimeout(function() { window.requestAnimationFrame(pulseBrightness); }, 100) } // Throttled to 10FPS\n\t}", "function illuminateGreen() {\n clearLights();\n document.getElementById('goLight').style.backgroundColor = \"green\";\n}", "function drawLightBright() {\n var lightBright = new Image();\n lightBright.src = \"light-bright.png\";\n lightBright.onload = function() {\n ctx.drawImage(lightBright,state.light.x,0,200,200);\n }\n}", "function drawBackground() {\n //drawShadow(); //drawDog shadow beneath dog first\n context.fillStyle = BG_COLOR;\n context.fillRect(0, 0, WIDTH, 500); //wipe picture above shadow\n context.fillStyle = '#83B799';\n context.fillRect(0, 500, WIDTH, 2); //drawDog horizontal ground line\n}", "function drawGlass(gl){\n gl.uniform1f(program.u_Alpha,0.5);\n pushMatrix(g_modelMatrix);\n if(self.position[2]>0){\n g_modelMatrix.translate(0,10,-50.5);\n g_modelMatrix.scale(79.5,10,0.5);\n drawObject(gl,wind);\n g_modelMatrix.setTranslate(0,10,50.5);\n g_modelMatrix.scale(79.5,10,0.5);\n drawObject(gl,wind);\n }else{\n g_modelMatrix.translate(0,10,50.5);\n g_modelMatrix.scale(79.5,10,0.5);\n drawObject(gl,wind);\n g_modelMatrix.setTranslate(0,10,-50.5);\n g_modelMatrix.scale(79.5,10,0.5);\n drawObject(gl,wind);\n }\n g_modelMatrix=popMatrix();\n gl.uniform1f(program.u_Alpha,1);\n}", "function creepyHut(){\n\tcurrentBG = hut;\n\tbackground(hut);\n}", "function drawThrowBottle() {\n let timePassed = new Date().getTime() - bottleThrowTime;\n let gravity = Math.pow(9.81, timePassed / 300);\n\n if (isThrowingRight) {\n thrownBottle_x = 225 + (timePassed * 0.7);\n } else if (isThrowingLeft) {\n thrownBottle_x = 225 - (timePassed * 0.7);\n }\n thrownBottel_y = 280 - (timePassed * 0.6 - gravity);\n\n let base_image = checkBackgroundImageCache(currentBottleImage);\n ctx.drawImage(base_image, thrownBottle_x, thrownBottel_y, base_image.width * 0.2, base_image.height * 0.2);\n}", "function runEffect() {\n var effectArray = [\"blind\", \"clip\", \"drop\", \"explode\", \"fold\", \"puff\"];\n var effectNumber = Math.floor(Math.random() * 6) + 1;\n effectNumber--;\n effect = effectArray[effectNumber];\n $(\"#gamerules\").effect(effect, 750);\n $(\"#start\").effect(effect, 750);\n setTimeout(function() {\n mpopup.style.display = \"none\";\n }, 749);\n }", "function toggleGlow(element) {\n let glowElement = svg.getElementById(getGlowID(element));\n glowElement.style.display = glowElement.style.display === \"none\" ? \"\" : \"none\";\n}", "update(time) {\n /*light.intensity = (Math.sin(time)+1.5)/1.5;\n light.color.setHSL( Math.sin(time), 0.5, 0.5 );\n */\n }", "shade(amount = 10) {\n return this.mix('black', amount);\n }", "function moduleMistake() {\n // Red light\n let red_light = document.querySelector(\n `.svg_container${moduleCounter} .svg_subcontainer .red_light`\n );\n red_light.style.opacity = \"1\";\n setTimeout(function () {\n red_light.style.opacity = \"0\";\n }, 1000);\n\n // Shake\n let container = document.querySelector(`.svg_container${moduleCounter}`);\n container.classList.add(\"shake\");\n setTimeout(function () {\n container.classList.remove(\"shake\");\n }, 100);\n\n // Add strike\n strikeFunc();\n }", "function glowTime(timestamp)\r\n{\r\n\tvar time=new Date(timestamp*1000);\r\n\tvar M=time.getMonth()+1;\r\n\tvar d=time.getDate();\r\n\tvar y=time.getFullYear();\r\n\tvar h=time.getHours();\r\n\tvar m=time.getMinutes();\r\n\tvar s=time.getSeconds();\r\n\tif (h<12) \r\n\t{ var u=\"AM\"; }\r\n\telse \r\n\t{ var u=\"PM\"; }\r\n\tif (M<10) { M = \"0\" + M; }\r\n\tif (d<10) { d = \"0\" + d; }\r\n\tif (h>12) { h = h - 12; }\r\n\tif (h==0)\r\n\t{ h=12;\t}\r\n\telse if (h<10)\r\n\t{ h = \"0\" + h; }\r\n\tif(m<10) { m = \"0\" + m; }\r\n\tif(s<10) { s = \"0\" + s; }\r\n\treturn M + \"/\" + d + \"/\" + y + \" @ \" + h + \":\" + m + \":\" + s + \" \" + u;\r\n}", "function img_light_r() {\n\t\t$('.img_light_r').velocity(\n\t\t{\n\t\ttop: 50,\n\t\topacity: 1,\n\t\t},\n\t\t500);\n\t}", "function glossSlider() {\r\n gloss = document.getElementById(\"glossiness\").value;\r\n var g = makeObject();\r\n vert = g.vertex;\r\n ind = g.index;\r\n flatNormz = g.flatN;\r\n smoothNormz = g.smoothN;\r\n var temp = g.fcolor;\r\n var temp2 = g.scolor;\r\n flatColor = g.fcolor;\r\n smoothColor = g.scolor;\r\n if(specular){\r\n if (flatShaded){flatColor = specularLighting(flatNormz);}\r\n else{smoothColor = specularLighting(smoothNormz);}\r\n }\r\n gl = main();\r\n if (buttonE){drawObjects();}\r\n else {drawSOR(gl); drawLights(gl);}\r\n flatColor=temp;\r\n smoothColor=temp2;\r\n}", "function drawShadows() {\n\n if (isMovingRight && bg_ground > -5500 && timePassedSinceHurt > HURT_TIME && timePassedSinceDead > DEAD_TIME) {\n bg_shadows = bg_shadows - (0.5 * GAME_SPEED);\n }\n if (isMovingLeft && bg_ground < 500 && timePassedSinceHurt > HURT_TIME && timePassedSinceDead > DEAD_TIME) {\n bg_shadows = bg_shadows + (0.5 * GAME_SPEED);\n }\n for (let index = -2; index < 10; index++) {\n addBackgroundobject('./img/background/ground2.png', index * 1920, bg_shadows, -110, 0.5);\n }\n\n}", "function drawHealth() {\n push()\n fill(healthColor, 255, 100);\n noStroke();\n textSize(22);\n textAlign(RIGHT);\n text(\"HEALTH-->\", width / 1.1, height - 20)\n rect(width - 50, height, width - 50, -playerHealth);\n //if the players health is gettin glow, turn the recangle red, and play a ticking clock sound\n if (playerHealth < playerMaxHealth / 3) {\n healthColor = 0;\n tickTock.play();\n } else {\n healthColor = 120;\n tickTock.stop();\n }\n pop();\n}", "mineBurst(mineSound) {\n\t\t// play the sound effect\n\t\tmineSound.position = 0;\n\t\tmineSound.play();\n\t\t// graphics\n\t\tthis.mineBurstGraphic.visible = true;\n\t\tvar currentTime = Date.now();\n\t\tthis.mineBurstGraphic.birth = currentTime;\n\t\tthis.mineBurstGraphic.death = currentTime + 300;\n\t}", "function lowlight() { // remove any highlight\n if (OldTarget) {\n OldTarget.scale = 1.0;\n OldTarget = null;\n }\n }", "function pulse_flash() {\n $('.flash, .flash p').effect('highlight', {}, 3000)\n}", "function ThrowBottle() {\n let timePassed = new Date().getTime() - bottleThrowTime;\n if (timePassed > 800) {\n AUDIO_BOTTLE_THROW.play()\n collectedBottles--;\n bottleThrowTime = new Date().getTime();\n drawThrowBottle();\n\n }\n}", "function shadowOn(context)\n{\n\tcontext.shadowOffsetX = BOARDER;\n\tcontext.shadowOffsetY = BOARDER;\n\tcontext.shadowBlur = 4;\n\tcontext.shadowColor = COLOUR.SHADOW;\n}", "function bikeTweens() {\n const light = document.querySelector(\"#light1\");\n\n const hero = document.querySelector(\".hero\");\n const heatLeftIds = [\"#heatL1\", \"#heatL2\", \"#heatL3\"];\n const heatRightIds = [\"#heatR1\", \"#heatR2\", \"#heatR3\"];\n const heatIds = [...heatRightIds, ...heatLeftIds];\n\n const isMobile = window.innerWidth < 590;\n\n bikeDoodlesTl.fromTo(\n hero,\n {\n autoAlpha: 0,\n x: \"2rem\",\n },\n {\n duration: 0.9,\n delay: 0.8,\n ease: Power3.easeInOut,\n autoAlpha: isMobile ? 0.3 : 1,\n x: 0,\n }\n );\n\n bikeDoodlesTl.fromTo(\n light,\n 1.5,\n {\n autoAlpha: 1,\n drawSVG: \"0%\",\n },\n {\n drawSVG: \"100%\",\n ease: Power1.easeOut,\n delay: -0.3,\n }\n );\n\n bikeDoodlesTl.fromTo(\n heatLeftIds,\n { drawSVG: \"0%\", autoAlpha: 1 },\n { duration: 0.8, drawSVG: \"100%\", stagger: 0.3, delay: -1 }\n );\n\n bikeDoodlesTl.fromTo(\n heatRightIds,\n { drawSVG: \"0%\", autoAlpha: 1 },\n { duration: 0.8, drawSVG: \"100%\", stagger: 0.3, delay: -0.8 }\n );\n\n hero.addEventListener(\"mouseenter\", (e) => {\n const heatTl = gsap.timeline();\n heatTl.to(heatIds, {\n drawSVG: \"50% 50%\",\n yoyo: true,\n repeat: 1,\n duration: 0.4,\n ease: Power3.easeInOut,\n stagger: 0.1,\n });\n heatTl.to(heatIds, {\n drawSVG: \"100%\",\n });\n });\n}", "flower(x,w,h,r,g,b){\n stroke(0,168,0)\n strokeWeight(3)\n //stem\n let vol = amp.getLevel()\n \n line(x, height, x, 1090 - vol * g)\n //leaves\n fill(0, 168, 0)\n stroke(100, 168, 0)\n ellipse(x - 8, height, 10, 120 - vol * 200)\n ellipse(x + 8, height, 8, 100)\n //flower bulb\n noStroke()\n strokeWeight(1)\n fill(r, g, b)\n arc(x, 1090 - vol * g, w, h,-QUARTER_PI,HALF_PI * 2)\n ellipse(x, 1090 - vol * g, w-15, h-30)\n }", "function draw() {\n background(150);\n\n console.log(`hookDown: ${hookDown}`);\n //console.log(`pink: ${pinkeen}`);\n //console.log(`vent: ${ventricocus}`);\n //console.log(`shark: ${whatisthat}`);\n\n moveFish1();\n moveFish2(); //Controls movement of fish\n\n checkDist(); // Checks if fish gets within catching range\n checkOffScreen(); // Repositions fish if they go too far\n\n baitFish1(); // Moves fish towards hook with user input if within range\n baitFish2();\n\n scareFish1()\n scareFish2()\n\n if (fish1.reeled === 1) {\n reelFish1(); //Attatches fish to hook\n }\n if (fish1.caught === 1) {\n checkFish1(); // Checks which fish you caught\n catchFish1(); // Catches the fish\n fish1.caught = 0;\n }\n if (fish2.reeled === 1) {\n reelFish2();\n }\n if (fish2.caught === 1) {\n checkFish2();\n catchFish2();\n fish2.caught = 0;\n }\n // Lake\n push();\n imageMode(CENTER);\n tint(255, 188);\n image(pool, 400, 280, 750, 750);\n pop();\n // Background\n push();\n imageMode(CORNER);\n image(grass, 0, 0, windowWidth, windowHeight);\n pop();\n\n setHook(); // Sets position of hook on rod\n dropHook(); // Drops hook into water\n\n push();\n imageMode(CENTER);\n image(rod, mouseX, mouseY, 200, 200); // Displays rod\n pop();\n\n push();\n fill(145, 126, 97);\n stroke(74, 63, 47);\n strokeWeight(10);\n rect(900, 300, 300, 400);\n textSize(32);\n text(\"Last Caught Fish\", 930, 340); // Displays sign\n pop();\n\n push()\n fill(10, 150)\n rect(980, -10, 300, 60);\n fill(255, 150)\n textSize(12);\n text(\"Click to drop and reel back your hook\", 988, 12); //Displays instructions\n text(\"Hold WASD to bait the fish towards you\", 988, 30)\n text(\"if it comes close enough\", 988, 42);\n pop()\n\n // Displays last caught fish and plays their cry\n push();\n if (pinkeen === 1) {\n displayPinkeen();\n }\n if (acanphurus === 1) {\n displayAcanphurus();\n }\n if (ventricocus === 1) {\n displayVentricocus();\n }\n if (hamashirama === 1) {\n displayHamashirama();\n }\n if (whatisthat === 1) {\n displaywhatisthat();\n }\n pop();\n\n // Controls fireflies movement and appearance\n push();\n noStroke();\n //var pointillize = map(mouseX, 0, width, smallPoint, largePoint);\n var x = floor(random(windowWidth));\n var y = floor(random(windowHeight));\n pop();\n\n for (var j = 0; j < maxFlies; j++) drawFlies(fireflies[j].x, fireflies[j].y);\n\n glowTimer++;\n if (parseInt(glowTimer) % 2 == 0) {\n if (expandContract == 0) {\n dim -= 0.5;\n z++;\n if (z == 3) expandContract = 1;\n } else if (expandContract == 1) {\n dim += 0.5;\n z--;\n if (z == 0) expandContract = 0;\n }\n }\n\n for (var j = 0; j < maxFlies; j++) fireflies[j].changeDir();\n for (var j = 0; j < maxFlies; j++) fireflies[j].Move(fireflies[j].dir);\n} //===========================================================================", "function lightAndSound(simon) {\n\t// First setTimeout is delay between player move ending and computer move starting.\n\tsetTimeout(function() {\n\t\tfor (var i = 0; i < simon.length; i++) {\n\t\t\t(function(order) {\n\t\t\t\t// Second setTimeout is for delay between computer moves.\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsoundIdx = colorArr.indexOf(simon[order]);\n\t\t\t\t\tsoundsArr[soundIdx].play();\n\t\t\t\t\t$('.' + simon[order]).addClass(simon[order] + '-glow');\n\t\t\t\t\t// Third setTimeout is for delay between removing glow effect.\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$('.' + simon[order]).removeClass(simon[order] + '-glow')\n\t\t\t\t\t}, speed());\n\t\t\t\t}, order * (speed() + 50));\n\t\t\t})(i);\n\t\t}\n\t}, 850);\n\tplayerTurn = true;\n}", "function animate() {\n // Canvas, Canvas Context, Math\n with(a) with(c) with(Math) {\n \n // Check if another minute has elapsed, increment time, 3593 to provide smooth flapping at level up\n if (time++ > 3593) {\n // Clear time\n time = 0;\n // Power up for Snogard\n snogardHealth = eggY ? 0 : 99;\n // Increment chasers\n dragons++;\n // Generate X coordinate of the Egg\n eggX = random() * (width - 9);\n // Generate Y coordinate of the Egg\n eggY = 9 + random() * (height - 9);\n }\n \n // Clear screen with green\n fillStyle = \"#080\";\n fillRect(0, 0, width, height);\n \n // Set darker green to stroke blades of grass\n strokeStyle = \"#040\";\n \n // Stroke blades of grass, positions based on the polygon of dragon (only seems to be random), it's something\n for(i in dragonPolygon) {\n strokeText(\"\\\\l/\", width / 48 * abs(dragonPolygon[i]), height / 42 * abs(dragonPolygon[21 - i]));\n }\n \n // Draw egg, use \"tan\" color (almost white), use asterisk character (very small, but somewhat filled and round)\n strokeStyle = \"tan\";\n strokeText(\"*\", eggX, eggY);\n \n // Pick up egg\n if (abs(dragonX[0] - eggX) + abs(dragonY[0] - eggY) < 60) {\n // Hide it, by putting it on the edge of canvas\n eggY = 0;\n }\n\n // Display time, set the \"fire\" strokeStyle now\n strokeStyle = \"#e93\";\n strokeText(~~(time / 60), 110, 9);\n \n // Update variables, draw dragons, fire and indicators\n for(i = 0; i < dragons; i++) {\n // Get the relative position of the dragon's target (Snogard's target is the mouse pointer, the dragons' target is Snogard)\n var dx = dragonX[i] - (i ? dragonX[0] : targetX);\n var dy = dragonY[i] - (i ? dragonY[0] : targetY);\n // Find the angle diference in radians between the dragon's angle and the relative angle of the position of its target\n var diff = atan(dy / dx) + ((dx < 0) ? PI : 0) - dragonZ[i];\n // Normalize diff to (-PI, PI) interval\n while (abs(diff += diff > 0 ? -2 * PI : 2 * PI) > PI) {\n // Normalization is done in condition\n }\n \n // Attack Snogard based on the dragon's angle and relative position, and Snogard's fire\n if ((abs(diff) < 1) & (abs(dx) + abs(dy) < 70) & i & (dragonFire[0] < 50)) {\n dragonFire[i] = 99;\n snogardHealth--;\n }\n \n // Rotate dragon by random steps, this way the gameplay is less deterministic\n dragonZ[i] += (diff < 0 ? -0.02 : 0.02) * (random() + 0.1);\n \n // Snogard's color is \"tan\", the others are \"red\" (the only 3 letter html color codes :)\n fillStyle = i ? \"red\" : \"tan\";\n \n // Save the context state (transformation, shadow, lineWidth)\n save();\n \n // Set Dragon Shadow\n shadowColor = \"#000\";\n shadowBlur = shadowOffsetX = shadowOffsetY = 30;\n \n // Translate (Move dragon, newer dragons are faster), rotate\n translate(dragonX[i] -= cos(dragonZ[i]) * (2 + i / 9), dragonY[i] -= sin(dragonZ[i]) * (2 + i / 9));\n rotate(dragonZ[i] + PI);\n \n // Draw Dragon Polygon\n beginPath();\n // First one side, then the other mirrored side, tricky way to get first k = -1, then k = 1\n for(k = -2; k++ < 1;) {\n // Go through the vertices of the polygon\n for(j = 0; j < 22; j += 2) {\n // Draw body and Flapping wings, inside condition: (j > 7) & (j < 16) is for flapping wings\n lineTo(dragonPolygon[j], k * dragonPolygon[j + 1] * (0.8 + 0.2 * ((j % 16 > 7) ? sin(time / 26 + i) : 1)));\n }\n }\n \n // Fill Dragon Polygon\n fill();\n \n // Hide shadow of fire by high blur, takes less code\n shadowBlur = 99;\n \n // Draw fire with bold tilde characters, lineWidth = 3\n if (dragonFire[i]-- > 0) {\n strokeText(\"~~~\", 38, lineWidth = 3);\n }\n \n // Restore the context state (transformation, shadow, lineWidth)\n restore()\n \n // Draw Health, and number of Chaser dragons\n fillRect(5, i * 9 + 5, i ? 5 : snogardHealth, 5);\n }\n \n // Check if Snogard is still alive, or survived all dragons, otherwise continue\n if (snogardHealth <= 0) {\n // Lose\n alert(\":(\");\n }\n else if (dragons > 7) {\n // Win\n alert(\":D\");\n }\n else {\n // Continue game\n requestAnimationFrame(animate);\n }\n }\n}", "function raindropeffect() {\n for (var i = 0; i < GUI.decoration.bubblesLength; i++) {\n GUI.decoration.bubbles.push(new raindrop());\n }\n}", "function _addEffect() {\n $(this).addClass('hovered');\n }", "function illuminateRed() {\n clearLights();\n document.getElementById('stopLight').style.backgroundColor = \"red\";\n document.getElementById('goLight-R').style.backgroundColor = \"green\";\n}", "function illuminateRed(){\n clearLights();\n $(\"#stopLight\").css(\"background-color\", \"red\");\n }", "decreaseLight() {\n if (this.lightRadius > this.lightRadiusMin)\n this.lightRadius *= this.lightDecreaseFactor;\n }", "function sprinkler(){\r\n sprinklerrate++;\r\n if (sprinklerrate >= sprinkly) {\r\n sprinklerrate = 0;\r\n spread = Math.floor(Math.random() * 20)-10\r\n moleclickicons.push({x: 250, y: 125,t: 0,spread: spread})\r\n }\r\n }", "hit() {\n\n //if 1 splash occurs add a splash\n if(splash = 1) {\n splash++;\n }\n \n\n //if it reaches 10 splashes reset to 0, and add blue color into the ground. \n if(splash = 10) {\n \n splash = 0;\n this.blue = this.blue + 2;\n\n \n\n console.log(\"hit\");\n\n }\n\n }", "powerUpBrickBreaker() {\r\n if (this.powerUps.isActive(BrickBreaker) && this.powerUps.hitPaddle) {\r\n if(activeEffects) this.particleS.addParticle(floor(random(2, 10)), this.ball.pos);\r\n\r\n this.ball.behaviors(this.bricks, this.blocks);\r\n }\r\n }", "glitch() {\n gsap.killTweensOf(this.DOM.imgStack);\n\n gsap.timeline()\n .set(this.DOM.imgStack, {\n opacity: 0.2\n }, 0.04)\n .set(this.DOM.stackImages, {\n x: () => `+=${gsap.utils.random(-15,15)}%`,\n y: () => `+=${gsap.utils.random(-15,15)}%`,\n opacity: () => gsap.utils.random(1,10)/10\n }, 0.08)\n .set(this.DOM.imgStack, {\n opacity: 0.4\n }, '+=0.04')\n .set(this.DOM.stackImages, {\n y: () => `+=${gsap.utils.random(-8,8)}%`,\n rotation: () => gsap.utils.random(-2,2),\n opacity: () => gsap.utils.random(1,10)/10,\n scale: () => gsap.utils.random(75,95)/100\n }, '+=0.06')\n .set(this.DOM.imgStack, {\n opacity: 1\n }, '+=0.06')\n .set(this.DOM.stackImages, {\n x: (_, t) => t.dataset.tx,\n y: (_, t) => t.dataset.ty,\n rotation: (_, t) => t.dataset.r,\n opacity: 1,\n scale: 1\n }, '+=0.06')\n }", "shiftOpacity() {\n\t\tconst shift = (Math.random() - 0.5) * this.opacityVar;\n\t\tthis.opacity = shift;\n\t}", "function takeDamage (damage : int){\n\n\t//here we play the sound that it got hurt\n\taudio.PlayOneShot(hurtSound);\n\t//here we change the color of the bat to give a visual indication that it was hit\n\trenderer.material.color.r = 1;\n\trenderer.material.color.g = 0; \n\trenderer.material.color.b = 0; \n\t//we set the color counter to zero so we can track how long we have the color indication going for.\n\tcolorCounter = 0.0;\n\t//we subtract health to track how much it has so it can die\n\thealth -= damage;\n\t//if the health hits zero or is somehow less than zero, we want to get the death stuff going\n\tif(health <= 0){\n\t\t//here we choose a random number to determine what he will drop\n\t\tvar randNum:int = Random.Range(1,4);\n\t\t//if the number is 2 we'll do a heart\n\t\tif(randNum == 2){\n\t\t\tInstantiate(heart, transform.position, Quaternion.Euler(-90,180,0));\n\t\t//if its any other number besides 2, we'll drop a gem instead\n\t\t}else{\n\t\t\tInstantiate(gem, transform.position, Quaternion.Euler(-90,180,0));\n\t\t}\n\t//before we destroy the bat we want to spawn the explosion animation so it looks pretty.\n\tInstantiate(explosion, transform.position, Quaternion.Euler(-90,180,0));\n\t//here we delete the bat. you won!\n\tDestroy(gameObject);\n}\n\n//if the bat got hurt, we set the velocity to zero before we choose which direction it will go\nrigidbody.velocity = Vector3(0,0,0);\n\n}", "function illuminateYellow() {\n clearLights();\n document.getElementById('slowLight').style.backgroundColor = \"yellow\";\n}", "function realLight(){\n pntLight = true;\n}", "function flamingSlime(event) {\t\t\t\t\t\t\t//Let's set the \"Slime\" on fire!\r\n\r\n //var entityHit = event.getEntityHit();\t\t\t\t//First, use the getEntityHit() method from projectileHitHook to figure out WHAT was hit...\r\n //var entityHit = event.getEntityType();\t\t\t\t//First, use the getEntityHit() method from projectileHitHook to figure out WHAT was hit...\r\n var entityHit = event.getEntity();\r\n //var projectile = event.getProjectile();\t\t\t\t//...then, use the getProjectile() method from projectileHitHook to figure out WHICH projectile was used...\r\n //var projectile = event.getLastDamageCause().getCause();\r\n var projectile = event.getDamager().getType();\r\n //var thrower = projectile.getThrower();\t\t\t\t//...and finally, use the getThrower() method from projectile to figure out WHO threw the projectile.\r\n echo(projectile);\r\n echo(entityHit); \r\n if (!(projectile == cmSnowBall)){\t\t\t//If the throwable IS NOT a snowball: \"there is nothing to see here, move along.\"\r\n return;\r\n }\r\n //echo('hello');\r\n if (entityHit instanceof cmSlime1){\t\t\t\t//Now, suppose the throwable was a snowball. Did it hit \"Slime\"?\t\t\r\n var slimeSize = entityHit.getSize();\t\t//If so, get the size of the \"Slime\" entity.\r\n var entityWhere = entityHit.getLocation();\t//Also, we get the location of the \"Slime\", to decide where the explosion sound will originate;\r\n entityHit.setFireTicks(100);\t\t\t\t//we then set the \"Slime\" on fire...\r\n // sounds.explode(entityWhere);\t\t\t\t//...and use the sounds plugin to provide the \"explode\" sound effect with origin at the \"Slime\"'s position.\r\n sounds.entityGenericExplode(entityWhere);\r\n function vanquishSlime(){\t\t\t\t\t//Not satisfied with simply setting \"Slime\" on fire, my 9 year-old advisor suggested vanquishing them.\r\n if (!(slimeSize == 'BIG')){\t\t\t\t//So... if the \"Slime\" is BIG, you will need to keep on hitting with snowballs until it breaks apart;\t\t\t\r\n //entityHit.destroy();\t\t\t\t//if the \"Slime\" size < BIG, then the \"Slime\" will be destroyed... \r\n entityHit.setHealth(0);\r\n destroyCount = destroyCount + 1;\t//The counter in then updated ***TO DO: build a decent counter using scoreboard!\r\n //echo(thrower, destroyCount);\t\t//and displays how many \"Slime\" entities were slayed.\r\n }\t\t\r\n }\t\t\r\n setTimeout(vanquishSlime, 2000);\t\t\t//Without a delay, you do not see the flaming \"Slime\"... so we get 2 seconds of fire.\r\n }\r\n}", "function makeShade() {\n shade = game.add.graphics(0, 0);\n shade.beginFill(0x000000, 0.6);\n shade.drawRect(0, 0, game.world.width, game.world.height);\n shade.endFill();\n}", "toggleShadow(){\r\n let thiscolor = this.mesh1.material.color;\r\n if(!this.lamb) {\r\n var lambMaterial = new THREE.MeshLambertMaterial({color: thiscolor});\r\n lambMaterial.shading = THREE.FlatShading;\r\n lambMaterial.shading = THREE.SmoothShading;\r\n this.geometry.normalsNeedUpdate = true;\r\n this.mesh1.material = lambMaterial;\r\n this.lamb = true;\r\n }\r\n else{\r\n var matPhong = new THREE.MeshPhongMaterial({color: thiscolor, side:THREE.DoubleSide});\r\n matPhong.specular = new THREE.Color(0x111111);\r\n matPhong.shininess = 30;\r\n matPhong.shading = THREE.FlatShading;\r\n matPhong.shading = THREE.SmoothShading;\r\n matPhong.needsUpdate = true;\r\n this.mesh1.normalsNeedUpdate = true;\r\n this.mesh1.material = matPhong;\r\n this.lamb = false;\r\n }\r\n }", "function WithGlowLayer() {\n const glowRef = useRef(null);\n\n const onCheckboxClicked = (value) => {\n if (glowRef.current) {\n glowRef.current.hostInstance.isEnabled = value;\n }\n };\n\n return (\n <Engine antialias adaptToDeviceRatio canvasId='babylonJS'>\n <Scene clearColor={new Color4(0.02, 0.022, 0.02, 1)} onCreated={onSceneCreated}>\n <arcRotateCamera\n name='Camera'\n alpha={2.5}\n beta={0.9}\n radius={25}\n lowerRadiusLimit={20}\n upperRadiusLimit={80}\n target={Vector3.Zero()}\n useAutoRotationBehavior\n />\n \n <hemisphericLight name='toto' direction={Vector3.Up()}/>\n <glowLayer ref={glowRef} name=\"glow\" options={{mainTextureSamples: 2}} isEnabled={true}/>\n \n <ScaledModelWithProgress rootUrl='https://www.babylonjs.com/Assets/NeonPipe/glTF/' sceneFilename='NeonPipe.gltf'\n progressBarColor={Color3.FromInts(255, 165, 0)}\n />\n\n <adtFullscreenUi name='ui1'>\n <stackPanel\n width='200px'\n isVertical={false}\n horizontalAlignment={Control.HORIZONTAL_ALIGNMENT_RIGHT }\n verticalAlignment={Control.VERTICAL_ALIGNMENT_CENTER}\n >\n <checkbox width='20px' height='20px' isChecked={true} color='green'\n onIsCheckedChangedObservable={onCheckboxClicked}\n />\n <textBlock text='Glow Enabled' width='180px' paddingLeft='5px' color='white'\n textHorizontalAlignment={Control.HORIZONTAL_ALIGNMENT_LEFT}\n />\n </stackPanel>\n </adtFullscreenUi>\n <environmentHelper options={{\n groundSize: 160,\n skyboxSize: 160,\n sizeAuto: false\n }} setMainColor={[Color3.Gray()]}/>\n </Scene>\n </Engine>\n )\n}", "function gradient (){\n\t\t$('.one').mouseenter(function(){\n\t\t\t$(this).addClass('grad')\n\t\t\t$(this).fadeTo('fast','-=0.1');\n\t\t});\n\t}", "function legendsFrameGlare(){\r\n var $legendsPicGlare = $(\".legends-pic-glare\");\r\n var finalX = $(\".legends-pic-frame\").width();\r\n\r\n //move glare across frame (fades in and out and moves left to right)\r\n var tl = new TimelineMax({repeat:-1, repeatDelay:1.6});\r\n tl.to($legendsPicGlare, 3.5, {left:finalX});\r\n tl.to($legendsPicGlare, 1, {opacity:1},0);\r\n tl.to($legendsPicGlare, 1, {opacity:0},1.7);\r\n }", "function draw() {\n\n // Move the felt image down by increasing its y position\n feltTextureImageY += 1;\n\n // Display the felt image\n image(feltTextureImage,feltTextureImageX,feltTextureImageY);\n\n // calculate larger distance x,y for skull ---> 1/30th distance from mouse\nvar skullFaceX = mouseX - skullX;\nvar skullFaceY = mouseY - skullY;\n\nskullX = skullX + skullFaceX/30;\nskullY = skullY + skullFaceY/30;\n\n //display skull\n image(skullFace,skullX,skullY);\n\n // Move the clown by moving it 1/10th of its current distance from the mouse\n\n // Calculate the distance in X and in Y\n var xDistance = mouseX - clownImageX;\n var yDistance = mouseY - clownImageY;\n\n\n // Add 1/10th of the x and y distance to the clown's current (x,y) location\n clownImageX = clownImageX + xDistance/10;\n clownImageY = clownImageY + yDistance/10;\n\n\n\n // Display the clown image\n image(clownImage,clownImageX,clownImageY);\n\n //display alien\n image(alienFace,alienX,alienY);\n\n //alien matches mouse position.\n alienX = mouseX;\n alienY = mouseY;\n\n\n\n // green-ish circle moving across the screen\n\n circleColor = color(143, 252, 70);\n fill(circleColor);\n circleX = circleX + 3;\n ellipse(circleX,circleY,150,150);\n\n\n\n}", "updateAmbientLightColor() {\n // Calculate the position on the gradient by looking at the time (0..1, 0.5 = 12:00)\n var h = (this.time.getHours() / 24) * 24;\n var m = this.time.getMinutes();\n\n // Calculate the time step taking minutes into accout aswell\n var hour = (0.5 * (h * 60 + m)) / 360;\n\n // Calculate a position on the gradient (the gradient goes from 0..24)\n var gradientPos = hour * 12;\n\n // Holds two gradient stops, a left one and a right one, encapsulating the gradient slice we're looking at\n var leftStop = -1;\n var rightStop = -1;\n\n // Find the stops by looking at the gradient's keys\n var gradientStops = Object.keys(AMBIENT_COLOR_GRADIENT);\n\n gradientStops.forEach(function(stopValue, stopIndex) {\n // Get the stop\n var stop = parseInt(stopValue);\n\n // Check if a next stop after this exists\n if ((stopIndex + 1) < gradientStops.length) {\n // Parse the next stop\n var nextStop = parseInt(gradientStops[stopIndex+1]);\n \n // Check if the gradient position is inside these boundaries\n if (gradientPos >= stop && gradientPos < nextStop) {\n leftStop = stop;\n rightStop = nextStop;\n }\n } \n // If no next stop exists, we arrived at the end of the gradient\n else {\n // We can loop back to the first gradient stop\n if (gradientPos >= stop) {\n leftStop = stop;\n rightStop = gradientStops[0];\n }\n }\n });\n\n // Get the colors from the two gradient stops\n var color1 = Phaser.Display.Color.ColorToRGBA(AMBIENT_COLOR_GRADIENT[leftStop]);\n var color2 = Phaser.Display.Color.ColorToRGBA(AMBIENT_COLOR_GRADIENT[rightStop]);\n\n // Calculate the interpolation factor which goes from 0..100 because we've taken 100 interpolation steps\n var interp = ((gradientPos - leftStop) / (rightStop - leftStop)) * 100;\n\n // Now interpolate and get the new color\n var newAmbientColor = Phaser.Display.Color.Interpolate.RGBWithRGB(color1.r, color1.g, color1.b, color2.r, color2.g, color2.b, 100, interp);\n\n // Apply the color to the scene's ambient light\n window.game.scene.lights.setAmbientColor(Phaser.Display.Color.GetColor(newAmbientColor.r, newAmbientColor.g, newAmbientColor.b));\n }", "static get BlendNone() {\n\n return 0; //do not blend\n }", "lighten(factor = 0.1) {\n this.addEffect(new Effects.Lighten(factor));\n }", "function roundOver(currentWorm)\r\n{\r\n\tyMarker = 0;\r\n\tif(winningWorm == 0) \r\n\t\tplaySound(\"red\");\r\n\telse if(winningWorm == 1) \r\n\t\tplaySound(\"blue\");\r\n\telse if(winningWorm == 2) \r\n\t\tplaySound(\"green\");\r\n\telse if(winningWorm == 3) \r\n\t\tplaySound(\"purple\");\r\n\telse if(winningWorm == 4) \r\n\t\tplaySound(\"cyan\");\r\n\telse if(winningWorm == 5) \r\n\t\tplaySound(\"yellow\");\r\n\tstart();\r\n}", "function illuminateRed() {\n clearLights();\n document.getElementById('stopLight').style.backgroundColor = \"red\";\n}", "function loadGlowDefs(defs) {\n loadGlow(defs, 0.0, 0.0, 0.7, 'blue-glow');\n loadGlow(defs, 1.0, 1.0, 0.3, 'yellow-glow');\n }", "function brighten(amt) {\r\n\tamt = (amt > 1) ? 1 : amt;\r\n\tamt = (amt < -1) ? -1 : amt;\r\n\tamt = ~~(255 * amt);\r\n\tloadPixels();\r\n\tfor (var y = 0; y < height; y++) {\r\n\t\tfor (var x = 0; x < width; x++) {\r\n\t\t\tvar i = (x + y * width) * 4;\r\n\t\t\tpixels[i] += amt;\r\n\t\t\tpixels[i+1] += amt;\r\n\t\t\tpixels[i+2] += amt;\r\n\t\t}\r\n\t}\r\n\tupdatePixels();\r\n}", "function brewBeer() {\n if (gameData.grain >= 1) {\n gameData.beer += gameData.beerPerClick\n gameData.grain = (gameData.grain - 1)\n showGameData();\n }\n}", "function draw() {\n/*\n //nobody\n fill(0);\n stroke(15);\n line(300, 200, 300, 400);\n ellipse(300, 200, 30, 30);\n line(300, 250, 250, 200);\n */\n\n\n\n //draw clouds\n background(146, 255, 238, 160);\n cloud(x3, y3, 30, 30);\n cloud(310 + a, 10, 30, 30);\n scale(0.8, 0.8);\n cloud(200 + a * 2, 20, 30, 30);\n x3 = x3 + 10;\n if (x3 > 450) {\n x3 = -80;\n }\n a = a + 20;\n if (a > 200) {\n a = -400;\n }\n\n // grass with varies height and color change, maybe try using array/for loop/draw randomly/custom function\n //left bush\n noStroke(0);\n fill('#A6FF39');\n triangle(o-120, 500, o- 80, 500, z-50 , k-50 );\n triangle(o-70, 400, o- 80, 500, z-30 , k-30 );\n triangle(o-50, 400, o-80, 500, z , k );\n \n\n \n \n\n\n grass(30, 40);\n grass(30, 30);\n grass(40, 100);\ngrass(30, 300);\n grass(20, 350);\n grass(40, 200);\n grass(60, 400);\n \n //right bush\nnoStroke(0);\n fill('#A6FF39');\n triangle(o, 550, o+100, 700, z+50, k+50 );\ntriangle(o, 600, o+80, 700, z+80, k+80 );\n triangle(o, 700, o+50, 700, z+100, k+100 );\n triangle(o, 700, o+50, 700, z+130, k+130 );\n triangle(o, 700, o+60, 800, z+140, k+140 );\n triangle(o, 700, o+50, 700, z+150, k+150 );\n\n\n//farleft bush\n noStroke(0);\n fill('#A6FF39');\ntriangle(o-130, 450, 0- 40, 600, z-30 , k-30 );\ntriangle(o-200, 500, 0-50, 700, z-30 , k-30 );\n\n\n //setting up the coordinates of the third vertex, such that the vertex moves in an arc\n //triangle grass\n noStroke(0);\n fill('#A6FF39');\n\n z = o + 15 + r * sin(b); //here the o axis moves along a circle of r radius \n k = 400 - r * cos(b); //here k axis moves along a circle of r radius\n triangle(o, 500, o + 30, 500, z, k);\n triangle(o, 500, o + 30, 500, z + 20, k + 20);\n triangle(o, 500, o + 30, 500, z - 20, k - 20);\n triangle(o, 500, o + 30, 500, z - 50, k - 40);\n\n b = 0.6 * t - 0.5 * 0.01 * t * t;\n t = t + 0.04;\n if (b > (PI / 5)) {\n t = 0;\n b = 0;\n\n \n /*\n noStroke();\ncolorMode(HSB, 100);\n ellipse(mouseX,mouseY,20,20);\nfor (q = 0; q < 100; q++) {\n for (q = 0; q < 100; q++) {\n stroke(q, j, 100);\n point(q, j);\n \n function mouseIsPressed(){\n background(146, 255, 238, 160);\n }\n }\n \n */\n\n }\n/*\n //bouncing ball\n fill(\"#D81C0E\");\n noStroke();\n ellipse(l1, l2, 15, 15);\n\n l1 = l1 + l1speed;\n l1speed = l1speed + l2gravity;\n\n if (l2 > height) {\n l1speed = l1speed * -1;\n\n l2 = height;\n }\n */\n}", "function blend(j, k) {\n return blend_beats(i, j, k)\n }", "function ShadowGenerator(mapSize,light){var _this=this;// Members\nthis._filter=ShadowGenerator.FILTER_NONE;this.blurScale=2;this._blurBoxOffset=0;this._bias=0.00005;this._lightDirection=BABYLON.Vector3.Zero();this.forceBackFacesOnly=false;this._darkness=0;this._transparencyShadow=false;this._viewMatrix=BABYLON.Matrix.Zero();this._projectionMatrix=BABYLON.Matrix.Zero();this._transformMatrix=BABYLON.Matrix.Zero();this._worldViewProjection=BABYLON.Matrix.Zero();this._currentFaceIndex=0;this._currentFaceIndexCache=0;this._useFullFloat=true;this._light=light;this._scene=light.getScene();this._mapSize=mapSize;light._shadowGenerator=this;light._markMeshesAsLightDirty();// Texture type fallback from float to int if not supported.\nvar textureType;var caps=this._scene.getEngine().getCaps();if(caps.textureFloat&&caps.textureFloatLinearFiltering&&caps.textureFloatRender){this._useFullFloat=true;textureType=BABYLON.Engine.TEXTURETYPE_FLOAT;}else{this._useFullFloat=false;textureType=BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;}// Render target\nthis._shadowMap=new BABYLON.RenderTargetTexture(light.name+\"_shadowMap\",mapSize,this._scene,false,true,textureType,light.needCube());this._shadowMap.wrapU=BABYLON.Texture.CLAMP_ADDRESSMODE;this._shadowMap.wrapV=BABYLON.Texture.CLAMP_ADDRESSMODE;this._shadowMap.anisotropicFilteringLevel=1;this._shadowMap.updateSamplingMode(BABYLON.Texture.BILINEAR_SAMPLINGMODE);this._shadowMap.renderParticles=false;this._shadowMap.onBeforeRenderObservable.add(function(faceIndex){_this._currentFaceIndex=faceIndex;});this._shadowMap.onAfterUnbindObservable.add(function(){if(!_this.useBlurExponentialShadowMap){return;}if(!_this._shadowMap2){_this._shadowMap2=new BABYLON.RenderTargetTexture(light.name+\"_shadowMap\",mapSize,_this._scene,false,true,textureType);_this._shadowMap2.wrapU=BABYLON.Texture.CLAMP_ADDRESSMODE;_this._shadowMap2.wrapV=BABYLON.Texture.CLAMP_ADDRESSMODE;_this._shadowMap2.updateSamplingMode(BABYLON.Texture.BILINEAR_SAMPLINGMODE);_this._downSamplePostprocess=new BABYLON.PassPostProcess(\"downScale\",1.0/_this.blurScale,null,BABYLON.Texture.BILINEAR_SAMPLINGMODE,_this._scene.getEngine(),false,textureType);_this._downSamplePostprocess.onApplyObservable.add(function(effect){effect.setTexture(\"textureSampler\",_this._shadowMap);});_this.blurBoxOffset=1;}_this._scene.postProcessManager.directRender([_this._downSamplePostprocess,_this._boxBlurPostprocess],_this._shadowMap2.getInternalTexture());});// Custom render function\nvar renderSubMesh=function renderSubMesh(subMesh){var mesh=subMesh.getRenderingMesh();var scene=_this._scene;var engine=scene.getEngine();// Culling\nengine.setState(subMesh.getMaterial().backFaceCulling);// Managing instances\nvar batch=mesh._getInstancesRenderList(subMesh._id);if(batch.mustReturn){return;}var hardwareInstancedRendering=engine.getCaps().instancedArrays!==null&&batch.visibleInstances[subMesh._id]!==null&&batch.visibleInstances[subMesh._id]!==undefined;if(_this.isReady(subMesh,hardwareInstancedRendering)){engine.enableEffect(_this._effect);mesh._bind(subMesh,_this._effect,BABYLON.Material.TriangleFillMode);var material=subMesh.getMaterial();_this._effect.setFloat2(\"biasAndScale\",_this.bias,_this.depthScale);_this._effect.setMatrix(\"viewProjection\",_this.getTransformMatrix());_this._effect.setVector3(\"lightPosition\",_this.getLight().position);if(_this.getLight().needCube()){_this._effect.setFloat2(\"depthValues\",scene.activeCamera.minZ,scene.activeCamera.maxZ);}// Alpha test\nif(material&&material.needAlphaTesting()){var alphaTexture=material.getAlphaTestTexture();_this._effect.setTexture(\"diffuseSampler\",alphaTexture);_this._effect.setMatrix(\"diffuseMatrix\",alphaTexture.getTextureMatrix());}// Bones\nif(mesh.useBones&&mesh.computeBonesUsingShaders){_this._effect.setMatrices(\"mBones\",mesh.skeleton.getTransformMatrices(mesh));}if(_this.forceBackFacesOnly){engine.setState(true,0,false,true);}// Draw\nmesh._processRendering(subMesh,_this._effect,BABYLON.Material.TriangleFillMode,batch,hardwareInstancedRendering,function(isInstance,world){return _this._effect.setMatrix(\"world\",world);});if(_this.forceBackFacesOnly){engine.setState(true,0,false,false);}}else{// Need to reset refresh rate of the shadowMap\n_this._shadowMap.resetRefreshCounter();}};this._shadowMap.customRenderFunction=function(opaqueSubMeshes,alphaTestSubMeshes,transparentSubMeshes){var index;for(index=0;index<opaqueSubMeshes.length;index++){renderSubMesh(opaqueSubMeshes.data[index]);}for(index=0;index<alphaTestSubMeshes.length;index++){renderSubMesh(alphaTestSubMeshes.data[index]);}if(_this._transparencyShadow){for(index=0;index<transparentSubMeshes.length;index++){renderSubMesh(transparentSubMeshes.data[index]);}}};this._shadowMap.onClearObservable.add(function(engine){if(_this.useExponentialShadowMap||_this.useBlurExponentialShadowMap){engine.clear(new BABYLON.Color4(0,0,0,0),true,true,true);}else{engine.clear(new BABYLON.Color4(1.0,1.0,1.0,1.0),true,true,true);}});}", "function raiseShield(level)\n{\n player.imgElement.classList.add(\"shielded\");\n player.shielded = true;\n\n shieldCooldown = 100*level;\n weaponCooldown = 150*level;\n}", "function fadeIn() {\n\n if (ctx.globalAlpha < 1) {\n ctx.globalAlpha += 0.001;\n paint(); }\n }", "function trail(){\n\tvar num = 10\n trailGridSize(num);\n $('.square').css(\"background-color\", \"#CFCFCF\")\n $('.square').hover(function () {\n $(this).css(\"background-color\", \"#CFCFCF\")\n $(this).fadeTo(\"fast\",0.5, function(){$(this).fadeTo(\"fast\", 1)\n });\n });\n}", "function swordImpact(power : float) {\n\t//fastBloodSpawner.transform.eulerAngles.z = transform.eulerAngles.z + 90;\n\tswordBloodSpawner.transform.position = transform.position;\n\tswordBloodSpawner.Emit(5);\n\t\n\tdamage(power*Time.deltaTime);\n}", "function draw() {\n\n // Move the felt image down by increasing its y position\n feltTextureImageY += 1;\n rectX += 1.5;\n\n // Display the felt image\n image(feltTextureImage,feltTextureImageX,feltTextureImageY);\n\n // Move the clown by moving it 1/10th of its current distance from the mouse\n\n // Calculate the distance in X and in Y\n var xDistance = mouseX - clownImageX;\n var yDistance = mouseY - clownImageY;\n // Add 1/10th of the x and y distance to the clown's current (x,y) location\n clownImageX = clownImageX + xDistance/10;\n clownImageY = clownImageY + yDistance/10;\n\n // Display the clown image\n image(clownImage,clownImageX,clownImageY);\n\n //Display the moving rect\n fill(255,255,255,50);\n stroke(0,0,0,50);\n rect(rectX,rectY,width/5,height);\n\n // Start the added img exactly where the mouse is\n imgAddedX = mouseX;\n imgAddedY = mouseY;\n imgAdded.height = 50;\n imgAdded.width = 50;\n // Display the added image 1\n image(imgAdded,imgAddedX,imgAddedY);\n\n\n //Setting up and display added img 2\n xDistance = mouseX - imgAdded2X;\n yDistance = mouseY - imgAdded2Y;\n //Add 1/30th of the x and y distance to the clown's current (x,y) location\n imgAdded2X = imgAdded2X + xDistance/30;\n imgAdded2Y = imgAdded2Y + yDistance/30;\n\n //Display added img 2\n image(imgAdded2,imgAdded2X,imgAdded2Y);\n\n // Move the Sin img according to the sin wave\n imgSinX += 0.75;\n imgSinY = height/2 + amplitudeMultiplier * Math.sin(imgSinX * frequency);\n\n //Display sin img\n image(imgSin,imgSinX,imgSinY);\n}" ]
[ "0.77231836", "0.6952363", "0.6822934", "0.68209517", "0.6775819", "0.65353125", "0.63898504", "0.63600284", "0.6336795", "0.63015604", "0.6251064", "0.6248621", "0.6217673", "0.6123779", "0.61117685", "0.6064038", "0.60639983", "0.6039543", "0.60394305", "0.60371625", "0.6034236", "0.60107934", "0.595248", "0.5949677", "0.5913978", "0.5909043", "0.5907647", "0.5906747", "0.5901314", "0.58556175", "0.5844034", "0.58226234", "0.5819022", "0.5812006", "0.5802824", "0.57925916", "0.5789534", "0.57780725", "0.57562554", "0.5747451", "0.57464266", "0.57431966", "0.5734289", "0.57329875", "0.57219905", "0.57102966", "0.56935483", "0.5690726", "0.56825507", "0.56787455", "0.56705934", "0.5669331", "0.56626374", "0.56601447", "0.5654102", "0.56482625", "0.56349856", "0.56188667", "0.56184053", "0.5608185", "0.5597029", "0.5585832", "0.5584541", "0.55782", "0.55750453", "0.5574168", "0.5573354", "0.55481786", "0.5548146", "0.5541339", "0.554041", "0.5539116", "0.5535451", "0.55223453", "0.55095786", "0.5505751", "0.5499813", "0.549606", "0.549252", "0.548489", "0.5472104", "0.54649824", "0.546334", "0.5459832", "0.5459388", "0.5455194", "0.54551584", "0.54407793", "0.54401785", "0.5438095", "0.54374194", "0.5436803", "0.5432268", "0.54320055", "0.5424664", "0.5424651", "0.5416298", "0.5413632", "0.54112875", "0.5410192" ]
0.68668896
2
Updates the monitor with information
updateStats() { if (this.visualize) { var ncount = document.getElementById("ncount"); ncount.innerHTML = "Neutron count: " + this.neutrons.length; var meanHeat = document.getElementById("meanHeat"); meanHeat.innerHTML = "Mean heat: " + this.getMeanHeat(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doUpdate () {\n\t\tif (! this.isDisplayConditionActive) {\n\t\t\tthis.setPaused (false);\n\t\t\tthis.clearStage ();\n\t\t\treturn;\n\t\t}\n\t\tconst monitorstatus = App.systemAgent.agentControl.getLocalAgent ().lastStatus.monitorServerStatus;\n\t\tif ((typeof monitorstatus != \"object\") || (monitorstatus == null)) {\n\t\t\tthis.setPaused (false);\n\t\t\tthis.clearStage ();\n\t\t\treturn;\n\t\t}\n\t\tthis.monitorStatus = monitorstatus;\n\t\tif (this.stage == \"\") {\n\t\t\tthis.setStage (Initializing);\n\t\t}\n\t}", "function updateInformation() {\n\t\tupdateBattery();\n\n\t}", "function mainMonitor() {\n // queueDisk.addEvent() listen.... todo\n onNewDevEvent(() => {\n console.warn(\"newDevEvent\");\n\n // //step1 get new dev info and update view\n // sendGlobalUpdate();//global view update(from store)\n //\n // //setp check2 ntfs and update\n // if (action === NTFS_Mount) {\n // workerDisk.autoMount(function () {\n // sendGlobalUpdate();//global view update again\n // });\n // }\n })\n\n}", "update() {\n\t\tbus.emit('Server:Update', this)\n\t\tif (this.Vars._displayStatusMessage) {\n\t\t\tthis.Vars._displayStatusMessage = false\n\t\t}\n\t\tthis.log('Updating Server Info')\n\t}", "function updateWatch() {\n updateTime();\n }", "function updateWatch() {\n updateTime();\n updateDate(0);\n }", "function updateOutput() { //\n\tfor (var i = 1; i <= numMonitors; i++) { //updates all output for only the monitors that are show\n\t\tcheckIfCustom(i);\n\t\tupdateResolution(i);\n\t\tdrawMonitor(i); //with animation\n\t\tdisplaySize(i);\n\t\tdisplayHeight(i);\n\t\tdisplayWidth(i);\n\t\tdisplayArea(i)\n\t\tdisplayAspectRatio(i);\n\t\tdisplayResolution(i);\n\t\tdisplayPixels(i);\n\t\tdisplayPPI(i);\n\t\tsearchMonitor(i);\n\t}\n displayTotalNumPixels();\n displayTotalWidth();\n displayTotalArea();\n \n displayTotalMonitorsCost();\n displayTotalSetupCost();\n}", "update() {\r\n this.sendDetail();\r\n }", "function update() {\n\tIPC.sendToHost('api-call', '/daemon/version', 'version');\n\t\n\tupdating = setTimeout(update, 50000);\n}", "function refreshInfo() { \t \n everyone.now.setStatus(statusv);\n\t upSongNum();\n\t setTimeout(upPlaylist(everyone),350);\n }", "function updateScreen(){\n\tconsole.log(\"update screen\");\n\tObject.keys(state.stops).forEach(function(item){\n\t\tgetDataFromApi(item.substring(2), updateData);\n\t});\n\tdisplayData();\n}", "function monitor() {\n window.clearInterval(pollingInterval);\n pollingInterval = window.setInterval(function () {\n conversations.refresh(function () {\n monitor();\n });\n }, settings.getPollRate() * 60 * 1000);\n }", "update() {\n this.poll();\n }", "function updateRobotStatus (updatedData) {\n updatedData['Time'] = new Date();\n updatedData['Arduino Attached'] = serverStatus.hasArduino;\n \n socket.broadcast.emit('robot status', { 'data': updatedData });\n}", "function timeUpdateListener() {\n setMedia();\n try {\n if (media) adjustRealInfo.show(media);\n } catch(e) {\n console.log(e);\n }\n }", "_onUpdateDisplay() {}", "function updateInfo(e) {\n\tconst { gamepad } = e;\n\t$('#cont-area').attr('data-original-title','Connected');\n\t$('#cont-area').removeClass('bg-danger');\n\t$('#cont-area').addClass('bg-success');\n\t//$('#joystick').addClass('d-none');\n\tgamepadTimer = setInterval(sendMovementValues, 100); \n}", "function updateHealthMonitor(request, response, appData) {\n logutils.logger.debug('updateHealthMonitor');\n updateHealthMonitorCB(request, appData, function(error, results) {\n commonUtils.handleJSONResponse(error, response, results);\n });\n}", "update() {\n /* istanbul ignore else */\n queueWatcher(this)\n }", "function updateScreen() {\n _currSec = truncAtTwo(_currSec + _secPerRow);\n _progress = getProgress();\n updateProgress();\n drawCanvas();\n checkIfCompleted();\n }", "function updateMonitoringData () {\n // Get HTML elements where results are displayed\n // ...\n}", "statusUpdates(world, time) {}", "function updateDisplay(info) {\n\n display.innerHTML = info;\n\n }", "getMonitorInfo(params, cb) {\n util.getMyWindowIdentifier((myWindowIdentifier) => {\n if (!params.windowIdentifier) {\n params.windowIdentifier = myWindowIdentifier;\n }\n this.routerClient.query(\"Launcher.getMonitorInfo\", params, function (err, response) {\n if (cb) {\n cb(err, response.data);\n }\n });\n });\n }", "UpdateMetrics() {\n }", "function Monitor (params) {\n params = params || {};\n this.interval = params.interval || 60000;\n this.url = params.url || 'http://api.ihackernews.com/page';\n this.debug = params.debug || false;\n\n // Keep a signature of the last news, to compare\n this.newsSignature = '';\n\n this.timeout = null;\n this.running = false;\n}", "function addMonitor() {\n\tif (numMonitors >= maxNumMonitors) {\n\t\talert(\"This tool has a limit of \" + maxNumMonitors + \" monitors\");\n\t} else {\n\t\t$(\"#monitorBox\" + ++numMonitors).fadeIn(400);\n\t\t$(\"#monitorBox\" + numMonitors).css(\"display\", \"inline-block\");\n\t\tdisplayTotalNumPixels();\n displayTotalWidth();\n displayTotalArea();\n displayTotalMonitorsCost();\n displayTotalSetupCost();\n\t}\n}", "_pushMonitors () {\n this.monitorBlocks.runAllMonitored(this);\n }", "deviceUpdate () {\n this.channel && this.deviceSN && this.channel.publish(`device/${this.deviceSN}/info`, JSON.stringify({\n lanIp: Device.NetworkAddr('lanip'),\n llIp: Device.NetworkAddr('linklocal'),\n version: Device.SoftwareVersion(),\n name: Device.deviceName()\n }))\n }", "function updateStats() {\n\t$(\"#stats\").text(JSON.stringify(ozpIwc.metrics.toJson(),null,2));\n}", "update() {\n for( let sName in this.oIdMap ){\n this[sName].webContents.send('efm-window-update', this.oIdMap);\n }\n }", "function update() {}", "monitor() {\n this.init();\n }", "function statusUpdate() {\n console.log(\"Session Seconds: \" + sessionSeconds);\n console.log(\"Short Break Seconds: \" + shortBreakSeconds);\n console.log(\"Long Break Seconds: \" + longBreakSeconds);\n console.log(\"Paused: \" + paused);\n console.log(\"Seconds Left: \" + seconds_left);\n console.log(\"Current Timer: \" + currentTimer);\n console.log(\"Temp Session Seconds: \" + tempoarySessionSeconds);\n console.log(\"Temp Short Break Seconds: \" + tempoaryShortBreakSeconds);\n console.log(\"Temp Long Break Seconds: \" + tempoaryLongBreakSeconds);\n}", "update() {\n for( let sName in this.oInstances ){\n this[sName].webContents.send('es-window-update', this.oIdMap);\n }\n }", "function update() {\n controls.update();\n stats.update();\n }", "update(info) {\n this.setLandingInfoDisplayed(info.closestPlanetDistance < GameConfig.SHOW_LANDING_INFO);\n\n this.topLeftUI.update(info);\n if (info.uiMessage) {\n this.message.setMessage(info.uiMessage);\n this.message.setVisible(true);\n }\n\n _.each(this.indicators, (indicator) => {\n indicator.update(getIndicatorPos(indicator, 700, 500, info.rocket), distancePoints(indicator.point, info.rocket));\n });\n }", "function on_ui_update (args) {\n var info = args[0];\n console.log(\"on_ui_update() event received with: \" + info);\n showFeedback(info['success']['message'])\n }", "function updateCurrentValues() {\n var status = document.getElementById(\"device-status\");\n status.innerHTML = devicesValues[currentDevice];\n }", "function updateElectron() {\n if (state.window.title !== state.prev.title) {\n state.prev.title = state.window.title\n ipcRenderer.send('setTitle', state.window.title)\n }\n if (state.dock.progress.toFixed(2) !== state.prev.progress.toFixed(2)) {\n state.prev.progress = state.dock.progress\n ipcRenderer.send('setProgress', state.dock.progress)\n }\n if (state.dock.badge !== state.prev.badge) {\n state.prev.badge = state.dock.badge\n ipcRenderer.send('setBadge', state.dock.badge || 0)\n }\n}", "async update() {}", "notify() {\n this.observer[0].update(this.state);\n }", "function updateDisplay() {\n\t$(\"#launched\").text(\"Application launched: \" + launched_count);\n}", "function update() {\n\t\t\n\t}", "function AbrirMonitor()\n{\t \n //Monitor de impresiones\n if(ventana_monitor== null)\t\t\t\n ventana_monitor=\"VentanaMonitor\";\n}", "update() {\n\t\tif(this.checkWin()){\n\t\t\tthis.logWin();\n\t\t} else {\n\t\t\tthis.render();\n\t\t}\n\t}", "deviceUpdate () {\n this.channel && this.deviceSN && this.channel.publish(`device/${ this.deviceSN }/info`, JSON.stringify({ \n lanIp: Device.networkInterface().address,\n name: Device.deviceName()\n }))\n }", "function updateDisplay() {\n\t/*$(\"#launched\").text(\"Application launched: \" + launched_count);\n\t$(\"#resumed\").text(\"Application paused: \" + paused_count);\n\t$(\"#paused\").text(\"Application resumed: \" + resumed_count); //A fucntion to update the display when an event happens*/\n\t\n\tdocument.getElementById (\"launched\").innerHTML = \"Application launched: \" + launched_count;\n\tdocument.getElementById (\"resumed\").innerHTML = \"Application paused: \" + paused_count;\n\tdocument.getElementById (\"paused\").innerHTML = \"Application resumed: \" + resumed_count;\n}", "function update() {\n\n\tupdateFocus();\n\tupdateFamilyTooltip();\n\tupdateHighlights();\n}", "function update(){\r\n updateBackground();\r\n //extractData();\r\n loop();\r\n // checkStatus();\r\n \r\n}", "function update() {\n updateBodyCostDisplay();\n updateAddedComponentDisplay();\n updateBodyStringDisplay();\n updateComponentCountDisplay();\n updateComponentCountTable();\n updateProgressBar();\n }", "function update(args) {\n\tMainwinObj.update(args);\n}", "update() {\n this._checkEvents();\n }", "function backgroundInfoUpdater(milliseconds) {\n\tsetInterval(function() {\n\t\tlet boolChecker;\n\t\tboolChecker==null ? boolChecker = true : boolChecker = false;\n\t\tinfo.update = function() {\n\t\t\tthis._div.innerHTML = // +=\n\t\t\t\t'<div class=\"backendlogs\">' +\n\t\t\t\t'<p><b>Key' + document.getElementById('hiddenHandlerKeys').innerText + '</b></p>';\n\t\t\t\t'<b>' + boolChecker + '<br/>' + '</b>';\n\t\t\t\t// infoUpdaterCounter.toString()\n\t\t\t\t'</div>'\n\t\t\t;\n\t\t};\n\t\t// infoUpdaterCounter++;\n\t}, milliseconds);\n}", "function updateInfo() {\n\t\t\tr3e.getDriversInfo(function(data) {\n\t\t\t\tvar drivers = [];\n\t\t\t\tvar foundFastest = false;\n\t\t\t\tvar usersIndex = null;\n\t\t\t\tdata.driversInfo.forEach(function(driver, i) {\n\t\t\t\t\tif (driver.slotId === UI.state.focusedSlot) {\n\t\t\t\t\t\tusersIndex = i;\n\t\t\t\t\t\treturn drivers.push(driver);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (usersIndex) {\n\t\t\t\t\tdrivers.push(data.driversInfo[usersIndex-1]);\n\t\t\t\t}\n\n\t\t\t\tvar jobs = [];\n\t\t\t\tdrivers.forEach(function(driver) {\n\t\t\t\t\tjobs.push(function(done) {\n\t\t\t\t\t\tUI.batch({\n\t\t\t\t\t\t\t'vehicleInfo': function(done) {\n\t\t\t\t\t\t\t\tr3e.getVehicleInfo({\n\t\t\t\t\t\t\t\t\t'slotId': driver.slotId\n\t\t\t\t\t\t\t\t}, done);\n\t\t\t\t\t\t\t},\n 'pushToPassInfo': function(done) {\n r3e.getPushToPassInfo({\n 'slotId': UI.state.focusedSlot\n }, done)\n },\n\t\t\t\t\t\t\t'extendedInfo': function(done) {\n\t\t\t\t\t\t\t\tr3e.getExtendedInfo({\n\t\t\t\t\t\t\t\t\t'slotId': driver.slotId\n\t\t\t\t\t\t\t\t}, done);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, function(data) {\n\t\t\t\t\t\t\tdriver.vehicleInfo = data.vehicleInfo;\n\t\t\t\t\t\t\tdriver.extendedInfo = data.extendedInfo;\n\t\t\t\t\t\t\tdriver.pushToPassInfo = data.pushToPassInfo;\n\t\t\t\t\t\t\tdone(driver);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tUI.batch(jobs, function(data) {\n\t\t\t\t\tself.setState({\n\t\t\t\t\t\t'driversInfo': data\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function update(value){\n screen.innerText = value;\n}", "function updateScreen() {\n document.getElementById('screen').innerHTML = activeNumber;\n}", "updateDisplay() {\n const ttDisplay = this.player_.getChild('textTrackDisplay');\n\n if (ttDisplay) {\n ttDisplay.updateDisplay();\n }\n this.saveSettings();\n }", "function update() {\n\t\t\t\t\t\t\t\t$timeout(\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\tvar headerObj = {\n\t\t\t\t\t\t\t\t\t\t\t\t'accept' : 'application/json'\n\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\tvar devices = Restangular\n\t\t\t\t\t\t\t\t\t\t\t\t\t.all('sensors');\n\t\t\t\t\t\t\t\t\t\t\tdevices\n\t\t\t\t\t\t\t\t\t\t\t\t\t.get(\"sensor_battery_soc\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{}, headerObj)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.then(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfunction(response) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// $scope.value\n\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// device.status.SinglePhaseActivePowerMeasurementState[0].value.split('\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ')[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$scope.value = parseFloat(response.result.sensor_value);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfindType($scope.value)\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\tupdate();\n\t\t\t\t\t\t\t\t\t\t}, 2000);\n\t\t\t\t\t\t\t}", "update(signal) {\n\t\tlet result;\n\t\twhile ((result = signal.getResult()) != null) {\n\t\t\tif (this.Sensors !== undefined && typeof result !== 'string' && result != null && result.valid) {\n\t\t\t\tlet tz = this.driver.homey.clock.getTimezone();\n\t\t\t\tlet when = result.lastupdate.toLocaleString(this.driver.homey.i18n.getLanguage(), { timeZone: tz });\n\t\t\t\tlet whenUTC = result.lastupdate; // UTC\n\t\t\t\tlet pid = result.pid || result.protocol;\n\t\t\t\tlet did = pid + ':' + result.id + ':' + (result.channel || 0);\n\t\t\t\tif (this.Sensors.get(did) === undefined) {\n\t\t\t\t\tthis.Sensors.set(did, { raw: { data: {} } });\n\t\t\t\t\tsignal.debug('Found a new sensor. Total found is now', this.Sensors.size);\n\t\t\t\t}\n\t\t\t\tlet current = this.Sensors.get(did).raw;\n\t\t\t\t// Check if a value has changed\n\t\t\t\tlet newdata = false;\n\t\t\t\tlet newvalue = {\n\t\t\t\t\t...result,\n\t\t\t\t\tdata: current.data\n\t\t\t\t};\n\t\t\t\tfor (let c in result.data) {\n\t\t\t\t\tif (result.data[c] !== newvalue.data[c]) {\n\t\t\t\t\t\tnewdata = true;\n\t\t\t\t\t\tnewvalue.data[c] = result.data[c];\n\t\t\t\t\t\tlet cap = capability[c];\n\t\t\t\t\t\tif (cap !== undefined) {\n\t\t\t\t\t\t\tlet val = this._mapValue(c, newvalue.data[c]);\n\t\t\t\t\t\t\tthis.emit('value:' + did, cap, val)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.emit('update:' + did, when, whenUTC);\n\n\t\t\t\t// Determine the sensor type based on its values\n\t\t\t\tnewvalue.type = this._determineType(newvalue.data);\n\t\t\t\tif (newvalue.type !== undefined) {\n\t\t\t\t\tsignal.debug('Sensor value has changed:', newdata);\n\n\t\t\t\t\t// Add additional data\n\t\t\t\t\tnewvalue.count = (current.count || 0) + 1;\n\t\t\t\t\tnewvalue.newdata = newdata;\n\n\t\t\t\t\tlet device = this.Devices.get(did)\n\t\t\t\t\tlet name = newvalue.name\n\t\t\t\t\tif (device) {\n\t\t\t\t\t\tname = device.getName()\n\t\t\t\t\t}\n\n\t\t\t\t\t// Update the sensor log\n\t\t\t\t\tlet display = {\n\t\t\t\t\t\tprotocol: signal.getName(),\n\t\t\t\t\t\ttype: genericType[newvalue.type].txt[this.locale] || genericType[newvalue.type].txt.en,\n\t\t\t\t\t\ticon: genericType[newvalue.type].icon,\n\t\t\t\t\t\tname: name,\n\t\t\t\t\t\tchannel: (newvalue.channel ? newvalue.channel.toString() : '-'),\n\t\t\t\t\t\tid: newvalue.id,\n\t\t\t\t\t\tupdate: when,\n\t\t\t\t\t\tdata: newvalue.data,\n\t\t\t\t\t\tpaired: this.Devices.has(did)\n\t\t\t\t\t}\n\t\t\t\t\tthis.Sensors.set(did, { raw: newvalue, display: display });\n\t\t\t\t\t//signal.debug(this.Sensors);\n\t\t\t\t\t// Send an event to the front-end as well for the app settings page\n\t\t\t\t\tthis.driver.homey.api.realtime('sensor_update', Array.from(this.Sensors.values()).map(x => x.display));\n\t\t\t\t} else {\n\t\t\t\t\tsignal.debug('ERROR: cannot determine sensor type for data', newvalue);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function updateDisplay(){\n const display = document.querySelector('.calculator-screen');\n // update the value of screen from displayValue in calculator object\n display.value = calculator.displayValue;\n}", "function dashboardUpdateAll() {\n\t\tdashboardSet('stars', whiteStar + whiteStar + whiteStar);\n\t\tdashboardSet('tally', 0);\n\t\tdashboardSet('reset', semicircleArrow);\n\t\tdocument.getElementsByClassName('current-timer')[0].innerHTML = \"00:00\";\n}", "function initInfo() {\n updateProgress(0)\n updateData(0, 0, 0, 0)\n updatePeer(0)\n}", "function updateScreen() {\n toScreen = inputs.join(\"\");\n if (toScreen.includes(\"*\") || toScreen.includes(\"/\")) {\n $(\"#screen\").html(robotToHuman());\n } else {\n $(\"#screen\").html(toScreen);\n }\n }", "function startStatusUpdates(){\n if(!pound.userOptions.printStatusUpdateEveryNseconds){return;}\n var intervalCount = 1;\n pound.statusUpdateIntervalId = setInterval(function(){\n console.log('============= status update %s ==================', intervalCount++);\n printTotals();\n }, pound.userOptions.printStatusUpdateEveryNseconds * 1000);\n\n }", "function update () {\n\t\t\t$(\".wins\").html(\"Wins: \" + wins); // displays wins to page\n\t\t\t$(\".losses\").html(\"Losses: \" + losses); // displays losses to page\n\t\t}", "function populateMonitors(){\n $.get('/monitoring', function(data){\n if(data['error']){\n \t$('#enableMonitoring').val(\"False\");\n $('#monitors').css('display', 'none');\n \t$('#monitoringWarning').css(\"display\", \"\");\n \tconfig['monitoring'] = false;\n \twriteUpdate(true);\n }\n else{\n $('#hostMonitors').empty();\n for(var key in data){\n $('#hostMonitors').append('<tr><td>'+key+'</td><td>'+data[key]['status']+'</td><td>'+data[key]['uptime']+'</td><td>'+data[key]['users']+'</td><td>'+data[key]['1min']+', '+data[key]['5min']+', '+data[key]['15min']+'</td></tr>');\n }\n }\n });\n}", "update() {\n\t\tthis.dev.controlTransfer(0xb2, 0x06, 0, 0, 128).then((status) => {\n\t\t\tif(status.length != 128) {\n\t\t\t\treturn this.error(`Status size error. Received: ${status.length}`);\n\t\t\t}\n\t\t\tthis.parseStatus(status);\n\t\t});\n\t}", "function update() {\n // ... no implementation required\n }", "update() {\n this._updated = true;\n let now = new Date().getTime();\n if (now > this._lastDumpTime + this._interval) {\n try {\n this.dump();\n }\n catch (ex) {\n // Todo: decide what to do\n }\n }\n }", "_triggerUpdated() {\n\t if (!this.updating) {\n\t this.updating = true;\n\t const update = () => {\n\t this.updating = false;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-updated', this);\n\t };\n\t if (this._checkSync()) {\n\t update();\n\t }\n\t else {\n\t setTimeout(update);\n\t }\n\t }\n\t }", "function updateStats(ui, stats) {\n ui.headMovements.text('Track Movement: ' + stats.trackMovement);\n ui.averageTime.text('Average Wait Time: ' + Math.round(stats.averageWait));\n}", "function updatePosition() {\n\tcheckConnection();\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n console.log(\"geolocation start: \" + watchID);\n}", "notify(){\n /**\n * Informs listeners that file system received new data\n * @event DirService#update\n * @type void\n */\n this.emit( \"update\" );\n }", "function initialize() {\n monitor();\n }", "update() {\n let pos = CosmoScout.state.pointerPosition;\n if (pos !== undefined) {\n this._pointerContainer.innerText =\n `${CosmoScout.utils.formatLongitude(pos[0]) + CosmoScout.utils.formatLatitude(pos[1])}(${\n CosmoScout.utils.formatHeight(pos[2])})`;\n } else {\n this._pointerContainer.innerText = ' - ';\n }\n\n pos = CosmoScout.state.observerLngLatHeight;\n if (pos !== undefined) {\n this._userContainer.innerText =\n `${CosmoScout.utils.formatLongitude(pos[0]) + CosmoScout.utils.formatLatitude(pos[1])}(${\n CosmoScout.utils.formatHeight(pos[2])})`;\n } else {\n this._userContainer.innerText = ' - ';\n }\n\n if (CosmoScout.state.observerSpeed !== undefined) {\n this._speedContainer.innerText = CosmoScout.utils.formatSpeed(CosmoScout.state.observerSpeed);\n }\n }", "update() {\n if (this.energy <= 0) {\n this.element.innerHTML = this.name + \" has run away because you don't know how to take care of anything.\";\n } else {\n this.energy--;\n this.report();\n this.element.innerHTML = this.name + \" has \" + this.energy + \" energy.\";\n }\n }", "function monitor(){\n\t\t\twakeWatch.unbind(wakeEvents, wake).bind(wakeEvents, wake);\n\t\t\tvar myCookie = e2.getCookie('lastActiveWindow');\n\t\t\tif (e2.now() - lastActive > e2.sleepAfter * 60000 ||\n\t\t\t\t(!e2.isChatterlight && myCookie && myCookie != windowId)) zzz('sleep');\n\t\t}", "startObserving() {\r\n this.counter = 0;\r\n document.getElementById(\"log-panel\").value = \"\";\r\n document.getElementById(\"text\").value = \"Reload!\" + \"\\n\";\r\n document.getElementById(\"help-panel\").value = \"Initializing...\";\r\n }", "function update_displays() {\n dispAperture.innerHTML = \"\" + apertureList[apertureIndex];\n dispShutter.innerHTML = \"\" + shutterList[shutterIndex];\n dispIso.innerHTML = \"\" + isoList[isoIndex];\n }", "function updateNotify()\n{\n\n\t\tif( get[ 'msg' ] == 'update' )\n\t\t{\n\n\t\t\t\tnotifySuccess( 'El menú <b>' + get[ 'element' ] + '</b> ha sido modificado correctamente.' );\n\n\t\t}\n\n}", "function updateLockScreenTime() {\n\n\tif ($(\".lockscreenopened\").length > 0) { // Lockscreen not open? No need to keep track of time here\n\t\tconsole.log(\"well bye\");\n\t\treturn;\n\t}\n\n\tvar thedate = new Date(); // Get current date\n\tvar parsetime = thedate.toTimeString().split(\":\"); // Parse time into array\n\tvar parsedate = thedate.toDateString().split(\" \"); // Parse date into array\n\tvar month = os.formatMonth(parsedate[1]); // Format the month (i.e. Jan -> January)\n\n\tlockScreenTimeNode.html(parsetime[0] + \":\" + parsetime[1] + \"<div class='lockscreendate'>\" + parsedate[2] + \" \" + month + \"</div>\"); // Display time and date\n\n\tsetTimeout(updateLockScreenTime,2000); // Update time again after 2 seconds\n}", "function updateInfo(resource) {\n\t// format time using Moment.js\n\tvar time = moment(resource.start.dateTime, moment.ISO_8601).format(\"MMMM Do YYYY, h:mm a\");\n\n\t// cap description at 95 characters, rounded to nearest word\n\tvar description = \"\"\n\tvar word = \"\"\n\tfor (var i = 0; i < 95; i++) {\n\t\tif (resource.description[i] === \" \" || i === resource.description.length) {\n\t\t\tdescription += word;\n\t\t\tword = \" \";\n\t\t} else {\n\t\t\tword += resource.description[i];\n\t\t}\n\t}\n\t// add ellipses if description truncated\n\tif (resource.description.length > 95) {\n\t\tdescription += \"...\"\n\t}\n\t\n\t// update fields\n\tdocument.getElementById('title').innerHTML = resource.summary;\n\tdocument.getElementById('start-time').innerHTML = time;\n\tdocument.getElementById('location').innerHTML = resource.location;\n\tdocument.getElementById('description').innerHTML = description;\n\t\n\t// update values and popup appearance\n\teventSuccess = true;\n\tshow(\"loading-div\", false)\n\tshow(\"event-info\", true);\n\tshow(\"buttons\", true);\n\n\t// Upon button click, execute addEvent function\n\tdocument.getElementById(\"buttons\").addEventListener('click', function () {\n\t\tgapi.client.load('calendar', 'v3', addEvent(resource));\n\t})\n}", "set info(newInfo) {\n\t\tthis._info = newInfo\n\t\tserver.send('update-node-info', {\"id\": this.id, \"info\": this._info})\n\t}", "function startUpdate(){\n updating = true;\n }", "function notifyObservers(request) {\n solarResource.properties = getProperties();\n\n solarResource.notify().catch(\n function(error) {\n debuglog('Failed to notify observers with error: ', error);\n if (error.observers.length === 0) {\n resetLCDScreen();\n }\n });\n}", "function updateCounter (data) {\n const time = getCurrentTime()\n lastUpdateContainer.innerHTML = 'Last updated at: ' + time + ' with data: ' + JSON.stringify(data)\n}", "update_data(obj) {\n // Data result and query info\n const data = obj.json\n const first = obj.first\n const last = obj.last\n const units = obj.units\n const uid = obj.uid\n\n // Track timings\n const timings = obj.timings // from viewer\n timings.buffer_latency = performance.now() - timings.buffer_time\n timings.data_time = performance.now()\n this._last_timings = timings\n\n // State from data-updates. Stored for manual mode layout-saving\n this._last_update = {first: first, last: last, units: units}\n this._needs_custom_update = false\n\n if (this._sync_mode == SyncMode.MANUAL) {\n // Show manual button in a default color to indicate we are no longer stale\n // TODO: This just indicates a refresh. If the global slider/settings has moved SINCE then, we could\n // actually be stale. This is a ui bug that needs to be fixed using a global settings version number\n // or something like that.\n this.jheader.find('#sync-manual').addClass('selected')\n }\n this.remove_status_msg(BaseWidget.STALE)\n this.jheader.find('#sync-manual').removeClass('selected-warning')\n this.jheader.find('#sync-manual').html(BaseWidget.MANUAL_BUTTON_TEXT_DEFAULT)\n this.jheader.removeClass('stale')\n\n this.num_data_updates++\n this.on_update_data(data, obj)\n }", "connectedCallback() {\n this._update();\n }", "draw() {\r\n // ask for the old alerts\r\n for (var severity of [\"info\", \"warning\", \"alert\", \"value\"]) {\r\n // set the link to the widget\r\n $(\"#notification_\"+severity+\"_link\").attr(\"href\", \"#__notifications\"+\"=\"+severity.toUpperCase())\r\n // retrieve the counter from the database\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET_COUNT\"\r\n message.args = severity\r\n message.set(\"timeframe\", \"last_24_hours\")\r\n message.set(\"scope\", \"alerts\")\r\n gui.sessions.register(message, {\r\n })\r\n this.send(message)\r\n }\r\n // subscribe for new alert\r\n this.add_broadcast_listener(\"+/+\", \"NOTIFY\", \"#\")\r\n // ask for manifest files needed for notifying about available updates\r\n this.listener = this.add_manifest_listener()\r\n }", "function updateDisplays() {\n $(\"#wins-text\").text(wins);\n $(\"#losses-text\").text(losses);\n $(\"#crystal-core-text\").text(crystalValue);\n }", "function updatePosition() {\n\t\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n}", "updateStatus(){\n getStatus();\n }", "notifyChange() {\n this.triggerEvent(new MediaCaptureEvent('change', this));\n }", "function updateStatus(errorMessages, warningMessages, infoMessages) {\n $(\"#info-box\").html(\"\");\n if (errorMessages != null && errorMessages.length > 0) {\n $(\"#info-box\").append(printErrorMessages(errorMessages));\n showInvalidIcon(errorMessages.length);\n } else if (warningMessages != null && warningMessages.length > 0) {\n $(\"#info-box\").append(printMessages(warningMessages));\n showWarningIcon(warningMessages.length);\n } else {\n $(\"#info-box\").slideUp(200);\n showValidIcon();\n }\n\n if (infoMessages != null && infoMessages.length > 0) {\n $(\"#info > .precision\").html(infoMessages[0]).css(\"display\", \"inline\");\n if (infoMessages[1] !== undefined) {\n $(\"#info > .recall\").html(infoMessages[1]).css(\"display\", \"inline\");\n } else {\n $(\"#info > .recall\").css(\"display\", \"none\");\n }\n if (infoMessages[2] !== undefined) {\n $(\"#info > .measure\").html(infoMessages[2]).css(\"display\", \"inline\");\n } else {\n $(\"#info > .measure\").css(\"display\", \"none\");\n }\n $(\"#info\").css(\"display\", \"block\");\n }\n}", "onUpdateAvailable(info) {\n var self = this;\n\n this.updateEntry = new TextEntry(\"Update available\", \"A new version of XenonTrade (<span>v\" + info.version + \"</span>) is available.<br /><i class='fas fa-arrow-right'></i> <span data-update='download'>Update now</span>\", {icon: \"fa-box blue\"});\n this.updateEntry.add();\n\n $(\".entry[data-id='\" + this.updateEntry.getId() + \"']\").find(\"[data-update='download']\").click(function() {\n ipcRenderer.send(\"download-update\");\n $(\".menu\").find(\"[data-button='download']\").show();\n\n self.updateEntry.setTitle(\"Downloading <span>v\" + info.version + \"</span>...\");\n self.updateEntry.setText(\"\");\n self.updateEntry.enableClose(false);\n });\n }", "_refresh() {\r\n\t\tthis._lastUpdateCount = this._alertModel.getUpdateCount();\r\n\r\n\t\tthis._div.innerHTML = \"\";\r\n\t\tconst alerts = this._alertModel.getCurrentAlerts();\r\n\t\tfor(let i = 0; i < alerts.length; ++i) {\r\n\t\t\tthis._addAlert(alerts[i]);\r\n\t\t}\r\n\t}", "static tickUiUpdate() {\n // Fill badge data\n let updateParcel = {\n text: \"\",\n color: \"#d352ad\",\n tooltip: \"\"\n };\n\n this.setUpdateObjTexts(updateParcel);\n\n // Apply to UI\n if (this.networkOk) {\n this.applyBadgeConfig(updateParcel);\n }\n\n this.updatePopupUi(updateParcel);\n }", "function updateReporter(time){\n\t\n if(showReporter){\n\n\t\tvar posi=JSON.parse(httpGet(reporterPosiSource)); //Two dimensional array with reporter position\n\n\t\tfor(var i=0;i<posi.length;i++){\n\t\t\tif(typeof(reporterMap[posi[i][0].mac])=='undefined'){\n\t\t\t\n\t\t\t\treporterMap[posi[i][0].mac]=new reporterMarker(posi[i][0]);\n // console.log(reporterMap);\n\t\t\t\t// console.log(\"Add\");\n\t\t\t}else{ \n\t\t\t\treporterMap[posi[i][0].mac].setPosi({\"lat\":parseFloat(posi[i][0].lat),\"lng\":parseFloat(posi[i][0].long)}); \n\t\t\t\treporterMap[posi[i][0].mac].time=parseInt(posi[i][0].ts);\n reporterMap[posi[i][0].mac].rssi=parseInt(posi[i][0].rssi);\n\t\t\t\t// console.log(reporterMap);\n\t\t\t\t// console.log(posi[i][0]);\n\t\t\t}\n\t\t}\n\t\t\n\t}else{\n\n\t\t// Clear memory\n\t\tfor(var key in reporterMap){\n\t\t\treporterMap[key].marker.setMap(null);\n\t\t}\n\t\treporterMap={};\n\t\t\n\t}\n \n window.setTimeout(\"updateReporter(\"+time+\")\",time);\n}", "function updateStats() {\n let contents = \"Restarts: \" + restarts;\n $(\"#restarts\").text(contents);\n\n contents = \"Endings: \" + endings.length + \"/\" + TOTAL_ENDINGS;\n $(\"#totalEndings\").text(contents);\n}" ]
[ "0.66343194", "0.66332155", "0.64013964", "0.6381926", "0.6253539", "0.624404", "0.6030699", "0.60276973", "0.5897045", "0.582892", "0.5816831", "0.58063763", "0.5788189", "0.5759749", "0.57371235", "0.5726047", "0.57059234", "0.5676226", "0.56720674", "0.5654307", "0.5652041", "0.56274146", "0.56094974", "0.55886155", "0.5584128", "0.5582702", "0.5559134", "0.5548441", "0.55425084", "0.551745", "0.5511645", "0.5509829", "0.54977924", "0.5496409", "0.547933", "0.5476994", "0.5473763", "0.545802", "0.5451052", "0.5444811", "0.54401165", "0.54231447", "0.5409077", "0.54017526", "0.54013985", "0.5381643", "0.53690237", "0.5367567", "0.5353136", "0.5350722", "0.5348872", "0.5345637", "0.53239274", "0.5309894", "0.5303285", "0.53027743", "0.5300528", "0.5278289", "0.5269123", "0.52615565", "0.5260769", "0.5257892", "0.52578175", "0.5241198", "0.5241023", "0.52393544", "0.5235952", "0.5235025", "0.5234105", "0.52280664", "0.52268857", "0.5215338", "0.5202698", "0.5201982", "0.520012", "0.5199964", "0.51996624", "0.519724", "0.51923555", "0.5182235", "0.515478", "0.515443", "0.51518047", "0.515088", "0.51236176", "0.5123385", "0.51123506", "0.5106227", "0.5105825", "0.5099383", "0.5097867", "0.50930583", "0.50914943", "0.509096", "0.5089574", "0.50871813", "0.50800604", "0.5079792", "0.507788", "0.5074981" ]
0.5376478
46
Here it searches for an email
function contact_response(response,extension) { var doc = new DOMParser() .parseFromString(response.responseText, "text/html"); var i,j, email_val, my_match; if(extension===undefined) extension=''; console.log("in contact_response "+response.finalUrl); var short_name=response.finalUrl.replace(my_query.url,"");//.replace(/[\/]+/g,""); var links=doc.links,email_matches=doc.body.innerHTML.match(email_re); var phone_matches=doc.body.innerText.match(british_phone_re); var replacement=response.finalUrl.match(/^https?:\/\/[^\/]+/)[0]; console.log("replacement="+replacement); var temp_url,curr_url; if(email_matches!==null) { j=0; console.log("email_matches="+JSON.stringify(email_matches)); for(j=0; j < email_matches.length; j++) { if(!MTurk.is_bad_email(email_matches[j]) && email_matches[j].length>0) { my_query.fields.email=email_matches[j]; // document.getElementsByName("Email ")[0].value=my_query.email; break; } } console.log("Found email hop="+my_query.fields.email); } if(phone_matches) { my_query.fields.phoneNumber=phone_matches[0]; } for(i=0; i < links.length; i++) { // console.log("i="+i+", text="+links[i].innerText); if(extension==='') { if(/(Contact|About|Privacy)/i.test(links[i].innerText) && !/^\s*mailto/i.test(links[i].href)) { console.log("blunk"); // console.log(my_query.url.match(/https?:\/\/[^\/]+/)); curr_url=links[i].href; temp_url=window.location.href.replace(/\/$/,""); while(temp_url.split("/").length>=3) { links[i].href=links[i].href.replace(temp_url,replacement); temp_url=temp_url.replace(/\/[^\/]+$/,""); console.log("link="+links[i].href+", temp_url="+temp_url); } let new_link=links[i].href; if(!my_query.queryList.includes(new_link)) { my_query.queryList.push(new_link); console.log("*** Following link labeled "+links[i].innerText+" to "+new_link); get_page(new_link, contact_response,"NOEXTENSION"); } } } //if(my_query.fields.email.length>0) break; if(links[i].dataset.encEmail!==undefined) { console.log("### "+links[i].dataset.encEmail); let temp_email=MTurkScript.prototype.swrot13(links[i].dataset.encEmail.replace(/\[at\]/,"@")); console.log("### "+temp_email); if(!MTurkScript.prototype.is_bad_email(temp_email)) { my_query.fields.email=temp_email; } } if(links[i].href.indexOf("amazonaws.com")===-1 && links[i].href.indexOf("mturkcontent.com")===-1) { // console.log(short_name+": ("+i+")="+links[i].href); } if(links[i].href.indexOf("cdn-cgi/l/email-protection#")!==-1) { var encoded_match=links[i].href.match(/#(.*)$/); if(encoded_match!==null) { email_val=MTurkScript.prototype.cfDecodeEmail(encoded_match[1]); console.log("DECODED "+email_val); if(!MTurkScript.prototype.is_bad_email(email_val.replace(/\?.*$/,""))) { my_query.fields.email=email_val.replace(/\?.*$/,""); my_query.doneEmail=true; } } } if(email_re.test(links[i].href.replace(/^mailto:\s*/,""))) { email_val=links[i].href.replace(/^mailto:\s*/,"").match(email_re); console.log("Found emailBlop="+email_val); if(email_val.length>0 && !MTurkScript.prototype.is_bad_email(email_val)) { console.log("set email"); my_query.fields.email=email_val; } } if(links[i].href.indexOf("javascript:location.href")!==-1) { my_match=links[i].href.match(/String\.fromCharCode\(([^\)]+)\)/); console.log("my_match="+JSON.stringify(my_match)); var match_split=my_match[1].split(","); email_val=""; for(j=0; j < match_split.length; j++) { email_val=email_val+String.fromCharCode(match_split[j].trim()); } //email_val=String.fromCharCode(my_match[1]); console.log("new email_val="+email_val); my_query.fields.email=email_val; } if(links[i].href.indexOf("javascript:DeCryptX(")!==-1) { my_match=links[i].href.match(/DeCryptX\(\'([^\)]+)\'\)/); console.log("my_match="+JSON.stringify(my_match)); email_val=MTurkScript.prototype.DecryptX(my_match[1]); console.log("new email_val="+email_val); my_query.fields.email=email_val; } if(/^tel:/.test(links[i].href)) { my_query.fields.phoneNumber=links[i].href.replace(/^tel:/,""); console.log("Found phone="+my_query.fields.phoneNumber); } } console.log("my_query="+JSON.stringify(my_query)); if(my_query.fields.email.length>0 && document.getElementById("email").value.length===0) { document.getElementById("email").value=my_query.fields.email; /* if(!my_query.submitted) { my_query.submitted=true; check_and_submit(check_function,automate); }*/ } if(extension==='') { my_query.doneWeb=true; } else { my_query.doneQueries++; } add_to_sheet(); submit_if_done(); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailSearch(email) {\n desk.get('cases/search/',{email: email, sort_field:'created_at', sort_direction: 'desc'}, function(error, data) {\n if (data._embedded.entries.length > 0) {\n caseAttachment(data._embedded.entries[0].id)\n } else if (data._embedded.entries.length < 1) {\n empty()\n } else {\n help()\n }\n });\n }", "function searchEmail(email){\n var x; \n if (validateEmail(email)) {\n x = true;\n } else {\n x = false;\n }\n callHerokuApi(x,\"email=\", email); \n }", "function testEmailSearch(){\n searchEmail('[email protected]'); // invalid\n\t searchEmail(\"[email protected]\"); // valid entry\n\t searchEmail(null); // invalid entry\n\t searchEmail(1); // invalid entry\n }", "function emailSearch(emailIn) {\n for (id in users) {\n if (users[id].email == emailIn){\n return true;\n }\n }\n return false;\n}", "function findByEmail(email, callback) {\n var sql_search_by_email = 'select id, email, nickname, gender, text, imagepath, need, ' +\n 'position_id, genre_id, city_id, town_id, password ' +\n 'from user ' +\n 'where email = ?';\n\n var user = {};\n\n if (email === undefined) {\n return callback(null, null);\n }\n else {\n dbPool.getConnection(function (err, dbConn) {\n if (err) {\n return callback(err);\n } else {\n dbConn.query(sql_search_by_email, [email], function (err, result) {\n dbConn.release();\n if (err) {\n return callback(err);\n } else {\n if (result[0] === undefined) {\n // no such email\n callback(new Error('there is no user have such email'));\n } else {\n user.id = result[0].id;\n user.email = result[0].email;\n user.nickname = result[0].nickname;\n user.gender = result[0].gender;\n user.text = result[0].text;\n user.imagepath = result[0].imagepath;\n user.position_id = result[0].position_id;\n user.genre_id = result[0].genre_id;\n user.city_id = result[0].city_id;\n user.town_id = result[0].town_id;\n user.need = result[0].need;\n user.password = result[0].password;\n callback(null, user);\n }\n }\n });\n }\n });\n }\n}", "function lookupEmail (email) {\n for (let key in users) {\n if (email === users[key].email){\n return users[key];\n }\n }\n return false;\n}", "function emailChecker (email){\n for (id in users) {\n if (email === users[id].email){\n return users[id]\n } \n }\n return false;\n}", "function findUserEmail (email) {\n let found = \"\";\n\n for (let key in users) {\n if (users[key].email === email) {\n found = key\n }\n }\n return found\n}", "function find_email(str, pstr){\n // alert(arr[0].emailt)\n // alert(arr[0].passwordt)\n let status = true;\n for( let i = 0; i<arr.length;i++){\n if((arr[i].emailt == str) && (arr[i].passwordt ==pstr)){\n status = true;\n break;\n \n }else{\n \n status = false;\n }\n }\n return status;\n }", "function checkEmail() {}", "function emailChecker (email) {\n for (id in users){\n if (email === users[id].email){\n return true;\n }\n }\n return false;\n}", "function emailChecker(email) {\n\tvar x = email.toLowerCase;\n\tvar y = x.split(\"\");\n\tvar alphabet = [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\tif ( y[0] ) {}\n}", "async function find_email(email) {\n return new Promise((res, rej) => {\n con.query(\n `select * from Admin where email = ?`,\n [email],\n async (err, row, field) => {\n if (err) rej(err);\n // console.log(\"+++++++++++\");\n // console.log(row[0].email);\n res(row);\n }\n );\n }).catch((error) => {\n assert.isNotOk(error, 'Promise error');\n done();\n });;\n }", "function email (s) {\n\t return low.string(s) &&\n\t /^.+@.+\\..+$/.test(s)\n\t}", "function emailLookup(userEmail, users) {\n for (user in users) {\n if (userEmail === users[user][\"email\"]) {\n return true;\n }\n }\n return false;\n}", "function inspectEmail(email) {\n return regEx.test(String(email).toLowerCase());\n}", "function isEmail(e){\r\n var atSymbol = e.indexOf(\"@\");\r\n if(atSymbol<1) return true;\r\n var dot =e.lastIndexOf(\".\");\r\n if(dot<=atSymbol+2) return true;\r\n if(dot=== e.length-1) return true;\r\n \r\n return false;\r\n}", "function checkEmail(n)\r\n{\r\n\treturn n.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/)!=-1?!0:!1\r\n\t\r\n}", "async function findEmail(email) {\n return await this.findOne({ email })\n}", "async getByEmail(email, lid) {\n let [res,] = await this.db.query(`SELECT * FROM om_xlista_${lid} WHERE email LIKE ?`, [email])\n .catch(errorHandler.catchThrow.call(this, `No se encontro suscriptor con el email ${email} en la lista ${lid}`));\n\n return res && res[0]\n ? res[0]\n : null;\n }", "function chkcorreo1() {\r\nvar mydata = document.getElementById(\"correo1\");\r\n\tvar position = mydata.value.search(/[a-z]+\\.?[a-z]+?[0-9]?*@[a-z]+\\.[com|edu]/);\r\n\t\r\n\tif(position != 0) {\r\n\t\talert(\"El correo entrado esta en un formato incorrecto.\\nSolo aceptamos dominios .com o .edu.\\nIntente de nuevo.\");\r\n\t\tmydata.select();\r\n\t\tmydata.focus();\t\t\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function checa_email(campo) {\r\n\tvar mensagem = \"Informe corretamente endereco e-mail\"\r\n\tvar msg = \"\";\r\n\tvar email = /^\\w+[\\+\\.\\w-]*@([\\w-]+\\.)*\\w+[\\w-]*\\.([a-z]{2,4}|\\d+)$/i\r\n\r\n\tvar returnval = email.test(campo)\r\n\tif (returnval == false) {\r\n\t\tmsg = mensagem;\r\n\t}\r\n\r\n\treturn msg;\r\n}", "function checkEmail(usersDB, email, callback){\n usersDB.find({Email:email}, function(err, doc){\n if(!err && doc.length > 0){\n console.log(\"emial: \",doc);\n callback(false);\n } else {\n callback(true);\n }\n });\n}", "function emailChecker(storedEmail, reqEmail, callback){\n if (storedEmail === reqEmail){\n callback();\n };\n}", "function getNameinEmail(email)\n{\n var t = email.split('@');\n return t[0]; \n}", "function getNameinEmail(email)\n{\n var t = email.split('@');\n return t[0]; \n}", "function comprobarEmailSearch( campo, size ) {\n var email = /^[a-zñ0-9]*@?([ña-z]*.)*(es|org|com)?$/;\n if(!comprobarExpresionRegular(campo,email,size)){//comprueba que la expresión enviada en email sea cumplida por el campo enviado si no lo hace devuelve false\n return false;\n }else {\n campo.style.border = \"2px solid green\";\n return true;\n }\n}", "function checkEmail(email)\n { \n let passed = false;\n for (let i = 0; i < email.length; ++i) {\n if (email[i] == \"@\" && i != 0 && i != email.length-1) {\n passed = true;\n }\n }\n return passed;\n }", "function email(string) {\n return /.+@.+\\..+/.test(string);\n }", "function checkEmail(mail) {\n var k = mail;\n for (var i = 0; i < k.length; i++)\n if ((k[i] == '@') || (k[i] == '.') || (k[i] == '_'))\n return true;\n return false;\n}", "function emailExists(email: string, callback: GenericCallback<boolean>) {\n email = email.toLowerCase();\n getUIDFromMail(email, function (error, username) {\n callback(error, username !== null);\n });\n}", "function esEmail(email) {\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(String(email).toLowerCase());\n}", "function isEmail(text) {\n\n var words = text.toLowerCase();\n var urlRegex = /(([^<>()[\\]\\\\.,;:\\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 var match;\n\n if(match = urlRegex.exec(words)) {\n return true;\n }\n return false;\n}", "function emailTest(email){ // create function emailTest assign email parameter\n var userName = /(^[a-zA-Z])[a-zA-Z0-9_]+@[a-zA-Z0-9]+\\.[a-zA-Z]{1,}$/ // var userName tests the email to verify the input. ^ checks that the first characters are letters. then it tests that the \n \t\t\t\t\t// letters can be capital or lower case, that there is an @ sign, that the next charcters are letters (capital and lower)\n if (check.test(email)){ //next checks that there is a dot, then letters (again capital and lower) the 1 makes sure there is a least letter after the dot\n \talert(\"true\"); \t\t// check.test varifies the email input by user, if it \n } else{\t\t\t\t\t// email address has all of input varified, an alert will \n \talert(\"false\"); \t// display true, if not, the alert will says false\n }\n}", "function filterEmailsByDomain() {\n\n}", "function checkemail(data,callback)\n{\n console.log(\"entered email :\"+ data);\n var query='select email from info where email =\"'+data+'\"';\n con.query(query,function(err,result,feilds){\n console.log(\"result is\"+result[0]);\n if(result[0]==undefined)\n return callback(false);\n else\n return callback(true);\n })\n}", "getMessage(inbox, subjectText) {\n for (const mail of inbox) {\n const { subject, text, html } = mail;\n if (subject.includes(subjectText)) {\n return h2t.fromString(html, { wordwrap: false });\n }\n }\n throw new Error('Unable to find email');\n }", "function lookUpEmail(email) {\n return new Promise(function (resolve, reject) {\n external_commonjs_vue_commonjs2_vue_root_Vue_default.a.axios.get(\"\".concat(baseURL, \"/users_public?email=\").concat(email)).then(function (data) {\n if (data.data.length) {\n resolve(data.data[0]);\n } else {\n resolve(null);\n }\n }).catch(function (e) {\n console.log('err: ', e);\n reject(e);\n });\n });\n}", "emailExists(email: string, callback) {\n super.query(\n 'SELECT organiser_email as email, \"organiser\" as type FROM organiser WHERE organiser_email = ? UNION SELECT email, \"user\" as type FROM user WHERE email = ?',\n [email, email],\n callback,\n );\n }", "function isEmail($email) {\r\n\t\t\t\t\tconsole.log($email + \" checking email here\");\r\n \t\t\t\t var filter = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\r\n \t\t\t\r\n \t\t\t if (filter.test($email)) {\r\n \t\t\t \t\r\n \t\t\t\treturn true;\r\n \t\t\t\t}\r\n \t\t\t\t else {\r\n \t\t\t\t \r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t\t\t\r\n\t\t\t}", "function getFriendsByEmail(req, res){\n var email = req.params.email;\n MongoClient.connect(\"mongodb://ezplan:[email protected]:13916/ezplan\", function(err, db){\n if(err){ res.send(err)}\n var ret = [];\n db.collection(\"users\").find({\n email: email\n }).forEach(function(doc){\n if(doc.userid != userID){\n ret.push(doc);\n }\n })\n\n setTimeout(function(){\n res.send(ret);\n }, 500);\n\n });\n}", "function is_email(email){ \r\n var emailReg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\r\n return emailReg.test(email); }", "function extractEmails ( text ){\n var myRegexp = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi;\n email = text.match(myRegexp);\n if(email!==null){\n for (var i = 0; i < email.length; i++) {\n var newString = email[i].replace('@','');\n if(i==0){\n emailtransform = '\"'+newString+'\"';\n }else{\n emailtransform = emailtransform + \",\"+'\"'+newString+'\"';\n }\n //students.push(newString);\n }\n }else{\n emailtransform = '';\n }\n \n }", "function isEmail(email){ \n return (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email))\n }", "function filterEmail(email) {\r\n var regex = new RegExp(/^([a-zA-Z0-9_.+-])+\\@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]{2,4})+$/);\r\n return regex.test(email);\r\n }", "function emailQualifies(){\n\t\t\n\t\t// Get the ID of the email holder and store it in emailOption.\n\t\tvar emailOption = document.getElementById(\"email\").value;\n\t\t\n\t\t// Store the email regex checker in a var.\n\t\tvar emailRegex = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n\t\t\n\t\t// Test if the email entered passes the regex test.\n\t\tvar emailValid = emailRegex.test(emailOption);\n\t\t\n\t\t// If its a valid email.. continue,\n\t\tif(emailValid){\n\t\t\treturn true;\n\t\t}\n\t\t// else return an error.\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t} // End emailQualifies.", "function returnGMail() {\n return users.filter(user => {\n return user.email.includes('@google')\n })\n}", "function checkMail(email)\n{\n var str1=email;\n var arr=str1.split('@');\n var eFlag=true;\n if(arr.length != 2)\n {\n eFlag = false;\n }\n else if(arr[0].length <= 0 || arr[0].indexOf(' ') != -1 || arr[0].indexOf(\"'\") != -1 || arr[0].indexOf('\"') != -1 || arr[1].indexOf('.') == -1)\n {\n eFlag = false;\n }\n else\n {\n var dot=arr[1].split('.');\n if(dot.length < 2)\n {\n eFlag = false;\n }\n else\n {\n if(dot[0].length <= 0 || dot[0].indexOf(' ') != -1 || dot[0].indexOf('\"') != -1 || dot[0].indexOf(\"'\") != -1)\n {\n eFlag = false;\n }\n\n for(i=1;i < dot.length;i++)\n {\n if(dot[i].length <= 0 || dot[i].indexOf(' ') != -1 || dot[i].indexOf('\"') != -1 || dot[i].indexOf(\"'\") != -1 || dot[i].length > 4)\n {\n eFlag = false;\n }\n }\n }\n }\n return eFlag;\n}", "function checkMail(email)\n{\n var str1=email;\n var arr=str1.split('@');\n var eFlag=true;\n if(arr.length != 2)\n {\n eFlag = false;\n }\n else if(arr[0].length <= 0 || arr[0].indexOf(' ') != -1 || arr[0].indexOf(\"'\") != -1 || arr[0].indexOf('\"') != -1 || arr[1].indexOf('.') == -1)\n {\n eFlag = false;\n }\n else\n {\n var dot=arr[1].split('.');\n if(dot.length < 2)\n {\n eFlag = false;\n }\n else\n {\n if(dot[0].length <= 0 || dot[0].indexOf(' ') != -1 || dot[0].indexOf('\"') != -1 || dot[0].indexOf(\"'\") != -1)\n {\n eFlag = false;\n }\n\n for(i=1;i < dot.length;i++)\n {\n if(dot[i].length <= 0 || dot[i].indexOf(' ') != -1 || dot[i].indexOf('\"') != -1 || dot[i].indexOf(\"'\") != -1 || dot[i].length > 4)\n {\n eFlag = false;\n }\n }\n }\n }\n return eFlag;\n}", "async readByEmail(email) {\n if (!email) {\n return;\n }\n return await this.firebaseProvider.readByQuery({name : \"email\", value : email}, this.collection);\n }", "function userEmailCheck(input) {\n for (user in users) {\n if (users[user].email === input) {\n return users[user].id;\n }\n }\n return false;\n}", "function fun2(){\n\tvar email = prompt('enter your e-mail');\n\nvar checkEmail = function(email){\n\tvar regExp = /\\w+@[a-zA-Z_].[a-z A-Z]{2,6}/ig;// regexp for check e-mail\n\treturn regExp.test(email); //true if there is a coincidence whith regExp\n\n}\n\n\tconsole.log(checkEmail(email));\n}", "function isEmailAddress( text ) {\nvar email = EMAIL_ADDRESS_PATTERN;\nreturn email.test( text );\n}", "function validarEmail(email) {\n\n var patronArroba = /[@]/;\n\n if (patronArroba.test(email)) { //reviso que exista una @\n\n var dominio = email.split(\"@\")[1]; //divido donde halla una @\n if (dominio == 'gmail.com') {\n return 'success';\n } else {\n return 'dominio';\n }\n\n } else {\n return 'formato';\n }\n\n}", "static async findOne(data) {\n const { email } = data;\n const result = await db.query(\n `SELECT email\n FROM newsletter_emails \n WHERE email = $1`,\n [email]\n );\n return result.rows[0];\n }", "function evaluate_emails(callback) {\n // console.log(\"name=\"+JSON.stringify(my_query.fullname));\n for(i=0;i<my_query.email_list.length;i++) {\n my_query.email_list[i]=my_query.email_list[i].replace(/^[^@]+\\//,\"\").replace(/(\\.[a-z]{3})yX$/,\"$1\"); }\n my_query.email_list.sort(function(a,b) {\n try {\n if(a.split(\"@\")[1]<b.split(\"@\")[1]) return -1;\n else if(a.split(\"@\")[1]>b.split(\"@\")[1]) return 1;\n if(a.split(\"@\")[0]<b.split(\"@\")[0]) return -1;\n else if(a.split(\"@\")[0]>b.split(\"@\")[0]) return 1;\n else return 0;\n }\n catch(error) { return 0; }\n });\n remove_dups(my_query.email_list);\n console.log(\"my_query.email_list=\"+JSON.stringify(my_query.email_list));\n var my_email_list=[],i,curremail;\n my_query.fullname={fname:my_query.fields.firstname,lname:my_query.fields.lastname};\n var fname=my_query.fullname.fname.replace(/\\'/g,\"\"),lname=my_query.fullname.lname.replace(/\\'/g,\"\");\n\n var email_regexps=\n [new RegExp(\"^\"+fname.charAt(0)+\"(\\\\.)?\"+lname+\"@\",\"i\"),new RegExp(\"^\"+fname+\"[\\\\._]{1}\"+lname+\"@\",\"i\"),\n new RegExp(\"^\"+fname+lname.charAt(0)+\"@\",\"i\"),new RegExp(\"^\"+lname+fname.charAt(0)+\"@\",\"i\"),new RegExp(\"^\"+my_query.fullname.fname+\"@\")];\n // Judges the quality of an email\n function EmailQual(email) {\n this.email=email;\n this.domain=email.replace(/^[^@]*@/,\"\");\n this.quality=0;\n if(/wix\\.com/.test(this.email)) return;\n if(/^(info|contact|admission|market)/.test(email)) this.quality=1;\n else this.quality=2;\n if(new RegExp(my_query.fullname.fname,\"i\").test(email)) this.quality=3;\n if(new RegExp(my_query.fullname.lname.substr(0,5),\"i\").test(email)) {\n this.quality=4;\n if(email.toLowerCase().indexOf(my_query.fullname.lname.replace(/\\'/g,\"\").toLowerCase())>0 &&\n my_query.fullname.fname.toLowerCase().charAt(0)===email.toLowerCase().charAt(0)) this.quality=5;\n }\n for(var i=0;i<email_regexps.length;i++) if(email_regexps[i].test(email)) this.quality=6;\n if(this.email.replace(/^[^@]*@/,\"\")===MTP.get_domain_only(my_query.url,true)) this.quality+=5;\n\n }\n for(i=0;i<my_query.email_list.length;i++) {\n // console.log(\"my_query.email_list[\"+i+\"]=\"+typeof(my_query.email_list[i]));\n if(MTP.is_bad_email(my_query.email_list[i])) continue;\n curremail=new EmailQual(my_query.email_list[i].trim());\n if(curremail.quality>0) my_email_list.push(curremail);\n }\n my_email_list.sort(function(a, b) { return b.quality-a.quality; });\n console.log(\"my_email_list=\"+JSON.stringify(my_email_list));\n if(my_email_list.length>0) {\n my_query.fields.email=my_email_list[0].email;\n console.log(\"# Calling callback?=submit_if_done, evaluate_emails length>0\");\n\n callback();\n return true;\n }\n console.log(\"# Calling callback?=submit_if_done, evaluate_emails otherwise\");\n callback();\n }", "function isEmail( field )\r\n {\r\n\ttext = field.value;\r\n\t//alert('inside isEmail');\r\n\tif(isEmpty(field))\r\n\t {\r\n\t\t//alert('Empty Text Box');\r\n\t\treturn true;\r\n\t }\r\n\telse\r\n\t{\r\n\t\t\tvar i;\r\n\t\t\tvar index;\r\n\t\t\tfor( i = 0; i < text.length; i++ )\r\n\t\t\t{\r\n\t\t\t oneChar = text.charAt( i );\r\n\t\t\t if ( ! isCharValid( oneChar, PERIOD|ALPHA|NUMERICS|EMAILAT|DASH|UNDERSCORE|PLUS ) )\r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\tif( ( index = text.indexOf( '@' ) ) == -1 ) \r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\tvar user = text.substring( 0, index );\r\n\t\t\tvar domain = text.substring( index, text.length );\r\n\t\t\tif ( domain.indexOf( '@', 1 ) != -1 ) \r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\tif ( ( ( index = domain.indexOf( '.' ) ) == -1 ) ||( user == \"\" ) )\r\n\t\t\t{\r\n\t\t\t return false ;\r\n\t\t\t}\r\n\t\t\tvar suffix = domain.substring(domain.lastIndexOf('.') +1);\r\n\t\t\t//if(! isTLD(suffix) ){\r\n\t\t\t//\talert(BADEMAIL);\r\n\t\t\t// field.focus();\r\n\t\t\t//\tfield.select();\r\n\t\t\t// return false;\r\n\t\t//\t}\r\n\t\t\twhile( index != -1 )\r\n\t\t\t{\r\n\t\t\t if ( ( index == 0 ) || ( index == domain.length - 1 ) )\r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\t if ( domain.charAt( index + 1 ) == '.' )\r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\t index++;\r\n\t\t\t index = domain.indexOf( '.', index );\r\n\t\t\t}\r\n\t\t\t //alert('Valid Email Id');\r\n\t\t\t return true;\r\n\t}\r\n }", "function checkEmail(email) \n{ \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/; \n if(email.match(mailformat)) \n return true; \n else \n return false;\n}", "function checkEmail(emailField)\r\n{\r\n\r\n var tomatch = /(\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*\\.((com|net|org|edu|in|gov|info|co)))/i\r\n if (!tomatch.test(emailField.value))\r\n {\r\n window.alert(\"Please Enter Valid Email Id\");\r\n emailField.value = \"\";\r\n emailField.focus();\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "checkEmail(req, res, next){\n\n if (req.body.email){\n\n db.query(queries.selectUserWithEmail, [req.body.email], (err, results, fields) => {\n\n if (err) throw err;\n \n if (results.length == 0){\n next();\n } else {\n res.status(400).send(\"Email already exists.\");\n }\n });\n } else {\n \n res.status(400).send(\"Email field is empty.\");\n }\n \n }", "function retrieveUserByEmail(email, callback) {\n retrieveUserByQuery({\"email\": email}, callback);\n}", "function email(){\n var emailReg =/[a-z].*(@)[a-z]*(.)[a-z]{2,}$/;\n var validEmail = document.getElementById('email').value;\n if (emailReg.test(validEmail) === false)\n {\n throw \"invalid email address\";\n }\n }", "function checkMail(em) \r{\r\tvar error = \"\";\r\t\r\t// Valida el email\r\treg = /^(.+)@(.+)\\.(.{2,3})$/;\r\r\tif (!reg.test(em)) \r\t{\r\t\tdocument.getElementById(\"maillabel\").className = \"error\";\r\t\terror = \"<b>Invalid e-mail</b>\";\r\t}\r\r\treturn error;\r}", "function validarEmail(email) {\n if (usuariosList.find(function(item){\n return item[2] == email;\n }) !== undefined) return false;\n if (/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.([a-zA-Z]{2,4})+$/.test(email)){\n return true;\n } else {\n return false;\n }\n\n }", "function findFirstEmail(strList) {\n if (!Array.isArray(strList) || strList.length === 0) return undefined;\n\n const domain = \".com\" || \".vn\" || \".com.vn\";\n const res = strList.filter((x) => {\n if (\n x.indexOf(\"@\") !== x[x.length - 1] &&\n x.slice(x.indexOf(domain)) === domain &&\n x.slice(0, x.indexOf(\"@\")).length > 2 &&\n x.slice(x.indexOf(\"@\"), x.indexOf(domain)).length > 2\n )\n return x;\n });\n return res[0];\n}", "isEmail(value) {\n return new RegExp(\"^\\\\S+@\\\\S+[\\\\.][0-9a-z]+$\").test(\n String(value).toLowerCase()\n );\n }", "function inputAndFormatEmail() {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n return new Promise(resolve => rl.question('Enter Email ', result => {\n rl.close();\n if (i.test(String(result).toLowerCase()) !== true) {\n console.log('Invalid Email');\n return null;\n } else {\n result = 'https://www.' + result.split('@')[1]\n resolve(result);\n }\n }))\n}", "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}", "function findEmailDomain(address) {\n let adSeen = false\n let domain = ''\n for(let i = 0; i < address.length; i++){\n if(address[i] === '@' && adSeen === false){\n adSeen = true\n }else if(address[i] === '@' && adSeen === true){\n domain = ''\n }else if(adSeen === true){\n domain += address[i]\n }\n } \n}", "function testEmail(user, callback) {\n if (user.email) {\n if (/^[a-z0-9._-]+@[a-z0-9._-]+\\.[a-z]{2,6}$/i.test(user.email)) {\n collection.value.aggregate([\n {\n \"$match\": {\n \"email\": user.email\n }\n }\n ]).toArray((err, resultAggr) => {\n if (err) {\n callback(false, \"Une erreur est survenue lors du test de l'adresse e-mail : \" + err)\n } else {\n if (resultAggr.length > 0) {\n callback(false, \"Adresse e-mail déjà utilisé\")\n } else {\n callback(true, \"Autorisation accordé\")\n }\n }\n })\n } else {\n callback(false, \"Le format d'adresse est invalide\")\n }\n\n } else {\n callback(false, \"Aucun adresse e-mail n'est spécifié\")\n }\n}", "async function getEmail(email) {\n return await Emails.findOne({email: email}).exec();\n}", "function findUser(email) {\n const user = users.filter(user => user.email === email)\n return user[0]\n }", "function checkIfEmailExists(email){\n return new Promise((resolve, reject) => {\n r.table(table)\n .filter({ email: email })\n .run()\n .then(response => _.isEmpty(response) ? reject([{param: 'email', msg: 'User not found'}]) : resolve(response))\n .error(err => reject(err));\n })\n}", "function getEmail(url) {\n var qmark = url.indexOf(\"?\");\n var addresses;\n\n if (qmark > mailtolength) {\n addresses = url.substring(mailtolength, qmark);\n } else {\n addresses = url.substr(mailtolength);\n }\n // Let's try to unescape it using a character set\n try {\n addresses = Services.textToSubURI.unEscapeURIForUI(addresses);\n } catch (ex) {\n // Do nothing.\n }\n return addresses;\n}", "async validateEmailInput() {\n this.baseEl.find('.email-exists').removeClass('on');\n this.baseEl.find('.email-invalid').removeClass('on');\n\n let email = this.baseEl.find('.email-input').val();\n\n let result = await User.find(`.findOne({email: '${email}'})`);\n if (result) {\n this.baseEl.find('.email-exists').addClass('on');\n return false;\n }\n let regEx = /\\w\\w+@\\w\\w+\\.\\w\\w+/;\n if (!regEx.test(email)) {\n this.baseEl.find('.email-invalid').addClass('on');\n return false;\n }\n return true;\n }", "function checkE(email) {\r\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(String(email).toLowerCase());\r\n}", "function chkEmail(event) {\r\n\t\r\n\r\n// Get the target node of the event\r\n\r\n var myEmail = event.currentTarget;\r\n\r\n// Test the format of the input email\r\n \r\n var pos = myEmail.value.search(/^[A-Za-z0-9\\.\\-]+\\@[A-Za-z0-9]*\\.*[A-Za-z0-9]*\\.*[A-Za-z0-9]+\\.[A-Za-z0-9]{2,3}$/);\r\n var ext = myEmail.value.search(/\\.{2,}/);\r\n \r\n if (pos != 0 || ext != -1) {\r\n alert(\"The email you entered (\" + myEmail.value +\r\n \") is not in the correct form. \\n\");\r\n myEmail.focus();\r\n myEmail.select();\r\n\treturn false;\r\n } \r\n}", "function findUser(email) {\n return new Promise((resolve, reject) => {\n client.getSchema().then(schema => {\n var userCollection = schema.getTable(TABLE.USERS);\n // Lookup by email\n var results = [];\n let recordMap = RECORD_MAP.USERS;\n userCollection.select().where(\"email = :param\").bind(\"param\", email).execute(row => {\n results.push(recordMap(row));\n }).then(() => {\n resolve(results);\n }).catch(err => {\n // Handle database errors\n console.log(\"Error querying user email.\", err);\n reject(err);\n })\n }).catch(err => { reject(err); });\n });\n}", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(compMail.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function searchFilterSettings(ss, filterHeader, email) {\n var emailCol = filterHeader.indexOf(\"EMAIL\");\n var lastRow = ss.getLastRow();\n var lastColumn = ss.getLastColumn();\n var array = ss.getRange(4, 2, lastRow-3, lastColumn).getValues();\n var designerRow = ss.getRange(4, 2, lastRow-3, lastColumn).getValues().filter(function (row) { return row[emailCol] == email; })[0];\n \n //If email not found return false\n if (designerRow === undefined || designerRow.length < 1) {\n return false;\n }\n else {\n return designerRow;\n }\n}", "function isEmailExist() {\n for (var index = 0; index < signUpContainer.length; index++) {\n if ( signUpContainer[index].userEmail.toLowerCase() == signUpEmail.value.toLowerCase() ) {\n return false\n }\n }\n}", "function validate_email(field,alerttxt)\r\n{\r\n\tif (/^\\w+([\\+\\.-]?\\w+)*@\\w+([\\+\\.-]?\\w+)*(\\.\\w{2,6})+$/.test(field.value))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse \r\n\t{\r\n\t\tshow_it(field,alerttxt)\r\n\t\treturn false;\r\n\t}\r\n}", "function typeOfEmail(eMail) {\n for (let i = 0; i < eMail.length; i++) {\n if (eMail.charAt(i) === \"@\") {\n domain = eMail.substring(i + 1, eMail.length);\n\n if (domain === \"novi-education.nl\") {\n return \"Student\";\n } else if (domain === \"novi.nl\") {\n return \"Medewerker\";\n } else {\n return \"Extern\";\n }\n }\n }\n}", "function ejercicio01(email){\n console.log(email);\n emails = 0;\n if(email == \"[email protected]\" || email == \"[email protected]\" || email == \"[email protected]\")\n {\n return true\n }\n else\n {\n return false;\n }\n}", "async findByEmail(email) {\n try {\n wlogger.silly(\"Enteried cassandra-db/findByEmail()\")\n\n await this.client.connect()\n\n const data = await this.client.execute(`\n SELECT * FROM users WHERE email='${email}'\n `)\n\n //await this.client.shutdown()\n\n //console.log(`users: ${JSON.stringify(data.rows, null, 2)}`)\n return data.rows[0]\n } catch (err) {\n wlogger.error(`Error in cassandra-db/findByEmail()`)\n throw err\n }\n }", "function emailaddresscheck(element)\n{\n\t//alert(emailidvalue);\n\telement=element.toLowerCase();\n\tvar emailfilter =/^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/;\n\n\tif((!(emailfilter.test(element)))) {\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "function checkExistingEmail(email) {\n var flag = false;\n for (let item in databases.users) {\n if(databases.users[item].email === email){\n flag = true;\n userId = databases.users[item].id;\n }\n }\n return flag;\n}", "function CheckMail(InBoxMails)\r\n{\r\n var MailSubject = readTextFile('D2').trim();\r\n\tvar AllMail = new String(InBoxMails);\r\n\tif(AllMail.includes(MailSubject))\r\n\t{\r\n\t\tconsole.log('Mail Received');\r\n\t}\r\n\telse\r\n\t{\r\n\t\tconsole.log('Mail Not Received');\r\n\t}\r\n\t\r\n\t\r\n\t\r\n}", "function checkDB(email, msg) {\n axios.get('https://ift-bot-default-rtdb.firebaseio.com/attendees.json')\n .then((res) => res.data)\n .then((data) => {\n var found = false;\n for (let i = 0; i < data.length; i++) {\n if (email == data[i]) { // success\n msg.channel.send(\"yay\");\n found = true;\n }\n }\n\n if (!found) {\n msg.channel.send(\"boo\");\n throw new Error(\"Email not found\");\n }\n })\n .catch((err) => console.log(\"authentication failed\"));\n}", "function extractEmails(text) {\n return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9._-]+)/gi);\n}", "function checkEmail(){\r\n\t\r\n\t\r\n\t var text = document.getElementById(\"input-email\").value;\r\n \r\n \r\n var batt;\r\n \r\n batt=/^\\w+\\s?\\w{5,20}[@]{1}[gy][ma][ah][io][lo]{1}[.][c][o][m]{1}$/\r\n var b = batt.test(text);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\t\r\n\tif(b){\r\n\t\t\r\n\t\t\r\n\t\tdocument.querySelector(\".check-email\").style.backgroundColor=\"green\";\r\n\t\tdocument.querySelector(\".check-email\").style.border=\"1px solid green\";\r\n\t\tdocument.querySelector(\".valid-email\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".invalid-email\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"invalid-image\").style.display=\"none\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\telse{\r\n\t\tdocument.querySelector(\".check-email\").style.backgroundColor=\"hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".check-email\").style.border=\"1px solid hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".invalid-email\").style.display=\"block\";\r\n\t\tdocument.getElementById(\"invalid-image\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".valid-email\").style.display=\"none\";\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n}", "function checkemail(str){\n\tvar testresults = false;\n\tvar filter=/^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n\t\tif (filter.test(str)){\n\t\t\ttestresults=true;\n\t\t}\n\treturn (testresults);\n}", "function getUser(enteredEmail) {\n for (let user in users ) {\n if (users[user].email === enteredEmail) {\n return users[user];\n }\n } \n return false;\n}", "function validarEmail(email) {\n var expr = /^\\w+([\\.+-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n\n if(email.search(expr) == -1) {\n return false;\n }\n\n return true;\n}", "async function findUserByEmail(eml) {\n\ttry {\n\t\tconst response = await axios.get('http://localhost:3013/rest/account/' + eml);\n\t\treturn response.data;\n\t}catch (err) {\n\t\tconsole.log(\"Can not connect to server.\");\n\t\tconsole.log(err);\n\t}\n}", "function checkEmail(email) {\n for (let id in users) {\n if (email === users[id].email)\n return true;\n }\n return false;\n}", "function gotEmail(emailAddress, title) {\n var md5email = makeMD5(emailAddress);\n var endpoint = 'lists/'+ LIST_ID +'/members/'+ md5email + '/activity';\n var options = {\n \"headers\":{\n \"Authorization\":\"apikey \" + API_KEY\n },\n \"method\":\"GET\",\n \"Content-Type\":\"application/json\",\n \"muteHttpExceptions\" : true\n };\n // call the Mailchimp API\n var response = UrlFetchApp.fetch(ROOT+endpoint, options);\n var data = response.getContentText();\n var json = JSON.parse(data);\n if(response.getResponseCode() !== 200 && json.detail == 'The requested resource could not be found.') {\n return \"Email not found in list\";\n }\n var activity = json.activity;\n var sentCount = 0;\n for(var i = 0; i < activity.length; i++) {\n var singleActivityObject = activity[i];\n if(!singleActivityObject.title) continue;\n if(singleActivityObject.title.indexOf(title) !== -1 && singleActivityObject.action == 'sent') sentCount++;\n }\n return sentCount;\n}", "function userForExistingEmail(email) {\n for (let userKey in users) {\n if (users[userKey].email === email) {\n return users[userKey];\n }\n }\n}", "function GetByEmail(req, res) {\r\n // console.log(\"da el body: \" +req.params.email )\r\n var email = req.params['email'];\r\n console.log(email);\r\n user.findOne({\r\n $or: [\r\n { 'email': email }\r\n ]\r\n })\r\n .populate({\r\n path: 'recipes',\r\n select: 'name -_id'\r\n })\r\n .populate({\r\n path: 'fevRecipes',\r\n select: 'name -_id'\r\n })\r\n .populate({\r\n path: 'shoppingList',\r\n select: 'name -_id'\r\n })\r\n .populate({\r\n path: 'enrolledCourse.course',\r\n select: '-_id',\r\n })\r\n .populate({\r\n path: 'enrolledCourse.visitedSections',\r\n select: '-_id',\r\n })\r\n .populate('badges.badgeid')\r\n .then(_result => res.json(_result))\r\n .catch(_err => res.status(500).send())\r\n}", "function validateEmail(email) \r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function checkEmail(){\r\n \r\n var emailstring = elemail.value;\r\n var positionOfAtTeRate = 0, positionOfDot = 0;\r\n var firstLetterCheck = emailstring[0];\r\n var lastLetterCheck = emailstring[emailstring.length - 1];\r\n var letterCheck; \r\n if(lastLetterCheck == '@' || lastLetterCheck == '.' || firstLetterCheck == '@' || firstLetterCheck == '.' ){\r\n letterCheck = 'invalid';\r\n }\r\n \r\n \r\n for(var i = 0; i < emailstring.length; i++){\r\n \r\n if(emailstring[i] == '@'){\r\n positionOfAtTeRate = i;\r\n }\r\n \r\n if(emailstring[i] == '.'){\r\n positionOfDot = (i - 1);\r\n }\r\n \r\n }\r\n if(positionOfAtTeRate < positionOfDot && letterCheck != 'invalid'){\r\n elemail_feedback.textContent = '';\r\n validations++;\r\n \r\n }else{\r\n \r\n elemail_feedback.textContent = 'Please enter valid E-mail address';\r\n }\r\n}" ]
[ "0.77180046", "0.7529995", "0.72207934", "0.70810175", "0.6808174", "0.67928135", "0.67781824", "0.6744428", "0.6671264", "0.6648262", "0.6627082", "0.6610432", "0.653376", "0.65091103", "0.64861715", "0.6445668", "0.6442297", "0.63982964", "0.6391133", "0.6388537", "0.6378034", "0.6376122", "0.6367589", "0.6363015", "0.63514876", "0.63514876", "0.6349107", "0.63407", "0.6338823", "0.63273466", "0.6308948", "0.63078326", "0.6284927", "0.628414", "0.6271868", "0.6270746", "0.6266011", "0.62523806", "0.6238205", "0.6235055", "0.6233699", "0.62306404", "0.62281865", "0.6225907", "0.62257034", "0.62254834", "0.62225765", "0.62225324", "0.62225324", "0.62157315", "0.62131256", "0.62066525", "0.6194474", "0.6187794", "0.6184872", "0.61756057", "0.61627495", "0.6154472", "0.6154315", "0.615234", "0.61509895", "0.6147384", "0.61454624", "0.6143943", "0.61363", "0.61339456", "0.6124611", "0.6123898", "0.6123612", "0.61164457", "0.6116441", "0.61005366", "0.6100482", "0.60997427", "0.60843015", "0.6082609", "0.607554", "0.6072226", "0.6071166", "0.6070999", "0.6060353", "0.60565954", "0.6049446", "0.60473", "0.6045774", "0.60425067", "0.6037367", "0.6036719", "0.6035633", "0.60284746", "0.6025318", "0.60232323", "0.6019435", "0.60133654", "0.6007521", "0.60056895", "0.59967035", "0.59951794", "0.5992602", "0.5986292", "0.59828216" ]
0.0
-1
Search on bing for search_str, parse bing response with callback
function query_search(search_str, resolve,reject, callback) { console.log("Searching with bing for "+search_str); var search_URIBing='https://www.bing.com/search?q='+ encodeURIComponent(search_str)+"&first=1&rdr=1"; GM_xmlhttpRequest({method: 'GET', url: search_URIBing, onload: function(response) { callback(response, resolve, reject); }, onerror: function(response) { reject("Fail"); }, ontimeout: function(response) { reject("Fail"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },\n ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function query_search(search_str, resolve,reject, callback,type) {\n console.log(\"Searching with bing for \"+search_str+\", try_count[\"+type+\"]=\"+my_query.try_count[type]);\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&first=1&rdr=1\";\n GM_xmlhttpRequest({method: 'GET', url: search_URIBing,\n onload: function(response) { callback(response, resolve, reject,type); },\n onerror: function(response) { reject(\"Fail\"); },ontimeout: function(response) { reject(\"Fail\"); }\n });\n }", "function doSearch(searchTerm, cb) {\n var url = baseUrl + searchTerm;\n request(url, function(error, response, body) {\n if (error) {\n cb(error, null);\n } else {\n var results = parse(body);\n cb(null, results);\n }\n });\n}", "function getSearchResponse(text) {\n // First, get bing :( response\n let res = rp(`https://www.bing.com/search?q=${text}`).then((body) => {\n var soup = new JSSoup(body);\n // Get the regular responses\n var resultsHTML = soup.findAll('li', 'b_algo');\n const DESC_SIZE = 100;\n let results = resultsHTML.slice(0, 4).map(e => {\n let titleHtml = e.find(\"h2\");\n if (titleHtml) {\n let urlHtml = titleHtml.find(\"a\");\n let descHtml = e.find(\"p\") ? e.find(\"p\") : e.find(\"span\");\n if (urlHtml && descHtml) {\n return {\n title: titleHtml.text,\n url: urlHtml.attrs[\"href\"],\n desc: descHtml.text.substring(0, DESC_SIZE - 3) + \"...\"\n }\n } else {\n return null\n }\n }\n }).filter(e => e != null);\n // Get the card, if there is one\n let x = soup.find(\"div\", \"b_entityTP\");\n if (x) {\n // Ensure the card has the right things in it\n let descHtml = x.find(\"div\", \"b_snippet\")\n let urlHtml = x.find(\"div\", \"infoCardIcons\") ? x.find(\"div\", \"infoCardIcons\").find(\"a\") : null;\n let titleHtml = x.find(\"div\", \"b_clearfix\") || x.find(\"h2\"); \n const CARD_DESC_SIZE = 300;\n if (descHtml && urlHtml && titleHtml) {\n results = results.concat({\n type: \"card\",\n desc: descHtml.text.substring(0, CARD_DESC_SIZE - 3) + \"...\",\n url: urlHtml.attrs[\"href\"],\n title: titleHtml.text\n });\n }\n }\n return results;\n });\n return res;\n}", "function textSearch(input){\n var query = {\n key:key.placekey,\n query:input+\" in Hong Kong\",\n // region:\"hk\",\n }\n var options = {\n host: 'maps.googleapis.com',\n path:'/maps/api/place/textsearch/json?'+qs.stringify(query),\n method: 'GET'\n }\n var body = null;\n https.get(options, function(res) {\n // console.log('STATUS: ' + res.statusCode);\n // console.log('HEADERS: ' + JSON.stringify(res.headers));\n // Buffer the body entirely for processing as a whole.\n var bodyChunks = [];\n res.on('data', function(chunk) {\n // You can process streamed parts here...\n bodyChunks.push(chunk);\n }).on('end', function() {\n body = Buffer.concat(bodyChunks);\n var tmp = body.toString('utf8');\n tmp = JSON.parse(tmp);\n for (var item in tmp[\"results\"]){\n // console.log(tmp[\"results\"][item]);\n var json = {};\n json[\"mapID\"] = tmp[\"results\"][item][\"place_id\"];\n json[\"mapName\"] = tmp[\"results\"][item][\"name\"];\n json[\"status\"] = tmp[\"status\"];\n json[\"geometry\"] = tmp[\"results\"][item][\"geometry\"][\"location\"];\n json[\"types\"] = tmp[\"results\"][item][\"types\"];\n savePlace(json);\n }\n });\n });\n}", "function search(pattern, callback) { \n var url= \"/search\";\n if( pattern ) url+= \"?name=\"+pattern; \n get_from_server( url, function(error, result) {\n sys.puts(result); \n callback();\n });\n}", "_blockstackSearch(query){\n console.log('bssearch');\n return null;\n }", "function search(query){\n\n\t$.ajax ({\n\t type: 'GET',\n\t dataType: 'jsonp',\n\t crossDomain: true,\n\t jsonp: 'json_callback',\n\t url: 'http://www.giantbomb.com/api/search/?format=jsonp&resources=game&api_key=' + apikey +'&query=' + encodeURI(query),\n\t complete: function() {\n\t console.log('ajax complete');\n\t },\n\t success: function(data) {\n\t searchCallback(data.results);\n\t console.log(\"Results Finished\");\n\n\t }\n\t});\n\n}", "function search(searchString) {\n if (!searchString || (searchString && searchString.length === 0)) {\n vscode.window.showErrorMessage(\"No search string was entered.\");\n return;\n }\n\n //# async waterfall for control flow\n async.waterfall(\n [\n callback => callback(null, searchString),\n fetchResults,\n processResults,\n displayResults\n ],\n (err, result) =>\n console.log(\n `Error: ${JSON.stringify(err, null, 4)}, Result: ${JSON.stringify(\n result,\n null,\n 4\n )}`\n )\n );\n //# async waterfall for control flow\n}", "function tenorCallback_search(responsetext) {\n // parse the json response\n var response_objects = JSON.parse(responsetext);\n res = response_objects[\"results\"];\n\n // load the GIFs -- for our example we will load the first GIFs preview size (nanogif) and share size (tinygif)\n // document.getElementById(\"preview_gif\").src = top_10_gifs[0][\"media\"][0][\"nanogif\"][\"url\"];\n // document.getElementById(\"share_gif\").src = \n return res[0][\"media\"][0][\"tinygif\"][\"url\"];;\n}", "async function Search__() \r\n {\r\n let cve_id_bein = \"https://cve.circl.lu/api/cve/\";\r\n \r\n const response = await fetch(cve_id_bein + message__);\r\n const data = await response.json();\r\n let json_split = JSON.parse(JSON.stringify(data));\r\n print_search(json_split.id, json_split.summary, json_split.references, json_split.cvss);\r\n }", "function fetchResults(txt) {\n\tconsole.log(searchStr);\n}", "function search(query, cb) {\n // get places matching query (asynchronously)\n var parameters = {\n geo: query\n };\n $.getJSON(\"search.php\", parameters)\n .done(function(data, textStatus, jqXHR) {\n // call typeahead's callback with search results (i.e., places)\n cb(data);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n // log error to browser's console\n console.log(errorThrown.toString());\n });\n}", "function search(query, cb)\n{\n // get places matching query (asynchronously)\n var parameters = {\n geo: query\n };\n $.getJSON(\"search.php\", parameters)\n .done(function(data, textStatus, jqXHR) {\n\n // call typeahead's callback with search results (i.e., places)\n cb(data);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n\n // log error to browser's console\n console.log(errorThrown.toString());\n });\n}", "function search(query, cb)\n{\n // get places matching query (asynchronously)\n var parameters = {\n geo: query\n };\n $.getJSON(\"search.php\", parameters)\n .done(function(data, textStatus, jqXHR) {\n\n // call typeahead's callback with search results (i.e., places)\n cb(data);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n\n // log error to browser's console\n console.log(errorThrown.toString());\n });\n}", "function search(query, cb)\n{\n // get places matching query (asynchronously)\n var parameters = {\n geo: query\n };\n $.getJSON(\"search.php\", parameters)\n .done(function(data, textStatus, jqXHR) {\n\n // call typeahead's callback with search results (i.e., places)\n cb(data);\n })\n .fail(function(jqXHR, textStatus, errorThrown) {\n\n // log error to browser's console\n console.log(errorThrown.toString());\n });\n}", "function search(query){\n\n\t$.ajax ({\n\t type: 'GET',\n\t dataType: 'jsonp',\n\t crossDomain: true,\n\t jsonp: 'json_callback',\n\t url: 'http://www.giantbomb.com/api/search/?format=jsonp&resources=game&api_key=' + apikey +'&query=' + encodeURI(query),\n\t complete: function() {\n\t console.log('ajax complete');\n\t },\n\t success: function(data) {\n\t searchCallback(data.results);\n\t }\n\t});\n\n}", "function search(query){\n\n\t$.ajax ({\n\t type: 'GET',\n\t dataType: 'jsonp',\n\t crossDomain: true,\n\t jsonp: 'json_callback',\n\t url: 'http://www.giantbomb.com/api/search/?format=jsonp&resources=game&api_key=' + apikey +'&query=' + encodeURI(query),\n\t complete: function() {\n\t console.log('ajax complete');\n\t },\n\t success: function(data) {\n\t searchCallback(data.results);\n\t }\n\t});\n\n}", "function doBingSearch(req, res, next){\n\tBing.web(req.query.bingSearch, function (error, ress, body) { \n\t\tres.render('tagsMovie', {\n\t\t\tuser : req.user,\n\t\t\ttagsMovie : null,\n\t\t\ttagsResult : null,\n\t\t\tsearch_results : null,\n\t\t\tbing_search_results: body.d.results,\n\t\t});\n\t}, {\n\t\ttop: 10, \n\t\tskip: 0 \n\t});\n}", "function doSearch(string) {\n $.getJSON(\"https://www.cs.kent.ac.uk/people/staff/lb514/hygiene/hygiene.php\",\n {\n \top: 'searchname',\n name: string\n },\n function(data) {\n \tloadTable(data);\n \t$(\".businesses\").before(\"<p class='result-msg'>Results for businesses with names containing '\" + string + \"':</p>\");\n\t});\n}", "function searchBIT (input) {\n // Requiring moment to format the concert date\n var moment = require(\"moment\");\n // Bands in Town Request\n request(\"https://rest.bandsintown.com/artists/\" + input + \"/events?app_id=codingbootcamp\", function (error, response, body) {\n if (error) {\n console.log(\"An error occured: \" + error)\n } else {\n // console.log(body);\n console.log(\n \"Lineup: \" + JSON.parse(body)[0].lineup +\n \"\\nVenue name: \" + JSON.parse(body)[0].venue.name +\n \"\\nLocation: \" + JSON.parse(body)[0].venue.city +\n \"\\nEvent Date: \" + moment(JSON.parse(body)[0].venue.datetime).format(\"MM/DD/YYYY\")\n );\n };\n })\n}", "function WhereAmI_Meeting_Search_CallBack ( in_response_object )\n\t{\n\t\tvar text_reply = in_response_object.responseText;\n\t\tif ( text_reply )\n\t\t\t{\n\t\t\tg_last_response = in_response_object;\n\t\t\t\n\t\t\teval ( 'var json_obj = '+text_reply );\n\t\t\t\n\t\t\tif ( json_obj )\n\t\t\t\t{\n\t\t\t\tif ( json_obj.length )\n\t\t\t\t\t{\n\t\t\t\t\tload_map ( );\n\t\t\t\t\tg_main_map.response_object = json_obj;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\talert ( c_g_no_meetings_found );\n\t\t\t\t\twindow.history.back();\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\talert ( c_g_server_error );\n\t\t\t\twindow.history.back();\n\t\t\t\t};\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\talert ( c_g_no_meetings_found );\n\t\t\twindow.history.back();\n\t\t\t};\n\t}", "function executeGeoNamesAPISearch(searchterm, callback) {\n //Reach out to GeoNames API\n\n //Encode for URL\n searchterm = encodeURIComponent(searchterm);\n\n var options = {\n host: 'api.geonames.org',\n path: '/search?name=' + searchterm + '&username=' + settings.geonames.username + '&featureClass=A&featureClass=P&type=json',\n method: 'GET',\n port: 80,\n headers: {\n 'Content-Type': 'application/json'\n }\n };\n\n rest.getJSON(options, function (statusCode, result) {\n common.log(\"got geonames result.\");\n callback(statusCode, result)\n }); //send result back to calling function\n }", "function callBing(res, query, key) {\n let host = 'https://api.cognitive.microsoft.com';\n let path = '/bing/v7.0/search';\n let url =host + path + '?mkt=en-us&answerCount=' + 2 + '&q=' + query;\n\n let answercount = '2';\n console.log('Searching the Web for: ' + query); \n let request_params = { \n headers: {\n 'Ocp-Apim-Subscription-Key': key,\n }\n };\n \n axios.get(url, request_params).then(function (response) { \n //Filter out to what we are interested in only\n let data=filterJSONResponse(response['data']['webPages']['value']);\n //console.log(JSON.stringify(data));\n //res.write(JSON.stringify(data)); \n res.render('index', {title : query, message : JSON.stringify(data)}) \n //res.send(JSON.stringify(data));\n });\n }", "function parseSearch(result) {\n if ('isJackett' in config && config.isJackett) {\n // this is a jackett Search Engine\n var output = [];\n if (config.useTorznab) {\n // jackett via torznab returns xml \n var x2js = new X2JS({arrayAccessForm : \"property\"});\n var jsonObj = x2js.xml2json((new DOMParser()).parseFromString(result.data, \"text/xml\"));\n if ('rss' in jsonObj && 'channel' in jsonObj.rss && 'item' in jsonObj.rss.channel) {\n //console.debug(config.name,jsonObj.rss.channel.item_asArray);\n jsonObj.rss.channel.item_asArray.map(function(data) {\n var seeds = null,\n peers = null;\n data.attr_asArray.map(function(attr) {\n if (attr._name === 'seeders') {\n seeds = attr._value;\n }\n if (attr._name === 'peers') {\n peers = attr._value;\n }\n });\n var out = {\n releasename: data.title,\n size: (parseFloat(data.size) / 1000 / 1000).toFixed(2) + ' MB',\n seeders: (seeds != null) ? seeds : 'n/a',\n leechers: (peers != null) ? peers : 'n/a',\n detailUrl: data.guid,\n noMagnet: true,\n noTorrent: true\n };\n var magnet = null;\n if (data.link.indexOf('magnet:?') === 0) {\n magnet = data.link;\n }\n var magnetHash = null;\n if (magnet) {\n out.magnetUrl = magnet;\n out.noMagnet = false;\n magnetHash = out.magnetUrl.match(/([0-9ABCDEFabcdef]{40})/);\n }\n var torrent = null;\n if (data.link.indexOf('http') === 0) {\n torrent = data.link;\n }\n if (torrent) {\n out.torrentUrl = torrent;\n out.noTorrent = false;\n } else if (magnetHash && magnetHash.length) {\n out.torrentUrl = 'http://itorrents.org/torrent/' + magnetHash[0].toUpperCase() + '.torrent?title=' + encodeURIComponent(out.releasename.trim());\n out.noTorrent = false;\n }\n output.push(out);\n })\n }\n } else {\n // jackett via Admin/search returns json\n if ('Results' in result.data && result.data.Results !== output) {\n //console.debug(config.name,result.data.Results);\n result.data.Results.map(function(data) {\n var out = {\n releasename: data.Title,\n size: (parseFloat(data.Size) / 1000 / 1000).toFixed(2) + ' MB',\n seeders: (data.Seeders != null) ? data.Seeders : 'n/a',\n leechers: (data.Peers != null) ? data.Peers : 'n/a',\n detailUrl: data.Guid,\n noMagnet: true,\n noTorrent: true\n };\n var magnet = data.MagnetUri;\n var magnetHash = null;\n if (magnet) {\n out.magnetUrl = magnet;\n out.noMagnet = false;\n magnetHash = out.magnetUrl.match(/([0-9ABCDEFabcdef]{40})/);\n }\n var torrent = data.Link;\n if (torrent) {\n out.torrentUrl = torrent;\n out.noTorrent = false;\n } else if (magnetHash && magnetHash.length) {\n out.torrentUrl = 'http://itorrents.org/torrent/' + magnetHash[0].toUpperCase() + '.torrent?title=' + encodeURIComponent(out.releasename.trim());\n out.noTorrent = false;\n }\n output.push(out);\n })\n }\n }\n //console.debug(config.name,output);\n return output;\n } else {\n // this is a standard (or custom) Search Engine\n var parser = new DOMParser();\n var doc = parser.parseFromString(result.data, \"text/html\");\n //console.debug(doc);\n var selectors = config.selectors;\n if ('loginRequired' in config && config.loginRequired) {\n var loginTest = doc.querySelectorAll(config.loginTestSelector);\n if (loginTest.length > 0) {\n if (confirm(\"Not logged in @ \" + config.mirror + '. Do you want to open a new window so that you can login?')) {\n window.open(config.mirror + config.loginPage);\n }\n throw \"Not logged in!\";\n }\n }\n var results = doc.querySelectorAll(selectors.resultContainer);\n //console.debug('searchcontainer',selectors.resultContainer,results);\n var output = [];\n\n function sizeToMB(size) {\n size = (typeof size !== 'undefined' && size !== null && size !== '') ? size.replace(',', '').match(/[0-9.]{1,}[\\W]{0,}[KTMGmgibBytes]{2,}/)[0] : '0 MB';\n var sizeA = (size.replace(',', '').split(/\\s{1}/)); // size split into value and unit\n var newSize = null; // size converted to MB\n switch (sizeA[1].toUpperCase()) {\n case 'B':\n case 'BYTES':\n newSize = (parseFloat(sizeA[0]) / 1000 / 1000).toFixed(2);\n break;\n case 'KB':\n newSize = (parseFloat(sizeA[0]) / 1000).toFixed(2);\n break;\n case 'MB':\n newSize = (parseFloat(sizeA[0])).toFixed(2);\n break;\n case 'GB':\n newSize = (parseFloat(sizeA[0]) * 1000).toFixed(2);\n break;\n case 'TB':\n newSize = (parseFloat(sizeA[0]) * 1000 * 1000).toFixed(2);\n break;\n case 'KIB':\n newSize = ((parseFloat(sizeA[0]) * 1024) / 1000 / 1000).toFixed(2);\n break;\n case 'MIB':\n newSize = ((parseFloat(sizeA[0]) * 1024 * 1024) / 1000 / 1000).toFixed(2);\n break;\n case 'GIB':\n newSize = ((parseFloat(sizeA[0]) * 1024 * 1024 * 1024) / 1000 / 1000).toFixed(2);\n break;\n case 'TIB':\n newSize = ((parseFloat(sizeA[0]) * 1024 * 1024 * 1024 * 1024) / 1000 / 1000).toFixed(2);\n break;\n default:\n return size;\n }\n return newSize + ' MB';\n }\n\n for (var i = 0; i < results.length; i++) {\n var releasename = getPropertyForSelector(results[i], selectors.releasename);\n if (releasename === null) continue;\n var seed = getPropertyForSelector(results[i], selectors.seeders);\n var leech = getPropertyForSelector(results[i], selectors.leechers);\n seed = (seed != null) ? seed.replace(',', '') : 'n/a';\n leech = (leech != null) ? leech.replace(',', '') : 'n/a';\n var out = {\n releasename: releasename.trim(),\n size: sizeToMB(getPropertyForSelector(results[i], selectors.size)),\n seeders: seed,\n leechers: leech,\n detailUrl: (config.includeBaseURL ? config.mirror : '') + getPropertyForSelector(results[i], selectors.detailUrl),\n noMagnet: true,\n noTorrent: true\n };\n var magnet = getPropertyForSelector(results[i], selectors.magnetUrl);\n var magnetHash = null;\n if (magnet) {\n out.magnetUrl = magnet;\n out.noMagnet = false;\n magnetHash = out.magnetUrl.match(/([0-9ABCDEFabcdef]{40})/);\n }\n var torrent = getPropertyForSelector(results[i], selectors.torrentUrl);\n if (torrent) {\n out.torrentUrl = (torrent.startsWith('http')) ? torrent : config.mirror + torrent;\n out.noTorrent = false;\n } else if (magnetHash && magnetHash.length) {\n out.torrentUrl = 'http://itorrents.org/torrent/' + magnetHash[0].toUpperCase() + '.torrent?title=' + encodeURIComponent(out.releasename.trim());\n out.noTorrent = false;\n }\n // if there is no magnet and/or no torrent, check of detailsSelectors has been provided.\n if ('detailsSelectors' in config) {\n if ('magnetUrl' in config.detailsSelectors) {\n out.noMagnet = false;\n }\n if ('torrentUrl' in config.detailsSelectors) {\n out.noTorrent = false;\n }\n }\n output.push(out);\n }\n //console.debug('parseSearch',config.mirror, output);\n return output;\n }\n }", "function handleSearchResponseMsg(msg, id, ip_address, pending_results, routing_table, awaiting_acks, socket) {\n var response = new Buffer(JSON.stringify(msg));\n if (msg.word in pending_results) {\n pending_results[msg.word] = pending_results[msg.word].concat(msg.response);\n }\n route(msg.node_id, id, routing_table, function(route_id) {\n if (route_id !== id) {\n send(response, route_id, id, routing_table, awaiting_acks, socket);\n }\n });\n}", "function nearbySearch(text, callback) {\n service.nearbySearch({location: room_26_100, radius: 1000, keyword: text},\n function(results, status) {\n if (status != \"OK\" && status != \"ZERO_RESULTS\") {\n var msg = \"Request to Google Places service (nearbySearch) failed (status: \" + status + \")\";\n alert(msg);\n throw {name: \"places\", message: msg};\n }\n\n callback(results);\n });\n}", "function search(query, cb) {\n\n return fetch(`https://trackapi.nutritionix.com/v2/natural/nutrients`, {\n method: \"post\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'x-app-id': '6f812326',\n 'x-app-key': '5e4d76d60110068b62760cfba5754e99',\n 'x-remote-user-id': '1'\n },\n body: JSON.stringify({\n 'query': `${query}`,\n 'num_servings': 1,\n 'use_raw_foods': true, \n })\n })\n .then(checkStatus)\n .then(parseJSON)\n .then(checkSearch)\n .then(cb);\n}", "function processSearchResponse() {\n\tif (requestXml.readyState == 4) {\n\t\tvar resultXml = requestXml.responseXML;\n\t\t\n\t\tk = 0;\n\t\tnames = [];\n\t\ttrackers = [];\n\t\thashes = [];\n\t\t$('RESULT', resultXml).each(function(i) {\n\t\t\tnames[k] = $(this).find(\"NAME\").text();\n\t\t\ttrackers[k] = $(this).find(\"TRACKER\").text();\n\t\t\thashes[k] = $(this).find(\"HASH\").text();\n\t\t\tk++;\n\t\t});\n\t\t\n\t\tsearch_results = [];\n\t\tfor (var j = 0; j < names.length; j++)\n\t\t\tsearch_results.push(names[j]);\n\t\t\n\t\t$('#results_list').sfList('clear');\n\t\t$('#results_list').sfList('option', 'data', search_results);\n\t\t\n\t\tis_list_shown = true;\n\t}\n}", "function callback(results,status) {\n if (status == google.maps.places.PlacesServiceStatus.OK) {\n var priRes = results[0];\n processPlaceObject(priRes);\n } else {\n alert('Oops! we cannot find the location, please try something else.');\n $('#search').removeClass('searchBarLoading');\n }\n\n}", "searchBook(search) {\n this.jsonLog('searchBook sending data', search);\n this.setState({waitingSearch: true});\n this.bookCtrl.searchBook(search, (err, resp) => {\n if (err) {this.error(err);}\n else {\n var searchResults = resp.items;\n this.log('searchBook with ' + search + ' response OK');\n this.log('items.length ' + resp.items.length);\n this.setState({\n searchResults: searchResults,\n waitingSearch: false\n });\n }\n });\n }", "function cb(err,response,html){\n if(err){\n console.log(\"Error: \"+err);\n }else{\n extractMatch(html);\n }\n}", "function callback() {\n let latLong = self.state.latLong;\n let search = `${latLong['lat']},${latLong['lng']},${self.state.searchRadius}`\n self.setState({searchParams: search});\n self.props.search(self.state.searchParams, self.state.latLong);\n }", "function search_twitter_eind(keyword_value) {\n\n\n var twitter_search_params = {q: keyword_value, count: 300};\n\n\n client.get('search/tweets', twitter_search_params, function(error, tweets, response) {\n\n\n\n var results = [];\n\n if(!error) {\n\n\n for(tweet of tweets.statuses) {\n\n\n if(tweet.user.location != null && tweet.user.location.trim().length > 0 && tweet.lang == 'nl') {\n\n console.log('>Tweet: ' + '\\n' + tweet.text + '\\n\\n' + '>Locatie: ' + '\\n' + tweet.user.location + '\\n')\n\n var result2 = {tweet: tweet.text, location: tweet.user.location};\n\n results.push(result2);\n\n }\n\n } \n\n } else {\n\n console.log('No tweets:' + error );\n }\n\n\n //console.log(tweets);\n\n\n if (results.length === 0) {\n io.emit('errormessageeind', \"Sorry, your end search doesn't match any located tweets.\")\n \n } else {\n \n\n io.emit('search_twitter_results_eind', choice(results)); \n\n }\n\n });\n\n}", "function getSearch() {\n\n\t\t\t\t\tvar request = $http({\n\t\t\t\t\t\tmethod: \"get\",\n\t\t\t\t\t\turl: \"http://tmb_rpc.qa.pdone.com/search_processor.php?mode=SEARCH&page=1&phrase=e&page_length=100&type=news\",\n\t\t\t\t\t});\n\n\t\t\t\t\treturn( request.then( handleSuccess, handleError ) );\n\n\t\t\t\t}", "function getSearchFromApi(searchTerm, callback) {\n var query = {\n q: searchTerm,\n }\n $.getJSON(SearchRequest_URL, query, callback);\n}", "function BN_search (BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result, is_recur = true) {\r\n if (BN_match(BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch)) {\r\n\ta_result.push(BN);\r\n }\r\n if (is_recur && (BN.type == \"folder\")) {\r\n\tlet children = BN.children;\r\n\tif (children != undefined) {\r\n\t let url;\r\n\t let i;\r\n\t let len = children.length;\r\n\t for (let j=0 ; j<len ; j++) {\r\n\t\ti = children[j];\r\n\t\tif ((i.type != \"separator\")\r\n\t\t\t&& (((url = i.url) == undefined) || !url.startsWith(\"place:\")) // Ignore special bookmarks\r\n\t\t ) {\r\n\t\t BN_search(i, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result, is_recur)\r\n\t\t}\r\n\t }\r\n\t}\r\n }\r\n}", "function searchProduct(src, callback) {\n const xhr = new XMLHttpRequest();\n xhr.onload = function() {\n if (xhr.status >= 200 && xhr.status < 300) {\n console.log('Search Success!');\n const search = JSON.parse(xhr.responseText);\n callback(search);\n } else {\n console.log('The request has failed');\n }\n };\n xhr.open('GET', src, true);\n xhr.send();\n}", "searchGoogle(searchStr, location2) {\n console.log(\"I'm in search Google on the front-end\");\n console.log(searchStr);\n console.log(location2);\n API.searchGoogle({\n search: searchStr,\n location: location2\n })\n .then(res => {\n console.log(\"I've completed searchYelp and i'm on the client. Here is res\");\n console.log(res);\n })\n .catch(err => console.log(err));\n }", "function mangaNelSearch($, entry) {\n let error = $(\"div.daily-update-item\").length\n let mangaName\n console.log(\"ERROR\")\n console.log(error)\n\n // check how many search results\n if (error == 0) {\n console.log(\"Error: Bad Manga Request\")\n message.sendTextMessage(entry.senderId, \"Can't see to find this manga. Did you spell it correctly?\")\n } \n else if (error > 1){\n let res = []\n let extract = (i,val)=>{\n res.push( {name : $(val).find(\"span a\").text(),\n url : $(val).find(\"span a\").attr('href')} )}\n\n $(\"div.daily-update-item\").each(extract)\n\n console.log(\"RES:\"+JSON.stringify(res))\n\n message.sendQuickResponseMangaNel(entry.senderId, entry.action, res)\n\n } else {\n let url = $(\"div.daily-update-item\").children().first().find(\"span a\").attr('href')\n let newEntry = {\n senderId: entry.senderId,\n url: url,\n action: entry.action\n }\n console.log(\"NEWENTRY2 \"+JSON.stringify(newEntry))\n let callback = mangaNelExtract\n\n getUrl(url, newEntry, callback)\n }\n}", "searchByCriteria(searchString, page) {\n return new Promise((fulfill, reject) => {\n https.get(restHost + \"/discover/movie\" + pathTail + searchString + \"&page=\" + page, function (response) {\n response.setEncoding('utf8');\n var body = '';\n response.on('data', function (d) {\n body += d;\n });\n response.on('error', (e) => {\n reject(e);\n });\n response.on('end', function () {\n var parsed = JSON.parse(body);\n fulfill(parsed);\n });\n });\n });\n }", "function sendSearchResult(search) {\n selectAndExecute(\"sr/\" + forHash(search), function() {\n var response = {type: \"searchresult\", link: \"search\", search: search, lists: [], controlLink: location.hash};\n response.header = $.trim($(\"#breadcrumbs\").find(\".tab-text\").text());\n var searchView = $(\"#main .search-view\");\n response.moreText = $.trim(searchView.find(\"div .header .more:visible\").first().text());\n response.lists.push(parseSublist(searchView, \"srar\", 6));\n response.lists.push(parseSublist(searchView, \"sral\", 5));\n response.lists.push(parseSublist(searchView, \"srs\", 10));\n response.empty = response.lists[0] === null && response.lists[1] === null && response.lists[2] === null;\n post(\"player-navigationList\", response);\n });\n }", "function search(str) {\n lastSearch = str;\n $('<img src=\"/static/images/ajax-spinner.gif\" class=\"loading-gif\">').insertBefore('div.search img.mag-glass');\n action({\n data: {'action':'searchAutoComplete','string':str},\n success: function(data)\n {\n // ensure desired search hasn't changed\n if(lastSearch!=str) return;\n var obj = $.parseJSON(data);\n var dropdown = $(\"div.search div.search-dropdown\");\n dropdown.html(obj.html);\n dropdown.fadeIn(100);\n },\n timeout: 10000,\n complete: function() {\n stopSearch();\n }\n });\n}", "function searchResponse(error, response, body) {\n // console.log(body);\n // var tmp2 = $(\"<div>\" + body + \"</div>\");\n // console.log(tmp2.html());\n var tmp = $(\".container .midBar .item\", \"<div>\" + body + \"</div>\");\n // console.log (tmp);\n var result = [];\n var callback = this.callback;\n async.each(tmp, function(e, callback1){\n var title = $(e).find('a.title').text();\n // console.log(title);\n var rel_link = $(e).find('a.title').attr('href');\n var titlekey = rel_link.substring(1, rel_link.length - 2);\n var link = baseuri + rel_link;\n var imguri = $(e).find('img').attr('src');\n var updateinfo = \"作者:\" + $(e).find('dt>a:first-of-type').text();\n // console.log(updateinfo);\n var description = $(e).find('.info .value').text().replace(/^\\s+|\\s+$/g, '');\n var obj = {};\n obj.link = link;\n obj.titlekey = titlekey;\n obj.imguri = imguri;\n obj.title = title;\n obj.host = host;\n obj.updateinfo = updateinfo;\n obj.description = description;\n result.push(obj);\n callback1();\n }, function () {\n console.log(\"All Search dm5 done\");\n callback(result, host);\n });\n\n // this.callback(result, host);\n}", "function searchBand(bandQuery) {\n console.log(\"searching concerts\");\n var queryURL = \"https://rest.bandsintown.com/artists/\" + bandQuery + \"/events?app_id=codingbootcamp\";\n //console.log(queryURL);\n\n //searching for concerts with bands in town API\n request(queryURL, function (error, response, body) {\n //error occurs\n if (error) {\n console.log(error);\n }\n\n //request processed successfully\n if (!error && response.statusCode === 200) {\n //console.log(\"processed request\");\n\n var events = JSON.parse(body);\n //console.log(events);\n\n //displaying information for each event\n for (var i = 0; i < events.length; i++) {\n var event = events[i];\n\n var venue = event.venue.name;\n var location = event.venue.city + \", \" + event.venue.country;\n\n var moment = require(\"moment\");\n var date = moment(event.datetime).format(\"L\");\n\n console.log(\"\\n\");\n console.log(venue);\n console.log(location);\n console.log(date);\n }\n }\n });\n}", "function doSearch() {\n twitter.getSearch({\n q: SEARCH_WORDS.join(\" \"),\n lang: \"en\",\n count: 15\n }, (err, response, body) => {\n console.error(\"SEARCH ERROR:\", err);\n }, (data) => {\n var response = JSON.parse(data);\n processTweets(response.statuses);\n });\n}", "function makeServiceCall(searchTerm, callback, recsToIgnore) {\n var pagePathComponents = location.pathname.split('/'),\n pageKey = '',\n apiUrl;\n\n recsToIgnore = recsToIgnore ? ',' + recsToIgnore : '';\n apiUrl = configuration.apiEndpointBases.SearchPage + '?No=0&Ns=&N=0&Ntk=' + searchTerm.ntk + '&Ntx=mode+matchany&Dx=mode+matchany&Ntt=' + searchTerm.ntt;\n apiUrl = Utility.handleUserConfiguration(apiUrl, $.cookie('UserSegment'));\n\n //Make sure the current record is not returned in the results\n if (pagePathComponents.length >= 1) {\n pageKey = _.last(pagePathComponents);\n pageKey = pageKey.replace('R-', '');\n }\n\n apiUrl = Utility.updateQueryString(apiUrl, 'HideRecord', 'NOT(P_Primary_Key:' + pageKey + '),NOT(ContentTypes:Definition)' + recsToIgnore);\n\n $.getJSON(apiUrl)\n .done(function (json) {\n if (Utility.checkNested(json, 'mainContent[0].contents[0].records') && (json.mainContent[0].contents[0].records.length || json.mainContent[0].contents[0].totalNumRecs === 0)) {\n callback(json);\n }\n });\n\n }", "function searchShelf() {\n\n let title = document.getElementById(\"title\").value.replace(\"'\", \"/\");\n // let author = document.getElementById(\"author\").value;\n let isbn = document.getElementById(\"borrowISBN\").value;\n let searchRadius = document.getElementById(\"radius\").value;\n if (searchRadius <= 0) {\n alert(\"Search Radius must be greater than 0\");\n return;\n }\n let message;\n const url = \"/api/search\";\n $.ajax({\n type: \"POST\",\n url: url,\n data: {\n json_string: JSON.stringify({\n title: title ? title : \"null\",\n isbn: isbn ? isbn : \"null\",\n radius: searchRadius ? searchRadius : \"null\",\n latitude: latitude ? latitude : 38.957,\n longitude: longitude ? longitude : -95.255,\n searchBy: searchBy ? searchBy : \"null\"\n })\n },\n success: function (response) {\n let initialParse = response.split(\"\\\"\");\n\n let parsed = [];\n let item = \"\";\n for (let i = 0; i < initialParse.length; i++) {\n if (i % 2 == 1) {\n item = \"Email: \";\n item = item + initialParse[i];\n }\n else if (i > 1) {\n smallParse = \"\";\n for (let j = 0; j < initialParse[i].length; j++) {\n if (j > 1 && j < 8 && (!isNaN(initialParse[i][j]) || initialParse[i][j] == '.')) {\n smallParse = smallParse + initialParse[i][j];\n }\n }\n\n item = item + \" - Distance: \" + smallParse + \" km\";\n parsed.push(item);\n }\n\n }\n\n finalString = \"CONTACT THE FOLLOWING TO BORROW YOUR BOOK:\\n\\n\"\n for (let i = 0; i < parsed.length; i++) {\n finalString = finalString + parsed[i] + \"\\n\"\n }\n if (parsed.length == 0) {\n alert(\"Sorry: Match not found. Please Try another book.\")\n }\n else {\n alert(finalString);\n }\n },\n dataType: 'text',\n async: false\n })\n\n}", "function handleSearchResponse(data){\n\t\t\t\n\t\t\tvar view = new Uint8Array(data);\n\t\t\treadBuffer += UtilsService.byteArrayToString(view);\n\t\t\t\n\t\t\tconsole.log(view);\n\t\t\t\n\t\t\tvar line = readBuffer.split(\"\\r\\n\", 1);\n\t\t\t\n\t\t\ttry{\n\t\t\t\tvar message = JSON.parse(line);\n\t\t\t\t\n\t\t\t\tif(line.length > 0){\n\t\t\t\t\treadBuffer = readBuffer.slice(line[0].length);\n\t\t\t\t\tsearch( false );\n\t\t\t\t\tclose();\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$rootScope.$$phase)\n\t\t\t\t\t\t$rootScope.$apply(function(){\n\t\t\t\t\t\t\tdiscovered['serial'] = message;\n\t\t\t\t\t\t});\n\t\t\t\t\n\t\t\t}catch(err){}\n\t\t\t\n\t\t\t\n\t\t}", "function searchSensors (searchText, callBack) {\n var WOTKIT_URL = \"http://wotkit.sensetecnic.com/api/v1\";\n $.ajax({\n type:\"GET\",\n url:WOTKIT_URL+'/sensors?text='+encodeURIComponent(searchText),\n success: function(data){callBack(data);}\n });\n}", "function jsonapi (search, callback){\n var stackexchange = require('stackexchange-node');\n var options = { version: 2.2 };\n\tvar context = new stackexchange(options);\n\tvar re=/<pre><code>([\\s\\S]*?)<\\/code><\\/pre>/gm;\n\tvar re2=/<(.*?)>/g;\n\tvar m;\n var complete = {\n concept: [],\n code: [],\n title: '',\n is_code: false\n };\n\tvar filter = {\n \t\tpagesize: 1,\n \t\tsort: 'relevance',\n \t\torder: 'desc',\n \t\tq: search,\n \t\tfilter: '!)R7_YdluAAl180(njTbqNhsH'\n\t};\n //console.log(context.search.advanced);\n\tcontext.search.advanced(filter, function (err, results){\n //console.log(results);\n if (err) throw err;\n var s;\n for(var i=0;i<results.items[0].answers.length;i++){\n if(results.items[0].answers[i].is_accepted){\n s=results.items[0].answers[i].body;\n break;\n }\n }\n complete.title=results.items[0].title;\n //complete.concept=s;\n //var s='<p><strong>You are a victim of <a href=\\\"//en.wikipedia.org/wiki/Branch_predictor\\\" rel=\\\"noreferrer\\\">branch prediction</a> fail.</strong></p>\\n\\n<hr>\\n\\n<h2>What is Branch Prediction?</h2>\\n\\n<p>Consider a railroad junction:</p>\\n\\n<p><a href=\\\"//commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG\\\" rel=\\\"noreferrer\\\"><img src=\\\"https://i.stack.imgur.com/muxnt.jpg\\\" alt=\\\"Licensed Image\\\"></a>\\n<sub><a href=\\\"//commons.wikimedia.org/wiki/File:Entroncamento_do_Transpraia.JPG\\\" rel=\\\"noreferrer\\\">Image</a> by Mecanismo, via Wikimedia Commons. Used under the <a href=\\\"//creativecommons.org/licenses/by-sa/3.0/deed.en\\\" rel=\\\"noreferrer\\\">CC-By-SA 3.0</a> license.</sub></p>\\n\\n<p>Now for the sake of argument, suppose this is back in the 1800s - before long distance or radio communication.</p>\\n\\n<p>You are the operator of a junction and you hear a train coming. You have no idea which way it is supposed to go. You stop the train to ask the driver which direction they want. And then you set the switch appropriately.</p>\\n\\n<p><em>Trains are heavy and have a lot of inertia. So they take forever to start up and slow down.</em></p>\\n\\n<p>Is there a better way? You guess which direction the train will go!</p>\\n\\n<ul>\\n<li>If you guessed right, it continues on.</li>\\n<li>If you guessed wrong, the captain will stop, back up, and yell at you to flip the switch. Then it can restart down the other path.</li>\\n</ul>\\n\\n<p><strong>If you guess right every time</strong>, the train will never have to stop.<br>\\n<strong>If you guess wrong too often</strong>, the train will spend a lot of time stopping, backing up, and restarting.</p>\\n\\n<hr>\\n\\n<p><strong>Consider an if-statement:</strong> At the processor level, it is a branch instruction:</p>\\n\\n<p><img src=\\\"https://i.stack.imgur.com/pyfwC.png\\\" alt=\\\"image2\\\"></p>\\n\\n<p>You are a processor and you see a branch. You have no idea which way it will go. What do you do? You halt execution and wait until the previous instructions are complete. Then you continue down the correct path.</p>\\n\\n<p><em>Modern processors are complicated and have long pipelines. So they take forever to \\\"warm up\\\" and \\\"slow down\\\".</em></p>\\n\\n<p>Is there a better way? You guess which direction the branch will go!</p>\\n\\n<ul>\\n<li>If you guessed right, you continue executing.</li>\\n<li>If you guessed wrong, you need to flush the pipeline and roll back to the branch. Then you can restart down the other path.</li>\\n</ul>\\n\\n<p><strong>If you guess right every time</strong>, the execution will never have to stop.<br>\\n<strong>If you guess wrong too often</strong>, you spend a lot of time stalling, rolling back, and restarting.</p>\\n\\n<hr>\\n\\n<p>This is branch prediction. I admit it\\'s not the best analogy since the train could just signal the direction with a flag. But in computers, the processor doesn\\'t know which direction a branch will go until the last moment.</p>\\n\\n<p>So how would you strategically guess to minimize the number of times that the train must back up and go down the other path? You look at the past history! If the train goes left 99% of the time, then you guess left. If it alternates, then you alternate your guesses. If it goes one way every 3 times, you guess the same...</p>\\n\\n<p><strong><em>In other words, you try to identify a pattern and follow it.</em></strong> This is more or less how branch predictors work.</p>\\n\\n<p>Most applications have well-behaved branches. So modern branch predictors will typically achieve >90% hit rates. But when faced with unpredictable branches with no recognizable patterns, branch predictors are virtually useless.</p>\\n\\n<p>Further reading: <a href=\\\"//en.wikipedia.org/wiki/Branch_predictor\\\" rel=\\\"noreferrer\\\">\\\"Branch predictor\\\" article on Wikipedia</a>.</p>\\n\\n<hr>\\n\\n<h2>As hinted from above, the culprit is this if-statement:</h2>\\n\\n<pre><code>if (data[c] &gt;= 128)\\n sum += data[c];\\n</code></pre>\\n\\n<p>Notice that the data is evenly distributed between 0 and 255. \\nWhen the data is sorted, roughly the first half of the iterations will not enter the if-statement. After that, they will all enter the if-statement.</p>\\n\\n<p>This is very friendly to the branch predictor since the branch consecutively goes the same direction many times.\\nEven a simple saturating counter will correctly predict the branch except for the few iterations after it switches direction.</p>\\n\\n<p><strong>Quick visualization:</strong></p>\\n\\n<pre><code>T = branch taken\\nN = branch not taken\\n\\ndata[] = 0, 1, 2, 3, 4, ... 126, 127, 128, 129, 130, ... 250, 251, 252, ...\\nbranch = N N N N N ... N N T T T ... T T T ...\\n\\n = NNNNNNNNNNNN ... NNNNNNNTTTTTTTTT ... TTTTTTTTTT (easy to predict)\\n</code></pre>\\n\\n<p>However, when the data is completely random, the branch predictor is rendered useless because it can\\'t predict random data.\\nThus there will probably be around 50% misprediction. (no better than random guessing)</p>\\n\\n<pre><code>data[] = 226, 185, 125, 158, 198, 144, 217, 79, 202, 118, 14, 150, 177, 182, 133, ...\\nbranch = T, T, N, T, T, T, T, N, T, N, N, T, T, T, N ...\\n\\n = TTNTTTTNTNNTTTN ... (completely random - hard to predict)\\n</code></pre>\\n\\n<hr>\\n\\n<p><strong>So what can be done?</strong></p>\\n\\n<p>If the compiler isn\\'t able to optimize the branch into a conditional move, you can try some hacks if you are willing to sacrifice readability for performance.</p>\\n\\n<p>Replace:</p>\\n\\n<pre><code>if (data[c] &gt;= 128)\\n sum += data[c];\\n</code></pre>\\n\\n<p>with:</p>\\n\\n<pre><code>int t = (data[c] - 128) &gt;&gt; 31;\\nsum += ~t &amp; data[c];\\n</code></pre>\\n\\n<p>This eliminates the branch and replaces it with some bitwise operations.</p>\\n\\n<p><sub>(Note that this hack is not strictly equivalent to the original if-statement. But in this case, it\\'s valid for all the input values of <code>data[]</code>.)</sub></p>\\n\\n<p><strong>Benchmarks: Core i7 920 @ 3.5 GHz</strong></p>\\n\\n<p>C++ - Visual Studio 2010 - x64 Release</p>\\n\\n<pre><code>// Branch - Random\\nseconds = 11.777\\n\\n// Branch - Sorted\\nseconds = 2.352\\n\\n// Branchless - Random\\nseconds = 2.564\\n\\n// Branchless - Sorted\\nseconds = 2.587\\n</code></pre>\\n\\n<p>Java - Netbeans 7.1.1 JDK 7 - x64</p>\\n\\n<pre><code>// Branch - Random\\nseconds = 10.93293813\\n\\n// Branch - Sorted\\nseconds = 5.643797077\\n\\n// Branchless - Random\\nseconds = 3.113581453\\n\\n// Branchless - Sorted\\nseconds = 3.186068823\\n</code></pre>\\n\\n<p>Observations:</p>\\n\\n<ul>\\n<li><strong>With the Branch:</strong> There is a huge difference between the sorted and unsorted data.</li>\\n<li><strong>With the Hack:</strong> There is no difference between sorted and unsorted data.</li>\\n<li>In the C++ case, the hack is actually a tad slower than with the branch when the data is sorted.</li>\\n</ul>\\n\\n<p>A general rule of thumb is to avoid data-dependent branching in critical loops. (such as in this example)</p>\\n\\n<hr>\\n\\n<p><strong>Update:</strong></p>\\n\\n<ul>\\n<li><p>GCC 4.6.1 with <code>-O3</code> or <code>-ftree-vectorize</code> on x64 is able to generate a conditional move. So there is no difference between the sorted and unsorted data - both are fast.</p></li>\\n<li><p>VC++ 2010 is unable to generate conditional moves for this branch even under <code>/Ox</code>.</p></li>\\n<li><p>Intel Compiler 11 does something miraculous. It <a href=\\\"//en.wikipedia.org/wiki/Loop_interchange\\\" rel=\\\"noreferrer\\\">interchanges the two loops</a>, thereby hoisting the unpredictable branch to the outer loop. So not only is it immune the mispredictions, it is also twice as fast as whatever VC++ and GCC can generate! In other words, ICC took advantage of the test-loop to defeat the benchmark...</p></li>\\n<li><p>If you give the Intel Compiler the branchless code, it just out-right vectorizes it... and is just as fast as with the branch (with the loop interchange).</p></li>\\n</ul>\\n\\n<p>This goes to show that even mature modern compilers can vary wildly in their ability to optimize code...</p>\\n'\n //var s='<p>Okay, I have seen this:\\n<a href=\"https://stackoverflow.com/questions/1129216/sorting-objects-in-an-array-by-a-field-value-in-javascript\">Sort array of objects by string property value in JavaScript</a><br>\\nNow, my problem is that I want sort the array by a field value in dependence of an external int value.</p>\\n\\n<p>The Int value represents a number of persons for a reservation, the objects in the array are the tables with the seats.<br></p>\\n\\n<p>Now, when I got a Reservation with 4 persons the array should beginn with the object where Seats are equal to my Int (the 4 persons) or the nearest higher one. The next ones should be i.e. 6 and 8. Objects with Seats are smaller then my Int should listed at the end (when 4 persons want a reservation, I dont need tables with 2 Seats). I hop its a bit cleare now.</p>\\n\\n<pre><code>{\\n Area: \"Bar\",\\n Seats: 2,\\n Id : 1\\n},{\\n Area: \"Outside\",\\n Seats: 8,\\n Id : 2\\n},{\\n Area: \"Room\",\\n Seats: 4,\\n Id : 3\\n},{\\n Area: \"Floor\",\\n Seats: 2,\\n Id : 4\\n},{\\n Area: \"Room\",\\n Seats: 6,\\n Id : 5\\n}\\n</code></pre>\\n\\n<p>Okay, here is my solution:<br></p>\\n\\n<pre><code> res.sort(function (a, b) {\\n if ((a.Seats &lt; goal) &amp;&amp; (b.Seats &lt; goal)) {\\n return b.Seats - a.Seats;\\n }\\n if (a.Seats &lt; goal) {\\n return 1;\\n }\\n if (b.Seats &lt; goal) {\\n return -1;\\n }\\n return a.Seats - b.Seats;\\n });\\n</code></pre>\\n';\n //var s=\"<p>The reason why performance improves drastically when the data is sorted is that the branch prediction penalty is removed, as explained beautifully in <a href=\\\"https://stackoverflow.com/users/922184/mysticial\\\">Mysticial</a>'s answer.</p>\\n\\n<p>Now, if we look at the code</p>\\n\\n<pre><code>if (data[c] &gt;= 128)\\n sum += data[c];\\n</code></pre>\\n\\n<p>we can find that the meaning of this particular <code>if... else...</code> branch is to add something when a condition is satisfied. This type of branch can be easily transformed into a <strong>conditional move</strong> statement, which would be compiled into a conditional move instruction: <code>cmovl</code>, in an <code>x86</code> system. The branch and thus the potential branch prediction penalty is removed.</p>\\n\\n<p>In <code>C</code>, thus <code>C++</code>, the statement, which would compile directly (without any optimization) into the conditional move instruction in <code>x86</code>, is the ternary operator <code>... ? ... : ...</code>. So we rewrite the above statement into an equivalent one:</p>\\n\\n<pre><code>sum += data[c] &gt;=128 ? data[c] : 0;\\n</code></pre>\\n\\n<p>While maintaining readability, we can check the speedup factor.</p>\\n\\n<p>On an Intel <a href=\\\"http://en.wikipedia.org/wiki/Intel_Core#Core_i7\\\" rel=\\\"noreferrer\\\">Core i7</a>-2600K @ 3.4&nbsp;GHz and Visual Studio 2010 Release Mode, the benchmark is (format copied from Mysticial):</p>\\n\\n<p><strong>x86</strong></p>\\n\\n<pre><code>// Branch - Random\\nseconds = 8.885\\n\\n// Branch - Sorted\\nseconds = 1.528\\n\\n// Branchless - Random\\nseconds = 3.716\\n\\n// Branchless - Sorted\\nseconds = 3.71\\n</code></pre>\\n\\n<p><strong>x64</strong></p>\\n\\n<pre><code>// Branch - Random\\nseconds = 11.302\\n\\n// Branch - Sorted\\n seconds = 1.830\\n\\n// Branchless - Random\\nseconds = 2.736\\n\\n// Branchless - Sorted\\nseconds = 2.737\\n</code></pre>\\n\\n<p>The result is robust in multiple tests. We get a great speedup when the branch result is unpredictable, but we suffer a little bit when it is predictable. In fact, when using a conditional move, the performance is the same regardless of the data pattern.</p>\\n\\n<p>Now let's look more closely by investigating the <code>x86</code> assembly they generate. For simplicity, we use two functions <code>max1</code> and <code>max2</code>.</p>\\n\\n<p><code>max1</code> uses the conditional branch <code>if... else ...</code>:</p>\\n\\n<pre><code>int max1(int a, int b) {\\n if (a &gt; b)\\n return a;\\n else\\n return b;\\n}\\n</code></pre>\\n\\n<p><code>max2</code> uses the ternary operator <code>... ? ... : ...</code>:</p>\\n\\n<pre><code>int max2(int a, int b) {\\n return a &gt; b ? a : b;\\n}\\n</code></pre>\\n\\n<p>On a x86-64 machine, <code>GCC -S</code> generates the assembly below.</p>\\n\\n<pre><code>:max1\\n movl %edi, -4(%rbp)\\n movl %esi, -8(%rbp)\\n movl -4(%rbp), %eax\\n cmpl -8(%rbp), %eax\\n jle .L2\\n movl -4(%rbp), %eax\\n movl %eax, -12(%rbp)\\n jmp .L4\\n.L2:\\n movl -8(%rbp), %eax\\n movl %eax, -12(%rbp)\\n.L4:\\n movl -12(%rbp), %eax\\n leave\\n ret\\n\\n:max2\\n movl %edi, -4(%rbp)\\n movl %esi, -8(%rbp)\\n movl -4(%rbp), %eax\\n cmpl %eax, -8(%rbp)\\n cmovge -8(%rbp), %eax\\n leave\\n ret\\n</code></pre>\\n\\n<p><code>max2</code> uses much less code due to the usage of instruction <code>cmovge</code>. But the real gain is that <code>max2</code> does not involve branch jumps, <code>jmp</code>, which would have a significant performance penalty if the predicted result is not right.</p>\\n\\n<p>So why does a conditional move perform better?</p>\\n\\n<p>In a typical <code>x86</code> processor, the execution of an instruction is divided into several stages. Roughly, we have different hardware to deal with different stages. So we do not have to wait for one instruction to finish to start a new one. This is called <strong><a href=\\\"http://en.wikipedia.org/wiki/Pipeline_%28computing%29\\\" rel=\\\"noreferrer\\\">pipelining</a></strong>.</p>\\n\\n<p>In a branch case, the following instruction is determined by the preceding one, so we cannot do pipelining. We have to either wait or predict.</p>\\n\\n<p>In a conditional move case, the execution conditional move instruction is divided into several stages, but the earlier stages like <code>Fetch</code> and <code>Decode</code> does not depend on the result of the previous instruction; only latter stages need the result. Thus, we wait a fraction of one instruction's execution time. This is why the conditional move version is slower than the branch when prediction is easy.</p>\\n\\n<p>The book <em><a href=\\\"http://rads.stackoverflow.com/amzn/click/0136108040\\\" rel=\\\"noreferrer\\\">Computer Systems: A Programmer's Perspective, second edition</a></em> explains this in detail. You can check Section 3.6.6 for <em>Conditional Move Instructions</em>, entire Chapter 4 for <em>Processor Architecture</em>, and Section 5.11.2 for a special treatment for <em>Branch Prediction and Misprediction Penalties</em>.</p>\\n\\n<p>Sometimes, some modern compilers can optimize our code to assembly with better performance, sometimes some compilers can't (the code in question is using Visual Studio's native compiler). Knowing the performance difference between branch and conditional move when unpredictable can help us write code with better performance when the scenario gets so complex that the compiler can not optimize them automatically.</p>\\n\";\n m=s.split(re);\n for(var i=0; i<m.length; i++){\n if(i%2==0){\n complete.concept.push(m[i]);\n }else{\n complete.code.push(m[i]);\n }\n }\n complete.is_code = complete.code.length > 0;\n for(var i=0; i<complete.concept.length;i++){\n while(re2.test(complete.concept[i])){\n complete.concept[i]=complete.concept[i].replace(re2,\" \");\n }\n while(/\\n|\\r/g.test(complete.concept[i])){\n complete.concept[i]=complete.concept[i].replace(/\\n|\\r/g,\" \");\n }\n }\n //console.log(complete);\n callback(complete);\n });\n}", "function poll(result) {\n var stat = parseInt(result.status);\n if (stat === 0) {\n window.setTimeout(\n function () {\n BSVE.api.datasource.result(searchid, poll, onerror);\n },\n 500\n );\n } else if (stat === -1) {\n onerror();\n } else {\n $el.geojs('data', 'search', process_search(result));\n done();\n }\n }", "function searchApiCall(searchString: string): global.Promise {\n const payload = addMatchQuery(defaultSearch(context), searchString);\n return this.api.post(`/search/public/products_catalog_view/_search?size=${MAX_RESULTS}`, payload);\n}", "function bingImageSearch(imgQueryObj) {\r\n console.log('About to make Bing Api call promise');\r\n return new Promise((resolve, reject) => {\r\n let queryStringPath = config.apiEndPoint + '?q=' + encodeURIComponent(imgQueryObj.searchStr);\r\n if(!isNaN(parseInt(imgQueryObj.count))) {queryStringPath += '&count=' + imgQueryObj.count}\r\n if(!isNaN(parseInt(imgQueryObj.offset))) {queryStringPath += '&offset=' + imgQueryObj.offset}\r\n\r\n let requestParams = {\r\n method: 'GET',\r\n hostname: config.apiHost,\r\n path: queryStringPath,\r\n headers: {\r\n 'Ocp-Apim-Subscription-Key': config.apiKey1\r\n }\r\n };\r\n console.log('about to make http request to bing');\r\n let req = https.request(requestParams, (bingResponse) => {\r\n console.log('entered callback for http request');\r\n if (bingResponse) {\r\n resolve(bingResponse);\r\n } else {\r\n console.log('https request failed');\r\n reject('https request failed');\r\n }\r\n });\r\n req.end();\r\n });\r\n}", "function search(query, syncResults, asyncResults)\n{\n // Get places matching query (asynchronously)\n let parameters = {\n q: query\n };\n $.getJSON(\"/search\", parameters, function(data, textStatus, jqXHR) {\n\n // Call typeahead's callback with search results (i.e., places)\n asyncResults(data);\n });\n}", "search(city, result) {\n $.get(`${this.basePath}/search?page=1&per_page=25&location=${city}&distance=10&stolenness=proximity`)\n .then(function(response) {\n result(response.bikes);\n })\n .fail(function(error) {\n throw(error.responseText);\n });\n }", "function contentApiCallback(){\n\t\n\tvar output = \"\";\n\t\n\tif(myclient.data == null){\n \tvar display = \"<b><font color='red'>return object == null</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var textJson = gadgets.json.parse(myclient.data);\n if(!textJson){\n var display = \"<b><font color='red'>parsing results returned nothing</font></b>\"\n document.getElementById(myclient.divid).innerHTML = output;\n return;\n }\n \n var entries = textJson['search-results']['entry'];\n \n\t$.each(entries, function(i1, entry){\n \tvar title = entry['dc:title'];\n \toutput = output + (i1+1) + \". \" + title + \"<br>\";\n });\n \n document.getElementById(myclient.divid).innerHTML = \"Search results:<br>\"+output;\n}", "function getResults(query, callback)\n{\n var xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function()\n {\n if(xhr.readyState === 4)\n {\n var results;\n\n try\n {\n results = JSON.parse(this.responseText)\n callback(results);\n }\n catch(e)\n {\n // If we encounter an error while parsing the JSON,\n // silently handle the error\n callback([]);\n }\n }\n }\n\n xhr.open(\"GET\", \"/search?q=\" + encodeURIComponent(query));\n xhr.send();\n}", "function findEbayProducts(search){\n \n \n \n $.ajax({\n\t\ttype: \"GET\",\n\t\turl: \"assets/php/proxyEbay.php?search=\" + search,\n\t\tdataType: \"xml\",\n\t\tsuccess: parseXml\n\t });\n\t \n\t \n }", "async find(productStr, callback) {\n // this.EanSearchScrapper.searchForProduct(this.props.barCode, (productInfo) => {\n // if (!productInfo) {console.log(\"NULL\"); return; }\n //\n // this.props.setProductName(productInfo.name);\n // this.props.setProductPhotoUrl(productInfo.photoUrl);\n // this.setState({\n // loading: false\n // });\n // });\n\n this.GoogleSearchProductFinder.searchForProductV2(productStr, (productInfo) => {\n callback(productInfo);\n });\n\n // this.allegroScrapper.searchForProduct(this.props.barCode, (productInfo) => {\n // if (!productInfo) return;\n //\n // this.props.setProductName(productInfo.name);\n // this.props.setProductPhotoUrl(productInfo.photoUrl);\n // this.setState({\n // loading: false\n // });\n // });\n }", "search(value) {\n this.channel.publish(\"start\");\n const results = this.providers.map(provider => provider.search(value));\n Promise.all(results)\n .catch(err => {\n this.channel.publish(\"error\", err);\n this.channel.publish(\"complete\");\n })\n .then(() => this.channel.publish(\"complete\"));\n results.forEach(result => {\n result\n .catch(reason => {\n this.onError(reason);\n })\n .then(result => {\n if (!result)\n throw \"response expected\";\n this.onSuccess(result);\n });\n });\n }", "function tenorCallback_search(responsetext)\n{\n // parse the json response\n var response_objects = JSON.parse(responsetext);\n\n top_10_gifs = response_objects[\"results\"];\n\n // load the GIFs -- for our example we will load the first GIFs preview size (nanogif) and share size (tinygif)\n\n // document.getElementById(\"preview_gif\").src = top_10_gifs[0][\"media\"][0][\"nanogif\"][\"url\"];\n\n document.getElementById(\"share_gif\").src = top_10_gifs[0][\"media\"][0][\"tinygif\"][\"url\"];\n\n return;\n\n}", "async function callGeoCodeAPI(s) {\n const app_id = '3boscW8lytN3EJTQTIBS';\n const app_code = 'r9Lizz8pwlpdqNNBgVnAfA';\n const searchtext = s;\n let result = await axios({\n method: 'get',\n url: `https://geocoder.api.here.com/6.2/geocode.json?app_id=${app_id}&app_code=${app_code}&searchtext=${searchtext}`,\n });\n\n result = result['data']['Response']['View'][0]['Result'][0]['Location'];\n return result;\n}", "callBBBapi (path, callback) {\n\n let options = {\n host: 'api.bbb.org',\n port: 443,\n path: path,\n method: 'GET',\n headers: {\n 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13',\n 'Authorization': constants.BBB_TOKEN\n }};\n \n let request = https.request(options, function(response){\n console.log('Status: ' + response.statusCode);\n response.setEncoding('utf8');\n let body = '';\n response.on('data', (chunk) => body+=chunk);\n response.on('end', function () {\n let nodes = JSON.parse(body);\n if(nodes.TotalResults) console.log(\"Total Results: \" + nodes.TotalResults);\n if(nodes.SearchResults) callback(nodes.SearchResults);\n })});\n\n request.on('error', (error) => {\n console.log('***PROBLEM with request: '+error.message)\n });\n request.end();\n }", "function PlaceSearch(point, callback) {\n Places.search({\n location: point,\n types: Types,\n radius: 500\n },\n function(err,res) {\n if(err) {\n console.log(err);\n }\n else {\n callback(res);\n }\n });\n}", "function searchCompany(query, syncResults, asyncResults)\n{\n // Get places matching query (asynchronously)\n let parameters = {\n q: query\n };\n $.getJSON(\"/searchCompany\", parameters, function(data) {\n\n // Call typeahead's callback with search results (i.e., places)\n asyncResults(data);\n });\n}", "_performSearch() {\n let self = this;\n let content = '';\n for (var item in this.state) {\n if (this.state[item] !== '' && item !== \"searchParams\" && item != \"searchRadius\") {\n content = content + this.state[item] + '+';\n }\n }\n console.log(\"api key\", GOOGLE_API_KEY);\n console.log(\"content: \", content);\n\n self._getLatLong(content, callback)\n\n // Using this callback so it waits on the fetch to complete in _getLatLong\n function callback() {\n let latLong = self.state.latLong;\n let search = `${latLong['lat']},${latLong['lng']},${self.state.searchRadius}`\n self.setState({searchParams: search});\n self.props.search(self.state.searchParams, self.state.latLong);\n }\n }", "function getDataFromApi(searchTerm, callback) {\n displayLoadingMessage();\n $('.js-search-results').html();\n const settings = {\n url: endPoint,\n data: {\n term: 'restaurant',\n location: `${searchTerm}`,\n limit: 40,\n attributes: 'hot_and_new'\n },\n dataType: 'json',\n type: 'GET',\n success: callback\n };\n\n $.ajax(settings);\n\n}", "async search(searchObj) {\n const { results, searchURL } = await runSearch(searchObj)\n\n this.lastSearchURL = searchURL\n this.lastSearch = searchObj\n this.results = results\n\n return results\n }", "function search() {\t\t\t\t\n\t\t\tconsole.log(vm.apiDomain);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tAlleleFearSearchAPI.search(vm.apiDomain, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclear();\n\t\t\t\t pageScope.loadingEnd();\n\t\t\t\t}\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: AlleleFearSearchAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "function getBing()\n {\n service = 'News';\n $('#bing').empty();\n var query = queryTerm;\n $.getJSON('http://people.ischool.berkeley.edu/~haroon/IOLab/bing_proxy.php?callback=?', {q: query, sop: service}, function(data)\n {\n if (data.d !== undefined)\n {\n var j=0;\n var items = data.d.results;\n for (var i = 0 ; i < items.length && j<5; i++)\n {\n var item = items[i];\n $('#bingnews').append('<hr><li class=\"term\"><a href=\"'+item.Url+'\" title=\"'+item.Description+'\">'+ item.Title+'</li>');\n j += 1;\n }\n }\n });\n }", "function liveSearchBar(str)\n{\n ajax.process('GET', 'Models/livesearch.php?q=' + str, handleResponse);\n console.log(ajax);\n previousSearchQuery = str;\n}", "function onSearchResponse(response) {\r\n showResponse(response);\r\n}", "function searchTitlefromApi(searchTerm, callback) {\n let details = {\n url: '/search',\n data: JSON.stringify({\n \"query\": searchTerm\n }),\n dataType: 'json',\n type: 'POST',\n contentType: \"application/json; charset=utf-8\",\n success: callback,\n error: function (data) {\n if (data.status === 404) {\n $('.js-noResults').text(`Error code 404: Sorry, there was an error processing your request.`);\n $('.js-noResults').removeClass('hidden');\n }\n }\n };\n $.ajax(details);\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function search(query, syncResults, asyncResults)\n{\n // get places matching query (asynchronously)\n\n let parameters = {\n q: query\n };\n\n $.getJSON(\"/search\", parameters)\n .done(function(data, textStatus, jqXHR) {\n // call typeahead's callback with search results (i.e., places)\n asyncResults(data);\n })\n\n .fail(function(jqXHR, textStatus, errorThrown) {\n // log error to browser's console\n console.log(errorThrown.toString());\n // call typeahead's callback with no results\n asyncResults([]);\n\n });\n}", "function handleSearchResponse(_event) {\r\n let xhr = _event.target;\r\n if (xhr.readyState == XMLHttpRequest.DONE) {\r\n alert(xhr.response);\r\n }\r\n }", "function doSearch(query, pageNum, locale, category, catOnly) {\n cleanOut(oneSource);\n cleanOut(tempSource);\n var city = $('#city-state').val();\n if (catOnly == 'yes') {\n var cat = parseInt(category, 10);\n runWPAPI(locale, cat, city);\n } else {\n runWPAPI(locale, cat, city);\n }\n var cleanQuery = query.replace(/\\s/g, '+');\n var proxyAPI = 'XXXXXXXXX';\n if ($('#city').val() && $('#state').val()) {\n var city = $('#city').val();\n var cityCleanUp = city.replace(/\\s/g, '+');\n var state = $('#state').val();\n var queryLocale = \"&l=\" + cityCleanUp + \"%2C+\" + state;\n var target2API = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&start=\" + pageNum + \"&q=\" + cleanQuery + queryLocale;\n var targetAPIALT = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&q=\" + cleanQuery + queryLocale;\n } else {\n var target2API = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&start=\" + pageNum + \"&q=\" + cleanQuery;\n var targetAPIALT = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&q=\" + cleanQuery;\n }\n getAPIData(target2API + \"&callback=?\", function(returndata) {\n var data = returndata;\n //var dataTempFiltered = [];\n var totalPull = Math.round(data.totalResults / 25);\n if (totalPull > 50) {\n // loop\n for (i = 0; i < 50; i++) {\n var targetNum = 25 * i;\n var numTrack = i;\n if (numTrack == 49) {\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n checkGlobalGym();\n })\n } else {\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n })\n }\n }\n //end loop\n } else {\n //loop\n for (i = 0; i < totalPull; i++) {\n var targetNum = 25 * i;\n var numTrack = i;\n if (numTrack == (totalPull - 1)) {\n //console.log('final api under 40');\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n checkGlobalGym();\n })\n } else {\n //console.log('run api under 40');\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n })\n }\n }\n //end loop\n }\n })\n async function checkGlobalGym() {\n setupDataNew(tempSource);\n }\n}", "function grab_data(searchTerm, lmt)\n{\n var apikey = keys.tenor;\n\n // using default locale of en_US\n var search_url = \"https://api.tenor.com/v1/search?tag=\" + search_term + \"&key=\" +\n apikey + \"&limit=\" + lmt;\n\n httpGetAsync(search_url,tenorCallback_search);\n\n // data will be loaded by each call's callback\n return;\n}", "function SearchFeats (searchterm, callback){\n\tMongoClient.connect(conn, function(err, client) {\n\t\t//error free first, bb\n\t\tif(err){\n\t\t\tconsole.log(\"error connecting to db_lorr\");\n\t\t\tclient.close();\n\t\t\tmessage.reply(\"We couldn't connect you..\");\n\t\t\tthrow err;\n\t\t}\n\t\telse { console.log(\"connection successful\");\n\n\t\t\t//ok now search everything else.\n\t\t\tconst db = client.db(database);\n\t\t\tconst coll = db.collection(collection);\n\t\t\tvar finalresult = \"\";\n\t\t\tvar m;\n\t\t\t\n\t\t\tassert.equal(null, err);\n\t\t\tconsole.log(\"Connected successfully to server\");\n\n\t\t\t//Nate, implement a text index for non-exact searching. \n\t\t\t//if you don't, use what I have below to replace the {$text...} part\n\t\t\t//{name : searchterm}\n\t\t\tcoll.find({ $text: { $search: searchterm } }).toArray(function(err, result){\n\t\t\t\tif(err){\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t}\n\t\t\t\telse if(result.length > 0) {\n\t\t\t\t\tcallback(result);\n\t\t\t\t\tconsole.log(result);\n\t\t\t\t\tconsole.log(\"found result, sent to callback\");\n\t\t\t\t\tclient.close();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconsole.log(\"lorr_db closed.\");\n\t\t}\n\n\t});\n}", "function search(evt){\r\n\r\n if (evt){\r\n // don't search if pressing keys to navigate the list\r\n switch(evt.which){\r\n case 13:\r\n case 37:\r\n case 38:\r\n case 40:\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n return false; \r\n break;\r\n }\r\n }\r\n\r\n var searchstring = plugin.pcwInput.val();\r\n\r\n if (searchstring == ''){\r\n return;\r\n }\r\n\r\n // store the search string\r\n plugin.pcwInput.data('search-text',searchstring);\r\n\r\n if ($.trim(searchstring) == ''){\r\n return false;\r\n }\r\n \r\n $.ajax({\r\n url: constants.searchURL.replace('{{key}}', plugin.config.apikey) + searchstring,\r\n type: 'GET',\r\n dataType: 'jsonp',\r\n success: function(data){\r\n \r\n var addresses = data.predictions;\r\n\r\n if (addresses.length > 0){\r\n\r\n if (addresses.length == 1){\r\n // go straight to browse ??\r\n //browse(addresses[0][1]);\r\n }\r\n\r\n plugin.pcwAddressBrowse.trigger('hide');\r\n plugin.pcwAddressSelect.html('');\r\n\r\n // check searchstring is still current.\r\n if (searchstring === plugin.pcwInput.val()){\r\n \r\n // add the addresses to the Select drop down\r\n $.each(addresses, function(index, value){\r\n var listitem = $('<li></li>');\r\n var css = (value.complete) ? 'finish' : 'browse';\r\n var listitemlink = $('<a href=\"#\" class=\"'+css+'\">'+value.prediction+'</a>').data((value.complete)?'finish-id':'browse-id',value.refs);\r\n\r\n plugin.pcwAddressSelect.append(listitem.append(listitemlink)).trigger('show');\r\n\r\n });\r\n\r\n }\r\n\r\n }else{\r\n // try and filter any results we already have ??\r\n //filter(plugin.pcwAddressSelect, evt);\r\n }\r\n\r\n },\r\n error: function() { debug('Search failed',2) },\r\n timeout: 2000\r\n });\r\n }", "afterSearch(searchText, result) {\n }", "function searchforwords(str) {\n\n try {\n // PROCEED ONLY IF OBJECT IS NOT BUSY\n if (xmlhttp.readyState === 4 || xmlhttp.readyState === 0) {\n // EXECUTE THE PAGE ON THE SERVER AND PASS QUERYSTRING\n xmlhttp.open(\"POST\", \"../autocomplete.aspx\", true);\n \n // DEFINE METHOD TO HANDLE THE RESPONSE\n xmlhttp.onreadystatechange = handleresponse;\n // MAKE CALL\n xmlhttp.send(null);\n\n } else {\n // IF CONNECTION IS BUSY, WAIT AND RETRY\n setTimeout('searchforwords(\"' + str + '\")', 1000);\n }\n } catch (e) {\n //alert('ERROR: ' + e);\n }\n}" ]
[ "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.7368026", "0.73543155", "0.73543155", "0.73543155", "0.7196501", "0.6733122", "0.6420894", "0.6346361", "0.6180528", "0.6147053", "0.6122946", "0.6110541", "0.60811836", "0.60500455", "0.6046917", "0.6020785", "0.5991799", "0.5991799", "0.5991799", "0.5990197", "0.5990197", "0.598886", "0.59681565", "0.5945004", "0.5924367", "0.5917872", "0.59177464", "0.5908514", "0.5894575", "0.5872787", "0.58669424", "0.5859427", "0.5850774", "0.5837582", "0.5833351", "0.58159006", "0.58109444", "0.57999367", "0.57979435", "0.5788047", "0.5772951", "0.57686275", "0.57628655", "0.57538205", "0.5751717", "0.57449245", "0.57437235", "0.5727874", "0.5726806", "0.5724101", "0.5721672", "0.5706508", "0.5704555", "0.5703158", "0.5697067", "0.56944627", "0.56940997", "0.5676862", "0.5670453", "0.5669718", "0.56653804", "0.56610847", "0.5658872", "0.56587625", "0.56529576", "0.56471694", "0.56453425", "0.5633593", "0.56334114", "0.5626518", "0.5620164", "0.55957824", "0.55957216", "0.55940115", "0.55909985", "0.55835986", "0.5582406", "0.5577303", "0.5577303", "0.5577303", "0.5577303", "0.55752784", "0.5573298", "0.5571238", "0.55663985", "0.5554717", "0.55544925", "0.55510265", "0.5548048" ]
0.7414053
2
Following the finding the district stuff
function query_promise_then(result) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function districtSets() {\n let defaultFilter = feature => {\n return (\n feature.properties.SWCDIST_N &&\n feature.properties.SWCDIST_N.match(/\\s+[0-9]+$/)\n );\n };\n let defaultGrouping = feature => {\n return feature.properties.SWCDIST;\n };\n let defaultParser = input => {\n // Get parent name\n let parentTitle = input.SWCDIST_N.replace(/\\s+[0-9]+$/, '').trim();\n\n // Get subdistrict\n let subdistrict = input.SWCDIST_N.match(/\\s+([0-9]+)$/)[1];\n\n return {\n localId: `27-${input.SWCDIST.toString().padStart(4, '0')}`,\n title: `${parentTitle} Soil and Water Conservation District Subdistrict ${subdistrict}`,\n shortTitle: `${parentTitle} Subdistrict ${subdistrict}`,\n parentTitle,\n allCounties: _.uniq(\n input.fullGroup.map(p => {\n return p.COUNTYFIPS.toString().padStart(3, '0');\n })\n )\n };\n };\n\n return {\n 2018: {\n url:\n 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2018general',\n output: 'vtd2018general.geo.json',\n start: moment('2018-01-01'),\n end: moment('2019-12-31'),\n parser: defaultParser,\n filter: defaultFilter,\n grouping: defaultGrouping,\n countyParentYear: 2017\n },\n 2016: {\n url:\n 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2016general',\n output: 'vtd2016general.geo.json',\n start: moment('2016-01-01'),\n end: moment('2017-12-31'),\n parser: defaultParser,\n filter: defaultFilter,\n grouping: defaultGrouping,\n countyParentYear: 2017\n },\n 2014: {\n url:\n 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2014general',\n output: 'vtd2014general.geo.json',\n start: moment('2014-01-01'),\n end: moment('2015-12-31'),\n parser: defaultParser,\n filter: defaultFilter,\n grouping: defaultGrouping,\n countyParentYear: 2017\n }\n // Doesn't have name, so we can't determine the larger districts\n // 2012: {\n // url:\n // 'https://www.gis.leg.mn/php/shptoGeojson.php?file=/geo/data/vtd/vtd2012general',\n // output: 'vtd2014general.geo.json',\n // start: moment('2012-01-01'),\n // end: moment('2013-12-31'),\n // parser: defaultParser,\n // filter: defaultFilter,\n // grouping: defaultGrouping,\n // countyParentYear: 2017\n // }\n };\n}", "function district() {\n\n\t\tvar cur_districts = document.getElementsByClassName('#districts');\n\t\tif (cur_districts.length != 0) {\n\t\t\tcur_districts[0].innerHTML = \"\";\n\t\t}\n\n\t\tvar cur_legend = document.getElementsByClassName('key');\n\t\tlen = cur_legend.length;\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tcur_legend[i].parentElement.removeChild(cur_legend[i]);\n\t\t}\n\n\t\tsetselanddisptxt();\n\n\t\tsetdomains();\n\n\t\tdisplegend();\n\n\t\tdistrictsvg.selectAll(\"path\")\n\t\t.data(topojson.feature(districts, districts.objects.Dist).features)\n\t\t.enter().append(\"path\")\n\t\t.filter(function (d) {\n\t\t\tvar valcolor;\n\t\t\tif (display == \"Total\") {\n\t\t\t\tvalcolor = +d.properties[selected] * 0.0001;\n\t\t\t} else {\n\t\t\t\tif (+d.properties[selected.replace(/OSC/i, \"total\")] != 0) {\n\t\t\t\t\tvalcolor = (+d.properties[selected] / +d.properties[selected.replace(/OSC/i, \"total\")]) * 100;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t(d.properties.name != \"Pak Occupied Kashmir\") &&\n\t\t\t\t((+d.properties[selected.replace(/OSC/i, \"total\")] != 0) ||\n\t\t\t\t\t(display == \"Total\")) &&\n\t\t\t\t(statename == \"India\" || d.properties.statename == statename) &&\n\t\t\t\t((bound1 == 0 && bound2 == 0) || ((valcolor >= bound1 && valcolor <= bound2))));\n\t\t})\n\t\t.attr(\"style\", function (d) {\n\n\t\t\tvar districtcolor;\n\n\t\t\tif (display == \"Total\") {\n\t\t\t\tdistrictcolor = \"fill:\" + color(+d.properties[selected] * 0.0001) + \";opacity:1;stroke-opacity: 0;stroke-width: 0.4;\";\n\t\t\t} else {\n\t\t\t\tdistrictcolor = \"fill:\" + color((+d.properties[selected] / +d.properties[selected.replace(/OSC/i, \"total\")]) * 100) + \";opacity:1;stroke-opacity: 0;stroke-width: 0.4;\";\n\t\t\t}\n\t\t\treturn districtcolor;\n\t\t})\n\t\t.attr(\"d\", path)\n\t\t.on(\"mouseover\", displaytooltip)\n\t\t// fade out tooltip on mouse out\n\t\t.on(\"mouseout\", hidetooltip);\n\n\t}", "function addDistrict (feature) {\n let foundId;\n for (const districtId of Object.keys(districtToGeoJSON)) {\n //console.log(`Checking if ${feature.geometry.type} is within ${districtToGeoJSON[districtId].geometry.type}`)\n\n if (within(feature, districtToGeoJSON[districtId])) {\n console.log(`\\tAdding Council District ${districtId}`)\n foundId = districtId;\n break;\n }\n }\n\n if (!foundId) {\n console.log(\"\\tWARNING: Found No matching District\")\n }\n return foundId;\n}", "function getDistrict(LatLng) {\r\n for (var i = 0; i < 71; i++) {\r\n if(geoShapeType[i]==\"Polygon\"){\r\n if(google.maps.geometry.poly.containsLocation(LatLng, locationPolygon[i])) {\r\n return geoShapeBOROCD[i];\r\n }\r\n }else{\r\n for (var j = 0; j < locationPolygon[i].length; j++) {\r\n if(google.maps.geometry.poly.containsLocation(LatLng, locationPolygon[i][j])) {\r\n return geoShapeBOROCD[i];\r\n }\r\n }\r\n }\r\n }\r\n}", "highlightDistrict(geoid) {\n let filterSettings;\n // Filter for which district has been selected.\n if (typeof geoid === 'object') {\n filterSettings = ['any'];\n\n geoid.forEach((i) => {\n filterSettings.push(['==', 'GEOID', i]);\n });\n } else {\n if (geoid.substring(0, 2) === '42') {\n filterSettings = ['all', ['==', 'DISTRICT', geoid.substring(2)]];\n this.toggleFilters('selected-border-pa', filterSettings);\n return;\n }\n filterSettings = ['all', ['==', 'GEOID', geoid]];\n }\n // Set that layer filter to the selected\n this.toggleFilters('selected-fill', filterSettings);\n this.toggleFilters('selected-border', filterSettings);\n }", "function extractCouncilDistricts (jsonPath) {\n const districtFileContents = fs.readFileSync(jsonPath)\n const councilFeatureCollection = JSON.parse(districtFileContents)\n\n // keys are district numbers, values are GeoJSONn boundaries\n let idToBoundaryMap = {}\n\n councilFeatureCollection.features.forEach(feature => {\n const districtId = feature.properties['DISTRICT']\n if (districtId) {\n // District 1 is represented by three MultiPolygons. The first wo are are for tiny\n // islands where no sidewalks were built, so we only consider the third\n // which has an ID of \"CityCouncilDistricts.8\"\n if (districtId === 1) {\n if (feature.id === \"CityCouncilDistricts.8\") {\n console.log(`Found boundary for City Council district 1.`)\n idToBoundaryMap[districtId] = feature;\n }\n else {\n console.log(`Dicarding tiny island from District 1 where no sidewalks were built.`)\n }\n }\n else {\n console.log(`Found boundary for City Council district ${districtId}.`)\n idToBoundaryMap[districtId] = feature;\n }\n }\n })\n\n return idToBoundaryMap;\n}", "function spacesPerDistrict() {\n\n var d0Counter = 0;\n var d1Counter = 0;\n\n for (var i = 0; i < dataArray.length; i++) {\n if (dataArray[i].properties.G_DISTRICT == \"DISTRICT 0\") {\n d0Counter++;\n }\n if (dataArray[i].properties.G_DISTRICT == \"DISTRICT 1\") {\n d1Counter++;\n }\n }\n\n console.log(\"D0 Spaces: \" + d0Counter)\n console.log(\"D1 Spaces: \" + d1Counter)\n}", "function populateDistricts() {\n\n\tvar countyId = $('#select_filter_districts_by_county').val();\n\tvar searchDistrict = $(\"#id_input_search_district\").val();\n\n\trequest_url = DISTRICTS_URL;\n\trequest_params = ACTION_TYPE + \"=\" + ACTION_QUERY + \"&\" + SEARCH_KEY + \"=\"\n\t\t\t+ searchDistrict + \"&county=\" + countyId;\n\trequest_intent = INTENT_QUERY_DISTRICTS;\n\tsendPOSTHttpRequest(request_url, request_params, request_intent);\n}", "function callback_GetDistrictDrillDownData(resp){\n\tvar check,districtLcase,drillDown = {};\n\tif(resp != undefined){\n\t\t//console.log(\"========= Receiving response from indicator service for district. ==========\");\n\t\t//console.log(resp);\n\t\tvar currentView = dureUtil.retrieveFromLocal(\"currentView\");\n\t\tvar year = dureUtil.getCurrentYear();\t\t\n\t\tif(resp.localAttributeData[0][year] != undefined){\n\t\t\t\n\t\t\t//drillDown.summaryData = resp.indicators[3].districtIndicatorSummaryData[0][dureUtil.indicatorMaxYear][0].data;\n\t\t\tcheck = local.setDataForMap(resp);\n\t\t\tdistrictLcase = subprovince.getName();\n\t\t\t//dureUtil.loadInitialRegionSummaryData(drillDown.summaryData);\n\t\t\t//console.log(districtLcase);\n\t\t\tif(check){\n\t\t\t\tsubprovince.drilldownToDistrict(districtLcase);\n\t\t\t}\n\t\t}else{\n\t\t\n\t\t\tdureApp.showDialog('Local Data unavailable for the current year.','error');\n\t\t}\n\t}else{\n\t\tdureApp.showDialog('Data unavailable.','error');\n\t}\n}", "loadDistricts(callback) {\n const searchQuery = {\n index: districtIndex,\n body: {\n size: 100,\n _source: ['properties', 'center', 'geometry'],\n },\n }\n client\n .search(searchQuery, ((error, body) => {\n if (error) {\n console.trace('error', error.message)\n }\n let districts = []\n if (body && body.hits) {\n const results = body.hits.hits\n for (const { _id, _source: { properties: district, center: { coordinates }, geometry } } of results) {\n districts.push({\n id: _id,\n name: district.Name,\n number: district.Nr,\n centerLat: coordinates[1],\n centerLon: coordinates[0],\n polygon: geometry,\n })\n }\n }\n // sort\n districts = districts.sort((a, b) => a.name.localeCompare(b.name))\n callback(districts)\n }))\n }", "function createDistricts(){\n if (districts) {\n //create a Leaflet GeoJSON layer and add it to the map\n if (courtDistricts && typeof courtDistricts.remove === 'function') {\n courtDistricts.remove();\n }\n courtDistricts = L.geoJson(districts, {\n style: style\n }).addTo(map);\n jsonCheck = 1;\n updateActiveCases();\n\n } else if (typeof courtDistricts != 'undefined'){\n courtDistricts.remove();\n }\n console.log(courtDistricts);\n\n }", "function populateTrashedDistricts() {\n\n\tvar countyId = $('#select_filter_deleted_districts_by_county').val();\n\tvar searchDistrict = $(\"#id_input_search_deleted_district\").val();\n\n\trequest_url = DISTRICTS_URL;\n\trequest_params = ACTION_TYPE + \"=\" + ACTION_QUERY + \"&\" + SEARCH_KEY + \"=\"\n\t\t\t+ searchDistrict + \"&county=\" + countyId;\n\trequest_intent = INTENT_QUERY_DELETED_DISTRICTS;\n\tsendPOSTHttpRequest(request_url, request_params, request_intent);\n}", "function setUpDistrictChart()\n{ \n let selection_area = document.getElementById(\"counties-selection-area\");\n district_selected_county = selection_area.options[selection_area.selectedIndex].text;\n let district_data = population_data.filter((population) =>\n {\n if (population.county === district_selected_county)\n {\n return true;\n }\n return false;\n });\n let districts_name = getDistrictName(district_data);\n let male_population_per_district = getMalePopulationPerDistrct(district_data);\n let female_population_per_district = getFemalePopulationPerDistrct(district_data);\n updateDistrictChart(district_chart,districts_name,male_population_per_district,female_population_per_district);\n}", "function getDistrictInfoByGeoid(attributes) {\n if (isDefined(attributes)) {\n var geoid = attributes.GEOID\n for (var i = 0; i < members.length; i++) {\n if (members[i].GEOID === geoid) {\n return `\n <div class=\"borderedRow\">\n <div class=\"col6\">\n <p>State: ${members[i].StateCode}</p>\n <p>District: ${members[i].StateDistrict}</p>\n <p>Representative: ${members[i].Member}</p>\n </div>\n <div class=\"col6\">\n <a href=\"${memberLink + members[i].Id}\" target=\"_blank\">\n <img src=\"https://clerkpreview.house.gov/content/assets/img/members/${members[i].Id}.jpg\"/>\n </a>\n </div>\n </div>\n `;\n }\n }\n }\n return \"\";\n }", "function getColor_District(precinctID) {\n var myDistrict = precinctDistricts[precinctID];\n if (myDistrict) {\n return districtColors[myDistrict - 1];\n }\n return '#000000';\n}", "function getDistrictName(district_data)\n{\n let districts_name = [];\n for (let i = 0; i < district_data.length; i++)\n {\n districts_name.push(district_data[i].district);\n }\n return districts_name;\n}", "function get_covid_all_location(districts) {\n\tfor (let district of districts.districts) {\n\t\tfetch(`http://103.148.57.200:5000/districts/${district.id}`)\n\t\t\t.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.then((data) => {\n\t\t\t\tresult = {\n\t\t\t\t\tplace: district.title,\n\t\t\t\t\ttotalPositive: data.summary.totalPositive,\n\t\t\t\t\tsummary: data.summary,\n\t\t\t\t\twards: data.wards,\n\t\t\t\t};\n\t\t\t\tcovid_data.push(result);\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tconsole.log(\"Error: \", err);\n\t\t\t});\n\t}\n}", "function where_is_doge(){\n var doge_locs = []\n for(var i = 0; i < room_list.length; i++){\n for(var j= 0; j < room_list[0].length; j++){\n for(var r = 0; r < room_list[i][j].room_map.length; r++){\n for(var c = 0; c < room_list[i][j].room_map[0].length; c++){\n if(room_list[i][j].room_map[r][c].dog_present){\n doge_locs.push([i, j, room_list[i][j].room_map[r][c]])\n }\n }\n }\n }\n }\n return doge_locs;\n}", "getDistrictData (filterParams) {\n this.setState({districts: null})\n axios.get(url.api_url + 'district/filter?filter=' +\n JSON.stringify(filterParams)).then((response) => {\n if (response.data.length === 0) {\n this.setState({districts: -2, cur_page: -1, displayed_districts: -2})\n } else {\n this.setState({\n districts: response.data,\n cur_page: response.data.length / 16,\n displayed_districts: response.data.subarray(0, 16)\n })\n }\n }).catch((error) => {\n if (error) {\n this.setState({districts: -1})\n }\n })\n }", "function show_state_wise_districts(state_id){\n\n\t$.ajax({\n\t\turl:root_path+\"/api/get_state_wise_districts.php\",\n\t\tdataType:\"JSON\",\n\t\tdata:{state_id:state_id},\n\t\ttype:\"POST\",\n\t\tsuccess: function(response){\n\t\t\tvar option=\"<option>Select District</option>\";\n\t\t\t$.each(response,function(i,v){\n\t\t\t\toption+=\"<option value='\"+v.rec_id+\"'>\"+v.district_name+\"</option>\";\n\t\t\t});\n\t\t\t$(\"#district_drop_down\").html(option);\n\t\t\t$(\"#district_drop_down_edit_mandal\").html(option);\n\t\t\t$(\"#district_drop_down_edit_village\").html(option);\n\t\t\t$(\"#district_drop_down_edit_branches\").html(option);\n\n\n\t\t}\n\t});\t\n}", "function getInfoMN(PrecinctID) {\n var myData = precinctData[PrecinctID];\n var toReturn = '';\n var statNames = Object.keys(stateSyntax);\n // console.log(statNames);\n // console.log(myData);\n for (var i = 0; i < statNames.length; i++) {\n var statName = statNames[i];\n toReturn += \"<br>\";\n toReturn += \"<b>\" + statName + \"</b>: \";\n toReturn += myData[stateSyntax[statName]];\n }\n toReturn += \"<br><b>District</b>: \" + precinctDistricts[myData[stateSyntax[precinctID_NAME]]];\n return toReturn;\n}", "function getFilteredTripsByDistrict(){\n let num_studios = app.num_studios;\n let num_1bed = app.num_1bed;\n let num_2bed = app.num_2bed;\n let num_3bed = app.num_3bed;\n let tot_num_bedrooms = num_studios + num_1bed + (2*app.num_2bed) + (3*app.num_3bed);\n let attr;\n let rate;\n let rate_key;\n let unit;\n let scalar;\n let proxyLandUse;\n \n for (let district of geoDistricts) {\n let personTrips = {};\n let vehicleTrips = {};\n let totalPersonTrips = {};\n let totalVehicleTripsByMode = {};\n let geoId;\n \n switch(selectedDistribution) {\n case 'district':\n geoId = addressDistrictNum;\n break;\n case 'place-type':\n geoId = addressPlaceType;\n break;\n case 'city':\n geoId = 1;\n break;\n default:\n geoId = addressDistrictNum;\n break;\n }\n \n for (let landUse of landUses) {\n attr = landUseToAttr[landUse];\n rate_key = attr['rate_key'];\n scalar = attr['scalar'];\n unit = attr['unit'];\n proxyLandUse = attr['proxyLandUse'];\n \n switch (selectedTimePeriod) {\n case 'pm':\n rate = tripGenRates[rate_key].pkhr_rate;\n break;\n case 'daily':\n rate = tripGenRates[rate_key].daily_rate;\n break;\n }\n \n let mode2=selectedMode;\n if (selectedMode == 'tnc/taxi'){\n mode2='tnc_taxi';\n }\n \n personTrips[landUse] = (rate*scalar)*filterModeSplitData(proxyLandUse, app.placetype)[0][mode2]* \n getDistProps(selectedDistribution, geoId, district,\n selectedMode, selectedDirection, proxyLandUse,\n selectedTimePeriod, selectedPurpose)\n vehicleTrips[landUse] = personTrips[landUse]/(filterAvoData(proxyLandUse.toLowerCase(), selectedTimePeriod, selectedDistribution, geoId));\n }\n //if any of the land uses are undefined b/c no input, set them equal to 0. landUses is a global array of all 5 land uses\n personTrips[\"total\"] = 0\n vehicleTrips[\"total\"] = 0\n for (let landUse of landUses) {\n if (!(personTrips[landUse])){\n personTrips[landUse] == 0;\n }\n if (!(vehicleTrips[landUse])){\n vehicleTrips[landUse] == 0;\n }\n personTrips[\"total\"] += personTrips[landUse]\n vehicleTrips[\"total\"] += vehicleTrips[landUse]\n }\n districtPersonTrips[district.dist] = personTrips; //this creates a dictionary of dictionaries, with one dictionary for every district where the keys are the land uses/total\n //and the dictionary is populated by the time period\n districtVehicleTrips[district.dist] = vehicleTrips;\n }\n}", "function /*void*/ mapCityDistrict() {\n\tvar cityId = 0; \t//e.g. cityId = 1343 (set cityId to get all districts for the specified city)\n new Ajax.Request (\n 'ajaxXML', // url\n { // options\n method: 'get', // http method\n parameters: 'provider=CityDistrictMapProvider&cityId=' + cityId, // request parameters\n //indicator: 'throbbing'\n onSuccess: processCityDistrictMapSuccess,\n onFailure: processFailure\n }\n );\n}", "function updateStoryDistricts(districts) {\n\n // Update the sidebar filter.\n d3.select(\"#cb1\").property(\"checked\", (districts.indexOf(1) > -1) ? true : false);\n d3.select(\"#cb2\").property(\"checked\", (districts.indexOf(2) > -1) ? true : false);\n d3.select(\"#cb3\").property(\"checked\", (districts.indexOf(3) > -1) ? true : false);\n d3.select(\"#cb4\").property(\"checked\", (districts.indexOf(4) > -1) ? true : false);\n d3.select(\"#cb5\").property(\"checked\", (districts.indexOf(5) > -1) ? true : false);\n d3.select(\"#cb6\").property(\"checked\", (districts.indexOf(6) > -1) ? true : false);\n d3.select(\"#cb7\").property(\"checked\", (districts.indexOf(7) > -1) ? true : false);\n d3.select(\"#cb8\").property(\"checked\", (districts.indexOf(8) > -1) ? true : false);\n d3.select(\"#cb9\").property(\"checked\", (districts.indexOf(9) > -1) ? true : false);\n d3.select(\"#cb10\").property(\"checked\", (districts.indexOf(10) > -1) ? true : false);\n d3.select(\"#cb11\").property(\"checked\", (districts.indexOf(11) > -1) ? true : false);\n d3.select(\"#cb12\").property(\"checked\", (districts.indexOf(12) > -1) ? true : false);\n d3.select(\"#cb13\").property(\"checked\", (districts.indexOf(13) > -1) ? true : false);\n d3.select(\"#cb14\").property(\"checked\", (districts.indexOf(14) > -1) ? true : false);\n d3.select(\"#cb15\").property(\"checked\", (districts.indexOf(15) > -1) ? true : false);\n d3.select(\"#cb16\").property(\"checked\", (districts.indexOf(16) > -1) ? true : false);\n d3.select(\"#cb17\").property(\"checked\", (districts.indexOf(17) > -1) ? true : false);\n d3.select(\"#cb18\").property(\"checked\", (districts.indexOf(18) > -1) ? true : false);\n d3.select(\"#cb19\").property(\"checked\", (districts.indexOf(19) > -1) ? true : false);\n d3.select(\"#cb20\").property(\"checked\", (districts.indexOf(20) > -1) ? true : false);\n\n\n\n\n\n\n\n\n\n // Update the map.\n if (map)\n map.setFilter('total', ['in', 'reg_istat_code_num'].concat(districts));\n map.setFilter('pol', ['in', 'reg_istat_code_num'].concat(districts));\n map.setFilter('rel', ['in', 'reg_istat_code_num'].concat(districts));\n\n}", "function districtQuery(postcode, $targetControl) {\n 'use strict';\n\n // GET using Ajax\n var jqxhr = $.ajax({\n type: 'GET',\n url: '/service/postcode/' + postcode + '/district',\n dataType: 'json',\n success: function() { writeDistrictResults(jqxhr.responseText, $targetControl); },\n error: function() { bootbox.alert('Error looking up District'); },\n fail: function() { bootbox.alert('Problem reaching District service'); }\n });\n}", "function loadDistsProv(prov)\n{\n var censusSelect = document.distForm.Census;\n var census = censusSelect.value;\n var censusYear = census.substring(2);\n var xmlName;\n if (censusYear < \"1871\")\n { // pre-confederation\n xmlName = \"CensusGetDistricts.php?Census=\" + prov + censusYear;\n } // pre-confederation\n else\n { // post-confederation\n xmlName = \"CensusGetDistricts.php?Census=\" + census +\n \"&Province=\" + prov;\n } // post-confederation\n var tdNode = document.getElementById('DivisionCell');\n tdNode.innerHTML = '';\n\n // get the district information file \n HTTP.getXML(xmlName,\n gotDistFile,\n noDistFile);\n}", "function selectDefaultDistrict() {\n usStatelayer.queryFeatures({\n where: propertyNames.StateLayer.Name + \"='\" + selectedMemberLocation.state + \"'\",\n returnGeometry: true,\n outFields: [propertyNames.StateLayer.Id]\n }).then(function (response) {\n var features = response.features;\n var stateFp = features[0].attributes[propertyNames.StateLayer.Id];\n stateSelected(stateFp);\n goTo(features[0].geometry, true);\n usdistrictlayer.queryFeatures({\n where: propertyNames.DistrictLayer.DistrictNumber + \"=\" + selectedMemberLocation.districtNum + \" and \" +\n propertyNames.DistrictLayer.StateId + \"=\" + stateFp,\n returnGeometry: true,\n outFields: [\"*\"]\n }).then(function (districtResponse) {\n usdistrictlayer.popupEnabled = true;\n var features = districtResponse.features;\n mapview.popup.content = (isDefined(features) && isDefined(features[0]) && isDefined(features[0].attributes)) ? getDistrictInfoByGeoid(features[0].attributes) : \"\";\n mapview.popup.open();\n });\n });\n }", "function getListOfDistrict_specialIndent() {\n $(\"#districs_id\").empty();\n $(\"#districs_id_reg\").empty();\n loadingDistrictsMaster();\n var selectfirst = \"<option value='0'>Select District</option>\";\n $('#districs_id').append(selectfirst);\n $('#districs_id_reg').append(selectfirst);\n $.each(district, function (i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districs_id');\n $(districts).appendTo('#districs_id_reg');\n\n });\n $('#districs_id').trigger(\"chosen:updated\");\n $('#districs_id_reg').trigger(\"chosen:updated\");\n $('#districs_id').chosen();\n $('#districs_id_reg').chosen();\n}", "function subDistSet()\n{\n var newSubDistCode = args[\"subdistrict\"];\n if (newSubDistCode === undefined)\n return true;\n\n var subDistSelect = document.distForm.SubDistrict;\n var distOpts = subDistSelect.options;\n for(var i = 0; i < distOpts.length; i++)\n {\n if (distOpts[i].value == newSubDistCode)\n { // found matching entry\n subDistSelect.selectedIndex = i;\n changeSubDist(); \n break;\n } // found matching entry\n } // search for subDistrict to select\n\n // select specific division\n var newDivCode = args[\"division\"];\n if (newDivCode !== undefined)\n { // Division identifier supplied\n var divSelect = document.distForm.Division;\n if (divSelect !== undefined)\n { // SubDistrict has a Division select\n var divOpts = divSelect.options;\n for(var i = 0; i < divOpts.length; i++)\n {\n if (divOpts[i].value == newDivCode)\n { // found matching entry\n divSelect.selectedIndex = i;\n break;\n } // found matching entry\n } // search for division to select\n } // SubDistrict has a Division select\n } // Division identifier supplied\n\n // select specific Page\n var newPageCode = args[\"page\"];\n if (newPageCode !== undefined)\n { // Page identifier supplied\n var pageSelect = document.distForm.Page;\n if (pageSelect !== undefined)\n { // Division has a Page select\n pageSelect.selectedIndex = Number(newPageCode) - 1;\n } // Division has a Page select\n } // Page identifier supplied\n}", "function getDistrictColors() {\n var toReturn = {};\n var districts = Object.values(precinctDistricts);\n for (var i = 0; i < districts.length; i++) {\n var cur_dist = districts[i];\n if (cur_dist != null && toReturn[cur_dist] == undefined) {\n toReturn[cur_dist] = districtColors[cur_dist - 1];\n }\n }\n return toReturn;\n}", "function getDistrict(lat, lon){\r\n\tvar url = \"http://open.mapquestapi.com/nominatim/v1/reverse?format=xml&lat=\"+lat+\"&lon=\"+lon+\"&zoom=18&addressdetails=1\";\r\n\tvar district = \"abcd\";\r\n\tvar temp = [];\r\n\t$.ajax({\r\n\t\tasync: false,\r\n\t\ttype: \"POST\",\r\n\t\turl: url,\r\n\t\tcontentType: \"application/xml; charset=utf-8\",\r\n\t\tdataType: \"xml\",\r\n\t\t\r\n\t\tsuccess: function(responseObj){\r\n\t\t\tdistrict = $(responseObj).find('city_district').text();\r\n\t\t\ttemp = $(responseObj).find('city_district').text().split(\" \");\r\n\t\t\tdistrict = temp[temp.length-1]\r\n\t\t},\r\n\t\terror: function(){\r\n\t\t\talert('Server failure in retrieving district data!');\r\n\t }\r\n\t});\r\n\treturn district;\r\n}", "function districtCounter() {\n\n var uniqueDistricts = [\"Generic Name\"];\n\n for (var i = 0; i < dataArray.length; i++) {\n for (var j = 0; j < uniqueDistricts.length; j++) {\n if (uniqueDistricts[j] == dataArray[i].properties.G_DISTRICT) {\n break;\n }\n if (j == uniqueDistricts.length - 1 && uniqueDistricts[j] != dataArray[i].properties.G_DISTRICT) {\n uniqueDistricts.push(dataArray[i].properties.G_DISTRICT)\n }\n }\n }\n uniqueDistricts.shift();\n console.log(uniqueDistricts);\n console.log(uniqueDistricts.length - 1)\n}", "function getDistrictCode(prefix) {\n let districtCode;\n switch(prefix.toUpperCase()) {\n case 'S':\n districtCode = 0;\n break;\n case 'A':\n districtCode = 1;\n break;\n case 'B':\n districtCode = 2;\n break;\n case 'C':\n districtCode = 3;\n break;\n case 'D':\n districtCode = 41;\n break;\n case 'E':\n districtCode = 42;\n break;\n case 'F':\n districtCode = 43;\n break;\n case 'F':\n districtCode = 5;\n break;\n case 'G':\n districtCode = 6;\n break;\n default:\n districtCode = -1;\n }\n\n return districtCode;\n }", "function f1(stat_id)\n {\n s_id=stat_id\n // console.log(\"f1 called\"+s_id);\n const get_district_url = `https://cdn-api.co-vin.in/api/v2/admin/location/districts/${s_id}`\n xhr.open('GET',get_district_url)\n // console.log(get_district_url);\n xhr.onreadystatechange = () => {\n if(xhr.status == 200 && xhr.readyState == 4) {\n const district = JSON.parse(xhr.responseText)\n console.log(district);\n\n const district_length = district.districts.length\n for(let i=0; i < district_length; i++) {\n const sel_district=document.getElementById(\"sel-districts\")\n const options=document.createElement(\"option\")\n options.textContent=district.districts[i].district_name\n sel_district.appendChild(options)\n \n }\n const sel_district=document.getElementById(\"sel-districts\")\n sel_district.addEventListener('change', (e) => { \n //1.Remove existing result\n const result_div=document.getElementsByClassName(\"result-heading\")\n const div=document.getElementById(\"result\")\n if(div.childElementCount!=0){ \n div.removeChild(result_div[0])\n }\n \n const inner_boxes=document.getElementsByClassName(\"box\")\n const outer_box=document.getElementById(\"parent-box\")\n const child_length=outer_box.childElementCount\n for(var i=0;i<child_length;i++){\n outer_box.removeChild(inner_boxes[0]);\n }\n const combobox2=document.getElementById(\"sel-districts\")\n const msg=document.getElementById(\"validation_message\")\n if(combobox2.value==\"Select District\")\n {\n msg.textContent=\"select validdistrict\"\n }\n else{\n msg.textContent=\"\"\n district_name=e.target.value\n console.log(\"d name \"+e.target.value);\n var dist_id = -1\n for(let i = 0; i <district_length; i++) {\n if(district.districts[i].district_name == district_name) {\n district_id = district.districts[i].district_id\n break\n\n }\n }\n }\n })\n \n }\n \n }\n xhr.send()\n \n // button event to display the responded data.\n const search=document.getElementById(\"search-btn\");\n // console.log(search);\n search.addEventListener('click',(e)=>\n {\n e.preventDefault();\n\n const combobox2=document.getElementById(\"sel-districts\")\n console.log(combobox2.value)\n let todays_date,d,m,y\n todays_date=new Date()\n d=todays_date.getDate()\n m=todays_date.getMonth()+1\n y=todays_date.getFullYear()\n // required date format\n todays_date=`${d}-${0}${m}-${y}`\n if(combobox2.value!=\"Select District\")\n {\n // console.log(district_id);\n //get vaccination data to display\n\n const get_sessions_url = `https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByDistrict?district_id=${district_id}&date=${todays_date}`\n xhr.open('GET', get_sessions_url)\n // console.log(\"date\"+get_sessions_url);\n xhr.onreadystatechange = () => {\n if(xhr.readyState == 4 && xhr.status == 200) {\n const center_Data = JSON.parse(xhr.responseText)\n //console.log(data); //sessions array\n if(center_Data.sessions.length==0)\n {\n alert(\"Vaccine is not available\");\n console.log(\"not available\")\n }\n else{\n var counter=0;\n console.log(center_Data.sessions);\n for(var i=0;i< center_Data.sessions.length;i++){\n if(center_Data.sessions[i].available_capacity>0 && center_Data.sessions[i].min_age_limit>=18)\n {\n counter++;\n //create a number of cards div to display data \n // var audio=new Audio('./images/successsound.MP3')\n // audio.play()\n var block=document.createElement(\"div\")\n block.className=\"box\"\n // console.log(block);\n const name=document.createElement(\"h1\")\n name.className=\"name\"\n block.appendChild(name)\n const address=document.createElement(\"h2\")\n address.className=\"address\"\n block.appendChild(address)\n const vaccine_t_fee=document.createElement(\"p\")\n vaccine_t_fee.className=\"vaccine-type\"\n block.appendChild(vaccine_t_fee)\n const fees_type=document.createElement(\"i\")\n fees_type.className=\"fees-type\"\n block.appendChild(fees_type)\n const age=document.createElement(\"p\")\n age.className=\"age-limit\"\n block.appendChild(age)\n const capacity=document.createElement(\"p\")\n capacity.className=\"available_capacity\"\n block.appendChild( capacity)\n const dose1=document.createElement(\"p\")\n dose1.className=\"dose-1\"\n block.appendChild(dose1)\n const dose2=document.createElement(\"p\")\n dose2.className=\"dose-2\"\n block.appendChild(dose2)\n // console.log(block);\n name.textContent=center_Data.sessions[i].name\n fees_type.textContent=center_Data.sessions[i].fee_type\n address.textContent=\"Address : \"+center_Data.sessions[i].address+\", \"+center_Data.sessions[i].state_name+\", \"+center_Data.sessions[i].district_name+\", \"+center_Data.sessions[i].pincode;\n vaccine_t_fee.textContent=\"Vaccine : \"+center_Data.sessions[i].vaccine\n capacity.textContent=\"Availability : \"+center_Data.sessions[i].available_capacity\n age.textContent=\"Age : 18 & Above\"\n dose1.textContent=\"Vaccine Dose 1: \"+center_Data.sessions[i].available_capacity_dose1+\" available\"\n dose2.textContent=\"Vaccine Dose 2: \"+center_Data.sessions[i].available_capacity_dose2+\" available\"\n const cards=document.getElementById('parent-box')\n // console.log(cards)\n cards.appendChild(block)\n // console.log(\"function called\"+center_Data.sessions[0].name)\n // console.log(data.sessions)\n }\n \n // else{}\n \n }\n if(counter==0)\n {\n alert(\"All centers Vaccine Availability is 0\")\n }\n else{\n const result_div=document.getElementById(\"result\")\n const heading=document.createElement(\"h2\")\n const head_span=document.createElement(\"span\")\n heading.className=\"result-heading\"\n heading.textContent=\"Slot Search Results :\"\n head_span.textContent=`(${counter} Center(s) Found)`\n heading.appendChild(head_span)\n result_div.appendChild(heading)\n }\n \n }\n\n }\n }\n xhr.send()\n \n }\n else{\n const msg=document.getElementById(\"validation_message\")\n msg.textContent=\"Select Valide District\"\n }\n \n })\n }", "function gotCensus(census)\n{\n if ('censusid' in census)\n {\n let censusId = census.censusid;\n let cc = censusId.substring(0,2);\n let censusYear = censusId.substring(2);\n let provinces = census.provinces; \n var censusElt = document.distForm.censusId;\n let provSelect = document.distForm.Province;\n // province passed as a parameter\n let province = ''\n if ('province' in args)\n province = args.province;\n if (censusYear < 1867)\n { // pre-confederation\n if (province.length == 0)\n province = 'CW';\n if (provinces.indexOf(province) == -1)\n province = 'CW';\n censusElt.value = province + censusYear;\n } // pre-confederation\n else\n { // post-confederation\n provSelect.selectedIndex = 0;\n if (provinces.indexOf(province) == -1)\n province = '';\n } // post-confederation\n let domains = census.domains; \n for (const code in domains)\n {\n let provCode = code.substring(2);\n addOption(provSelect, domains[code], provCode);\n } // loop through provinces\n provSelect.value = province;\n \n // update districts \n loadDistsProv(province); // load districts\n }\n else\n if ('msg' in census)\n {\n popupAlert(census.msg, document.distForm.CensusYear);\n }\n}", "function DistSet()\n{\n var newDistCode = args[\"district\"];\n if (newDistCode === undefined)\n return true;\n\n var distSelect = document.distForm.District;\n var distOpts = distSelect.options;\n for(var i = 0; i < distOpts.length; i++)\n {\n if (distOpts[i].value == newDistCode)\n { // found matching entry\n distSelect.selectedIndex = i;\n changeDist(); \n return false;\n } // found matching entry\n } // search for distince to select\n return true;\n}", "function init_manual(){\n // Make sure the map is coloring by district affiliation\n setColoring(getColor_District);\n redraw();\n\n // Populate the div with content\n var ele = document.getElementById(\"district_container\");\n ele.innerHTML = getDistrictDisplay();\n }", "function findCongress(api, lat, lon, callback) {\n api.legislatorsLocate().filter(\"latitude\", lat).filter(\"longitude\", lon).call(function (data) {\n var mocList = Array();\n mocList.push(data.results[0].district);\n for (var i = 0; i < data.results.length; i++) {\n mocList.push(data.results[i].bioguide_id);\n }\n callback(mocList);\n });\n}", "function zoomDistrict(){\n\n var bbox = districtUpper.bbox; //TODO get bbox of both bboxes\n\n var drawNewDistrict = true;\n map.flyToBounds(bbox);\n\n//todo make this map.on('zoomend', function() {\n //todo check if changed districts\n myDistricts.clearLayers();\n drawDistrict(districtUpper, 'blue');\n drawDistrict(districtLower, 'red');\n \n\n }", "function selectDistrict(){\n let outputCommune = \"<option value='0'>&nbspChọn Phường/Xã...</option>\";\n let idDistrict = $('#input-user-district > option').filter(':selected').val();\n for (let i = 0; i < listCommune.length; i ++){\n if (listCommune[i].idDistrict == idDistrict){\n outputCommune += `<option>&nbsp${listCommune[i].name}</option>`;\n }\n }\n $('#input-user-commune').html(outputCommune);\n}", "function getDistrict()\n{\n // get district\n $.ajax({\n type: \"GET\",\n url: burl + \"/district/get/\" + $(\"#province\").val(),\n success: function (data) {\n var opts = \"\";\n for(var i=0; i<data.length; i++)\n {\n opts +=\"<option value='\" + data[i].id + \"'>\" + data[i].name + \"</option>\";\n }\n $(\"#district\").html(opts);\n }\n });\n}", "function valCountriesAndRegions() { \n var rcrdsObj = entityObj.curRcrds;\n var countries = buildCountryRefObj(); \n \n for (var locDesc in rcrdsObj) { checkCntryAndRegion(rcrdsObj[locDesc]); }\n\n function checkCntryAndRegion(rcrdsAry) { //console.log(\"checkCntryAndRegion called. rcrdsAry = %O\", rcrdsAry)\n rcrdsAry.forEach(function(rcrd){\n if (rcrd.country === null) { return; }\n if (rcrd.country in countries) { //console.log(\"----country key found\")\n checkRegion(rcrd)\n } else if (countryCanBeDetermined(rcrd.country, rcrd)) { //console.log(\"--------country can be determined\") \n checkRegion(rcrd)\n } else { console.log(\"unable to determine country = %s, rcrd = %O \", rcrd.country, rcrd) }\n });\n\n function countryCanBeDetermined(cntryStr, rcrd) {\n if (cntryStrInCntryKey(cntryStr, rcrd) || cntryHasNameVariant(cntryStr, rcrd)) {\n return true;\n } else { return false; }\n } \n function cntryStrInCntryKey(cntryStr, rcrd) {\n var capsCntry = cntryStr.toUpperCase();\n\n for (var cntryKey in countries) {\n var capsCntryKey = cntryKey.toUpperCase(); \n if (capsCntryKey.search(capsCntry) !== -1) { //console.log(\"cntryStrInCntryKey found. org = %s, new = %s\", cntryStr, cntryKey)\n rcrd.country = cntryKey;\n return true; \n }\n }\n }\n function cntryHasNameVariant(cntryStr, rcrd) {\n var nameVariations = { \n \"USA\": \"United States\",\n \"US Virgin Islands\": \"Virgin Islands, U.S.\",\n \"Niue Island\": \"Niue\",\n \"Java\": \"Indonesia\",\n };\n if (cntryStr in nameVariations) { //console.log(\"cntryHasNameVariant. org = %s, new = %s\", cntryStr, nameVariations[cntryStr])\n rcrd.country = nameVariations[cntryStr];\n return true; \n }\n }\n function checkRegion(rcrd) { \n var cntryRegion = countries[rcrd.country];// console.log(\"cntryRegion = \", cntryRegion);\n if (rcrd.region === null) { rcrd.region = cntryRegion; //console.log(\"------------region null.\") \n } else if (rcrd.region === cntryRegion) { //console.log(\"------------regions equal\") \n } else if ( regionCanBeDetermined() ) {// console.log(\"--------regions can be determined\") \n } else { console.log(\"unable to determine region. rcrd = %O\", rcrd) }\n \n function regionCanBeDetermined() { //console.log(\"regionCanBeDetermined?? region = %s, rcrd = %O\", rcrd.region, rcrd) \n var nameVariations = {\n \"Caribbean\": \"Caribbean Islands\",\n \"West Africa\": \"Sub-Saharan Africa\",\n }\n if (rcrd.region in nameVariations) { //console.log(\"regionCanBeDetermined. org = %s, new = %s, rcrd = %O\", rcrd.region, nameVariations[rcrd.region], rcrd)\n rcrd.region = nameVariations[rcrd.region];\n return true; \n } else if (rcrd.country === \"Mexico\" && rcrd.region === \"North America\") {\n rcrd.region = \"Central America\";\n return true; \n } else { return false; }\n }\n } /* End checkRegion */\n } /* End checkCntryAndRegion */\n }", "function loadDistsProv(prov)\n{\n var censusId = document.distForm.censusId.value;\n var censusYear = censusId.substring(2);\n\n // get the district information file \n HTTP.getXML(\"CensusGetDistricts.php?Census=\" + censusId +\n \"&Province=\" + prov,\n gotDistFile,\n noDistFile);\n}", "setDistrictInfo(id){\n var self = this;\n self.selected_district = id.replace(/-/g, \" \"); \n }", "function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#statutory_districtID');\n });\n $('#statutory_districtID').trigger(\"chosen:updated\");\n $(\"#statutory_districtID\").chosen();\n}", "function searchDistrict(districtID) {\n //Clear Form\n $('#region').prop('selectedIndex', 0);\n $('#store').prop('value', '');\n //Send Post Request\n $.get('/stores/findStoreByDistrictManagerID/' + districtID, function (stores) {\n createTable(stores);\n });\n}", "function districtSort(data) {\n return Object.entries(data).sort((dist1, dist2) => dist2[1] - dist1[1])\n //[[tvm,27],[kollam,27],[kottayam,28],[ekm,29],[tsr,32]]\n}", "function dehighlight () {\n //get the second class in the object of svg element that called function, the second class in the list is the county name\n var districtClass = \".\" + d3.select(this).attr(\"class\").split(\" \")[1];\n \n console.log(districtClass);\n \n //select both the map geometry and bar with the same corresponding county class, then apply colors for highlighting\n d3.selectAll(districtClass)\n .transition()\n .style(\"fill\" , function (d) {\n return colorScale(d[selectedField]);\n });\n \n //change the class for both div popups of they both are not shown\n var divPopup = d3.selectAll(\".tooltip-popup\")\n .classed(\"hidden\", true);//hide div through css rules applyed to the .hidden class\n }", "buildDepartments(startyear, endyear, weights, regions, deptCounts, deptNames, facultycount, facultyAdjustedCount) {\n /* contains an author name if that author has been processed. */\n let visited = {};\n for (let r in this.authors) {\n if (!this.authors.hasOwnProperty(r)) {\n continue;\n }\n let auth = this.authors[r];\n let dept = auth.dept;\n //\t if (!(dept in regionMap)) {\n if (!this.inRegion(dept, regions)) {\n continue;\n }\n let area = auth.area;\n if (weights[area] === 0) {\n continue;\n }\n let year = auth.year;\n if ((year < startyear) || (year > endyear)) {\n continue;\n }\n if (typeof dept === 'undefined') {\n continue;\n }\n let name = auth.name;\n // If this area is a child area, accumulate totals for parent.\n if (area in CSRankings.parentMap) {\n area = CSRankings.parentMap[area];\n }\n const areaDept = area + dept;\n if (!(areaDept in this.areaDeptAdjustedCount)) {\n this.areaDeptAdjustedCount[areaDept] = 0;\n }\n const count = parseInt(this.authors[r].count);\n const adjustedCount = parseFloat(this.authors[r].adjustedcount);\n this.areaDeptAdjustedCount[areaDept] += adjustedCount;\n /* Is this the first time we have seen this person? */\n if (!(name in visited)) {\n visited[name] = true;\n facultycount[name] = 0;\n facultyAdjustedCount[name] = 0;\n if (!(dept in deptCounts)) {\n deptCounts[dept] = 0;\n deptNames[dept] = [];\n }\n deptNames[dept].push(name);\n deptCounts[dept] += 1;\n }\n facultycount[name] += count;\n facultyAdjustedCount[name] += adjustedCount;\n }\n }", "function district()\n{\n\n document.getElementById(\"dist\").innerHTML='';\n var c= document.forms[\"register\"][\"district\"].value;\n document.getElementById(\"errdis\").innerHTML = \"\";\n if (c == null || c == \"\")\n {\n // var d = document.getElementById(\"dist\");\n // d.className += \" has-error\";\n document.getElementById(\"errdis\").innerHTML = \"Please Enter district\";\n }\n else \n {\n var el = document.getElementById(\"dist\");\n\n el.classList.remove(\"has-error\");\n\n return true;\n }\n}", "function getSelectedDistrict() {\n\treturn getCache(EXTRA_DISTRICT);\n}", "function gotDomains(obj)\n{\n if (obj && typeof(obj) == 'object')\n {\n var provSelect = document.distForm.Province;\n provSelect.options.length = 0; // clear the list\n\n for(var id in obj.domains)\n {\n var domain = obj.domains[id];\n var option = document.createElement('option')\n option.value = id.substring(2);\n option.text = domain;\n provSelect.add(option);\n }\n provSelect.selectedIndex = 0;\n\n // check for province passed as a parameter\n var province = 'ON';\n if ('province' in args)\n {\n province = args[\"province\"];\n }\n \n var provOpts = provSelect.options;\n for(var i = 0; i < provOpts.length; i++)\n {\n if (provOpts[i].value == province)\n { // found matching entry\n provSelect.selectedIndex = i;\n break;\n } // found matching entry\n }\n }\n else\n alert('ReqUpdateDists.js: gotDomains: ' . obj);\n}", "function getListOfDistrict_reg() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#reg_statutory_districtID');\n });\n $('#reg_statutory_districtID').trigger(\"chosen:updated\");\n $(\"#reg_statutory_districtID\").chosen();\n}", "function whichDepart() {\r\n\r\n let lcraDepartment = [\"Business Development\", \"Chief Administrative Officer\", \"Chief Commercial Officer\", \"Chief Financial Officer\", \"Chief of Staff\", \"Commercial Asset Management\", \"Communications\", \"Community Services\", \"Construction I\", \"Construction II\", \"Construction Support\", \"Controller\", \"Corporate Events\", \"Corporate Strategy\", \"Critical Infra Protection\", \"Critical Infrastructure Protection\", \"Customer Operations\", \"Cybersecurity\", \"Dam and Hydro\", \"Digital Services\", \"Enterprise Operations\", \"Environmental Affairs\", \"Environmental Field Services\", \"Environmental Lab\", \"Facilities Planning Management\", \"Finance\", \"Financial Planning & Strategy\", \"Fleet Services\", \"FPP Maintenance\", \"FPP Operations\", \"FPP Plant Support\", \"FRG Maintenance\", \"FRG Operations\", \"FRG Plant Support\", \"Fuels Accounting\", \"General Counsel\", \"General Manager\", \"Generation Environmental Group\", \"Generation Operations Mgmt\", \"Governmental & Regional Affairs\", \"Hilbig Gas Operations\", \"Human Resources\", \"Information Management\", \"Irrigation Operations\", \"Lands & Conservation\", \"Legal Services\", \"Line & Structural Engineering\", \"Line Operations\", \"LPPP Maintenance\", \"LPPP Operations\", \"LPPP Plant Support\", \"Materials Management\", \"Mid-Office Credit and Risk\", \"P&G Oper Reliability Group\", \"Parks\", \"Parks District - Coastal\", \"Parks District - East\", \"Parks District - West\", \"Plant Operations Engr. Group\", \"Plant Support Service\", \"Project Management\", \"Public Affairs\", \"QSE Operations\", \"Rail Fleet Operations\", \"Rangers\", \"Real Estate Services\", \"Regulatory & Market Compliance\", \"Regulatory Affairs\", \"Resilience\", \"River Operations\", \"Safety Services\", \"Sandy Creek Energy Station\", \"Security\", \"Service Quality & Planning\", \"SOCC Operations\", \"Strategic Initiatives & Transformation\", \"Strategic Sourcing\", \"Substation Engineering\", \"Substation Operations\", \"Supply Chain\", \"Survey GIS & Technical Svc\", \"System Control Services\", \"System Infrastructure\", \"Technical & Engineering Services\", \"Telecom Engineering\", \"Trans Contract Construction\", \"Trans Operational Intelligence\", \"Transmission Design & Protect\", \"Transmission Executive Mgmt\", \"Transmission Field Services\", \"Transmission Planning\", \"Transmission Protection\", \"Transmission Strategic Svcs\", \"Water\", \"Water Contracts & Conservation\", \"Water Engineering\", \"Water Quality\", \"Water Resource Management\", \"Water Surface Management\", \"Wholesale Markets & Sup\"];\r\n\r\n //let lcraDepart = document.getElementById(\"lcraDepart\");\r\n\r\n\r\n for(let i = 0; i < lcraDepartment.length; i++){\r\n let optn = lcraDepartment[i];\r\n let el = document.createElement(\"option\");\r\n el.value = optn;\r\n el.textContent = optn;\r\n lcraDepart.appendChild(el);\r\n }\r\n}", "function checkDistrictName(validData)\n {\n var test = validData;\n var input = $('#TxtDistName').val();\n var obj = $('#TxtDistName');\n var obj2 = $('#s_district');\n //alert('Pass in value: ' + test);\n\n validData = validEntry(obj, input, validData);\n passData(obj2, input);\n\n return validData;\n }", "function setPrecinctDistrict(precinctID, district) {\n precinctDistricts[precinctID] = district;\n}", "onLoad() {\n //default is sierra Leone id\n this.drawDistrict(\"ImspTQPwCqd\");\n }", "function getDistrictByState(meetingStatus,meetingLevel,isComment){\r\n\t var partyMeetingTypeArr=[];\r\n\t $(\"#committeeTypeId li\").each(function() {\r\n\t\t if($(this).find(\"input\").is(\":checked\")){\r\n\t\t\t partyMeetingTypeArr.push($(this).find(\"input\").attr(\"id\"));\r\n\t\t }\r\n\t });\r\n\t var jsObj ={ \r\n\t\t activityMemberId : globalActivityMemberId,\r\n\t\t\t\t\t stateId : globalStateId,\r\n\t\t\t\t\t fromDate : customStartDateMeetings,\r\n\t\t\t\t\t toDate : customEndDateMeetings,\r\n\t\t\t\t\t partyMeetingTypeArr:partyMeetingTypeArr,\r\n\t\t\t\t\t meetingStatus : meetingStatus,\r\n\t\t\t\t\t meetingLevel : meetingLevel,\r\n\t\t\t\t\t isComment : isComment\r\n\t\t\t\t }\r\n\t\t$.ajax({\r\n\t\t\ttype : 'POST',\r\n\t\t\turl : 'getDistrictByStateAction.action',\r\n\t\t\tdataType : 'json',\r\n\t\t\tdata : {task:JSON.stringify(jsObj)}\r\n\t\t}).done(function(result){\r\n\t\t\t $(\"#districtSlctBxId\").empty();\r\n\t\t\tif(result != null && result.length > 0){\r\n\t\t\t\t$(\"#districtSlctBxId\").append('<option value=\"0\">All</option>');\r\n\t\t\t\tfor(var i in result){\r\n\t\t\t\t $(\"#districtSlctBxId\").append('<option value=\"'+result[i].id+'\">'+result[i].name+'</option>');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}); \t\r\n}", "function callback_GetProvinceDrillDownData(resp){\n\tvar check,provinceLcase,drillDown = {};\n\t//console.log(\"========= Receiving response from indicator service for province. ==========\");\n\tif(resp.indicators[1].geoInfo) { // if geoinfo is null than data not available for drill down\n\t\textendSummaryBoxDistrict(resp);\n\t\tresetOverLayContainer();\n\t\tresp = clubObjectDataDistrict(resp);\n\t\tdrillDown.indicators = dureUtil.extractDataObjects(resp.indicators);\n\t\t//console.log(drillDown.indicators);\n\t\tif(drillDown.indicators.districtIndicatorSummaryData != undefined){\n\t\t\t//dureUtil.loadInitialRegionSummaryData(drillDown.indicators.districtIndicatorSummaryData)\n\t\t}\n\t\tcheck = subprovince.setDataForMap(resp);\n\t\tprovinceLcase = resp.indicators[1].geoInfo[0].provinceName;\n\t\t//console.log(provinceLcase);\n\t\tvar indicators = {};\n\t\tindicators.extractedObjects = drillDown.indicators; // To load overlay\n\t\t\n\t\tdureUtil.currentFormattedJSONData = indicators;\t\n\t\t\n\t\tif(dureOverlays.setData(indicators)) {\n\t\t\t//alert(\"set overlay data\");\n\t\t}\n\t\tif(check){\n\t\t\tprovince.drilldownToProvince(provinceLcase);\n\t\t}\n\t} else {\n\n\t\tdureApp.showDialog('Data not available.','info');\n\t}\n}", "function changeDistrict(){\n jCooper.congressional_district = \"Tennessee's 9th District,\"\n console.log(jCooper.congressional_district);\n}", "function districtLayer() {\n var districtsLayer = new ol.layer.Vector({\n source: new ol.source.Vector({\n url: 'https://raw.githubusercontent.com/codeforamerica/click_that_hood/master/public/data/frankfurt-main.geojson',\n format: new ol.format.GeoJSON({\n defaultDataProjection :'EPSG:4326', \n projection: 'EPSG:3857'\n })\n })\n });\n return districtsLayer;\n}", "function makingAddress() {\n let tempdata = fs.readFileSync('./data4.json')\n let data = JSON.parse(tempdata);\n\n // final ID is \"edanmdm:siris_arc_219393\"\n // length is 3874\n\n\n data.forEach((d, i) => {\n\n\n\n\n if (comparison[comparison.length - 1].numberslength == comparison[comparison.length - 1].addressarraylength) {\n\n if (d.geoLoc.place != 'none' && d.geoLoc.continent != 'none') {\n if (d.geoLoc.place != d.geoLoc.continent) {\n addressArray.push({\n title: d.title,\n type: d.type,\n date: d.date,\n id: d.id,\n geoLoc: d.geoLoc,\n coord: {\n target: 'detailLoc',\n content: d.geoLoc.place,\n }\n })\n } else if (d.geoLoc.place == d.geoLoc.continent) {\n\n addressArray.push({\n title: d.title,\n type: d.type,\n date: d.date,\n id: d.id,\n geoLoc: d.geoLoc,\n coord: {\n target: 'continent',\n content: d.geoLoc.place,\n }\n })\n }\n } else if (d.geoLoc.place == 'none' && d.geoLoc.continent != 'none') {\n\n addressArray.push({\n title: d.title,\n type: d.type,\n date: d.date,\n id: d.id,\n geoLoc: d.geoLoc,\n coord: {\n target: 'continent',\n content: d.geoLoc.area,\n }\n\n })\n } else if (d.geoLoc.place == 'none' && d.geoLoc.continent == 'none') {\n\n let checkif = d.type.includes('YouTube')\n if (!checkif) {\n console.log('something wrong with', d);\n }\n\n addressArray.push({\n title: d.title,\n type: d.type,\n date: d.date,\n id: d.id,\n geoLoc: d.geoLoc,\n coord: {\n target: 'none',\n content: 'none',\n }\n })\n }\n\n\n\n comparison.push({\n numberslength: i + 1,\n addressarraylength: addressArray.length\n })\n }\n\n\n\n })\n\n\n\n}", "function makeMap(nest) {\r\n console.log(\"In makeMap\", nest);\r\n\r\n // District level data join\r\n chicagoStack.push(nest[0])\r\n var district = svg.selectAll(\"g.district\").data(nest[1])\r\n // donut svg\r\n svg.append(\"g\").attr(\"class\", \"donut\")\r\n svg.append(\"g\").attr(\"class\", \"population\")\r\n\r\n // District level Update Pattern\r\n var districtEnter = district.enter().append(\"g\")\r\n .attr(\"class\", function(d) {\r\n return \"district \" + d.key.replace(/\\s|'/g, '_')\r\n })\r\n .style(\"fill\",function(d) {\r\n return color10(d.key)\r\n })\r\n\r\n // Community level data join, extracts community level data from district\r\n var community = district.selectAll(\"g.community\")\r\n .data(function(d){ return d.values})\r\n\r\n // Community level Update pattern\r\n var communityEnter = community.enter().append(\"g\")\r\n .attr('class', function(d){\r\n return \"community \" + d.key.replace(/\\s|'/g, '_')\r\n });\r\n\r\n // Append Path elements to community g's\r\n communityEnter.append(\"path\")\r\n .classed(\"boundary\", true)\r\n .attr(\"d\", function(d){\r\n return path(d.values[0])\r\n });\r\n\r\n\r\n // Array to hold positions of where the District labels fall within the map\r\n districtLabelPos = [\r\n [1140.5031214249061,345.4841104606627], //farnorth *\r\n [1560.5031214249061,703.1232091893608], // north side *\r\n [1609.7979511953843,962.7053750767045], // central *\r\n [789.2386914991861,731.207982993439], // north west side *\r\n [935.4344700176821,1000.9765203036148], // westside *\r\n [1710.0655965725955,1254.9106891589777], // southside *\r\n [1980.1569471215657,1612.664288366978], // far south east side *\r\n [777.1471029108511,1356.1624746165123], // south west side *\r\n [1100.1471029108511,1700.1624746165123] // far south west side *\r\n ] //translate(780.1471029108511,1356.1624746165123)\r\n\r\n // Set district names, add mouseover and mouseout functionality\r\n districtEnter.append(\"text\")\r\n .classed(\"dlabel\",true)\r\n .attr(\"transform\", function(d,i) {\r\n return \"translate(\" + districtLabelPos[i][0] + \",\" + districtLabelPos[i][1] +\")\";\r\n })\r\n .attr(\"dy\", \".35em\")\r\n .text(function(d) {\r\n return d.values[0].values[0].properties.district.name ;\r\n })\r\n\r\n districtEnter.append(\"circle\")\r\n .attr(\"cx\", 10)\r\n .attr(\"cy\", 10)\r\n .attr(\"r\", 10)\r\n .attr(\"transform\", function(d,i) {\r\n return \"translate(\" + districtLabelPos[i][0] + \",\" + (districtLabelPos[i][1]+10) +\")\";\r\n })\r\n\r\n // Object to hold positions of errant labels\r\n var commLabelPos = {\r\n \"O_Hare\": \"translate(550.0919010975593,500.9349721645051)\",\r\n \"Burnside\": \"translate(1622.2478666942989,1684.812617705221)\",\r\n \"West_Garfield_Park\": \"translate(1150.0423144232217,950.5395119412224)\",\r\n \"East_Garfield_Park\": \"translate(1240.7235487270556,975.4518759921707)\",\r\n \"Englewood\": \"translate(1465.7377190936527,1452.793975434456)\",\r\n \"Hegewisch\": \"translate(1795.752544153559,2010.3641730358465)\"\r\n }\r\n\r\n // Add labels to community locations\r\n communityEnter.append(\"text\")\r\n .classed(\"clabel\", true)\r\n .attr(\"transform\", function(d) {\r\n var clabel = d.key.replace(/\\s|'/g, '_');\r\n var pos = commLabelPos[clabel] ;\r\n if (pos) {\r\n return pos;\r\n } else {\r\n return \"translate(\" + path.centroid(d.values[0]) + \")\";\r\n }\r\n }).attr(\"dy\", \".35em\")\r\n .text(function(d) {\r\n return d.values[0].properties.community.name.toUpperCase();\r\n })\r\n\r\n ////////////////////////////////////////////////////////////\r\n //// Selection Listeners!\r\n ////////////////////////////////////////////////////////////\r\n\r\n // add some listeners for ditstrict\r\n // svg.selectAll(\".dlabel\")\r\n districtEnter\r\n .on(\"dblclick\", function(d){ console.log(\"dblclick!\", d)\r\n window.foo = d3.select(\"input[value=\\\"Male\\\"]\")\r\n var selection = d3.select(\"g.district.\"+d.key.replace(/\\s|'/g, '_'))[0][0].classList\r\n // If the district has never been selected, or it is currently set to zero...\r\n if (d3.values(selection).indexOf(\"c-selected\") < 0) {\r\n\r\n // color it yellow\r\n d3.select(\"g.district.\"+d.key.replace(/\\s|'/g, '_'))\r\n .classed(\"d-selected\",true)\r\n .classed(\"c-selected\",true);\r\n // push onto stack\r\n districtSelection.push(d);\r\n // Make sure we only have 3 communities selected at a time,\r\n // shift the leading selection off the stack and demark it.\r\n if (districtSelection.length > 3) {\r\n // shift the head off the stack\r\n var shifted = districtSelection.shift();\r\n // color it as unselected\r\n d3.select(\"g.district.\"+shifted.key.replace(/\\s|'/g, '_'))\r\n .classed(\"d-selected\",false)\r\n .classed(\"c-selected\",false);\r\n\r\n console.log(\"shifted \",shifted); // let us know that is was shifted\r\n }\r\n drawGenderCharts()\r\n // if it was already selected\r\n } else {\r\n // prepare to pop it\r\n var popped;\r\n // if our stack is size 3\r\n console.log(\"index of \",districtSelection.indexOf(d))\r\n if(districtSelection.length == 3){\r\n switch (districtSelection.indexOf(d)) {\r\n case 0:\r\n console.log(\"index is at 1\")\r\n popped = districtSelection.shift();\r\n break;\r\n case 1:\r\n var keep = districtSelection.pop(); // pop the tail, but hang on to\r\n popped = districtSelection.pop(); // pop the target element\r\n districtSelection.push(keep); // push the tail back onto the stack\r\n break;\r\n case 2:\r\n popped = districtSelection.pop();\r\n break;\r\n }\r\n } else {\r\n switch (districtSelection.indexOf(d)) {\r\n case 0:\r\n console.log(\"index is at 1\")\r\n popped = districtSelection.shift();\r\n break;\r\n case 1:\r\n popped = districtSelection.pop();\r\n break;\r\n }\r\n }\r\n d3.select(\"g.district.\"+popped.key.replace(/\\s|'/g, '_'))\r\n .classed(\"d-selected\",false)\r\n .classed(\"c-selected\",false);\r\n\r\n console.log(\"selection is popped\", popped);// d3.select(\"g.population\").remove();\r\n }\r\n })\r\n .on(\"mouseover\", function(d){\r\n console.log(d)\r\n d3.select(this).classed(\"hoverD\", true)\r\n // districtEnter.select(\"district.\"+d.key+\"text.dlabel\").classed(\"hoverD\", true)\r\n })\r\n .on(\"mouseout\", function(d){\r\n d3.select(this).classed(\"hoverD\", false)\r\n // district.select( \".dlabel\").classed(\"hoverD\", false)\r\n })\r\n // add some listeners for communities\r\n\r\n\r\n // Control the state of selection\r\n communityEnter\r\n .on(\"mouseover\", function(d){ d3.select(this).classed(\"c-mag\", true) })\r\n .on(\"mouseout\", function(d){ d3.select(this).classed(\"c-mag\", false)})\r\n\r\n .on(\"click\", function(d){ console.log(\"click!\", d)\r\n var selection = d3.select(\"g.community.\"+d.key.replace(/\\s|'/g, '_'))[0][0].classList\r\n // If the community has never been selected, or it is currently set to zero...\r\n if (d3.values(selection).indexOf(\"c-selected\") < 0) {\r\n // color it yellow\r\n d3.select(\"g.community.\"+d.key.replace(/\\s|'/g, '_')).classed(\"c-selected\",true);\r\n d3.select(\"boundary\").style(\"stroke\", color10(d.key))\r\n // push onto stack\r\n communitySelection.push(d);\r\n // Make sure we only have 3 communities selected at a time,\r\n // shift the leading selection off the stack and demark it.\r\n if (communitySelection.length > 3) {\r\n // shift the head off the stack\r\n var shifted = communitySelection.shift();\r\n // color it as unselected\r\n d3.select(\"g.community.\"+shifted.key.replace(/\\s|'/g, '_')).classed(\"c-selected\",false);\r\n console.log(\"shifted \",shifted); // let us know that is was shifted\r\n }\r\n // if it was already selected\r\n drawGenderCharts()\r\n } else {\r\n // prepare to pop it\r\n var popped;\r\n // if our stack is size 3\r\n console.log(\"index of \",communitySelection.indexOf(d))\r\n if(communitySelection.length == 3){\r\n switch (communitySelection.indexOf(d)) {\r\n case 0:\r\n console.log(\"index is at 1\")\r\n popped = communitySelection.shift();\r\n break;\r\n case 1:\r\n var keep = communitySelection.pop(); // pop the tail, but hang on to\r\n popped = communitySelection.pop(); // pop the target element\r\n communitySelection.push(keep); // push the tail back onto the stack\r\n break;\r\n case 2:\r\n popped = communitySelection.pop();\r\n break;\r\n }\r\n } else {\r\n switch (communitySelection.indexOf(d)) {\r\n case 0:\r\n console.log(\"index is at 1\")\r\n popped = communitySelection.shift();\r\n break;\r\n case 1:\r\n popped = communitySelection.pop();\r\n break;\r\n }\r\n }\r\n d3.select(\"g.community.\"+popped.key.replace(/\\s|'/g, '_')).classed(\"c-selected\",false);\r\n console.log(\"selection is popped\", popped);// d3.select(\"g.population\").remove();\r\n }\r\n })\r\n\r\n d3.select(\"#genderButton\").on(\"click\", updateGenderCharts);\r\n\r\n // Make the chicago graph constant\r\n if(chartType ===0 ) {gData = chicagoStack[0].raceT; gLabel = \"Total: Chicago\" }\r\n if(chartType ===1 ) {gData = chicagoStack[0].raceF; gLabel = \"Female: Chicago\" }\r\n if(chartType ===2 ) {gData = chicagoStack[0].raceM; gLabel = \"Male: Chicago\" }\r\n\r\n d3.select(\"g.population\").datum([gLabel, gData]).each(pChart0.plot)\r\n}", "function getListOfDistrict_scene() {\n $(\"#districs_id\").empty();\n $(\"#districs_id_reg\").empty();\n\n loadingDistrictsMaster();\n var selectfirst = \"<option value='0'>Select District</option>\";\n $('#districs_id').append(selectfirst);\n $('#districs_id_reg').append(selectfirst);\n $.each(district, function (i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districs_id');\n $(districts).appendTo('#districs_id_reg');\n\n });\n $('#districs_id').trigger(\"chosen:updated\");\n $('#districs_id_reg').trigger(\"chosen:updated\");\n $('#districs_id').chosen();\n $('#districs_id_reg').chosen();\n}", "function setDistrict(district) {\n return { type: 'SET_DISTRICT', district };\n}", "function getTax(province){\n \t\t\tvar columns = ['itemid','internalid','state','country'];\n \t\t\tvar taxSearch = search.create({\n \t\t\t\ttype:search.Type.TAX_GROUP,\n \t\t\t\ttitle:'Find tax group',\n \t\t\t\tcolumns:columns,\n \t\t\t\tfilters:[['description','contains',province]]\n \t\t\t});\n\n \t\t\tvar results = taxSearch.run().getRange({start: 0, end: 1000});\n \t\t\tlog.debug ({\n title: 'Finding tax results',\n details: results.length\n });\n\n\t\t\tvar internalid = searchResults(results,columns);\n\t\t\t//handle outside canada\n\t\t\tif(!internalid){\n\t\t\t\tinternalid = 4288;\n\t\t\t}\n\t\t\tlog.debug ({\n title: 'Tax result',\n details: internalid\n });\n\t \t\treturn internalid;\n\t\t }", "function show_district_wise_mandals(district_id){\n\n\t$.ajax({\n\t\turl:root_path+\"/api/get_district_wise_mandals.php\",\n\t\tdataType:\"JSON\",\n\t\tdata:{district_id:district_id},\n\t\ttype:\"POST\",\n\t\tsuccess: function(response){\n\t\t\tvar option=\"<option>Select Mandal</option>\";\n\t\t\t$.each(response,function(i,v){\n\t\t\t\toption+=\"<option value='\"+v.rec_id+\"'>\"+v.mandal_name+\"</option>\";\n\t\t\t});\n\t\t\t$(\"#mandal_drop_down\").html(option);\n\t\t\t$(\"#mandal_drop_down_edit_village\").html(option);\n\t\t\t$(\"#mandal_drop_down_edit_branches\").html(option);\n\n\t\t}\n\t});\t\n}", "function districtsStyle(feature){\n return{\n fillColor: DEFAULT_COLOR,\n weight: DISTRICT_BORDER_WEIGHT,\n color: BORDER_COLOR,\n fillOpacity: DISTRICT_FILL_OPACITY\n }\n}", "function chooseColor(district) {\n switch (district) {\n case 1:\n return \"teal\";\n case 2:\n return \"blue\";\n case 3:\n return \"green\";\n case 4:\n return \"orange\";\n case 5:\n return \"purple\";\n case 6:\n return \"brown\";\n case 7:\n return \"yellow\";\n case 8:\n return \"red\";\n case 9:\n return \"magenta\";\n default:\n return \"black\";\n }\n}", "function load_district_ps(district_id, ps_id, state_val, district_val, ps_val, sameasper_val, sameasper_id){\n data = {\"state\":state_val};\n reset_select(district_id, \"Select District\");\n $.ajax({ url: district_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == district_val){\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n\n //Police Station\n data = {\"state\": state_val, \"district\":district_val };\n reset_select(\"fir_victimpolicestation\", \"Select Police Station\");\n\n $.ajax({ url: police_station_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == ps_val){\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n if(sameasper_val==\"Yes\"){\n $('#'+sameasper_id).click();\n }\n }});\n\n\n }\n });\n}", "function load_district_ps(district_id, ps_id, state_val, district_val, ps_val, sameasper_val, sameasper_id){\n data = {\"state\":state_val};\n reset_select(district_id, \"Select District\");\n $.ajax({ url: district_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == district_val){\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+district_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n\n //Police Station\n data = {\"state\": state_val, \"district\":district_val };\n reset_select(\"fir_victimpolicestation\", \"Select Police Station\");\n\n $.ajax({ url: police_station_url,\n data: data,\n success: function(data){\n $.each(data, function(key, resource) {\n if(resource[0] == ps_val){\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).attr('selected', 'selected').text(resource[1]));\n }else{\n $('#'+ps_id).append($(\"<option></option>\").attr(\"value\",resource[0]).text(resource[1]));\n }\n });\n if(sameasper_val==\"Yes\"){\n $('#'+sameasper_id).click();\n }\n }});\n\n\n }\n });\n}", "function createDiseaseList() {\r\n let lookup = {};\r\n g.diseaseList = [];\r\n for (let item, i = 0; item = data[i++];) {\r\n let mal = item.mal;\r\n if (!(mal in lookup)) {\r\n lookup[mal] = 1;\r\n g.diseaseList.push(mal);\r\n }\r\n }\r\n g.diseaseList.sort(); \r\n}", "function getListOfDistrictForRegForCurrentDist() {\n if (district.length < 1 || district == []) {\n // here calling masterdata ajax call\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districtIdForCurrLoc');\n });\n $('#districtIdForCurrLoc').trigger(\"chosen:updated\");\n $(\"#districtIdForCurrLoc\").chosen();\n\n } else {\n $.each(district, function(i, resData) {\n // alert(\"jii\"+resData.districtName);\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districtIdForCurrLoc');\n\n });\n $('#districtIdForCurrLoc').trigger(\"chosen:updated\");\n $(\"#districtIdForCurrLoc\").chosen();\n }\n}", "function selectProvince(){\n let outputDistrict = \"<option value='0'>&nbspChọn Quận/Huyện...</option>\";\n let outputCommune = \"<option value='0'>&nbspChọn Phường/Xã...</option>\";\n let idProvince = $('#input-user-city-province > option').filter(':selected').val();\n for (let i = 0; i < listDistrict.length; i ++){\n if (listDistrict[i].idProvince == idProvince){\n outputDistrict += `<option value='${listDistrict[i].idDistrict}'>&nbsp${listDistrict[i].name}</option>`;\n }\n }\n $('#input-user-commune').html(outputCommune);\n $('#input-user-district').html(outputDistrict);\n}", "function selectProvinceAndDistrict(value){\n\t// if the inpput which should be select is province . means when country is changed\n\tif(value == \"province\"){\n\t\tvar country = document.getElementById(\"country\").value;\n\t\tvar province = document.getElementById(\"province\");\n\t\tvar district = document.getElementById(\"district\");\n\n\t\tif(country.length > 0){\n\t\t\tprovince.disabled =false;\n\t\t\tprovince.style.cursor = \"pointer\";\n\t\t\tprovince.setAttribute('title',\"Choose a province\");\n\t\t\tprovince.style.color = \"#6d6161\";\n\t\t\tprovince.innerHTML = \"\";\n\t\t\tprovince.innerHTML = \"<option value='' selected>Province</option>\";\n\t\t\tdistrict.value = \"\";\n\t\t\tdistrict.disabled = true;\n\t\t\tdistrict.style.cursor = \"not-allowed\";\n\t\t\tdistrict.style.color = \"lightgray\";\n\t\t\tdistrict.setAttribute('title',\"Choose a provice first\");\n\t\t\tdistrict.innerHTML = \"<option value='' selected>District</option>\";\n\n\t\t\t\n\t\t\tvar countryProvince = eval(\"province\" + country);\n\t\t\tconsole.log(countryProvince);\n\t\t\tfor(var index in countryProvince){\n\t\t\t\tvar openTag = \"<option value='\"+ index +\"'>\";\n\t\t\t\tvar text = countryProvince[index];\n\t\t\t\tvar closeTag = \"</option>\";\n\t\t\t \tvar result = openTag.concat(text,closeTag);\n\t\t\t\tprovince.innerHTML += result;\n\t\t\t}\n\n\t\t}else{\n\t\t\tprovince.disabled =true;\n\t\t\tprovince.style.cursor = \"not-allowed\";\n\t\t\tprovince.style.color = \"lightgray\";\n\t\t\tprovince.setAttribute('title',\"Choose a country first\");\n\t\t\tprovince.innerHTML = \"<option value='' selected>Province</option>\"\n\n\t\t\tdistrict.disabled =true;\n\t\t\tdistrict.style.cursor = \"not-allowed\";\n\t\t\tdistrict.style.color = \"lightgray\";\n\t\t\tdistrict.setAttribute('title',\"Choose a province first\");\n\t\t\tdistrict.innerHTML = \"<option value='' selected>District</option>\";\n\t\t}\n\t}else if (value == \"district\"){ // if its province which is chagned and need to enable the selection of district\n\t\tvar province = document.getElementById(\"province\").value;\n\t\tvar district = document.getElementById(\"district\");\n\n\t\tif(province.length > 0){\n\t\t\tdistrict.disabled =false;\n\t\t\tdistrict.style.cursor = \"pointer\";\n\t\t\tdistrict.setAttribute('title',\"Choose a district\");\n\t\t\tdistrict.style.color = \"#6d6161\";\n\t\t\tdistrict.innerHTML = \"\";\n\t\t\tdistrict.innerHTML = \"<option value=''>District</option>\";\n\n\t\t\t\n\t\t\tvar provinceDistrict = eval(\"district\" + province); //eval change a string into variable name\n\t\t\tfor(var index in provinceDistrict){\n\t\t\t\tvar openTag = \"<option value='\"+ index +\"'>\";\n\t\t\t\tvar text = provinceDistrict[index];\n\t\t\t\tvar closeTag = \"</option>\";\n\t\t\t \tvar result = openTag.concat(text,closeTag);\n\t\t\t\tdistrict.innerHTML += result;\n\t\t\t}\n\t\t}else{\n\t\t\tdistrict.disabled =true;\n\t\t\tdistrict.style.cursor = \"not-allowed\";\n\t\t\tdistrict.style.color = \"lightgray\";\n\t\t\tdistrict.setAttribute('title',\"Choose a province first\");\n\t\t\tdistrict.innerHTML = \"<option value='' selected>District</option>\"\n\t\t} // end of : if the no province is selected\n\t}\n\n\n}", "function getMalePopulationPerDistrct(district_data)\n{\n let male_population_pre_district = [];\n for (let i = 0; i < district_data.length; i++)\n {\n male_population_pre_district.push(district_data[i].male)\n }\n return male_population_pre_district;\n}", "function noSubDist()\n{\n var subdistSelect = document.distForm.SubDistrict;\n subdistSelect.options.length = 0; // clear the selection\n var tableNode = getElt(document.distForm, \"TABLE\");\n var tbNode = getElt(tableNode,\"TBODY\");\n var trNode = document.getElementById(\"divRow\");\n var tdNode = document.getElementById(\"divCell\");\n while (tdNode.hasChildNodes())\n tdNode.removeChild(tdNode.firstChild);\n var spanElt = document.createElement(\"span\");\n spanElt.setAttribute(\"class\", \"label\");\n spanElt.className = \"label\";\n tdNode.appendChild(spanElt);\n var msg = document.createTextNode(\"No subdistricts defined yet\");\n spanElt.appendChild(msg);\n}", "queryDistrictByCoordinates({ latitude, longitude }) {\n const searchQuery = {\n index: districtIndex,\n body: {\n size: 1,\n _source: ['properties.Name'],\n query: {\n geo_shape: {\n geometry: {\n relation: 'contains',\n shape: {\n type: 'point',\n coordinates: [\n longitude, latitude,\n ],\n },\n },\n },\n },\n },\n }\n\n return new Promise(((resolve, reject) => {\n client\n .search(searchQuery, ((error, body) => {\n if (error) {\n console.trace('error', error.message)\n return reject(error)\n }\n if (body && body.hits) {\n const result = body.hits.hits[0]\n if (result) {\n return resolve(result._source.properties.Name)\n }\n }\n return resolve('')\n }))\n }))\n }", "function canton(args) {\r\n let results = ecuador.data.lookupProvinces(args);\r\n results = results[0];\r\n let canton = [];\r\n for (var key in results.cities) {\r\n canton.push(results.cities[key].name);\r\n }\r\n return canton;\r\n}", "function changeDist(ev)\n{\n // identify the selected census\n var form = document.distForm;\n var censusSelect = form.CensusSel;\n var census = censusSelect.value;\n var censusYear = census.substring(2);\n\n // identify the selected district\n var distSelect = form.District;\n var optIndex = distSelect.selectedIndex;\n if (optIndex < 1)\n return; // no district selected\n var distId = distSelect.options[optIndex].value;\n var tdNode = document.getElementById('DivisionCell');\n tdNode.innerHTML = '';\n\n // identify the file containing subdistrict information for\n // the selected district\n var subFileName;\n var provSelect;\n var provId;\n\n if (censusYear > 1867)\n { // post-confederation, one census for all of Canada\n subFileName = \"CensusGetSubDists.php?Census=\" + census +\n \"&District=\" + distId;\n } // post-confederation, one census for all of Canada\n else\n { // pre-confederation, separate census for each colony\n provSelect = form.Province;\n optIndex = provSelect.selectedIndex;\n if (optIndex < 0)\n return; // no colony selected\n provId = provSelect.options[optIndex].value;\n subFileName = \"CensusGetSubDists.php?Census=\" +\n provId + censusYear +\n \"&District=\" + distId;\n } // pre-confederation, separate census for each colony\n // get the subdistrict information file\n //alert(\"ReqUpdatePages.js: changeDist: subFileName=\" + subFileName);\n HTTP.getXML(subFileName,\n gotSubDist,\n noSubDist);\n\n}", "function showDistricts(str) {\n if (str==\"\") {\n document.getElementById(\"s_district\").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(\"s_district\").innerHTML=this.responseText;\n }\n };\n xmlhttp.open(\"GET\",\"http://localhost/storelocator/supports/ajax_calls/getDristicts.php?q=\"+str,true);\n xmlhttp.send();\n}", "function GetCountryCityZoneAddress(results) {\n var country = null;\n var CityNamesArr = [];\n var ZoneNamesArr = [];\n\n /*\n if (Intern_ModifyPhysicalAdd === undefined || Intern_ModifyPhysicalAdd === null)\n var Intern_ModifyPhysicalAdd = false; */\n if(Intern_ModifyPhysicalAdd)\n Intern_PhysicalAddElem.val(results[0].formatted_address);\n Intern_ModifyPhysicalAdd = false;\n\n if (Intern_ModifyCountryCityZone) {\n var tempZone;\n\n // This loop here is used for those cases when the google map result is not very clear.\n if (results[1] !== undefined && results[1] !== null) {\n for (var i = 0; i < results[1].address_components.length; i++) {\n for (var b = 0; b < results[1].address_components[i].types.length; b++) {\n // There are different types that might hold a city admin_area_lvl_1 usually does in come cases looking for sublocality type will be more appropriate\n if (results[1].address_components[i].types[b].indexOf(\"locality\") > -1 || results[1].address_components[i].types[b].indexOf(\"neighborhood\") > -1) {\n tempZone = results[1].address_components[i].long_name;\n ZoneNamesArr[ZoneNamesArr.length] = tempZone;\n break;\n }\n }\n if (ZoneNamesArr.length > 0) break;\n }\n }\n\n //debugger;\n\n for (var i = 0; i < results[0].address_components.length; i++) {\n for (var b = 0; b < results[0].address_components[i].types.length; b++) {\n // There are different types that might hold a city admin_area_lvl_1 usually does in come cases looking for sublocality type will be more appropriate\n if (results[0].address_components[i].types[b].indexOf(\"locality\") > -1 || results[0].address_components[i].types[b].indexOf(\"neighborhood\") > -1) {\n tempZone = results[0].address_components[i].long_name;\n if(tempZone !== ZoneNamesArr[ZoneNamesArr.length - 1])\n ZoneNamesArr[ZoneNamesArr.length] = tempZone;\n\n // In french speacking africa we need to eliminate the term \"Quartier\" from the neighborhood.\n //if (tempZone.substring(0, 9) === \"Quartier \") {\n // ZoneNamesArr[ZoneNamesArr.length] = tempZone.substring(9, tempZone.length);\n //}\n //else {\n // ZoneNamesArr[ZoneNamesArr.length] = tempZone;\n //}\n break;\n }\n else if (results[0].address_components[i].types[b].indexOf(\"administrative_area\") > -1) {\n CityNamesArr[CityNamesArr.length] = results[0].address_components[i].long_name;\n break;\n }\n else if (results[0].address_components[i].types[b] === \"country\") {\n //this is the object you are looking for\n country = results[0].address_components[i];\n break;\n }\n }\n if (country !== null) break;\n }\n\n debugger;\n\n delete CityDropDownDict[Const_NewCityId]; // This is necessary to remove the recently computer CityID\n if (Intern_CountryElem !== undefined && Intern_CountryElem !== null && Intern_CountryElem !== \"\") {\n country_ReDrawMap = false;\n\n Intern_CountryElem.val(Utilities_StringInArrayIndex(country.long_name, Intern_GoogleLocCountryNames));\n Intern_CountryElem.change();\n\n var cityId = null;\n var zoneIDUsed = ZoneNamesArr.length;\n $.each(CityDropDownDict, function (index, value) {\n /*\n if (cityId === null)\n for (var i = 1; i < ZoneNamesArr.length; i++)\n if (ZoneNamesArr[i].indexOf(value) > -1) {\n cityId = index;\n zoneIDUsed = i;\n return;\n } */\n\n if (cityId === null)\n if (ZoneNamesArr[ZoneNamesArr.length - 1].indexOf(value) > -1) {\n cityId = index;\n zoneIDUsed = ZoneNamesArr.length - 1;\n return;\n }\n if(cityId === null)\n for (var i = 0; i < CityNamesArr.length; i++)\n if (CityNamesArr[i].indexOf(value) > -1) {\n cityId = index;\n return;\n } \n });\n if (cityId !== null) {\n city_ReDrawMap = false;\n city = CityDropDownDict[cityId];\n Intern_CityElem.val(cityId);\n Intern_CityElem.change();\n\n var zoneId = null;\n $.each(ZoneDropDownDict, function (index, value) {\n if (zoneId === null)\n for (var i = 0; i < zoneIDUsed; i++)\n if (ZoneNamesArr[i].indexOf(value) > -1) {\n zoneId = index;\n break;\n }\n });\n if (zoneId !== null) {\n zone_ReDrawMap = false;\n zone = ZoneDropDownDict[zoneId];\n Intern_ZoneElem.val(zoneId);\n Intern_ZoneElem.change();\n }\n else {\n\n //debugger;\n\n ZoneDropDownDict[Const_NewZoneId] = ZoneNamesArr[0];\n Intern_ZoneElem.html(Utilities_DictionaryToSelectOpt(ZoneDropDownDict, \"00000000-0000-0000-0000-000000000000\", text_DDBox_ChooseZone));\n Intern_ZoneElem.val(Const_NewZoneId);\n Intern_LocationStore.SetDataToLocalStore(\"City_\" + Const_NewZoneId, ZoneDropDownDict);\n //Intern_ZoneElem.change();\n }\n }\n else {\n\n //debugger;\n\n var newCityName = ZoneNamesArr.length > 1 ? ZoneNamesArr[ZoneNamesArr.length - 1] : CityNamesArr[0];\n \n CityDropDownDict[Const_NewCityId] = newCityName; // CityNamesArr[0];\n Intern_CityElem.html(Utilities_DictionaryToSelectOpt(CityDropDownDict, \"00000000-0000-0000-0000-000000000000\", text_DDBox_ChooseCity));\n Intern_CityElem.val(Const_NewCityId);\n Intern_LocationStore.SetDataToLocalStore(\"Country_\" + Intern_CountryElem.val(), CityDropDownDict);\n Intern_GoogleRegionNameElem.val(CityNamesArr[CityNamesArr.length - 1]);\n //Intern_CityElem.change();\n \n ZoneDropDownDict = {};\n ZoneDropDownDict[Const_NewZoneId] = ZoneNamesArr[0];\n Intern_ZoneElem.html(Utilities_DictionaryToSelectOpt(ZoneDropDownDict, \"00000000-0000-0000-0000-000000000000\", text_DDBox_ChooseZone));\n Intern_ZoneElem.val(Const_NewZoneId);\n Intern_LocationStore.SetDataToLocalStore(\"City_\" + Const_NewZoneId, ZoneDropDownDict);\n //Intern_ZoneElem.change();\n }\n console.log(\"ZoneNamesArr : \" + JSON.stringify(ZoneNamesArr));\n console.log(\"CityNamesArr : \" + JSON.stringify(CityNamesArr));\n }\n }\n Intern_ModifyCountryCityZone = true;\n }", "async getFederalAndStateReps() {\n const { gapi, address } = this.state;\n try {\n \tconst response = await gapi.client.civicinfo.representatives.representativeInfoByAddress({ address: address, includeOffices: true});\n await this.setState({ federalAndState: response.result[\"officials\"], normalizedInput: response.result[\"normalizedInput\"], divisions: response.result[\"divisions\"] });\n return this.state.federalAndState;\n } catch (err) {\n \tconsole.error('error fetching representative info', err);\n } \n }", "function getLocation(jData) {\n if (jData == null) {\n // There was a problem parsing search results\n return;\n }\n\n // save place array in 'postalcodes' to make it accessible from mouse event handlers\n postalcodes = jData.postalcodes;\n\n postalcodes[0].postalcode = parseInt(postalcodes[0].postalcode);\n\n //alert(typeof(postalcodes[0].postalcode));\n\n if (postalcodes.length > 1) {\n // we got several places for the postalcode\n // make suggest box visible\n document.getElementById('suggestBoxElement').style.visibility = 'visible';\n var suggestBoxHTML = '';\n // iterate over places and build suggest box content\n for (i=0;i< jData.postalcodes.length;i++) {\n // for every postalcode record we create a html div\n // each div gets an id using the array index for later retrieval\n // define mouse event handlers to highlight places on mouseover\n // and to select a place on click\n // all events receive the postalcode array index as input parameter\n suggestBoxHTML += \"<div class='suggestions' id=pcId\" + i + \" onmousedown='suggestBoxMouseDown(\" + i +\")' onmouseover='suggestBoxMouseOver(\" + i +\")' onmouseout='suggestBoxMouseOut(\" + i +\")'> \" + postalcodes[i].countryCode + ' ' + postalcodes[i].postalcode + ' - ' + postalcodes[i].placeName +'</div>';\n }\n // display suggest box\n document.getElementById('suggestBoxElement').innerHTML = suggestBoxHTML;\n } else {\n if (postalcodes.length == 1) {\n\n\n if (postalcodes[0].postalcode > 9999 && postalcodes[0].postalcode < 10999){\n\n document.getElementById('state').value = 'Caceres';\n } else {\n\n // Si comento esta Sale provincia=cataluna en vez de barcelona para el 08170\n // y para 08005 la Poblacion viene vacia y provincia= cataluna\n document.getElementById('state').value = postalcodes[0].adminName1;\n /*document.getElementById('state').value = postalcodes[0].adminName2;\n document.getElementById('state').value = postalcodes[0].adminName3;*/\n\n\n vlen1 = document.getElementById('state');\n vlen2 = document.getElementById('state');\n vlen3 = document.getElementById('state');\n vlen4 = '';\n\n //alert (\"ad1 fuera\"+vlen1);\n\n /*if (vlen1.length > 1){\n // alert (\"ad1 mayor a 1\"+vlen1);\n }\n\n if (vlen2.length > 1){\n // alert (\"ad2 mayor a 1\"+vlen2);\n }\n\n if (vlen3.length > 1){\n // alert (\"ad3 mayor a 1\"+vlen3);\n }\n\n if (vlen4.length == 0){\n // alert (\"ad4 mayor a 1\"+vlen4);\n }*/\n\n\n\n /* alert(\"fuera admin1: \"+postalcodes[0].adminName1);\n alert(\"fuera admin2: \"+postalcodes[0].adminName2);\n\t alert(\"fuera admin3: \"+postalcodes[0].adminName3); */\n\n if (postalcodes[0].adminName2 == 'undefined'){\n alert(\"dentro adminname undefined: \"+postalcodes[0].adminName3);\n document.getElementById('state').value = postalcodes[0].adminName3;\n }\n\n if (postalcodes[0].adminName3 == 'undefined'){\n alert(\"dentro adminname undefined: \"+postalcodes[0].adminName3);\n document.getElementById('state').value = postalcodes[0].adminName3;\n }\n\n\n }\n\n\n // Poblacion\n document.getElementById('city').value = postalcodes[0].placeName;\n\n\n // 03001\n if (postalcodes[0].postalcode > 3000 && postalcodes[0].postalcode < 4000){\n document.getElementById('state').value = 'Alicante';\n }\n\n\n\n //04006 ?\n if (postalcodes[0].postalcode > 4000 && postalcodes[0].postalcode < 5000){\n document.getElementById('state').value = 'Almeria';\n }\n\n if (postalcodes[0].postalcode > 8000 && postalcodes[0].postalcode < 9000){\n document.getElementById('state').value = 'Barcelona';\n //alert('es barcelona'):\n }\n\n\n\n\n //12006 ?\n if (postalcodes[0].postalcode > 12000 && postalcodes[0].postalcode < 13000){\n document.getElementById('state').value = 'Castellon';\n }\n\n //15010 OK\n if (postalcodes[0].postalcode > 15000 && postalcodes[0].postalcode < 16000){\n document.getElementById('state').value = 'A Coruna';\n }\n\n\t //23760 OK\n if (postalcodes[0].postalcode > 23000 && postalcodes[0].postalcode < 24000){\n document.getElementById('state').value = 'Jaen';\n }\n\n //23760 OK\n if (postalcodes[0].postalcode > 25000 && postalcodes[0].postalcode < 26000){\n document.getElementById('state').value = 'Lleida';\n }\n\n // 11400 OK\n if (postalcodes[0].postalcode > 10999 && postalcodes[0].postalcode < 11999){\n document.getElementById('state').value = 'Cadiz';\n }\n\n // 45250 OK\n if (postalcodes[0].postalcode > 45000 && postalcodes[0].postalcode < 46000){\n document.getElementById('state').value = 'Toledo';\n }\n\n// 45250 OK\n if (postalcodes[0].postalcode > 51000 && postalcodes[0].postalcode < 52000){\n document.getElementById('state').value = 'Ceuta';\n }\n// 45250 OK\n if (postalcodes[0].postalcode > 52000 && postalcodes[0].postalcode < 53000){\n document.getElementById('state').value = 'Melilla';\n }\n\n\n\n\n\n // 05003 OK\n if (postalcodes[0].postalcode > 04999 && postalcodes[0].postalcode < 05999){\n document.getElementById('state').value = 'Avila';\n }\n\n // 05003 OK\n if (postalcodes[0].postalcode > 7000 && postalcodes[0].postalcode < 8000){\n document.getElementById('state').value = 'Baleares';\n //alert('codigo postal de baleares');\n }\n\n\n //33012 - Asturias-Oviedo-Gijon\n if (postalcodes[0].postalcode > 33000 && postalcodes[0].postalcode < 34000){\n document.getElementById('state').value = 'Asturias';\n }\n //33012 - Asturias-Oviedo-Gijon\n if (postalcodes[0].postalcode > 35000 && postalcodes[0].postalcode < 36000){\n document.getElementById('state').value = 'Las Palmas';\n }\n\n\n //39001 - Santander-Cantabria\n if (postalcodes[0].postalcode > 39000 && postalcodes[0].postalcode < 40000){\n document.getElementById('state').value = 'Cantabria';\n }\n\n // 48001 OK\n if (postalcodes[0].postalcode > 48000 && postalcodes[0].postalcode < 49000){\n document.getElementById('state').value = 'Vizcaya';\n }\n\n // 48001 OK\n if (postalcodes[0].postalcode > 20000 && postalcodes[0].postalcode < 21000){\n document.getElementById('state').value = 'Guipuzcoa';\n }\n\n // 48001 OK\n if (postalcodes[0].postalcode > 22000 && postalcodes[0].postalcode < 23000){\n document.getElementById('state').value = 'Huesca';\n }\n\n if (postalcodes[0].postalcode > 26000 && postalcodes[0].postalcode < 27000){\n document.getElementById('state').value = 'La Rioja';\n }\n\n if (postalcodes[0].postalcode > 29000 && postalcodes[0].postalcode < 30000){\n document.getElementById('state').value = 'Malaga';\n }\n\n\n\n }\n closeSuggestBox();\n }\n}", "function changeDist(ev)\n{\n // identify the selected district\n var distSelect = document.distForm.District;\n var optIndex = distSelect.selectedIndex;\n if (optIndex == -1)\n optIndex = 0; // default to first entry\n var optVal = distSelect.options[optIndex].value;\n\n}", "function getFemalePopulationPerDistrct(district_data)\n{\n let female_population_pre_district = [];\n for (let i = 0; i < district_data.length; i++)\n {\n female_population_pre_district.push(district_data[i].female);\n }\n return female_population_pre_district;\n}", "function districtStyle(feature) {\n return {\n opacity: 1,\n dashArray: '3',\n fillOpacity: 0.7,\n fillColor: getOriginalColor()\n };\n}", "function firesInsideProvince(feature) {\n allCoord = new Array;\n var i;\n for(i = 0; i < dataForDate.length; i++) {\n if(d3.geoContains(feature, [dataForDate[i].longitude, dataForDate[i].latitude])) {\n allCircles[i].setAttribute(\"fill\", \"red\");\n allCoord.push(dataForDate[i]);\n }\n }\n console.log(allCoord);\n }", "function removeDistrict(dustbin) {\n var itemToDelete = dustbin.parentNode;\n //Find out at which position \"itemToDelete\" is in order to know the array number of which to remove the subarray entries.\n var items = document.getElementsByClassName(\"item\");\n for (i=0;i<items.length;i++) {\n //console.log(items[i]);\n if (items[i] == itemToDelete) {\n //console.log(i);\n removeColor(wikidataIds[i]); //remove the color of all polygons from the soon to be deleted district\n //console.log(wikidataIds[i]);\n wikidataIds.splice(i,1);\n wikidataIds.push([]);\n //wikidataIds[i].splice(0,wikidataIds[i].length); //from position 0 remove all items of this subarray\n oneColorUp(i); //Color all districts below the deleted one with a color one above the current one.\n console.log(wikidataIds);\n break;\n }\n }\n\n itemToDelete.remove();\n itemCounter--;\n //console.log(itemCounter);\n\n //change counter on id's, so they are consecutively numbered\n var allItems = document.getElementsByClassName(\"item\");\n for (var i=0; i<allItems.length; i++) {\n allItems[i].setAttribute(\"id\",\"item_\" + (i));\n }\n\n createOutput();\n}", "function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#district_id');\n });\n $('#district_id').trigger(\"chosen:updated\");\n $(\"#district_id\").chosen();\n}", "function getVillageDist(x,y) {\r\n\t\treturn function(e) {\r\n\t\t\tvar cities = find(\"//div[@id='lright1']//table[@class='f10']\", XPFirst);\r\n\t\t\tif(cities){\r\n\t\t\t\tvar txt1=new Array();\r\n\t\t\t\ttxt1.push('<tr><td colspan=2 align=center><b>'+x+'|'+y+'</b><tr><td style=\"border-bottom:solid 1px #00C000;\"><b>'+T('ALDEA')+'</b><td align=right style=\"border-bottom:solid 1px #00C000;\"><b>'+T('Dist')+'</b>');\r\n\t\t\t\tcities = cities.firstChild;\r\n\t\t\t\tfor (var j = 0; j < cities.childNodes.length; j++){\r\n\t\t\t\t\tvar city = cities.childNodes[j];\r\n\t\t\t\t\tvar cityname=city.childNodes[0].childNodes[2].textContent;\r\n\t\t\t\t\tcity.textContent.search(/\\((.*)\\n?\\|\\n?(.*)\\)/);\r\n\t\t\t\t\tvar x2=parseInt(RegExp.$1,10);\r\n\t\t\t\t\tvar y2=parseInt(RegExp.$2,10);\r\n\t\t\t\t\tvar dist=Math.sqrt(Math.pow(x-x2,2)+Math.pow(y-y2,2)).toFixed(2);\r\n\t\t\t\t\ttxt1.push('<tr><td>'+cityname+'<td align=right>'+dist);\r\n\t\t\t\t}\r\n//\t\t\t\tvar table = elem('table', txt1.join(''));\r\n//\t\t\t\tvar tooltip = get('tb_tooltip');\r\n////\t\t\t\tdocument.body.appendChild(tooltip);\r\n//\r\n//\t\t\t\ttooltip.innerHTML = \"\";\r\n//\t\t\t\ttooltip.appendChild(table);\r\n//\t\t\t\ttooltip.style.display = 'block';\r\n\r\n\t\t\t\ttimeout = setTimeout(function(){\r\n\t\t\t\t\tvar div = get(\"tb_tooltip\");\r\n\r\n\t\t\t\t\tdiv.innerHTML = \"\";\r\n\t\t\t\t\tdiv.appendChild(elem('table', txt1.join('')));\r\n\r\n\t\t\t\t\tdiv.style.display = 'block';\r\n\t\t\t\t}, 100);\r\n\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function /*void*/ updateCityDistrictOptions(cityId, districtId) {\n\tvar optList = \"\";\n\tif ($jq(\"#\" + cityId).val() != 0 && $jq.isArray(cityDistrictMap[$jq(\"#\" + cityId + \" option:selected\").text()])) {\n\t\t// Build list from array in the map\n\t\tvar districtsToShow = [];\n\t\t$jq(cityDistrictMap[$jq(\"#\" + cityId + \" option:selected\").text()]).each(function(id, value){\n\t\t\tdistrictsToShow.push(value);\n\t\t});\n\t\tif (originalDistrictList != null)\n\t\t\t$jq(originalDistrictList).each(function(){\n\t\t\t\tif ($jq(this).val() == 0 || $jq.inArray($jq(this).text(), districtsToShow) > -1) {\n\t\t\t\t\toptList += '<option value=\"' + $jq(this).val() + '\">' + $jq(this).text() + '</option>';\n\t\t\t\t}\n\t\t\t});\n\t} else if (originalDistrictList != null) {\n\t\t// Restore original list of all districts\n\t\t$jq(originalDistrictList).each(function(){\n\t\t\toptList += '<option value=\"' + $jq(this).val() + '\">' + $jq(this).text() + '</option>';\n\t\t});\n\t}\n\tif (optList.length > 0)\n\t\t$jq(\"#\" + districtId).empty().append(optList);\n}", "function finalAddrParse ( addrObj ) {\n\n if (addrObj.city == \"nocity\") addrObj.city = \"\";\n \n addrObj.streetName = (addrObj.streetNumber.trim()+\" \"+addrObj.streetName.trim());\n \n if (addrObj.streetName == \" RR\") addrObj.streetName = \"\";\n \n const \n addrStr = addrObj.streetName.split(\" \"),\n lastAddrStr = addrStr[addrStr.length-1];\n \n const regExTes1 = /[A-Z|0-9][A-Z]/;\n const regExTes2 = /[A-Z|0-9][A-Z][a-z]/;\n \n if (regExTes1.test(lastAddrStr) && lastAddrStr.length != 2) { \n \n const splitIndex = indexOfRegex(regExTes1, addrObj.streetName, addrObj.streetName.indexOf(lastAddrStr));\n const newStreetName = addrObj.streetName.substr(0,splitIndex);\n const newCityName = addrObj.streetName.substr(splitIndex+1)\n addrObj.streetName = newStreetName;\n addrObj.city = newCityName+\" \"+addrObj.city.trim()\n \n } else if (regExTes2.test(addrObj.city)) {\n \n const splitIndex = indexOfRegex(regExTes2, addrObj.city, 0);\n const streetAdd = addrObj.city.substr(0,splitIndex+1);\n const newCityName = addrObj.city.substr(splitIndex+1)\n addrObj.streetName = addrObj.streetName+\" \"+streetAdd;\n addrObj.city = newCityName;\n \n } else if (regExTes1.test(addrObj.city) && !regExTes2.test(addrObj.city)) {\n \n addrObj.streetName = addrObj.streetName+\" \"+addrObj.city;\n addrObj.city = \"Washington\"\n addrObj.state = \"DC\"\n \n } else if (addrObj.city.length == 2 && addrObj.city != 'of') {\n \n addrObj.streetName = addrObj.streetName+\" \"+addrObj.city\n addrObj.city = \"\";\n \n }\n \n \n const cityArr = addrObj.city.split(\" \");\n const len = cityArr.length;\n \n if (\n stateMap[cityArr[1]] != undefined\n || ( len > 2 && stateMap[(cityArr[len-2]+\" \"+cityArr[len-1])] != undefined )\n ) {\n addrObj.city = cityArr[0];\n }\n \n return addrObj;\n \n}", "function common_getProvinceCityMap(){\n var common_provinceCityMap = {\n \"1\": [\n {\n \"id\": 72,\n \"name\": \"朝阳区\"\n },\n {\n \"id\": 2800,\n \"name\": \"海淀区\"\n },\n {\n \"id\": 2801,\n \"name\": \"西城区\"\n },\n {\n \"id\": 2802,\n \"name\": \"东城区\"\n },\n {\n \"id\": 2803,\n \"name\": \"崇文区\"\n },\n {\n \"id\": 2804,\n \"name\": \"宣武区\"\n },\n {\n \"id\": 2805,\n \"name\": \"丰台区\"\n },\n {\n \"id\": 2806,\n \"name\": \"石景山区\"\n },\n {\n \"id\": 2807,\n \"name\": \"门头沟\"\n },\n {\n \"id\": 2808,\n \"name\": \"房山区\"\n },\n {\n \"id\": 2809,\n \"name\": \"通州区\"\n },\n {\n \"id\": 2810,\n \"name\": \"大兴区\"\n },\n {\n \"id\": 2812,\n \"name\": \"顺义区\"\n },\n {\n \"id\": 2814,\n \"name\": \"怀柔区\"\n },\n {\n \"id\": 2816,\n \"name\": \"密云区\"\n },\n {\n \"id\": 2901,\n \"name\": \"昌平区\"\n },\n {\n \"id\": 2953,\n \"name\": \"平谷区\"\n },\n {\n \"id\": 3065,\n \"name\": \"延庆县\"\n }],\n \"2\": [\n {\n \"id\": 2813,\n \"name\": \"徐汇区\"\n },\n {\n \"id\": 2815,\n \"name\": \"长宁区\"\n },\n {\n \"id\": 2817,\n \"name\": \"静安区\"\n },\n {\n \"id\": 2820,\n \"name\": \"闸北区\"\n },\n {\n \"id\": 2822,\n \"name\": \"虹口区\"\n },\n {\n \"id\": 2823,\n \"name\": \"杨浦区\"\n },\n {\n \"id\": 2824,\n \"name\": \"宝山区\"\n },\n {\n \"id\": 2825,\n \"name\": \"闵行区\"\n },\n {\n \"id\": 2826,\n \"name\": \"嘉定区\"\n },\n {\n \"id\": 2830,\n \"name\": \"浦东新区\"\n },\n {\n \"id\": 2833,\n \"name\": \"青浦区\"\n },\n {\n \"id\": 2834,\n \"name\": \"松江区\"\n },\n {\n \"id\": 2835,\n \"name\": \"金山区\"\n },\n {\n \"id\": 2837,\n \"name\": \"奉贤区\"\n },\n {\n \"id\": 2841,\n \"name\": \"普陀区\"\n },\n {\n \"id\": 2919,\n \"name\": \"崇明县\"\n },\n {\n \"id\": 78,\n \"name\": \"黄浦区\"\n }],\n \"3\": [\n {\n \"id\": 51035,\n \"name\": \"东丽区\"\n },\n {\n \"id\": 51036,\n \"name\": \"和平区\"\n },\n {\n \"id\": 51037,\n \"name\": \"河北区\"\n },\n {\n \"id\": 51038,\n \"name\": \"河东区\"\n },\n {\n \"id\": 51039,\n \"name\": \"河西区\"\n },\n {\n \"id\": 51040,\n \"name\": \"红桥区\"\n },\n {\n \"id\": 51041,\n \"name\": \"蓟县\"\n },\n {\n \"id\": 51042,\n \"name\": \"静海县\"\n },\n {\n \"id\": 51043,\n \"name\": \"南开区\"\n },\n {\n \"id\": 51044,\n \"name\": \"塘沽区\"\n },\n {\n \"id\": 51045,\n \"name\": \"西青区\"\n },\n {\n \"id\": 51046,\n \"name\": \"武清区\"\n },\n {\n \"id\": 51047,\n \"name\": \"津南区\"\n },\n {\n \"id\": 51048,\n \"name\": \"汉沽区\"\n },\n {\n \"id\": 51049,\n \"name\": \"大港区\"\n },\n {\n \"id\": 51050,\n \"name\": \"北辰区\"\n },\n {\n \"id\": 51051,\n \"name\": \"宝坻区\"\n },\n {\n \"id\": 51052,\n \"name\": \"宁河县\"\n }],\n \"4\": [\n {\n \"id\": 113,\n \"name\": \"万州区\"\n },\n {\n \"id\": 114,\n \"name\": \"涪陵区\"\n },\n {\n \"id\": 115,\n \"name\": \"梁平县\"\n },\n {\n \"id\": 119,\n \"name\": \"南川区\"\n },\n {\n \"id\": 123,\n \"name\": \"潼南县\"\n },\n {\n \"id\": 126,\n \"name\": \"大足区\"\n },\n {\n \"id\": 128,\n \"name\": \"黔江区\"\n },\n {\n \"id\": 129,\n \"name\": \"武隆县\"\n },\n {\n \"id\": 130,\n \"name\": \"丰都县\"\n },\n {\n \"id\": 131,\n \"name\": \"奉节县\"\n },\n {\n \"id\": 132,\n \"name\": \"开县\"\n },\n {\n \"id\": 133,\n \"name\": \"云阳县\"\n },\n {\n \"id\": 134,\n \"name\": \"忠县\"\n },\n {\n \"id\": 135,\n \"name\": \"巫溪县\"\n },\n {\n \"id\": 136,\n \"name\": \"巫山县\"\n },\n {\n \"id\": 137,\n \"name\": \"石柱县\"\n },\n {\n \"id\": 138,\n \"name\": \"彭水县\"\n },\n {\n \"id\": 139,\n \"name\": \"垫江县\"\n },\n {\n \"id\": 140,\n \"name\": \"酉阳县\"\n },\n {\n \"id\": 141,\n \"name\": \"秀山县\"\n },\n {\n \"id\": 48131,\n \"name\": \"璧山县\"\n },\n {\n \"id\": 48132,\n \"name\": \"荣昌县\"\n },\n {\n \"id\": 48133,\n \"name\": \"铜梁县\"\n },\n {\n \"id\": 48201,\n \"name\": \"合川区\"\n },\n {\n \"id\": 48202,\n \"name\": \"巴南区\"\n },\n {\n \"id\": 48203,\n \"name\": \"北碚区\"\n },\n {\n \"id\": 48204,\n \"name\": \"江津区\"\n },\n {\n \"id\": 48205,\n \"name\": \"渝北区\"\n },\n {\n \"id\": 48206,\n \"name\": \"长寿区\"\n },\n {\n \"id\": 48207,\n \"name\": \"永川区\"\n },\n {\n \"id\": 50950,\n \"name\": \"江北区\"\n },\n {\n \"id\": 50951,\n \"name\": \"南岸区\"\n },\n {\n \"id\": 50952,\n \"name\": \"九龙坡区\"\n },\n {\n \"id\": 50953,\n \"name\": \"沙坪坝区\"\n },\n {\n \"id\": 50954,\n \"name\": \"大渡口区\"\n },\n {\n \"id\": 50995,\n \"name\": \"綦江区\"\n },\n {\n \"id\": 51026,\n \"name\": \"渝中区\"\n },\n {\n \"id\": 51027,\n \"name\": \"高新区\"\n },\n {\n \"id\": 51028,\n \"name\": \"北部新区\"\n },\n {\n \"id\": 4164,\n \"name\": \"城口县\"\n }],\n \"5\": [\n {\n \"id\": 142,\n \"name\": \"石家庄市\"\n },\n {\n \"id\": 148,\n \"name\": \"邯郸市\"\n },\n {\n \"id\": 164,\n \"name\": \"邢台市\"\n },\n {\n \"id\": 199,\n \"name\": \"保定市\"\n },\n {\n \"id\": 224,\n \"name\": \"张家口市\"\n },\n {\n \"id\": 239,\n \"name\": \"承德市\"\n },\n {\n \"id\": 248,\n \"name\": \"秦皇岛市\"\n },\n {\n \"id\": 258,\n \"name\": \"唐山市\"\n },\n {\n \"id\": 264,\n \"name\": \"沧州市\"\n },\n {\n \"id\": 274,\n \"name\": \"廊坊市\"\n },\n {\n \"id\": 275,\n \"name\": \"衡水市\"\n }],\n \"6\": [\n {\n \"id\": 303,\n \"name\": \"太原市\"\n },\n {\n \"id\": 309,\n \"name\": \"大同市\"\n },\n {\n \"id\": 318,\n \"name\": \"阳泉市\"\n },\n {\n \"id\": 325,\n \"name\": \"晋城市\"\n },\n {\n \"id\": 330,\n \"name\": \"朔州市\"\n },\n {\n \"id\": 336,\n \"name\": \"晋中市\"\n },\n {\n \"id\": 350,\n \"name\": \"忻州市\"\n },\n {\n \"id\": 368,\n \"name\": \"吕梁市\"\n },\n {\n \"id\": 379,\n \"name\": \"临汾市\"\n },\n {\n \"id\": 398,\n \"name\": \"运城市\"\n },\n {\n \"id\": 3074,\n \"name\": \"长治市\"\n }],\n \"7\": [\n {\n \"id\": 412,\n \"name\": \"郑州市\"\n },\n {\n \"id\": 420,\n \"name\": \"开封市\"\n },\n {\n \"id\": 427,\n \"name\": \"洛阳市\"\n },\n {\n \"id\": 438,\n \"name\": \"平顶山市\"\n },\n {\n \"id\": 446,\n \"name\": \"焦作市\"\n },\n {\n \"id\": 454,\n \"name\": \"鹤壁市\"\n },\n {\n \"id\": 458,\n \"name\": \"新乡市\"\n },\n {\n \"id\": 468,\n \"name\": \"安阳市\"\n },\n {\n \"id\": 475,\n \"name\": \"濮阳市\"\n },\n {\n \"id\": 482,\n \"name\": \"许昌市\"\n },\n {\n \"id\": 489,\n \"name\": \"漯河市\"\n },\n {\n \"id\": 495,\n \"name\": \"三门峡市\"\n },\n {\n \"id\": 502,\n \"name\": \"南阳市\"\n },\n {\n \"id\": 517,\n \"name\": \"商丘市\"\n },\n {\n \"id\": 527,\n \"name\": \"周口市\"\n },\n {\n \"id\": 538,\n \"name\": \"驻马店市\"\n },\n {\n \"id\": 549,\n \"name\": \"信阳市\"\n },\n {\n \"id\": 2780,\n \"name\": \"济源市\"\n }],\n \"8\": [\n {\n \"id\": 560,\n \"name\": \"沈阳市\"\n },\n {\n \"id\": 573,\n \"name\": \"大连市\"\n },\n {\n \"id\": 579,\n \"name\": \"鞍山市\"\n },\n {\n \"id\": 584,\n \"name\": \"抚顺市\"\n },\n {\n \"id\": 589,\n \"name\": \"本溪市\"\n },\n {\n \"id\": 593,\n \"name\": \"丹东市\"\n },\n {\n \"id\": 598,\n \"name\": \"锦州市\"\n },\n {\n \"id\": 604,\n \"name\": \"葫芦岛市\"\n },\n {\n \"id\": 609,\n \"name\": \"营口市\"\n },\n {\n \"id\": 613,\n \"name\": \"盘锦市\"\n },\n {\n \"id\": 617,\n \"name\": \"阜新市\"\n },\n {\n \"id\": 621,\n \"name\": \"辽阳市\"\n },\n {\n \"id\": 632,\n \"name\": \"朝阳市\"\n },\n {\n \"id\": 6858,\n \"name\": \"铁岭市\"\n }],\n \"9\": [\n {\n \"id\": 639,\n \"name\": \"长春市\"\n },\n {\n \"id\": 644,\n \"name\": \"吉林市\"\n },\n {\n \"id\": 651,\n \"name\": \"四平市\"\n },\n {\n \"id\": 2992,\n \"name\": \"辽源市\"\n },\n {\n \"id\": 657,\n \"name\": \"通化市\"\n },\n {\n \"id\": 664,\n \"name\": \"白山市\"\n },\n {\n \"id\": 674,\n \"name\": \"松原市\"\n },\n {\n \"id\": 681,\n \"name\": \"白城市\"\n },\n {\n \"id\": 687,\n \"name\": \"延边州\"\n }],\n \"10\": [\n {\n \"id\": 727,\n \"name\": \"鹤岗市\"\n },\n {\n \"id\": 731,\n \"name\": \"双鸭山市\"\n },\n {\n \"id\": 737,\n \"name\": \"鸡西市\"\n },\n {\n \"id\": 742,\n \"name\": \"大庆市\"\n },\n {\n \"id\": 753,\n \"name\": \"伊春市\"\n },\n {\n \"id\": 757,\n \"name\": \"牡丹江市\"\n },\n {\n \"id\": 765,\n \"name\": \"佳木斯市\"\n },\n {\n \"id\": 773,\n \"name\": \"七台河市\"\n },\n {\n \"id\": 776,\n \"name\": \"黑河市\"\n },\n {\n \"id\": 782,\n \"name\": \"绥化市\"\n },\n {\n \"id\": 793,\n \"name\": \"大兴安岭地区\"\n },\n {\n \"id\": 698,\n \"name\": \"哈尔滨市\"\n },\n {\n \"id\": 712,\n \"name\": \"齐齐哈尔市\"\n }],\n \"11\": [\n {\n \"id\": 799,\n \"name\": \"呼和浩特市\"\n },\n {\n \"id\": 805,\n \"name\": \"包头市\"\n },\n {\n \"id\": 810,\n \"name\": \"乌海市\"\n },\n {\n \"id\": 812,\n \"name\": \"赤峰市\"\n },\n {\n \"id\": 823,\n \"name\": \"乌兰察布市\"\n },\n {\n \"id\": 835,\n \"name\": \"锡林郭勒盟\"\n },\n {\n \"id\": 848,\n \"name\": \"呼伦贝尔市\"\n },\n {\n \"id\": 870,\n \"name\": \"鄂尔多斯市\"\n },\n {\n \"id\": 880,\n \"name\": \"巴彦淖尔市\"\n },\n {\n \"id\": 891,\n \"name\": \"阿拉善盟\"\n },\n {\n \"id\": 895,\n \"name\": \"兴安盟\"\n },\n {\n \"id\": 902,\n \"name\": \"通辽市\"\n }],\n \"12\": [\n {\n \"id\": 904,\n \"name\": \"南京市\"\n },\n {\n \"id\": 911,\n \"name\": \"徐州市\"\n },\n {\n \"id\": 919,\n \"name\": \"连云港市\"\n },\n {\n \"id\": 925,\n \"name\": \"淮安市\"\n },\n {\n \"id\": 933,\n \"name\": \"宿迁市\"\n },\n {\n \"id\": 939,\n \"name\": \"盐城市\"\n },\n {\n \"id\": 951,\n \"name\": \"扬州市\"\n },\n {\n \"id\": 959,\n \"name\": \"泰州市\"\n },\n {\n \"id\": 965,\n \"name\": \"南通市\"\n },\n {\n \"id\": 972,\n \"name\": \"镇江市\"\n },\n {\n \"id\": 978,\n \"name\": \"常州市\"\n },\n {\n \"id\": 984,\n \"name\": \"无锡市\"\n },\n {\n \"id\": 988,\n \"name\": \"苏州市\"\n }],\n \"13\": [\n {\n \"id\": 2900,\n \"name\": \"济宁市\"\n },\n {\n \"id\": 1000,\n \"name\": \"济南市\"\n },\n {\n \"id\": 1007,\n \"name\": \"青岛市\"\n },\n {\n \"id\": 1016,\n \"name\": \"淄博市\"\n },\n {\n \"id\": 1022,\n \"name\": \"枣庄市\"\n },\n {\n \"id\": 1025,\n \"name\": \"东营市\"\n },\n {\n \"id\": 1032,\n \"name\": \"潍坊市\"\n },\n {\n \"id\": 1042,\n \"name\": \"烟台市\"\n },\n {\n \"id\": 1053,\n \"name\": \"威海市\"\n },\n {\n \"id\": 1058,\n \"name\": \"莱芜市\"\n },\n {\n \"id\": 1060,\n \"name\": \"德州市\"\n },\n {\n \"id\": 1072,\n \"name\": \"临沂市\"\n },\n {\n \"id\": 1081,\n \"name\": \"聊城市\"\n },\n {\n \"id\": 1090,\n \"name\": \"滨州市\"\n },\n {\n \"id\": 1099,\n \"name\": \"菏泽市\"\n },\n {\n \"id\": 1108,\n \"name\": \"日照市\"\n },\n {\n \"id\": 1112,\n \"name\": \"泰安市\"\n }],\n \"14\": [\n {\n \"id\": 1151,\n \"name\": \"黄山市\"\n },\n {\n \"id\": 1159,\n \"name\": \"滁州市\"\n },\n {\n \"id\": 1167,\n \"name\": \"阜阳市\"\n },\n {\n \"id\": 1174,\n \"name\": \"亳州市\"\n },\n {\n \"id\": 1180,\n \"name\": \"宿州市\"\n },\n {\n \"id\": 1201,\n \"name\": \"池州市\"\n },\n {\n \"id\": 1206,\n \"name\": \"六安市\"\n },\n {\n \"id\": 2971,\n \"name\": \"宣城市\"\n },\n {\n \"id\": 1114,\n \"name\": \"铜陵市\"\n },\n {\n \"id\": 1116,\n \"name\": \"合肥市\"\n },\n {\n \"id\": 1121,\n \"name\": \"淮南市\"\n },\n {\n \"id\": 1124,\n \"name\": \"淮北市\"\n },\n {\n \"id\": 1127,\n \"name\": \"芜湖市\"\n },\n {\n \"id\": 1132,\n \"name\": \"蚌埠市\"\n },\n {\n \"id\": 1137,\n \"name\": \"马鞍山市\"\n },\n {\n \"id\": 1140,\n \"name\": \"安庆市\"\n }],\n \"15\": [\n {\n \"id\": 1158,\n \"name\": \"宁波市\"\n },\n {\n \"id\": 1273,\n \"name\": \"衢州市\"\n },\n {\n \"id\": 1280,\n \"name\": \"丽水市\"\n },\n {\n \"id\": 1290,\n \"name\": \"台州市\"\n },\n {\n \"id\": 1298,\n \"name\": \"舟山市\"\n },\n {\n \"id\": 1213,\n \"name\": \"杭州市\"\n },\n {\n \"id\": 1233,\n \"name\": \"温州市\"\n },\n {\n \"id\": 1243,\n \"name\": \"嘉兴市\"\n },\n {\n \"id\": 1250,\n \"name\": \"湖州市\"\n },\n {\n \"id\": 1255,\n \"name\": \"绍兴市\"\n },\n {\n \"id\": 1262,\n \"name\": \"金华市\"\n }],\n \"16\": [\n {\n \"id\": 1303,\n \"name\": \"福州市\"\n },\n {\n \"id\": 1315,\n \"name\": \"厦门市\"\n },\n {\n \"id\": 1317,\n \"name\": \"三明市\"\n },\n {\n \"id\": 1329,\n \"name\": \"莆田市\"\n },\n {\n \"id\": 1332,\n \"name\": \"泉州市\"\n },\n {\n \"id\": 1341,\n \"name\": \"漳州市\"\n },\n {\n \"id\": 1352,\n \"name\": \"南平市\"\n },\n {\n \"id\": 1362,\n \"name\": \"龙岩市\"\n },\n {\n \"id\": 1370,\n \"name\": \"宁德市\"\n }],\n \"17\": [\n {\n \"id\": 1432,\n \"name\": \"孝感市\"\n },\n {\n \"id\": 1441,\n \"name\": \"黄冈市\"\n },\n {\n \"id\": 1458,\n \"name\": \"咸宁市\"\n },\n {\n \"id\": 1466,\n \"name\": \"恩施州\"\n },\n {\n \"id\": 1475,\n \"name\": \"鄂州市\"\n },\n {\n \"id\": 1477,\n \"name\": \"荆门市\"\n },\n {\n \"id\": 1479,\n \"name\": \"随州市\"\n },\n {\n \"id\": 3154,\n \"name\": \"神农架林区\"\n },\n {\n \"id\": 1381,\n \"name\": \"武汉市\"\n },\n {\n \"id\": 1387,\n \"name\": \"黄石市\"\n },\n {\n \"id\": 1396,\n \"name\": \"襄阳市\"\n },\n {\n \"id\": 1405,\n \"name\": \"十堰市\"\n },\n {\n \"id\": 1413,\n \"name\": \"荆州市\"\n },\n {\n \"id\": 1421,\n \"name\": \"宜昌市\"\n },\n {\n \"id\": 2922,\n \"name\": \"潜江市\"\n },\n {\n \"id\": 2980,\n \"name\": \"天门市\"\n },\n {\n \"id\": 2983,\n \"name\": \"仙桃市\"\n }],\n \"18\": [\n {\n \"id\": 1482,\n \"name\": \"长沙市\"\n },\n {\n \"id\": 1488,\n \"name\": \"株洲市\"\n },\n {\n \"id\": 1495,\n \"name\": \"湘潭市\"\n },\n {\n \"id\": 1501,\n \"name\": \"衡阳市\"\n },\n {\n \"id\": 1511,\n \"name\": \"邵阳市\"\n },\n {\n \"id\": 1522,\n \"name\": \"岳阳市\"\n },\n {\n \"id\": 1530,\n \"name\": \"常德市\"\n },\n {\n \"id\": 1540,\n \"name\": \"张家界市\"\n },\n {\n \"id\": 1544,\n \"name\": \"郴州市\"\n },\n {\n \"id\": 1555,\n \"name\": \"益阳市\"\n },\n {\n \"id\": 1560,\n \"name\": \"永州市\"\n },\n {\n \"id\": 1574,\n \"name\": \"怀化市\"\n },\n {\n \"id\": 1586,\n \"name\": \"娄底市\"\n },\n {\n \"id\": 1592,\n \"name\": \"湘西州\"\n }],\n \"19\": [\n {\n \"id\": 1601,\n \"name\": \"广州市\"\n },\n {\n \"id\": 1607,\n \"name\": \"深圳市\"\n },\n {\n \"id\": 1609,\n \"name\": \"珠海市\"\n },\n {\n \"id\": 1611,\n \"name\": \"汕头市\"\n },\n {\n \"id\": 1617,\n \"name\": \"韶关市\"\n },\n {\n \"id\": 1627,\n \"name\": \"河源市\"\n },\n {\n \"id\": 1634,\n \"name\": \"梅州市\"\n },\n {\n \"id\": 1709,\n \"name\": \"揭阳市\"\n },\n {\n \"id\": 1643,\n \"name\": \"惠州市\"\n },\n {\n \"id\": 1650,\n \"name\": \"汕尾市\"\n },\n {\n \"id\": 1655,\n \"name\": \"东莞市\"\n },\n {\n \"id\": 1657,\n \"name\": \"中山市\"\n },\n {\n \"id\": 1659,\n \"name\": \"江门市\"\n },\n {\n \"id\": 1666,\n \"name\": \"佛山市\"\n },\n {\n \"id\": 1672,\n \"name\": \"阳江市\"\n },\n {\n \"id\": 1677,\n \"name\": \"湛江市\"\n },\n {\n \"id\": 1684,\n \"name\": \"茂名市\"\n },\n {\n \"id\": 1690,\n \"name\": \"肇庆市\"\n },\n {\n \"id\": 1698,\n \"name\": \"云浮市\"\n },\n {\n \"id\": 1704,\n \"name\": \"清远市\"\n },\n {\n \"id\": 1705,\n \"name\": \"潮州市\"\n }],\n \"20\": [\n {\n \"id\": 3168,\n \"name\": \"崇左市\"\n },\n {\n \"id\": 1715,\n \"name\": \"南宁市\"\n },\n {\n \"id\": 1720,\n \"name\": \"柳州市\"\n },\n {\n \"id\": 1726,\n \"name\": \"桂林市\"\n },\n {\n \"id\": 1740,\n \"name\": \"梧州市\"\n },\n {\n \"id\": 1746,\n \"name\": \"北海市\"\n },\n {\n \"id\": 1749,\n \"name\": \"防城港市\"\n },\n {\n \"id\": 1753,\n \"name\": \"钦州市\"\n },\n {\n \"id\": 1757,\n \"name\": \"贵港市\"\n },\n {\n \"id\": 1761,\n \"name\": \"玉林市\"\n },\n {\n \"id\": 1792,\n \"name\": \"贺州市\"\n },\n {\n \"id\": 1806,\n \"name\": \"百色市\"\n },\n {\n \"id\": 1818,\n \"name\": \"河池市\"\n },\n {\n \"id\": 3044,\n \"name\": \"来宾市\"\n }],\n \"21\": [\n {\n \"id\": 1827,\n \"name\": \"南昌市\"\n },\n {\n \"id\": 1832,\n \"name\": \"景德镇市\"\n },\n {\n \"id\": 1836,\n \"name\": \"萍乡市\"\n },\n {\n \"id\": 1842,\n \"name\": \"新余市\"\n },\n {\n \"id\": 1845,\n \"name\": \"九江市\"\n },\n {\n \"id\": 1857,\n \"name\": \"鹰潭市\"\n },\n {\n \"id\": 1861,\n \"name\": \"上饶市\"\n },\n {\n \"id\": 1874,\n \"name\": \"宜春市\"\n },\n {\n \"id\": 1885,\n \"name\": \"抚州市\"\n },\n {\n \"id\": 1898,\n \"name\": \"吉安市\"\n },\n {\n \"id\": 1911,\n \"name\": \"赣州市\"\n }],\n \"22\": [\n {\n \"id\": 2103,\n \"name\": \"凉山州\"\n },\n {\n \"id\": 1930,\n \"name\": \"成都市\"\n },\n {\n \"id\": 1946,\n \"name\": \"自贡市\"\n },\n {\n \"id\": 1950,\n \"name\": \"攀枝花市\"\n },\n {\n \"id\": 1954,\n \"name\": \"泸州市\"\n },\n {\n \"id\": 1960,\n \"name\": \"绵阳市\"\n },\n {\n \"id\": 1962,\n \"name\": \"德阳市\"\n },\n {\n \"id\": 1977,\n \"name\": \"广元市\"\n },\n {\n \"id\": 1983,\n \"name\": \"遂宁市\"\n },\n {\n \"id\": 1988,\n \"name\": \"内江市\"\n },\n {\n \"id\": 1993,\n \"name\": \"乐山市\"\n },\n {\n \"id\": 2005,\n \"name\": \"宜宾市\"\n },\n {\n \"id\": 2016,\n \"name\": \"广安市\"\n },\n {\n \"id\": 2022,\n \"name\": \"南充市\"\n },\n {\n \"id\": 2033,\n \"name\": \"达州市\"\n },\n {\n \"id\": 2042,\n \"name\": \"巴中市\"\n },\n {\n \"id\": 2047,\n \"name\": \"雅安市\"\n },\n {\n \"id\": 2058,\n \"name\": \"眉山市\"\n },\n {\n \"id\": 2065,\n \"name\": \"资阳市\"\n },\n {\n \"id\": 2070,\n \"name\": \"阿坝州\"\n },\n {\n \"id\": 2084,\n \"name\": \"甘孜州\"\n }],\n \"23\": [\n {\n \"id\": 3690,\n \"name\": \"三亚市\"\n },\n {\n \"id\": 3698,\n \"name\": \"文昌市\"\n },\n {\n \"id\": 3699,\n \"name\": \"五指山市\"\n },\n {\n \"id\": 3701,\n \"name\": \"临高县\"\n },\n {\n \"id\": 3702,\n \"name\": \"澄迈县\"\n },\n {\n \"id\": 3703,\n \"name\": \"定安县\"\n },\n {\n \"id\": 3704,\n \"name\": \"屯昌县\"\n },\n {\n \"id\": 3705,\n \"name\": \"昌江县\"\n },\n {\n \"id\": 3706,\n \"name\": \"白沙县\"\n },\n {\n \"id\": 3707,\n \"name\": \"琼中县\"\n },\n {\n \"id\": 3708,\n \"name\": \"陵水县\"\n },\n {\n \"id\": 3709,\n \"name\": \"保亭县\"\n },\n {\n \"id\": 3710,\n \"name\": \"乐东县\"\n },\n {\n \"id\": 3711,\n \"name\": \"三沙市\"\n },\n {\n \"id\": 2121,\n \"name\": \"海口市\"\n },\n {\n \"id\": 3115,\n \"name\": \"琼海市\"\n },\n {\n \"id\": 3137,\n \"name\": \"万宁市\"\n },\n {\n \"id\": 3173,\n \"name\": \"东方市\"\n },\n {\n \"id\": 3034,\n \"name\": \"儋州市\"\n }],\n \"24\": [\n {\n \"id\": 2144,\n \"name\": \"贵阳市\"\n },\n {\n \"id\": 2150,\n \"name\": \"六盘水市\"\n },\n {\n \"id\": 2155,\n \"name\": \"遵义市\"\n },\n {\n \"id\": 2169,\n \"name\": \"铜仁市\"\n },\n {\n \"id\": 2180,\n \"name\": \"毕节市\"\n },\n {\n \"id\": 2189,\n \"name\": \"安顺市\"\n },\n {\n \"id\": 2196,\n \"name\": \"黔西南州\"\n },\n {\n \"id\": 2205,\n \"name\": \"黔东南州\"\n },\n {\n \"id\": 2222,\n \"name\": \"黔南州\"\n }],\n \"25\": [\n {\n \"id\": 4108,\n \"name\": \"迪庆州\"\n },\n {\n \"id\": 2235,\n \"name\": \"昆明市\"\n },\n {\n \"id\": 2247,\n \"name\": \"曲靖市\"\n },\n {\n \"id\": 2258,\n \"name\": \"玉溪市\"\n },\n {\n \"id\": 2270,\n \"name\": \"昭通市\"\n },\n {\n \"id\": 2281,\n \"name\": \"普洱市\"\n },\n {\n \"id\": 2291,\n \"name\": \"临沧市\"\n },\n {\n \"id\": 2298,\n \"name\": \"保山市\"\n },\n {\n \"id\": 2304,\n \"name\": \"丽江市\"\n },\n {\n \"id\": 2309,\n \"name\": \"文山州\"\n },\n {\n \"id\": 2318,\n \"name\": \"红河州\"\n },\n {\n \"id\": 2332,\n \"name\": \"西双版纳州\"\n },\n {\n \"id\": 2336,\n \"name\": \"楚雄州\"\n },\n {\n \"id\": 2347,\n \"name\": \"大理州\"\n },\n {\n \"id\": 2360,\n \"name\": \"德宏州\"\n },\n {\n \"id\": 2366,\n \"name\": \"怒江州\"\n }],\n \"26\": [\n {\n \"id\": 3970,\n \"name\": \"阿里地区\"\n },\n {\n \"id\": 3971,\n \"name\": \"林芝地区\"\n },\n {\n \"id\": 2951,\n \"name\": \"拉萨市\"\n },\n {\n \"id\": 3107,\n \"name\": \"那曲地区\"\n },\n {\n \"id\": 3129,\n \"name\": \"山南地区\"\n },\n {\n \"id\": 3138,\n \"name\": \"昌都地区\"\n },\n {\n \"id\": 3144,\n \"name\": \"日喀则地区\"\n }],\n \"27\": [\n {\n \"id\": 2428,\n \"name\": \"延安市\"\n },\n {\n \"id\": 2442,\n \"name\": \"汉中市\"\n },\n {\n \"id\": 2454,\n \"name\": \"榆林市\"\n },\n {\n \"id\": 2468,\n \"name\": \"商洛市\"\n },\n {\n \"id\": 2476,\n \"name\": \"安康市\"\n },\n {\n \"id\": 2376,\n \"name\": \"西安市\"\n },\n {\n \"id\": 2386,\n \"name\": \"铜川市\"\n },\n {\n \"id\": 2390,\n \"name\": \"宝鸡市\"\n },\n {\n \"id\": 2402,\n \"name\": \"咸阳市\"\n },\n {\n \"id\": 2416,\n \"name\": \"渭南市\"\n }],\n \"28\": [\n {\n \"id\": 2525,\n \"name\": \"庆阳市\"\n },\n {\n \"id\": 2534,\n \"name\": \"陇南市\"\n },\n {\n \"id\": 2544,\n \"name\": \"武威市\"\n },\n {\n \"id\": 2549,\n \"name\": \"张掖市\"\n },\n {\n \"id\": 2556,\n \"name\": \"酒泉市\"\n },\n {\n \"id\": 2564,\n \"name\": \"甘南州\"\n },\n {\n \"id\": 2573,\n \"name\": \"临夏州\"\n },\n {\n \"id\": 3080,\n \"name\": \"定西市\"\n },\n {\n \"id\": 2487,\n \"name\": \"兰州市\"\n },\n {\n \"id\": 2492,\n \"name\": \"金昌市\"\n },\n {\n \"id\": 2495,\n \"name\": \"白银市\"\n },\n {\n \"id\": 2501,\n \"name\": \"天水市\"\n },\n {\n \"id\": 2509,\n \"name\": \"嘉峪关市\"\n },\n {\n \"id\": 2518,\n \"name\": \"平凉市\"\n }],\n \"29\": [\n {\n \"id\": 2580,\n \"name\": \"西宁市\"\n },\n {\n \"id\": 2585,\n \"name\": \"海东地区\"\n },\n {\n \"id\": 2592,\n \"name\": \"海北州\"\n },\n {\n \"id\": 2597,\n \"name\": \"黄南州\"\n },\n {\n \"id\": 2603,\n \"name\": \"海南州\"\n },\n {\n \"id\": 2605,\n \"name\": \"果洛州\"\n },\n {\n \"id\": 2612,\n \"name\": \"玉树州\"\n },\n {\n \"id\": 2620,\n \"name\": \"海西州\"\n }],\n \"30\": [\n {\n \"id\": 2628,\n \"name\": \"银川市\"\n },\n {\n \"id\": 2632,\n \"name\": \"石嘴山市\"\n },\n {\n \"id\": 2637,\n \"name\": \"吴忠市\"\n },\n {\n \"id\": 2644,\n \"name\": \"固原市\"\n },\n {\n \"id\": 3071,\n \"name\": \"中卫市\"\n }],\n \"31\": [\n {\n \"id\": 4110,\n \"name\": \"五家渠市\"\n },\n {\n \"id\": 4163,\n \"name\": \"博尔塔拉蒙古自治州阿拉山口口岸\"\n },\n {\n \"id\": 15945,\n \"name\": \"阿拉尔市\"\n },\n {\n \"id\": 15946,\n \"name\": \"图木舒克市\"\n },\n {\n \"id\": 2652,\n \"name\": \"乌鲁木齐市\"\n },\n {\n \"id\": 2654,\n \"name\": \"克拉玛依市\"\n },\n {\n \"id\": 2656,\n \"name\": \"石河子市\"\n },\n {\n \"id\": 2658,\n \"name\": \"吐鲁番地区\"\n },\n {\n \"id\": 2662,\n \"name\": \"哈密地区\"\n },\n {\n \"id\": 2666,\n \"name\": \"和田地区\"\n },\n {\n \"id\": 2675,\n \"name\": \"阿克苏地区\"\n },\n {\n \"id\": 2686,\n \"name\": \"喀什地区\"\n },\n {\n \"id\": 2699,\n \"name\": \"克孜勒苏州\"\n },\n {\n \"id\": 2704,\n \"name\": \"巴音郭楞州\"\n },\n {\n \"id\": 2714,\n \"name\": \"昌吉州\"\n },\n {\n \"id\": 2723,\n \"name\": \"博尔塔拉州\"\n },\n {\n \"id\": 2727,\n \"name\": \"伊犁州\"\n },\n {\n \"id\": 2736,\n \"name\": \"塔城地区\"\n },\n {\n \"id\": 2744,\n \"name\": \"阿勒泰地区\"\n }],\n \"32\": [\n {\n \"id\": 2768,\n \"name\": \"台湾市\"\n }],\n \"42\": [\n {\n \"id\": 2754,\n \"name\": \"香港特别行政区\"\n }],\n \"43\": [\n {\n \"id\": 2770,\n \"name\": \"澳门市\"\n }],\n \"84\": [\n {\n \"id\": 1310,\n \"name\": \"钓鱼岛\"\n }],\n '53283':\n {\n 'A': [\n {\n id: 53285,\n name: '阿尔巴尼亚'\n },\n {\n id: 53296,\n name: '阿尔及利亚'\n },\n {\n id: 53284,\n name: '阿富汗'\n },\n {\n id: 53297,\n name: '阿根廷'\n },\n {\n id: 53300,\n name: '阿联酋'\n },\n {\n id: 53302,\n name: '阿鲁巴'\n },\n {\n id: 53495,\n name: '阿曼'\n },\n {\n id: 53315,\n name: '阿塞拜疆'\n },\n {\n id: 53320,\n name: '埃及'\n },\n {\n id: 53336,\n name: '埃塞俄比亚'\n },\n {\n id: 53337,\n name: '爱尔兰'\n },\n {\n id: 53338,\n name: '爱沙尼亚'\n },\n {\n id: 53339,\n name: '安道尔'\n },\n {\n id: 53341,\n name: '安哥拉'\n },\n {\n id: 53343,\n name: '安圭拉'\n },\n {\n id: 53346,\n name: '奥地利'\n },\n {\n id: 53347,\n name: '澳大利亚'\n },\n {\n id: 53344,\n name: '安提瓜和巴布达'\n }],\n 'B': [\n {\n id: 53349,\n name: '巴巴多斯'\n },\n {\n id: 53352,\n name: '巴哈马'\n },\n {\n id: 53353,\n name: '巴基斯坦'\n },\n {\n id: 53354,\n name: '巴拉圭'\n },\n {\n id: 53355,\n name: '巴林'\n },\n {\n id: 53356,\n name: '巴拿马'\n },\n {\n id: 53357,\n name: '巴西'\n },\n {\n id: 53359,\n name: '白俄罗斯'\n },\n {\n id: 53361,\n name: '百慕大三角'\n },\n {\n id: 53362,\n name: '保加利亚'\n },\n {\n id: 53365,\n name: '贝宁'\n },\n {\n id: 53367,\n name: '比利时'\n },\n {\n id: 53368,\n name: '冰岛'\n },\n {\n id: 53370,\n name: '波多黎各'\n },\n {\n id: 53372,\n name: '波兰'\n },\n {\n id: 53375,\n name: '玻利维亚'\n },\n {\n id: 53377,\n name: '伯利兹'\n },\n {\n id: 53379,\n name: '博茨瓦纳'\n },\n {\n id: 53380,\n name: '不丹'\n },\n {\n id: 53384,\n name: '布隆迪'\n },\n {\n id: 53382,\n name: '布基纳法索'\n },\n {\n id: 53350,\n name: '巴布亚新几内亚'\n },\n {\n id: 53374,\n name: '波斯尼亚和黑塞哥维那'\n }],\n 'CDEF': [\n {\n id: 53387,\n name: '丹麦'\n },\n {\n id: 53389,\n name: '德国'\n },\n {\n id: 53391,\n name: '东帝汶'\n },\n {\n id: 53392,\n name: '多哥'\n },\n {\n id: 53395,\n name: '俄罗斯'\n },\n {\n id: 53396,\n name: '厄瓜多尔'\n },\n {\n id: 53398,\n name: '法国'\n },\n {\n id: 53399,\n name: '法罗群岛'\n },\n {\n id: 53401,\n name: '菲律宾'\n },\n {\n id: 53403,\n name: '斐济群岛'\n },\n {\n id: 53405,\n name: '芬兰'\n },\n {\n id: 53406,\n name: '佛得角'\n },\n {\n id: 53400,\n name: '法属圭亚那'\n },\n {\n id: 53397,\n name: '厄立特里亚'\n },\n {\n id: 53386,\n name: '赤道几内亚'\n },\n {\n id: 53394,\n name: '多米尼加共和国'\n }],\n 'GH': [\n {\n id: 53407,\n name: '冈比亚'\n },\n {\n id: 53408,\n name: '刚果'\n },\n {\n id: 53409,\n name: '哥伦比亚'\n },\n {\n id: 53410,\n name: '哥斯达黎加'\n },\n {\n id: 53411,\n name: '格林纳达'\n },\n {\n id: 53412,\n name: '格陵兰'\n },\n {\n id: 53413,\n name: '格鲁吉亚'\n },\n {\n id: 53414,\n name: '古巴'\n },\n {\n id: 53415,\n name: '瓜德罗普'\n },\n {\n id: 53417,\n name: '关岛'\n },\n {\n id: 53419,\n name: '圭亚那'\n },\n {\n id: 53420,\n name: '哈萨克斯坦'\n },\n {\n id: 53421,\n name: '海地'\n },\n {\n id: 53422,\n name: '韩国'\n },\n {\n id: 53423,\n name: '荷兰'\n },\n {\n id: 53425,\n name: '黑山'\n },\n {\n id: 53426,\n name: '洪都拉斯'\n }],\n 'JK': [\n {\n id: 53430,\n name: '吉布提'\n },\n {\n id: 53434,\n name: '几内亚'\n },\n {\n id: 53436,\n name: '几内亚比绍'\n },\n {\n id: 53440,\n name: '加拿大'\n },\n {\n id: 53442,\n name: '加纳'\n },\n {\n id: 53444,\n name: '加蓬'\n },\n {\n id: 53445,\n name: '柬埔寨'\n },\n {\n id: 53447,\n name: '捷克'\n },\n {\n id: 53449,\n name: '津巴布韦'\n },\n {\n id: 53451,\n name: '喀麦隆'\n },\n {\n id: 53453,\n name: '卡塔尔'\n },\n {\n id: 53455,\n name: '开曼群岛'\n },\n {\n id: 53457,\n name: '科摩罗'\n },\n {\n id: 53458,\n name: '科特迪瓦'\n },\n {\n id: 53460,\n name: '科威特'\n },\n {\n id: 53461,\n name: '克罗地亚'\n },\n {\n id: 53463,\n name: '肯尼亚'\n },\n {\n id: 53464,\n name: '库克群岛'\n },\n {\n id: 53432,\n name: '吉尔吉斯斯坦'\n }],\n 'L': [\n {\n id: 53466,\n name: '拉脱维亚'\n },\n {\n id: 53467,\n name: '莱索托'\n },\n {\n id: 53476,\n name: '老挝'\n },\n {\n id: 53479,\n name: '黎巴嫩'\n },\n {\n id: 53481,\n name: '立陶宛'\n },\n {\n id: 53482,\n name: '利比里亚'\n },\n {\n id: 53484,\n name: '利比亚'\n },\n {\n id: 53486,\n name: '列支敦士登'\n },\n {\n id: 53491,\n name: '卢森堡'\n },\n {\n id: 53493,\n name: '卢旺达'\n },\n {\n id: 53494,\n name: '罗马尼亚'\n }],\n 'M': [\n {\n id: 53298,\n name: '马尔代夫'\n },\n {\n id: 53299,\n name: '马耳他'\n },\n {\n id: 53301,\n name: '马拉维'\n },\n {\n id: 53303,\n name: '马来西亚'\n },\n {\n id: 53304,\n name: '马里'\n },\n {\n id: 53305,\n name: '马其顿'\n },\n {\n id: 53306,\n name: '马提尼克'\n },\n {\n id: 53307,\n name: '毛里求斯'\n },\n {\n id: 53308,\n name: '毛里塔尼亚'\n },\n {\n id: 53309,\n name: '美国'\n },\n {\n id: 53286,\n name: '美属萨摩亚'\n },\n {\n id: 53311,\n name: '蒙古'\n },\n {\n id: 53312,\n name: '蒙特塞拉特'\n },\n {\n id: 53313,\n name: '孟加拉'\n },\n {\n id: 53314,\n name: '秘鲁'\n },\n {\n id: 53317,\n name: '摩尔多瓦'\n },\n {\n id: 53318,\n name: '摩洛哥'\n },\n {\n id: 53319,\n name: '摩纳哥'\n },\n {\n id: 53321,\n name: '莫桑比克'\n },\n {\n id: 53322,\n name: '墨西哥'\n },\n {\n id: 53316,\n name: '密克罗尼西亚'\n },\n {\n id: 53310,\n name: '美属维尔京群岛'\n },\n {\n id: 53496,\n name: '马达加斯加'\n }],\n 'NPR': [\n {\n id: 53323,\n name: '纳米比亚'\n },\n {\n id: 53324,\n name: '南非'\n },\n {\n id: 53325,\n name: '南苏丹'\n },\n {\n id: 53326,\n name: '尼泊尔'\n },\n {\n id: 53327,\n name: '尼加拉瓜'\n },\n {\n id: 53328,\n name: '尼日尔'\n },\n {\n id: 53329,\n name: '尼日利亚'\n },\n {\n id: 53330,\n name: '挪威'\n },\n {\n id: 53331,\n name: '帕劳'\n },\n {\n id: 53332,\n name: '葡萄牙'\n },\n {\n id: 53333,\n name: '日本'\n },\n {\n id: 53334,\n name: '瑞典'\n },\n {\n id: 53335,\n name: '瑞士'\n }],\n 'S': [\n {\n id: 53340,\n name: '萨尔瓦多'\n },\n {\n id: 53342,\n name: '萨摩亚'\n },\n {\n id: 53345,\n name: '塞尔维亚'\n },\n {\n id: 53348,\n name: '塞拉利昂'\n },\n {\n id: 53351,\n name: '塞内加尔'\n },\n {\n id: 53358,\n name: '塞浦路斯'\n },\n {\n id: 53360,\n name: '塞舌尔'\n },\n {\n id: 53363,\n name: '沙特阿拉伯'\n },\n {\n id: 53369,\n name: '圣卢西亚'\n },\n {\n id: 53371,\n name: '圣马力诺'\n },\n {\n id: 53376,\n name: '斯里兰卡'\n },\n {\n id: 53378,\n name: '斯洛伐克'\n },\n {\n id: 53381,\n name: '斯洛文尼亚'\n },\n {\n id: 53383,\n name: '斯威士兰'\n },\n {\n id: 53385,\n name: '苏丹'\n },\n {\n id: 53388,\n name: '苏里南'\n },\n {\n id: 53393,\n name: '索马里'\n },\n {\n id: 53390,\n name: '所罗门群岛'\n },\n {\n id: 53366,\n name: '圣基茨和尼维斯'\n },\n {\n id: 53364,\n name: '圣多美和普林西比'\n },\n {\n id: 53373,\n name: '圣文森特和格林纳丁斯'\n }],\n 'TW': [\n {\n id: 53402,\n name: '塔吉克斯坦'\n },\n {\n id: 53404,\n name: '泰国'\n },\n {\n id: 53418,\n name: '坦桑尼亚'\n },\n {\n id: 53424,\n name: '汤加'\n },\n {\n id: 53431,\n name: '突尼斯'\n },\n {\n id: 53433,\n name: '图瓦卢'\n },\n {\n id: 53435,\n name: '土耳其'\n },\n {\n id: 53437,\n name: '瓦努阿图'\n },\n {\n id: 53438,\n name: '危地马拉'\n },\n {\n id: 53439,\n name: '委内瑞拉'\n },\n {\n id: 53441,\n name: '文莱'\n },\n {\n id: 53443,\n name: '乌干达'\n },\n {\n id: 53446,\n name: '乌克兰'\n },\n {\n id: 53448,\n name: '乌拉圭'\n },\n {\n id: 53450,\n name: '乌兹别克斯坦'\n },\n {\n id: 53429,\n name: '特立尼达和多巴哥'\n },\n {\n id: 53427,\n name: '特克斯和凯科斯群岛'\n }],\n 'XYZ': [\n {\n id: 53452,\n name: '西班牙'\n },\n {\n id: 53454,\n name: '希腊'\n },\n {\n id: 53456,\n name: '新加坡'\n },\n {\n id: 53462,\n name: '新西兰'\n },\n {\n id: 53465,\n name: '匈牙利'\n },\n {\n id: 53468,\n name: '叙利亚'\n },\n {\n id: 53469,\n name: '牙买加'\n },\n {\n id: 53470,\n name: '亚美尼亚'\n },\n {\n id: 53471,\n name: '也门'\n },\n {\n id: 53472,\n name: '伊拉克'\n },\n {\n id: 53473,\n name: '伊朗'\n },\n {\n id: 53474,\n name: '以色列'\n },\n {\n id: 53475,\n name: '意大利'\n },\n {\n id: 53477,\n name: '印度'\n },\n {\n id: 53478,\n name: '印度尼西亚'\n },\n {\n id: 53480,\n name: '英国'\n },\n {\n id: 53485,\n name: '约旦'\n },\n {\n id: 53487,\n name: '越南'\n },\n {\n id: 53488,\n name: '赞比亚'\n },\n {\n id: 53489,\n name: '乍得'\n },\n {\n id: 53490,\n name: '智利'\n },\n {\n id: 53492,\n name: '中非'\n },\n {\n id: 53459,\n name: '新喀里多尼亚'\n },\n {\n id: 53483,\n name: '英属维尔京群岛'\n }]\n }\n };;\n return common_provinceCityMap;\n}", "function filterCandidates(){\n\t\t//updates district filter\n\t\tif (districtSelector.property(\"selectedIndex\") > 0) {\n\t\t\tcurrentDistrict = areas[districtSelector.property(\"selectedIndex\")-1];\n\t\t}\n\t\t//updates name and candidate number filter\n\t\tvar searchValue = searchInput.property(\"value\").toLowerCase();\n\t\tvar searchArray = searchValue.split(\" \");\n\n\t\t//Let the filtering begin!\n\t\tcandidates\n\t\t\t.attr(\"display\", function(d) {\n\t\t\t\t//district filter\n\t\t\t\tif (currentDistrict === ALLDISTRICTS) return \"inline\";\n\t\t\t\telse if (currentDistrict && d.district !== currentDistrict) return \"none\";\n\n\t\t\t\t//party filter\n\t\t\t\tif(!partyVisibility[d.party] || !partyVisibility[d.segment]) return \"none\";\n\n\t\t\t\t//if something in the search box then also filter with that\n\t\t\t\tif (searchValue) {\n\t\t\t\t\tfor (var i = 0; i < searchArray.length; i++) {\n\t\t\t\t\t\tif (d.name.toLowerCase().indexOf(searchArray[i].trim()) < 0){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t}", "function GetAvalibleDistricts(){\n var url = config.api.url + \"wijk?ex={'k':'beschikbaar', 'v':'true'}\";\n $http({\n url: url,\n method: 'GET'\n }).success(function(data, status, headers, config) {\n $scope.avalibleWijken = data;\n console.log(\"WijkData load succesfull\");\n }).error(function(data, status, headers, config) {\n console.log(\"WijkData load failed\");\n }); \n }", "function baseLocation_specialIndent(listOfDistrict) {\n\t$(\"#baselocationId\").empty();\n loadingBaseLocationMaster(listOfDistrict);\n var selectfirst = \"<option value='0'>Select BaseLocation</option>\";\n $('#baselocationId').append(selectfirst);\n $.each(baselocations, function (i, resData) {\n var baselocation = \"<option value=\" + resData.baselocationID + \">\" + resData.baselocationName + \"</option>\";\n $(baselocation).appendTo('#baselocationId');\n\n\n });\n $('#baselocationId').trigger(\"chosen:updated\");\n $(\"#baselocationId\").chosen();\n}", "function generateCoordinatesForNorway (callback) {\n\tbaner.find({}, function(err, docs){\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t} else {\n\t\t\tvar subStretchesArray = [];\n\t\t\tfor (var i = 0; i < docs.length; i++) {\n\t\t\t\tsubStretchesArray.push(generateDummyClusterForArea(docs[i]));\n\t\t\t};\n\t\t\tcallback(subStretchesArray);\n\t\t}\n\t});\n}", "function setDist(newDistCode)\n{\n var distSelect = document.distForm.District;\n var distOpts = distSelect.options;\n if (distOpts.length == 0)\n return null;\n var oldValue = null;\n if (distSelect.selectedIndex >= 0 &&\n distSelect.selectedIndex < distOpts.length)\n oldValue = distOpts[distSelect.selectedIndex];\n\n if (newDistCode === undefined || newDistCode === null)\n return oldValue;\n\n for(var i = 0; i < distOpts.length; i++)\n {\n if (distOpts[i].value == newDistCode)\n { // found matching entry\n distSelect.selectedIndex = i;\n changeDist(); \n break;\n } // found matching entry\n } // search for district to select\n return oldValue;\n}", "function getListOfDistrictForRegForChangeDist() {\n if (district.length < 1 || district == []) {\n // here calling masterdata ajax call\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districtidForChngLoc');\n });\n $(\"#districtidForChngLoc\").chosen();\n\n } else {\n $.each(district, function(i, resData) {\n // alert(\"jii\"+resData.districtName);\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districtidForChngLoc');\n\n });\n $('#districtIdForCurrLoc').trigger(\"chosen:updated\");\n $(\"#districtidForChngLoc\").chosen();\n }\n}", "function get_disease_data(){\n Diseases.selected($rootScope.diseases.userselected).then(function(res){\n $rootScope.diseases.vizdata = res.data;\n });\n }" ]
[ "0.6800403", "0.6655514", "0.6353948", "0.6333048", "0.6284119", "0.61306876", "0.60741776", "0.6042948", "0.60080963", "0.59532034", "0.58715427", "0.5793652", "0.5790668", "0.5774097", "0.5755154", "0.57330287", "0.5723503", "0.57139504", "0.5684567", "0.56777835", "0.56468093", "0.5633215", "0.5625831", "0.56241196", "0.5616613", "0.56154615", "0.5604217", "0.5586268", "0.5578521", "0.5570099", "0.556037", "0.55098176", "0.54151005", "0.53941226", "0.53900075", "0.536772", "0.53675187", "0.5358055", "0.53509057", "0.5342571", "0.5338046", "0.53301835", "0.5328914", "0.53287804", "0.5310025", "0.53065705", "0.53064954", "0.53057075", "0.5297908", "0.5272468", "0.52616346", "0.52347183", "0.52069753", "0.5200538", "0.5198873", "0.51857066", "0.5161602", "0.51576066", "0.51392037", "0.51370203", "0.5134767", "0.51141113", "0.51041925", "0.51040834", "0.50993127", "0.5095565", "0.5094902", "0.5090033", "0.5069118", "0.50615215", "0.50615215", "0.50463104", "0.5044371", "0.503232", "0.5029898", "0.5023768", "0.502339", "0.50226253", "0.5020589", "0.50189555", "0.4999314", "0.49768543", "0.49533653", "0.49519643", "0.4949592", "0.494737", "0.49451485", "0.4936998", "0.49319917", "0.49151972", "0.49043486", "0.48965883", "0.4895294", "0.48945585", "0.4889245", "0.48857036", "0.48776856", "0.4865221", "0.48632887", "0.486124", "0.48552182" ]
0.0
-1
Detail: Factorials, as we defined them, should only be calculated for nonnegative integers. However, the function we wrote doesn't verify if its argument is valid or not. Can you add the necessary checks? Try to avoid repeated, redundant tests!
function fact(n) { if (n < 0) { return 0; } else if (n === 0) { return 1; } else { return n * fact(n - 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorialZeros(n) {\n // mathy problem\n}", "function factorial(value){ \n if (typeof(+value) != \"number\") \n return \"Its not a number. try again!\" \n if (value <= 0) \n return 1 \n return value * factorial(value-1) \n}", "function factorial(number) { // Recibe un valor entero positivo\n if (number < 0) // Si es valor es un numero negativo entonces devuelve un -1 para hacer saber al usuario que se ingreso un valor invalido\n return -1; // retorno de valor invalido \n else if (number == 0) // Si el valor es 0, por definicion se devuelve un 1 por que 0! es 1, pero tambien sirve para la recursividad dentro de factorial\n return 1; // Devuelve el valor de 1 si es que el numero original es de 0 o si es la ultima iteracion de la funcion recursiva \n else { // Si el numero es un valor mayor a 1 se entra en la recursividad de la funcion \n return (number * factorial(number - 1)); // La recursividad funciona diciendo que el numero se multiplicara por la funcion - 1, y hasta que el numero dentro de la funcion no se vuelva 0 entonces se restara uno del valor del numero y se volver a multiplicar\n // Si el valor fuese 5, seria 5 * 5 - 1 * 5 - 1 - 1,5-1-1-1 * 5-1-1-1-1 * 0, claro que si se multiplica por 0 entonces el valor final seria 0, pero dentro del if si el valor es 0 hay un return de 1. \n // Pero el valor no sera de 1, dado que este return esta dentro de la primera iteracion de la recursividad, entonces el valor seria 5*4*3*2*1*1 = 120\n }\n}", "function factorial(someNum) {\r\n if (someNum < 0)\r\n return -1;\r\n else if (someNum == 0)\r\n return 1;\r\n else {\r\n return (someNum * factorial(someNum - 1));\r\n }\r\n\r\n}", "function factorial(n) {\n // This is a termination condition:\n if (n < 0)\n console.log(\"negative numbers are not allowed\");\n return;\n // This is the Base Case (NOTE/MATT: Why not else if?):\n if (n == 0)\n return 1;\n // This is the recursion, which runs (a) IFF the termination condition is false AND (b) UNTIL the Base Case is true.\n else\n return n * factorial (n-1);\n }", "function factorial(n){\n if ( n < 0) return -1;\n else if ( n === 0) return 1;\n else return n * factorial( n - 1);\n}", "function factorial(n) {\r\n\tif (n < 0) throw new Error(`Input value ${n} is not a positive integer.`);\r\n\r\n\tif (n <= 1) return 1;\r\n\treturn n * factorial(n - 1);\r\n}", "function factorial(n) {\n\n}", "function factorial(n) {\n if(n==0) {\n return 1;\n }\n return n * calcFactorial(n-1);\n }", "function factorial(num) {\n \n}", "function factorial(n) {\n\tif (isFinite(n) && n > 0 && n == Math.round(n)) {\n\t\t// Finite, positive ints only\n\t\tif (!(n in factorial))\n\t\t\t// If no cached result\n\t\t\tfactorial[n] = n * factorial(n - 1); // Compute and cache it\n\t\treturn factorial[n]; // Return the cached result\n\t} else return NaN; // If input was bad\n}", "function factorial(n) {\n //Baseline Condition\n if (n < 2) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n // This is our Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n // This is our Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n }", "function factorial(n) { \n // Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n // This is our Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n }", "function factorial(input) {\n if (input === 0){\n return 1;\n }\n return input * factorial(input-1);\n}", "function factorial(n) {\n if (n===0) return 1;\n else return n * factorial(n-1);\n}", "function factorial(num){\n \n}", "function factorial(num){\n \n}", "function factorial(n){\n\tlet ans=1;\n\tfor(let i=1;i<=n;i++) ans*=i;\n\treturn ans;\n}", "function factorial(n){\n//need if-statement to determine if factorial is equal to 0.\n if(n === 0){\n return 1;\n }\n// else return the number between itself and then subtract 1.\n return n * factorial(n - 1);\n}", "function factorial(n){\n if( n == 0){\n return 1;\n }\n else{\n return n * factorial(n-1);\n }\n \n}", "function factorial(n){\n if(n === 0){\n return 1\n }\n if (n >= 1){\n return(n) * factorial(n-1);\n\t};\n}", "function factorial(n) {\n //base case - when n is equal to 0, we stop the recursion\n if(n === 0){\n return 1;\n }\n //Recursive Case\n //It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n}", "function factorial(n){\n if( n === 0){\n return 1;\n }else {\n return n * factorial(n-1);\n }\n}", "function factI(n){\n if (n==0){return 1}//base case/exception of factorial is 0!=1\n var ans=1;\n for (i=1; i<=n;i++){//simple for loop\n ans=i*ans;\n }\n return ans;\n}", "function factorial(n) {\n\tif (isFinite(n) && n > 0 && n == Math.round(n)) {\n\t\t// Finite, positive ints only\n\t\tif (!(n in factorial))\t// if no cached result\n\t\t\tfactorial[n] = n * factorial(n - 1);\n\t\treturn factorial[n];\n\t}\n\telse return NaN;\n}", "function nFactorial(num) \n{ \n if (num < 0) { \n return -1; \n } else if (num === 0) { \n return 1; \n } else { \n return (num * nFactorial(num - 1)); \n } \n}", "function factorial(n){\n if(n === 0)\n return 1;\n else\n return (n* factorial(n - 1));\n}", "function factorial(num) {\n if (num < 0) return 0\n if (num <= 1) return 1\n return num * factorial(num - 1)\n}", "function factorial(num)\n{\n\n if (num < 0) {\n return -1;\n }\n\n else if (num == 0) {\n return 1;\n }\n\n else {\n return (num * factorial(num - 1));\n }\n}", "function factorial(n) {\n if (n == 0) {\n return 1;\n } else {\n return n * factorial(n - 1);\n }\n}", "function factorial(n) {\n if( n===0 || n===1 ) {\n return 1;\n } else {\n return factorial(n-1)*n;\n }\n}", "function factorial(n) {\n var retVal = 1;\n while (n > 1) {\n retVal *= n;\n n--;\n }\n return retVal;\n}", "function factorial(n){\n let answer = 1;\n if (n == 0 || n == 1){\n return answer;\n }else{\n for(var i = n; i >= 1; i--){\n answer = answer * i;\n }\n return answer;\n } \n }", "function factorial(n) {\n if (n == 0) {\n return 1;\n } else {\n return n * factorial(n - 1);\n }\n}", "function factorial(n) { \n // Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n // Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n === 0) {\n return 1;\n }\n return n * factorial(n-1);\n}", "function factorial(n) {\n if (n === 0) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n == 0) {\n return 1;\n }\n return n * factorial(n - 1);\n}", "function factorial(n) {\n // base case and exit recursion\n if (n === 0) return 0\n if (n === 1) return 1\n // recurse with different inputs\n return n * factorial(n - 1)\n}", "function factorial(n) {\n if (n === 0) {\n return 1;\n }\n return n * factorial(n - 1);\n}", "function factorial(number) {\n if (number == 0 || number == 1){\n return 1;\n }else{\n return factorial(number - 1) * number;\n }\n}", "function factorial(num) {\n if (num < 0) {\n return -1;\n } else if (num === 0) {\n return 1;\n } else {\n return num * factorial(num - 1);\n }\n}", "function factorial(x){\n if (x < 0 ) return 0;\n if (x <= 1 ) return 1;\n return x * factorial(x-1);\n}", "function factorial(n){\n if(n==0){\n return 1;\n }\n else{\n return n * factorial(n-1);\n }\n}", "function factorial(num) {\n if (num < 0) {\n return -1\n } else if (num === 0) {\n return 1\n } else {\n console.log(num)\n return num * factorial(num - 1)\n }\n}", "function factorial(n){\n if(n == 0 || n == 1){\n return 1;\n } \n else{\n return n * factorial(n-1);\n }\n}", "function factorial (a) {\n if (isNaN(a) || a === 1 || !a) {\n return (1);\n }\n return (factorial(a - 1) * a);\n}", "function factorial(n) {\n // Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n // Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n}", "function factorial(n) {\n\tvar result =1;\n // TODO: your code here\n if( n ===0){\n return 0;\n }\n while(n>=1){\n \tresult*=n;\n n--;\n }\nreturn result;\n}", "function factorial(n) {\n if (n < 0) {\n // Termination condition to prevent infinite recursion\n console.log('help');\n return;\n }\n // Base case\n if (n === 0) {\n return 1;\n }\n // Recursive case\n return n * factorial(n -1);\n}", "function factorial(x) {\n //basecase\n if (x < 0) return 0;\n if (x <= 1) return 1;\n return x * factorial(x - 1);\n}", "function factorial(n) {\n // This is our Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n\n // This is our Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n}", "function factorial(n) {\n var result = n\n if (n <= 1) {\n return 1\n }\n while (n > 1) {\n n--\n result *= n\n }\n return result\n}", "function nFactorial(num) {\nif (num > 1){\nreturn num * nFactorial(num - 1);\n}\nelse {\nreturn 1;\n}}", "function factorial(n) {\n var total = 1;\n while (n > 0) {\n total *= n;\n n--;\n }\n}", "function factorial(n) {\n if (n <= 1) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n <= 1) {\n return 1;\n }\n return n * factorial(n-1);\n\n}", "function factorial(x) \n{ \n\n if (x === 0)\n {\n return 1;\n }\n return x * factorial(x-1);\n \n}", "function factorial(n) {\n \n if (n === 0) {\n return 1;\n }else {\n return n * factorial(n-1);\n }\n }", "function factorial(n) {\n if (n < 1) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n let v = 1\n while (n !== 0){\n v *= n;\n n--\n }\n return v\n\n}", "function factorial(n){\n let res = 1;\n for(let i = 1; i <= n; i++){\n res = res * i;\n }\n return res;\n}", "function factorial(n) {\n if (n <= 1){\n return 1\n }\n for (let i = n - 1; i >= 1; i--) {\n n *= 1\n }\n return n\n}", "function factorial(n){\r\n //base case\r\n if(n == 0 || n == 1){\r\n return 1;\r\n //recursive case\r\n }else{\r\n return n * factorial(n-1);\r\n }\r\n}", "function factorial(n){\n if (n === 0){\n \t return 1;\n }\n return (n * factorial(n-1));\n }", "function factorial(n){\n if (n > 1) {\n return n * factorial(n-1)\n }\n return n\n\n}", "function factorial(number) {\n if (number === 0) return 1;\n return number * factorial(number - 1);\n}", "function factorial(n) {\n let result = 1;\n for (let i = n; i > 0; i -= 1) {\n result *= i;\n }\n return result\n}", "function factorial(n){\n if (n < 2) return 1;\n return n * factorial(n - 1);\n}", "function factorial(num) {\n if (num === 1) return 1;\n if (num === 0) return 1;\n return num * factorial(num - 1);\n}", "function factorial (num) {\n // If the number is less than 0, reject it.\n if (num < 0) {\n return -1\n }\n // If the number is 0, its factorial is 1.\n else if (num == 0) {\n return 1\n }\n // Otherwise, call this recursive procedure again.\n else {\n console.log(num)\n return (num * factorial(num - 1))\n }\n}", "function factorial(n) { \n let result;\n if(n !== 1) {\n result = n * factorial(n-1);\n } else {\n result = n;\n }\n return result;\n }", "function factorial(n) {\n return (n === 0) ? 1 : n * factorial(n-1);\n}", "function factorial(n) {\n if (n <= 1) {\n return 1\n }\n while (n > 1) {\n n--\n result *= n\n }\n return result\n}", "function factorial(num){\n if(num === 1) return 1; \n return num * sumRange(num-1);\n }", "function factorial (num) {\n if (num === 0) {\n return 1;\n } else if (num < 0) {\n return \"Hmm... try a positive number next time.\";\n };\n \n let fact = 1;\n while (num > 0) {\n fact*=num;\n num-=1;\n }\n return fact;\n}", "function factorial(n) {\n if (n===1) return 1;\n return n * factorial(n - 1);\n}", "function Factorial(n) {\n if (n == 1) {\n return 1;\n } else {\n return n * Factorial(n - 1);\n }\n}", "function factorial(number) {\n if (number < 0) {\n console.log('No existe factorial de numeros negativos');\n } else if (number == 0) {\n return number = 1;\n } else {\n var i = 1;\n var j;\n for (j = number; j > 0; j--) {\n i = i * j;\n }\n return i;\n }\n}", "function factorial(x) {\n if (x < 0) return 0;\n if (x <= 1) return 1;\n return x * factorial(x - 1);\n}", "function factorial(x) {\n if (x < 0) return 0;\n if (x <= 1) return 1;\n return x * factorial(x - 1);\n}", "function factorial(x) {\n if (x === 0) {\n return 1;\n\n } else {\n return x * factorial(x-1);\n }\n}", "function factorial(n) {\n //Establish base case\n if (n == 0) {\n return 1;\n } else {\n //Run recursive case\n return n * factorial(n - 1);\n }\n}", "function factorial(number) {\n if (number == 0) {\n return 1;\n }\n return number * factorial(number - 1);\n}", "function factorial(num) { \n if(num<=0) { \n return 1; \n } else { \n return (num * factorial(num-1) );\n } \n }", "function factorial(n){\n\n\tif (n ==1){\n\t\treturn 1;\n\t}\n\n\treturn bigInt(n).multiply(factorial(n-1));\n}", "function factorial(n) {\n if (n === 1) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n === 1) return 1;\n return n * factorial(n - 1);\n}", "function factorial(num){\n if(num <= 1){\n return num \n } else {\n return num * factorial(num - 1);\n }\n \n}", "function factorial(n) {\n if (n==0) {\n return 1;\n\n }\n else{\n return n* factorial (n-1);\n }\n}", "function factorial(number) {\n if(number <= 1) return number\n return factorial(number - 1) * number\n}", "function factorial(n){\n let inicial = n;\n for(let i=n-1;i>0;i--){\n inicial*=i;\n }\n return inicial\n}", "function factorial(num){ //5\n if(num === 1) return 1; //basecase \n\n return num * factorial(num-1); //5 * 4 * 3 * 2 = 120 \n\n}", "function factorial(number) {\n if (number <= 1)\n return 1;\n return number * factorial(number-1);\n}", "function factorial(n) {\n if (n < 2) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n == 1) {\n return 1;\n }\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n < 0) {\n return null;\n }\n if (n === 1) {\n return n;\n }\n return n * factorial(n - 1);\n}", "function factorial(n){\n return n == 0 || n == 1 ? 1 : n * factorial(n-1);\n}", "function factorial(n) {\n\n if (n == 1) {\n return 1;\n }\n\n else {\n return n * factorial(n - 1)\n }\n}", "function factorial(n) {\n // var n = 4;\n var result = 1;\n while(n){\n result *= n--;\n }\n return result;\n}" ]
[ "0.7552674", "0.7503302", "0.746183", "0.7442232", "0.7394075", "0.738543", "0.73772234", "0.73387", "0.7323305", "0.73103005", "0.7286367", "0.7284619", "0.7265239", "0.7256822", "0.72537756", "0.72420716", "0.7231157", "0.7231157", "0.7225532", "0.7221759", "0.7218096", "0.7213391", "0.72072244", "0.72061116", "0.7197819", "0.71940655", "0.7184757", "0.71815383", "0.71731037", "0.7170811", "0.71660125", "0.71560967", "0.71524525", "0.7152436", "0.71494794", "0.71469057", "0.71464044", "0.71450806", "0.71427876", "0.71350956", "0.7134894", "0.7133528", "0.7128051", "0.7124434", "0.71180165", "0.7111824", "0.71092635", "0.71071", "0.7106839", "0.71056217", "0.7099201", "0.7098569", "0.7096562", "0.7094878", "0.7094055", "0.7085291", "0.70840913", "0.7082458", "0.70796585", "0.70788234", "0.7073566", "0.7071755", "0.7070888", "0.7070589", "0.70699036", "0.70684844", "0.70666367", "0.70638543", "0.70604074", "0.70601815", "0.7054997", "0.70532423", "0.705027", "0.70445055", "0.70395833", "0.7034945", "0.7032014", "0.7031324", "0.70300704", "0.70276403", "0.7021892", "0.7021892", "0.70140815", "0.7012472", "0.701214", "0.7012075", "0.7007451", "0.7000271", "0.7000271", "0.6998232", "0.69933975", "0.6991362", "0.6990665", "0.6989027", "0.6988451", "0.6985944", "0.6985476", "0.6983354", "0.6980792", "0.6977617", "0.6976259" ]
0.0
-1
We need a function which handles requests and send response.this is a single server to handle both client registration and sending push notifs.
function handleRequest(request, response){ var jsonString = ''; var id=''; if (request.method == 'POST') { request.on('data', function (data) { jsonString += data; }); request.on('end', function () { console.log(JSON.parse(jsonString)); id=JSON.parse(jsonString).regId; var fs = require('fs'); fs.appendFile('Registration_Id.txt', id+"\n", function (err) { if(err) { return console.log(err); } console.log("The file was saved!"); }); }); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("FIST"); //response.end("Hello World\n"); } else { var fs = require('fs'); fs.readFile('Registration_Id.txt', function(err, data) { if(err) throw err; var array = data.toString().split("\n"); uniqueArray = array.filter(function(elem, pos) { return array.indexOf(elem) == pos; }) for(i in uniqueArray) { if(uniqueArray[i]!=''){ console.log(uniqueArray[i]); pushnotif(uniqueArray[i]); } } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function onRequest(request, response){\n\tvar command = \trequest.headers[\"command\"]\n\tvar deviceIP = \trequest.headers[\"tuyapi-ip\"]\n\t\n\tvar cmdRcvd = \"\\n\\r\" + new Date() + \"\\r\\nIP: \" + deviceIP + \" sent command \" + command\n\t//var cmdRcvd = \"\\n\\r\" + new Date() + \"\\r\\n sent command \" + command\n\tconsole.log(\" \")\n\tconsole.log(cmdRcvd)\n\t\t\n\tswitch(command) {\n\t\t//---- (BridgeDH - Poll for Server APP ------------------\n\t\tcase \"pollServer\":\n\t\t\tresponse.setHeader(\"cmd-response\", \"ok\")\n\t\t\tresponse.end()\n\t\t\tvar respMsg = \"Server Poll response sent to SmartThings\"\n\t\t\tconsole.log(respMsg)\n\t\tbreak\n\n\t\t//---- Device Command ---------------------------\n\t\tcase \"deviceCommand\":\n\t\t\tprocessDeviceCommand(request, response)\n\t\t\tbreak\n\t\n\t\tdefault:\n\t\t\tresponse.setHeader(\"cmd-response\", \"InvalidHubCmd\")\n\t\t\tresponse.end(\"no command\")\n\t\t\tvar respMsg = \"#### Invalid Command ####\"\n\t\t//\tvar respMsg = new Date() + \"\\n\\r#### Invalid Command from IP\" + deviceIP + \" ####\\n\\r\"\n\t\t\tconsole.log(respMsg)\n\t\t\tlogResponse(respMsg)\n\t}\n}", "function serverhundeler (req, res,next) {\n console.log('serverHandler');\n ip\n .create(req.body)\n .then((ip) => {\n console.log('this is newserver ip',ip);\n \n \n res.json('true'); \n })\n .catch((err) => next(err));\n}", "handler(req, res, callback) {\n if (this.options.inited !== true) {\n const echostr = this._verify(req);\n if (!echostr) {\n debug('verify with wechat server failed');\n return callback('verify failed');\n }\n debug(`verify with wechat echostr '${echostr}' correct`);\n res.writeHead(200, { 'content-type': 'text/html' });\n res.end(echostr);\n return;\n }\n // The implementation is different\n this._parsePayload(req).then(payload => {\n res.writeHead(200, { 'content-type': 'application/json' });\n res.end('{\"ok\": true}');\n // Just reuse the same naming\n this.emit('push', {\n payload,\n host: req.headers.host,\n event: 'wechat-push'\n });\n });\n }", "function handler(req, res){\n\n var remoteAddress = req.socket.remoteAddress;\n\n // Only process IPs in our authorised list\n if(authorisedIPs.indexOf(remoteAddress) >= 0) {\n\n try{\n if(req.method == 'POST'){\n var body = '';\n\n req.on('error',function(){\n res.writeHead(500, {\"Content-Type\": \"text/plain\"});\n res.end(\"Error\");\n });\n\n req.on('data',function(data){\n body += data;\n\n // Kill the connection if it's too large to handle\n if(body.length > 1e6){\n response.writeHead(413, {'Content-Type': 'text/plain'});\n req.connection.destroy();\n }\n });\n\n req.on('end',function(){\n var parsedBody = qs.parse(body);\n var json = JSON.stringify(parsedBody);\n\n // Emit a socket.io message to all current clients\n clients.forEach(function(client) {\n client.emit('data', json);\n });\n });\n }\n\n res.writeHead(200, {\"Content-Type\": \"text/plain\"});\n res.end(\"Ok\");\n }\n catch(error){\n res.writeHead(500, {\"Content-Type\": \"text/plain\"});\n res.end(\"Error\");\n }\n }\n else{\n res.writeHead(401, {\"Content-Type\": \"text/plain\"});\n res.end(\"Unauthorised\");\n }\n}", "async function send() {\n /***************Register service worker and make it live in the root of our app *************/\n console.log('Registering Service worker...');\n const register = await navigator.serviceWorker.register('/worker.js', {\n scope: \"/\"\n });\n console.log('Hurray!!! service worker registered.');\n\n /************* Register Push*************/\n console.log(\"Registering Push...\");\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(publicVapidKey)\n });\n console.log(\"Push Registered...\");\n\n /********** Send Push Notification**********/\n console.log(\"Sending Push...\");\n await fetch(\"/subscribe\", {\n method: \"POST\",\n body: JSON.stringify(subscription),\n headers: {\n \"content-type\": \"application/json\"\n }\n });\n console.log(\"Push Sent...\");\n}", "function subscribeFn(req, res) {\n\n var ip = (req.headers['x-forwarded-for'] || '').split(',')[0] || req.connection.remoteAddress;\n\n if (req.body.type === \"MASTER\") {\n var masterIp = master.getMasterServerIp();\n\n\n if (!masterIp || masterIp === ip) {\n master.setMasterServerIp(ip);\n console.log(\"Subscribe by \" + ip);\n res.send({status: 'ACK'});\n }\n else\n res.send({\n status: \"MASTER_ALREADY_EXISTS\",\n masterIp: masterIp\n\n });\n }\n else if(req.body.type === \"PROCLAMATION\") {\n\n master.setMasterServerIp(ip);\n console.log(\"Proclamation by: \" + ip);\n res.send({status: 'ACK'});\n }\n else\n res.send({status: \"BAD_REQUEST\"});\n\n}", "function handleRequest(request, response){\n \n\tpodatki+= \" I \";\n\tif((request.url)=='/reset'){\n\t\tpodatki=\"\";\n\t}\n\tif((request.url).indexOf('/send/')>-1){\n\t\tvar parts= (request.url).split(\"/\");\n\t\tpodatki=parts[parts.length-1];\n\t\tif(podatki.localeCompare(\"true\")==0){\n\t\t\tstatusi[0]=\"true\";\n\t\t}\n\t\telse{\n\t\t\tstatusi[0]=\"false\";\n\t\t}\n\t\tresponse.end();\n \n\t\n } \n\n if(request.url!='/'){\n console.log(\"Request handler random was called.\");\n response.writeHead(200, {\"Content-Type\": \"application/json\"});\n var indeks = -1;\n\t\tfor(var i = 0; i<clienti.length;i++){\n\t\t\tif((request.url).indexOf(clienti[i])==1){\n\t\t\t\tindeks = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//hello\n\t\tif(indeks==-1){\n\t\t\tresponse.end('Nisem nasel ' + request.url);\n\t\t}\n\t\telse{\n\t\t\tvar otherArray = { Ime: clienti[indeks], Status: statusi[indeks], Cas: \"pred 9h\"};\n\t\t\t \n\t\t\t var json = JSON.stringify({ \n\t\t\t\tOseba: otherArray, \n\t\t\t\t\n\t\t\t });\n\t\t\t response.end(json);\n\t\t}\n }\n\telse{\n\t\tresponse.end(\"Listening on \" + server_ip_address + \", server_port \" + server_port +\" \" + podatki + test2);\n\t}\n}", "function handleRequest(request, response){\n\t\t//console.log(request);\n\t\tif(request.url.indexOf('/api/') === -1) {\n\t\t\t// request.url = '/'\n\t\t\t// request.url = '/client.js'\n\n\t\t\tvar filename = request.url.substr(1);\n\n\t\t\t// old line: if(request.url === '/') { new line:\n\t\t\tif(request.url === '/' || (filename.length > 0 && filename[0] === '/') ||\n\t\t\tfilename.indexOf('..') !== -1) {\n\t\t\t\tfilename = 'index.html';\n\t\t\t}\n\n\t\t\tfs.readFile(filename, 'utf8', function (err,data) {\n\t \t\tif (err) {\n\t \t\t return console.log(err);\n\t \t\t}\n\t \t\tconsole.log(data);\n\t \t\tresponse.end(data);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tif(request.url.indexOf('/api/send/') > -1) {\n\t\t\t//viestit.push()\n\t\t\tvar postDataString = \"\";\n\t\t\trequest.on('data', function(chunk) {\n\t postDataString = postDataString + chunk.toString();\n\t });\n\n\t request.on('end', function() {\n\t \tviestit.push(postDataString)\n\t // empty 200 OK response for now\n\t response.writeHead(200, \"OK\", {'Content-Type': 'text/html'});\n\t response.end();\n\n\t });\n\t\t}\n\n\t\tif(request.url.indexOf('/api/get/') > -1) {\n\t\t\tresponse.end(JSON.stringify(viestit));\n\t\t}\n}", "function gotMessageFromServer(message) {\n console.log(\"Got message\", message.data); \n var data = JSON.parse(message.data); \n \n switch(data.type) { \n case \"login\": \n handleLogin(data.success,data.allUsers); \n break;\n case \"joined\":\n catchAllAvailableUsers(data.allUsers);\n break;\n case \"statusChange\":\n refreshAllAvailableUsers(data.user_status);\n break;\n case \"snap\":\n console.log('got imgUrl')\n gotRemoteSnapImg(data.snapUrl);\n break;\n //when somebody wants to call us \n case \"offer\": \n console.log('inside offer')\n document.getElementById('callFrom').innerHTML = '來自 ' + name;\n handleOffer(data.offer, data.name);\n alert(\"Receive a call from \" + data.name);\n break; \n case \"answer\": \n console.log('inside answer')\n handleAnswer(data.answer); \n break; \n //when a remote peer sends an ice candidate to us \n case \"candidate\": \n console.log('inside handle candidate')\n handleCandidate(data.candidate); \n break;\n case \"decline\":\n window.clearTimeout(callTimeout);\n handleLeave();\n alert(\"No response from remote\");\n break;\n case \"timeout\":\n handleLeave();\n alert(\"You didn't resopnse a call from \" + data.name);\n break;\n case \"leave\": \n handleLeave();\n alert(\"Remote has disconnected !\");\n break;\n case \"close\":\n if(data.reqFrom == connectedUser) {\n handleLeave();\n alert(\"Remote has disconnected !\");\n }\n refreshAllAvailableUsers(data.user_status);\n break;\n\n default: \n break; \n } \n\n serverConnection.onerror = function (err) { \n console.log(\"Got error\", err); \n };\n\n}", "function listen() {\n app.listen(config.port || config.port, () => console.log(`Webhook listening on port ${config.port}...`));\n\n // GET entry point (for verification)\n app.get('/webhook', (req, res) => {\n console.log('--< Request received');\n\n // parse query params\n let mode = req.query['hub.mode'];\n let token = req.query['hub.verify_token'];\n let challenge = req.query['hub.challenge'];\n\n // check if mode and token sent is correct\n if (mode && token) {\n if (mode === 'subscribe' && token === config.verifyToken) {\n // respond with the challenge token from the request\n console.log('--> Webhook verified');\n res.status(200).send(challenge);\n } else {\n console.log('422 UNPROCESSABLE ENTITY');\n res.sendStatus(422); \n }\n }\n });\n\n // POST entry point\n app.post('/webhook', (req, res) => {\n console.log('--< Request received');\n\n let body = req.body;\n\n // check if event is from a page subscription\n if(body.object === 'page') {\n\n // iterate over each entry\n body.entry.forEach(function(entry) {\n routeHTTPRequest(entry);\n });\n\n // respond with '200 OK'\n res.status(200).send('OK');\n } else {\n // respond with '403 FORBIDDEN' found if the event isn't from page subscription\n res.status(403).send('FORBIDDEN');\n console.log('403 FORBIDDEN');\n }\n });\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 }", "async send(request, response) {}", "respondAllSockets(info) {\n\n this.io.of('admin').emit('response', info);\n\n }", "function handleRequest(req, res) {\n var endpoints = {\n '/': handleAppHtml,\n '/appjs': handleAppJs,\n '/appcss': handleAppCss,\n '/clearDrawing': handleClearDrawing,\n '/connect': handleConnect,\n '/favicon.ico': handleFavicon,\n '/name': handleName,\n '/message': handleMessage,\n '/notifier': handleNotifier,\n '/point': handlePoint\n };\n\n // Determine the client's id, if it has one, and look up the 'client' object\n // which represents it.\n var id = req.headers['user-identity'];\n if (id) {\n var client = clients[id];\n if (!client) {\n client = makeClient(id);\n clients[id] = client;\n }\n client.requestCount++;\n }\n\n // Lookup and call a handler for this request.\n callHandler();\n\n\n function callHandler() {\n var handler = endpoints[req.url];\n if (handler) {\n debug('Handling ', req.url);\n\n if (req.method == 'POST') {\n parseIncomingJson(function(err, obj) {\n if (!err) {\n handler(obj);\n }\n else {\n emitJson({error: true, message: 'Server error handling request.'});\n }\n });\n }\n else {\n handler();\n } \n }\n else {\n handlerNotFound();\n } \n }\n\n function handlerNotFound() {\n debug('Handler not found for ', req.url);\n res.writeHead(404, {'content-type': 'text/plain'});\n res.end('These are not the droids you are looking for: ' + req.url);\n }\n\n // --- begin handlers ---\n\n function handleAppCss() {\n emitFile(appCssPath, 'text/css');\n }\n\n function handleAppHtml() {\n emitFile(appHtmlPath, 'text/html');\n }\n\n function handleAppJs() {\n emitFile(appJsPath, 'application/javascript');\n }\n\n function handleClearDrawing() {\n currentPoints = [];\n notifyAllClients({message: client.name + ' cleared the canvas.'});\n notifyAllClients({clearCanvas: true});\n emitJson({ok: true});\n }\n\n function handleConnect() {\n var msg = {ok: true, message: 'Connected to server as ' + client.name, presentation: 'log'};\n if (currentPoints.length) {\n msg.queue = [];\n currentPoints.forEach(function(point) {\n msg.queue.push({drawPoint: point});\n });\n }\n emitJson(msg);\n notifyAllClients({message: client.name + ' connected!'});\n }\n\n function handleFavicon() {\n // Just emit a simple 404 when the browser requests favicon.ico.\n res.writeHead(404);\n res.end();\n }\n\n function handleMessage(obj) {\n var notifyText = '<b>' + client.name + '</b>: ' + obj.text;\n emitJson({ok: true});\n notifyAllClients({message: notifyText});\n }\n\n function handleName(obj) {\n var oldName = client.name;\n client.name = obj.name;\n emitJson({ok: true});\n notifyAllClients({message: oldName + ' is now known as ' + client.name});\n }\n\n function handleNotifier() {\n client.response = res;\n processMessageQueue(client);\n }\n\n function handlePoint(obj) {\n emitJson({ok: true});\n currentPoints.push(obj.point);\n notifyAllClients({drawPoint: obj.point}, client);\n }\n\n // --- end handlers ---\n\n // --- begin output helpers ---\n\n function emitFile(filename, mimetype) {\n fs.readFile(filename, function(err, data) {\n res.writeHead(200, {'content-type': mimetype});\n res.end(data);\n });\n }\n\n function emitJson(obj) {\n res.writeHead(200, {'content-type': 'application/json'});\n res.end(JSON.stringify(obj));\n }\n\n function notifyAllClients(obj, except) {\n //debug('Notifying all clients: ', obj);\n\n for (var key in clients) {\n var cli = clients[key];\n if (cli === except) {\n cli.messageQueue.push('{}');\n }\n else {\n cli.messageQueue.push(obj);\n }\n processMessageQueue(cli);\n }\n }\n\n function processMessageQueue(cli) { \n if (cli.response && cli.messageQueue.length > 0) {\n if (cli.messageQueue.length == 1) {\n var msg = cli.messageQueue[0];\n cli.messageQueue = [];\n }\n else {\n var msg = {queue: cli.messageQueue};\n cli.messageQueue = [];\n }\n\n debug('Notifying ', cli.id, ' that ', msg);\n\n cli.response.writeHead({'content-type': 'application/json'});\n cli.response.end(JSON.stringify(msg));\n cli.response = null;\n }\n }\n\n // --- end output helpers ---\n\n // --- begin other helpers ---\n function parseIncomingJson(cb) {\n var data = '';\n\n req\n .on('data', function(chunk) {\n data += chunk;\n })\n .on('end', function() {\n debug('Data: ', data);\n try {\n cb(null, JSON.parse(data));\n }\n catch(e) { \n debug('Error parsing incoming JSON data: ', data);\n cb('Error parsing incoming JSON data');\n }\n });\n }\n}", "function subscribeInvoke(req, next) {\n // console.log(\"Invoked with\", req);\n var current_ts = \"\" + Math.floor(Date.now() / 1000);\n console.log(req);\n var allData1 = {\n \"peers\" : [\"peer0.org1.example.com\",\"peer1.org1.example.com\"],\n \"fcn\" : \"invoke\",\n \"args\" : [\"subscribe\", req.eventHash, req.participantName, current_ts],\n };\n\n var args1 = {\n data: allData1,\n headers: {\n \"Authorization\" : TokenForServer,\n \"Content-Type\": \"application/json\" },\n requestConfig: {\n timeout: 30000, //request timeout in milliseconds\n noDelay: true, //Enable/disable the Nagle algorithm\n keepAlive: true, //Enable/disable keep-alive functionalityidle socket.\n keepAliveDelay: 1000 //and optionally set the initial delay before the first keepalive probe is sent\n },\n };\n\n // Subscribe given user\n // sleep.sleep(1);\n var subscribeTxReq = client.post(SDKWebServerAddress + \"/channels/mychannel/chaincodes/lottery\", args1, function (data, response) {\n // parsed response body as js object\n console.log(\"data\", data);\n var tx_id = data.tx_id_string_;\n var payload = data.payload_;\n console.log(\"error flag\", data.flag);\n console.log(\"error message\" ,data.error_message);\n\n\n if (typeof payload !== \"strings\") {\n logger.debug(\"Typeof payload:\", typeof payload);\n payload = \"null\";\n }\n // logger.debug(typeof payload);\n // logger.debug(\"tx_id\", tx_id);\n // logger.debug(\"payload\", data.payload_);\n // logger.debug(\"Payload parse\", JSON.parse(data.payload_));\n logger.debug(\"EventName\", JSON.parse(data.payload_).EventName);\n logger.debug(\"EventHash\", JSON.parse(data.payload_).EventHash);\n updateLocalCache(cachedLotteries, JSON.parse(data.payload_));\n // raw response\n // console.log(\"response\", response);\n // token = data.token;\n // message = data.message;\n // secret = data.secret;\n\n // logger.info(token, message, secret);\n\n // when email entered\n if (validateEmail(req.participantName)) {\n RegisterByEmail(req.participantName, req.lotteryName, req.eventHash, req.token);\n }\n\n console.log(\"req.reses length\", req.reses.length);\n console.log(\"req.reses typeof\", typeof req.reses);\n var i = 0;\n for (res of req.reses) {\n if (data.flag == 1) {\n res.send(500, {error : data.error_message});\n // res.end();\n continue;\n }\n\n // res.write(req.tokens[i], \" 참여 성공!\"); \n res.write(req.tokens[i] + \" 참여 성공!\"); \n console.log(req.tokens[i]);\n ++i;\n res.end();\n // req.res.write(req.token);\n // req.res.end();\n }\n\n next();\n });\n\n subscribeTxReq.on('error', function(err) {\n logger.error(err);\n res.status(408).send(\"응모 실패\");\n return;\n });\n\n subscribeTxReq.on('requestTimeout', function (req) {\n logger.warn('응모 트랜잭션 실패');\n res.status(408).send(\"응모 실패\");\n subscribeTxReq.abort();\n return;\n });\n\n\n var useridentity = {\n lotteryName_ : req.lotteryName,\n participantName_ : req.participantName,\n // identityHash_ : identityHash,\n // encryptedIdentity_ : recordedIdentity,\n nonce_ : req.nonce,\n token_ : req.token\n };\n\n UserInfoTable.push(useridentity);\n console.log(\"New user added(\" + UserInfoTable.length + \")\");\n}", "function subscribe() {\n //resets the lines when the program starts\n request.post('http://localhost:3000/RTU/reset',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err, httpResponse, body){\n console.log(body);\n if (err) {\n console.log(err + \"10\");\n } else {\n console.log(\"Reseted Fastory line\");\n }\n });\n\n // get the notification when pallet is loaded to the zone3\n request.post('http://localhost:3000/RTU/SimROB7/events/PalletLoaded/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err + \"11\");\n } else {\n console.log(\"subscribed to the PalletLoaded event!\");\n }\n });\n\n // get the notification when the pallet has moved to the Z1 in CNV7\n request.post('http://localhost:3000/RTU/SimCNV7/events/Z1_Changed/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err + \"12\");\n } else {\n console.log(\"subscribed to the Z1 changed in station 7!\");\n }\n });\n\n // get the notification when the pallet has moved to the Z2 in CNV7\n request.post('http://localhost:3000/RTU/SimCNV7/events/Z2_Changed/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err + \"14\");\n } else {\n console.log(\"subscribed to the Z1 changed in station 7!\");\n }\n });\n\n // get the notification when the pallet has moved to the Z3 in CNV7\n request.post('http://localhost:3000/RTU/SimCNV7/events/Z3_Changed/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err+ \"15\");\n } else {\n console.log(\"subscribed to the Z3 changed in station 7!\");\n }\n });\n}", "listenRequests() {\n this.request(event.detail.request);\n }", "listenRequests() {\n this.request(event.detail.request);\n }", "function respond() {\r\n // Now we do the cool stuff!!\r\n var request = JSON.parse(this.req.chunks[0]);\r\n var user = JSON.parse;\r\n\r\n // Hey, something happened!\r\n if (request.text) {\r\n // HELP OUT USER\r\n if (helpRegex.test(request.text)) {\r\n console.log(\"!help\");\r\n this.res.writeHead(200);\r\n postMessage(getHelpText);\r\n this.res.end();\r\n }\r\n \r\n\r\n // GET ACCOUNTS\r\n else if (accountsRegex.test(request.text) || passEmptyRegex.test(request.text)) {\r\n console.log(\"!accounts\");\r\n this.res.writeHead(200);\r\n postMessage(getAccounts);\r\n this.res.end();\r\n }\r\n // GET PASSWORD\r\n else if (passwordRegex.test(request.text)) {\r\n account = request.text.slice(10); //!password\r\n console.log(\"!password \" + account);\r\n this.res.writeHead(200);\r\n postMessage(getPassword, account);\r\n this.res.end();\r\n }\r\n // GET ACTIVES\r\n else if (activesRegex.test(request.text)) {\r\n console.log(\"!actives\");\r\n this.res.writeHead(200);\r\n postMessage(getActives);\r\n this.res.end();\r\n }\r\n \r\n // GET SPECIFIC ACTIVE\r\n else if (sigmaRegex.test(request.text) || capitalizedsigmaRegex.test(request.text)) {\r\n sigmaNumber = request.text.slice(7); //!sigma\r\n console.log(\"!sigma \" + sigmaNumber);\r\n this.res.writeHead(200);\r\n postMessage(getSigma, sigmaNumber);\r\n this.res.end();\r\n }\r\n // GET PLEDGES\r\n else if (pledgesRegex.test(request.text)) {\r\n console.log(\"!pledges\");\r\n this.res.writeHead(200);\r\n postMessage(getPledges);\r\n this.res.end();\r\n }\r\n // GET CALENDAR\r\n else if (calendarRegex.test(request.text)) {\r\n console.log(\"!calendar\");\r\n this.res.writeHead(200);\r\n postMessage(getCalendarText);\r\n this.res.end();\r\n }\r\n\r\n else if (cockRegex.test(request.text)) {\r\n console.log(\"!cock\");\r\n this.res.writeHead(200);\r\n postMessage(getCock);\r\n this.res.end();\r\n }\r\n\r\n // GET STUDY\r\n else if (studyRegex.test(request.text)) {\r\n console.log(\"!study\");\r\n this.res.writeHead(200);\r\n postMessage(getStudyImage);\r\n this.res.end();\r\n }\r\n // GET USERNAME\r\n else if (usernameRegex.test(request.text)) {\r\n console.log(\"!username\");\r\n this.res.writeHead(200);\r\n postMessage(getUsername);\r\n this.res.end();\r\n }\r\n // GET REASONABLE\r\n else if (reasonableRegex.test(request.text)) {\r\n console.log(\"!reasonable\");\r\n this.res.writeHead(200);\r\n postMessage(getReasonable);\r\n this.res.end();\r\n }\r\n \r\n // GET CLEANUP\r\n else if (cleanupRegex.test(request.text)) {\r\n console.log(\"!cleanup\");\r\n this.res.writeHead(200);\r\n postMessage(getCleanup);\r\n this.res.end();\r\n }\r\n\r\n // GET BAR\r\n else if (barRegex.test(request.text)) {\r\n console.log(\"!bar\");\r\n this.res.writeHead(200);\r\n postMessage(getBar);\r\n this.res.end();\r\n }\r\n\r\n // GET DOOR\r\n else if (doorRegex.test(request.text)) {\r\n console.log(\"!door\");\r\n this.res.writeHead(200);\r\n postMessage(getDoor);\r\n this.res.end();\r\n }\r\n \r\n //post link to the google drive\r\n else if (driveRegex.test(request.txt)) {\r\n console.log(\"!drive\");\r\n this.res.writeHead(200);\r\n postMessage(getDrive);\r\n this.res.end();\r\n }\r\n\r\n // GET STANDARDS FORM\r\n else if (standardsRegex.test(request.text)) {\r\n console.log(\"!standards\");\r\n this.res.writeHead(200);\r\n postMessage(getStandardsForm);\r\n this.res.end();\r\n }\r\n\r\n // GET FIX FORM\r\n else if (fixRegex.test(request.text)) {\r\n console.log(\"!fix\");\r\n this.res.writeHead(200);\r\n postMessage(getFixForm);\r\n this.res.end();\r\n }\r\n\r\n // GET THANKS\r\n else if (thanksRegex.test(request.text)) {\r\n console.log(\"!thanks\");\r\n this.res.writeHead(200);\r\n postMessage(getThanks);\r\n this.res.end();\r\n }\r\n\r\n // GET MOON\r\n else if (moonRegex.test(request.text)) {\r\n console.log(\"!moon\");\r\n this.res.writeHead(200);\r\n postMessage(getMoon);\r\n this.res.end();\r\n }\r\n\r\n // GET risk\r\n else if (riskRegex.test(request.text)) {\r\n console.log(\"!risk\");\r\n this.res.writeHead(200);\r\n postMessage(getRisk);\r\n this.res.end();\r\n }\r\n\r\n // GET BUDGET\r\n else if (budgetRegex.test(request.text)) {\r\n console.log(\"!budget\");\r\n this.res.writeHead(200);\r\n postMessage(getBudget);\r\n this.res.end();\r\n }\r\n\r\n //no gay shit\r\n else if (gazeRegex.test(request.text)) {\r\n console.log(\"!pd\");\r\n this.res.writeHead(200);\r\n postMessage(getPD);\r\n this.res.end();\r\n }\r\n\r\n //beat the clock\r\n else if (socialRegex.test(request.text)) {\r\n console.log(\"!social\");\r\n this.res.writeHead(200);\r\n postMessage(getBTC);\r\n this.res.end();\r\n }\r\n\r\n //ban the R word\r\n else if (retardRegex.test(request.text)) {\r\n console.log(\"retard\");\r\n this.res.writeHead(200);\r\n postMessage(getRetard);\r\n this.res.end();\r\n }\r\n \r\n\t// GET NUKE (to be used to spam group chat if it all goes hell)\r\n else if (nukeRegex.test(request.txt)){\r\n\tconsole.log(\"!nuke\");\r\n\t//this.res.writeHead(200); // uncomment this to purge\r\n\t//postMessage(getNuke);\r\n\t//this.res.writeHead(200);\r\n\t//postMessage(getNukeCountdown);\r\n\tthis.res.writeHead(200);\r\n postMessage(getDrop);\r\n\tthis.res.end();\r\n }\r\n \r\n //return the frat's positive covid dates\r\n else if (covidRegex.test(request.text)) {\r\n console.log(\"!covid\");\r\n this.res.writeHead(200);\r\n postMessage(getCovid);\r\n this.res.end();\r\n }\r\n\r\n else if (hornyRegex.test(request.text)) {\r\n console.log(\"!horny\");\r\n this.res.writeHead(200);\r\n postMEssage(getHorny);\r\n this.res.end();\r\n }\r\n \r\n //roll a six sided die\r\n else if (dieRegex.test(request.text)) {\r\n console.log(\"!die\");\r\n this.res.writeHead(200);\r\n postMessage(rollDie);\r\n this.res.end();\r\n }\r\n // NOT IMPORTANT...\r\n else {\r\n console.log(\"don't care\");\r\n this.res.writeHead(200);\r\n this.res.end();\r\n }\r\n }\r\n // Boring......\r\n else {\r\n console.log(\"don't care\");\r\n this.res.writeHead(200);\r\n this.res.end();\r\n }\r\n}", "function support(req, res) {\n var message = req.body.message;\n\tconsole.log(req.body);\n\tsio.sockets.emit(\"incoming_message_chat\", message);\n\tres.status(200).json({ message: \"Message sent\" });\n}", "function nlobjServerResponse() {\n}", "function myCodeService(req, resp){\n var client = new MQTT.Client();\n client.publish(\"analytics\", JSON.stringify(payload))\n .then(function (resolve) {\n resp.success(\"success\");\n }, function (reason) {\n log(reason)\n resp.error('failure');\n });\n\n }", "run() {\n \n console.log(\"Booting up\");\n //so can call methods inside other function\n var self = this; //so can call inside callback function\n\n \n \n let serverHandler = function (request, response) {\n try {\n\n if(self.blacklist[response.connection.remoteAddress]) {\n response.destroy();\n }\n let sentUrl = url.parse(request.url, true);\n let method = request.method;\n console.log(\"Request Recieved: \" + method + \": \" + sentUrl.pathname);\n \n \n //determine action required\n if (method == \"GET\") {\n //sentUrl.pathname = removeExtraPaths(sentUrl.pathname);\n if (sentUrl.pathname.startsWith(self.databaseActions[0])) { //GET request for problem\n self.getProblem(sentUrl.pathname, response);\n } else if (sentUrl.pathname.startsWith(self.databaseActions[1])) { //GET request for Lesson\n self.getLesson(sentUrl.pathname, response);\n } else if (sentUrl.pathname.startsWith(self.databaseActions[2])) { //GET request for an account\n self.getAccount(sentUrl.pathname, response);\n } else if (sentUrl.pathname === self.databaseActions[3]) {\n self.queryProblems(sentUrl.query, response);\n } else if (sentUrl.pathname === self.databaseActions[4]) {\n self.queryLessons(sentUrl.query, response);\n } else { //GET request for a webpage\n self.getPage(sentUrl.pathname, response);\n }\n \n } else if (method == \"POST\") {\n let body = \"\";\n \n request.on('data', function (data) { //event listener for data received from POST request\n body += data;\n if (body.length > maxPostSize) { //stops outside from sending enormous file and crashing server\n request.connection.destroy();\n }\n });\n \n request.on('end', function () { //event listener for when data finished coming from POST request\n let jsonData;\n try {\n jsonData = JSON.parse(body);\n } catch (error) {\n console.log(\"============ Error =============\");\n console.log(\"Error parsing posted data\");\n console.log(error);\n console.log(\"==========End of Error =========\");\n return self.respondWithError(response, 400, \"Error 400: JSON POST data has bad syntax\");\n }\n \n self.authenticatedUserFromToken(response, self.getSentToken(request), function (accountID) {\n if (sentUrl.pathname.startsWith(self.databaseActions[0])) { //POST request for problem\n self.saveProblem(sentUrl.pathname, response, jsonData, accountID);\n } else if (sentUrl.pathname.startsWith(self.databaseActions[1])) { //POST request for Lesson\n self.saveLesson(sentUrl.pathname, response, jsonData, accountID);\n } else if (sentUrl.pathname.startsWith(self.databaseActions[2])) { //POST request for account\n self.saveAccount(response, jsonData, accountID);\n } else {\n console.log(\"============ Error =============\");\n console.log(\"Sent POST request does not match any api call\");\n console.log(\"==========End of Error =========\");\n return self.respondWithError(response, 400, \"Error 400: Bad Request\");\n }\n \n });\n //let accountID = self.authenticatedUser(self.getSentAccountID(request));\n });\n \n \n } else if (method == \"DELETE\") {\n self.authenticatedUserFromToken(response, self.getSentToken(request), function (accountID) {\n if (accountID === undefined) {\n return self.respondWithError(response, 401, \"Error 401: No Authorization Provided\");\n }\n if (sentUrl.pathname.startsWith(self.databaseActions[0])) { //DELETE request for problem\n self.deleteProblem(response, sentUrl.pathname, accountID);\n } else if (sentUrl.pathname.startsWith(self.databaseActions[1])) { //DELETE request for Lesson\n self.deleteLesson(response, sentUrl.pathname, accountID);\n } else if (sentUrl.pathname.startsWith(self.databaseActions[2])) { //DELETE request for account\n self.deleteAccount(response, sentUrl.pathname, accountID);\n } else {\n return self.respondWithError(response, 400, \"Error 400: Bad Request\");\n }\n });\n } else { // we do not handle other methods \n return self.respondWithError(response, 400, \"Error 400: Method not supported\");\n }\n } catch (error) {\n console.error(\"============ Error =============\");\n console.error(\"Uncaught Error!!!\");\n console.error(error);\n console.error(\"==========End of Error =========\");\n }\n }\n\n\n //https has a required options section, but http does not allow it on older versions of node\n if(this.PORT_NUMBER === 443) {\n this.http.createServer(this.options, serverHandler).listen(this.PORT_NUMBER, '0.0.0.0');\n\n const h = require('http');\n let redirectServerHandler = function (request, response) {\n let sentUrl = url.parse(request.url, true);\n console.log('Redirecting to: https://visualalgebra.org' + sentUrl.pathname);\n response.writeHead(301, { Location: 'https://visualalgebra.org' + sentUrl.pathname});\n response.end();\n }\n h.createServer(redirectServerHandler).listen(80, '0.0.0.0');\n } else {\n this.http.createServer(serverHandler).listen(this.PORT_NUMBER, '0.0.0.0');\n }\n }", "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 send out all relevant daily notifications\"\n\t\t\t}));\n\t\t} else {\n\t\t\ttry {\n\t\t\t\t//Get the Routing Entries from the table\n\t\t\t\tvar oRoutes = getRoutes();\n\n\t\t\t\t//Perform Counts and Trigger Notifications\n\t\t\t\t_countAndSend(oRoutes);\n\n\t\t\t\t//Write to the trace\n\t\t\t\t$.trace.info(JSON.stringify({\n\t\t\t\t\tRequestedNotifications: gvRequestedProcessing,\n\t\t\t\t\tProcessedNotifications: gvProcessingCount\n\t\t\t\t}));\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\tgvError = err.message;\n\t\t\t}\n\n\t\t\t$.response.status = 200;\n\t\t\t$.response.setBody(JSON.stringify({\n\t\t\t\tmessage: \"API Called\",\n\t\t\t\tError: gvError\n\t\t\t}));\n\t\t}\n\t}", "static postReponse() {\n const reqMessage = JSON.parse(this.req.chunks[0]);\n\n this.res.writeHead(200);\n this.res.end();\n Bot.Functions.load(reqMessage.group_id);\n function send() {\n //ACTUAL BOT\n const resMessage = Bot.Bot.checkMessage(reqMessage);\n if (resMessage) {\n\n //STARTS SEND\n Bot.Bot.sendMessage(resMessage);\n }\n }\n setTimeout(send, 200);\n }", "async function requestNotificationAccess() {\n console.info(\"Requesting Notifications\");\n const subscription = await Registrar.requestNotificationAccess();\n await fetch(`http://localhost:8082/register?key=${subscription}`, {\n method: 'POST'\n })\n}", "function connection_handler(req, res){\n\tconsole.log(`New Request for ${req.url} from ${req.socket.remoteAddress}`);\n\tif (req.url === \"/\"){\n\t\tconst main = fs.createReadStream(\"html/main.html\");\n\t\tres.writeHead(200, {\"Content-Type\":\"text/html\"});\n\t\tmain.pipe(res);\n\t}\n\telse if (req.url.startsWith(\"/search\")){\n\t\tconst user_input = url.parse(req.url, true).query; //take an url object return a js object \n\t\tconsole.log(\"Performing PetFinder API request\");\n\t\t//POST method \n\t\tconst authentication_cache = \"./cache/authentication-res.json\";\n\t\tcache_access_token(authentication_cache, user_input, res);\n\t}\n\telse {\n\t\tres.writeHead(404, {\"Content-Type\":\"text/plain\"});\n\t\tres.write(\"404 Not Found\");\n\t\tres.end();\n\t}\n}", "inbound(count, obj) {\n console.log(`vat-http.inbound (from browser) ${count}`, obj);\n const p = Promise.resolve(handler[obj.type](obj));\n p.then(\n res => D(commandDevice).sendResponse(count, false, harden(res)),\n rej => D(commandDevice).sendResponse(count, true, harden(rej)),\n );\n }", "function proccedtoCreateServer()\n{\n var erroredLines=[1,2,3];\n var resultJSONarray = [];\napp.get('/', (req,res) => {\nres.send('Good evening, Mr.Hunt \\n You have to deal with '+erroredLines.length+'errors Should you choose to accept it?');\n});\n\napp.get('/json',(req,res) => {\n console.log(__dirname);\n res.send(resultJSONarray);\n});\n\napp.get('/html',(req,res) => {\n console.log(__dirname);\n res.sendFile(__dirname+'/index.html');\n});\n\n(async () => {\navailablePort = await getPort({port:[8000,8080,8888,9090]});\nconsole.log(chalk.blue('The available port is',availablePort));\nstartListening();\n}) ();\n\nstartListening = function(){\n //spinner.stop(true);\napp.listen(availablePort, ()=>console.log(chalk.green('Server succesfully listening on the port :',availablePort)));\n\n//opn('http://localhost:'+availablePort);\n};\n}", "function sendServerMessage(message, successHandler, failureHandler) {\n log(\"Sending message to sprongle.com ...\\n\" + message, \"server_all\");\n var x = new XMLHttpRequest();\n x.open('POST', 'http://sprongle.com', true);\n x.onload = function () {\n log(\"Response from sprongle.com:\", \"server_all\");\n log(x.response, \"server_all\");\n if (x.responseText.startsWith(\"success\"))\n successHandler(x);\n else\n failureHandler(x);\n };\n try { x.send(message); }\n catch (e) {\n console.log(\"server error:\");\n console.log(e);\n }\n }", "function onRequest(request, response){\n\tconsole.log(\" \")\n\tconsole.log(new Date())\n\tvar command = request.headers[\"command\"]\n\tif(command == \"restartPC\"){\n\t\tconsole.log(\"Bridge restarting\")\n\t\tresponse.setHeader(\"cmd-response\", \"restart\")\n\t\tresponse.end()\n\t\tbridgeExec('shutdown /r /t 005')\n\t} else if(command == \"pollBridge\"){\n\t\tresponse.setHeader(\"cmd-response\", \"ok\")\n\t\tconsole.log(\"Bridge poll response sent to SmartThings\")\n\t\tresponse.end()\n\t} else {\n\t\tconsole.log(\"Unexpected command received from SmartThings\")\n\t\tresponse.end()\n\t}\n}", "async function send(){\n //register service worker\n console.log('inside send function');\n\n const register = await navigator.serviceWorker.register('/sw.js', {\n scope: '/'\n });\n\n await navigator.serviceWorker.ready;\n\n //register push\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n //public vapid key\n applicationServerKey: urlBase64ToUint8Array(publicKey)\n });\n\n var usr_email = document.getElementById('email').value;\n\n var obj = {\n email : usr_email,\n subscriptionData : subscription\n }\n console.log(obj);\n console.log('payload ready')\n //Send push notification\n await fetch(\"/subscribe\", {\n method: \"POST\",\n body: JSON.stringify(obj),\n headers: {\n \"content-type\": \"application/json\"\n }\n });\n\n document.getElementById('messageSpace').innerHTML = \"Welcome to BreakTime ! You have been successfully registered :)\";\n}", "function onRequest(request, response){\r\n\tvar command = request.headers[\"command\"]\r\n\tvar deviceIP = request.headers[\"tplink-iot-ip\"]\r\n\tvar cmdRcvd = \"\\n\\r\" + new Date() + \"\\r\\nIP: \" + deviceIP + \" sent command \" + command\r\n\tconsole.log(\" \")\r\n\tconsole.log(cmdRcvd)\r\n\tswitch(command) {\r\n\t\t//---- (BridgeDH - Poll for Server APP ------------------\r\n\t\tcase \"pollServer\":\r\n\t\t\tresponse.setHeader(\"cmd-response\", \"ok\")\r\n\t\t\tresponse.end()\r\n\t\t\tvar respMsg = \"Server Poll response sent to SmartThings\"\r\n\t\t\tconsole.log(respMsg)\r\n\t\tbreak\r\n\r\n\t\t//---- TP-Link Device Command ---------------------------\r\n\t\tcase \"deviceCommand\":\r\n\t\t\t//----- Simulated power data Selection ----------------------\r\n\t\t\tvar command = request.headers[\"tplink-command\"]\r\n\t\t\tvar action = request.headers[\"action\"]\r\n\t\t\tif (action == \"onWatts\") {\r\n\t\t\t\tresponse.setHeader(\"action\", \"energyMeterResponse\")\r\n\t\t\t\tresponse.setHeader(\"cmd-response\", onWatts)\r\n\t\t\t\tresponse.end()\r\n\t\t\t} else if (action == \"offWatts\") {\r\n\t\t\t\tresponse.setHeader(\"action\", \"energyMeterResponse\")\r\n\t\t\t\tresponse.setHeader(\"cmd-response\", offWatts)\r\n\t\t\t\tresponse.end()\r\n\t\t\t} else {\r\n\t\t\t//----- Real data ----------------------\r\n\t\t\t\tprocessDeviceCommand(request, response)\r\n\t\t\t}\r\n\t\t\tbreak\r\n\t\r\n\t\t//---- Energy Meter Simulated Data Return ---------------\r\n\t\tcase \"emeterCmd\":\r\n\t\t\tvar action = request.headers[\"action\"]\r\n\t\t\tvar engrCmd = action.substring(0,3)\r\nconsole.log(\"engrCmd = \" + engrCmd)\r\n\t\t\tvar engrData = action.substring(3)\r\nconsole.log(\"engrData = \" + engrData)\r\n\t\t\tif (engrCmd == \"Con\") {\r\n\t\t\t\tresponse.setHeader(\"action\", \"useTodayResponse\")\r\n\t\t\t} else {\r\n\t\t\t\tresponse.setHeader(\"action\", \"engrStatsResponse\")\r\n\t\t\t}\r\n\t\t\tvar respData = \"\"\r\n\t\t\tswitch(engrData) {\r\n\t\t\t\tcase \"DecWatts\":\r\n\t\t\t\t\trespData = DecWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"DecMWatts\":\r\n\t\t\t\t\trespData = DecMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"JanWatts\":\r\n\t\t\t\t\trespData = JanWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"JanMWatts\":\r\n\t\t\t\t\trespData = JanMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"FebWatts\":\r\n\t\t\t\t\trespData = FebWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"FebMWatts\":\r\n\t\t\t\t\trespData = FebMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"MarWatts\":\r\n\t\t\t\t\trespData = MarWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"MarMWatts\":\r\n\t\t\t\t\trespData = MarMWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day1Watts\":\r\n\t\t\t\t\trespData = Day1Watts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day1MWatts\":\r\n\t\t\t\t\trespData = Day1MWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day2Watts\":\r\n\t\t\t\t\trespData = Day2Watts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day2MWatts\":\r\n\t\t\t\t\trespData = Day2MWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day3Watts\":\r\n\t\t\t\t\trespData = Day3Watts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tcase \"Day3MWatts\":\r\n\t\t\t\t\trespData = Day3MWatts\r\n\t\t\t\t\tbreak\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak\r\n\t\t\t}\r\nconsole.log(respData)\r\n\t\t\tresponse.setHeader(\"cmd-response\", respData)\r\n\t\t\tresponse.end()\r\n\t\t\tbreak\r\n\t\tdefault:\r\n\t\t\tresponse.setHeader(\"cmd-response\", \"InvalidHubCmd\")\r\n\t\t\tresponse.end()\r\n\t\t\tvar respMsg = \"#### Invalid Command ####\"\r\n\t\t\tvar respMsg = new Date() + \"\\n\\r#### Invalid Command from IP\" + deviceIP + \" ####\\n\\r\"\r\n\t\t\tconsole.log(respMsg)\r\n\t\t\tlogResponse(respMsg)\r\n\t}\r\n}", "function ProcessRequest(req, res) {\n if (req.method == 'POST' && req.url === '/DispatchInterface') { \n var buffer = '';\n req.on('data', function(chunk) {\n // receive the complete request\n buffer += chunk;\n });\n req.on('end', function () {\n // process the request\n func.ProcessIncomingMessage(Appts, Sess, sio, buffer, function(error,response) {\n if (error) {\n l.error(sprintf('app.js: Error from ProcessIncomingMessage: %s', error));\n res.writeHead(200, { 'content-type': 'text/plain' });\n res.end(error);\n } else {\n l.all(sprintf('app.js: ProcessIncomingMessage: %s', response));\n res.writeHead(200, {\n 'Content-Length': response.length,\n 'Content-Type': 'text/plain'}\n );\n res.end(response);\n }\n });\n });\n }\n if (req.method == 'GET' && req.url === '/DispatchInterface') {\n res.writeHead(200, { 'content-type': 'text/plain' });\n res.end('Interface ready.');\n }\n if (req.url !== '/DispatchInterface') {\n res.writeHead(401, { 'content-type': 'text/plain' });\n res.end('Not found.');\n }\n}", "function startServer() {\n FastMQ.Client.connect('responseChannel', 'master').then((channel) => { // client connected\n console.log(\"Connected\")\n responseChannel = channel;\n responseChannel.response('refresh', (msg, res) => {\n console.log('Receive request payload:', msg.payload);\n // echo request data back;\n let resData = {\n data: msg.payload.data\n };\n res.send(resData, 'json');\n });\n \n }).catch((err) => {\n console.log('Got error:', err.stack);\n setTimeout(startServer, 5000);\n });\n}", "sendRegistObj(context, serverSocket, data) {\n console.log(\"regist obj\")\n serverSocket.emit('sendRegistObjToServer', data)\n console.log(\"디바이스추가완료\")\n }", "function main() {\n\n // create the server\n var server = restify.createServer( { name : hostName } );\n server.use(restify.bodyParser());\n // set up the route\n server.post('/incoming-webhook', processIncoming);\n server.get('/health-check', processHealthCheck);\n\n server.listen(port, function() {\n });\n}", "function notificationReceived(req) {\n console.log(\"notification received!\");\n io.emit(\"notification\", JSON.stringify(req.body));\n}", "function onRequest( req, res ){\n\t\n\t\t// we must work in binary, UTF-8 strings will be handled by deserializer\n\t\treq.setEncoding('binary');\n\n\t\t// collect body on data events\n\t\tvar body = '';\n\t\treq.addListener('data', function( chunk ){\n\t\t\tbody += chunk;\n\t\t} );\n\t\t\n\t\t// ready for processing when body fully collected\n\t\treq.addListener('end', function(){\n\t\t\t//sys.puts( utils.hex(body) );\n\t\t\ttry {\n\t\t\t\tvar requestPacket = amf.packet(body);\n\t\t\t\tif( requestPacket.version !== amf.AMF0 && requestPacket.version !== amf.AMF3 ){\n\t\t\t\t\tthrow new Error('Bad AMF request packet, sorry');\n\t\t\t\t}\n\t\t\t\tsys.puts( sys.inspect(requestPacket) );\n\n\t\t\t\t// prepare response packet with the same AMF version\n\t\t\t\tvar responsePacket = amf.packet();\n\t\t\t\tresponsePacket.version = requestPacket.version;\n\n\t\t\t\t// process all messages as function calls\n\t\t\t\tvar requestMessage, responseMessage, func, args, uri;\n\t\t\t\t// queue up all web service calls to be executed asynchronously\n\t\t\t\tvar queue = [];\n\t\t\t\tfor( var m in requestPacket.messages ){\n\t\t\t\t\trequestMessage = requestPacket.messages[m];\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// get function to call and arguments to pass from request message\n\t\t\t\t\t\tfunc = methods[ requestMessage.requestURI ];\n\t\t\t\t\t\targs = requestMessage.value;\n\t\t\t\t\t\turi = requestMessage.responseURI;\n\t\t\t\t\t\tif( typeof func !== 'function' ){\n\t\t\t\t\t\t\tthrow new Error('No such method \"'+requestMessage.requestURI+'\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( typeof args !== 'object' && typeof args.push !== 'function' ){\n\t\t\t\t\t\t\tthrow new Error('Arguments to \"'+requestMessage.requestURI+'\" must be sent as an array');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqueue.push( [ uri, func, args ] );\n\t\t\t\t\t}\n\t\t\t\t\t// errors respond with an onStatus method request to the client - no responseURI required\n\t\t\t\t\tcatch( Er ){\n\t\t\t\t\t\tconsole.warn('Error on request message \"'+requestMessage.requestURI+'\": ' + Er.message);\n\t\t\t\t\t\tresponseMessage = amf.message( Er.message, uri+'/onStatus', '' );\n\t\t\t\t\t\tresponsePacket.messages.push( responseMessage );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// execute all web services, responding only when all are complete\n\t\t\t\tfunction shiftQueue(){\n\t\t\t\t\tvar q = queue.shift();\n\t\t\t\t\tvar uri = q[0], func = q[1], args = q[2];\n\t\t\t\t\tfunction callback( value, func ){\n\t\t\t\t\t\tfunc = func || 'onResult';\n\t\t\t\t\t\t// ensure callback isn't executed twice\n\t\t\t\t\t\tif( uri !== null ){ \n\t\t\t\t\t\t\tclearTimeout(t);\n\t\t\t\t\t\t\tresponseMessage = amf.message( value, uri+'/'+func, '' );\n\t\t\t\t\t\t\tresponsePacket.messages.push( responseMessage );\n\t\t\t\t\t\t\turl = null;\n\t\t\t\t\t\t\tif( ++processed === qlen ){\n\t\t\t\t\t\t\t\trespond();\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\tfunction onTimeout(){\n\t\t\t\t\t\tcallback('method timeout', 'onStatus');\n\t\t\t\t\t}\n\t\t\t\t\t// hand off to method - any return value other than undefined assume to be a syncronous method\n\t\t\t\t\ttry {\n\t\t\t\t\t\targs.unshift( callback );\n\t\t\t\t\t\tvar t = setTimeout( onTimeout, timeout || 10000 );\n\t\t\t\t\t\tvar value = func.apply( null, args );\n\t\t\t\t\t\tif( value !== undefined ){\n\t\t\t\t\t\t\tcallback( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch( Er ){\n\t\t\t\t\t\tconsole.warn('Error on AMF method: ' + Er.message);\n\t\t\t\t\t\tcallback( Er.message, 'onStatus' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// final response when all messages have been processed\n\t\t\t\tfunction respond(){\n\t\t\t\t\t// flush HTTP response\n\t\t\t\t\tvar bin = responsePacket.serialize();\n\t\t\t\t\t//sys.puts( utils.hex(bin) );\n\t\t\t\t\t//sys.puts( sys.inspect(responsePacket) );\n\t\t\t\t\tres.writeHead( 200, {\n\t\t\t\t\t\t'Content-Type': 'application/x-amf',\n\t\t\t\t\t\t'Content-Length': bin.length \n\t\t\t\t\t} );\n\t\t\t\t\tres.write( bin, \"binary\" );\n\t\t\t\t\tres.end();\n\t\t\t\t}\n\t\t\t\t// process queue without a recursive call stack\n\t\t\t\tvar qlen = queue.length, processed = 0;\n\t\t\t\tfor( var i = 0; i < qlen; i++ ){\n\t\t\t\t\tsetTimeout( shiftQueue, 0 );\n\t\t\t\t}\n\t\t\t\tif( ! qlen ){\n\t\t\t\t\tthrow new Error('no messages to process');\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( e ){\n\t\t\t\tconsole.warn( 'Error: ' + e.message );\n\t\t\t\tres.writeHead( 500, {'Content-Type': 'text/plain'} );\n\t\t\t\tres.write( 'Error on AMF packet:\\n' + e.message );\n\t\t\t\tres.end();\n\t\t\t}\n\t\t} );\n\t}", "function handleRequest(request, response){\n \n console.log(\"LINE START\");\n console.log(\"check \"+request+\" - \"+response);\n \n try {\n console.log(\"check request\");\n for(var data in request) {\n //console.log(\" data \"+data);\n }\n \n console.log(\"check response\");\n for(var data in response) {\n //console.log(\" data \"+data);\n }\n \n console.log(\" chek data \"+request.method);\n \n var POST = {};\n if (request.method == 'POST') {\n request.on('data', function(data) {\n data = data.toString();\n console.log(data);\n \n var obj = JSON.parse(data);\n var userId = obj.events[0].source.userId;\n var message = obj.events[0].message.text;\n \n console.log(\"CEKKK :: flag menu BEFORE ::\"+flagMenu+\" \"+message);\n \n if(isMenuChek(message, \"Info\")) {\n var messages = util.msg_type_basic_text(\"HEllo World\");\n util.post(userId, messages);\n } else if(isMenuChek(message, \"Start\")) {\n var messages = util.msg_ready_registration();\n util.post(userId, messages);\n } else if(isMenuChek(message, \"Registrasi\")) {\n flagMenu = GLOBALS.REG.STEP_1;\n } else if(isMenuChek(message, \"Cek Saldo\")) {\n flagMenu = GLOBALS.MENU.CEK_SALDO;\n } \n \n else if(isMenuChek(message, \"Cek Mutasi Rekening\")) {\n flagMenu = GLOBALS.MENU.CEK_MUTASI_REK;\n } else if(flagMenu === GLOBALS.MENU.CEK_MUTASI_REK && isMenuChek(message, GLOBALS.CEK_MUTASI_REK.REK_UTAMA.LABEL)) {\n flagMenu = GLOBALS.CEK_MUTASI_REK.REK_UTAMA.VALUE;\n } else if(flagMenu === GLOBALS.MENU.CEK_MUTASI_REK && isMenuChek(message, GLOBALS.CEK_MUTASI_REK.REK_LAIN.LABEL)) {\n flagMenu = GLOBALS.CEK_MUTASI_REK.REK_LAIN.VALUE;\n } \n \n else if(isMenuChek(message, \"Kartu Kredit\")) {\n flagMenu = GLOBALS.MENU.REG_KK;\n }\n \n else if(isMenuChek(message, GLOBALS.MENU.TUTUP_LAYANAN.LABEL)) {\n flagMenu = GLOBALS.MENU.TUTUP_LAYANAN.VALUE;\n } else if(flagMenu === GLOBALS.MENU.TUTUP_LAYANAN.VALUE && isMenuChek(message, GLOBALS.TUTUP_LAYANAN.YA.LABEL)) {\n flagMenu = GLOBALS.TUTUP_LAYANAN.YA.VALUE;\n } else if(flagMenu === GLOBALS.MENU.TUTUP_LAYANAN.VALUE && isMenuChek(message, GLOBALS.TUTUP_LAYANAN.TIDAK.LABEL)) {\n flagMenu = GLOBALS.TUTUP_LAYANAN.TIDAK.VALUE;\n } \n \n \n console.log(\"CEKKK :: flag menu AFTER ::\"+flagMenu+\" \"+message+\" || \"+( GLOBALS.MENU.TUTUP_LAYANAN.LABEL) );\n\n /* CEK SALDO */\n if(flagMenu === GLOBALS.MENU.CEK_SALDO) {\n var myMessages = String.raw`Saldo \\n22/09 08:18:12 527xxx0000 Rp 1,000,000.00`;\n var messages = util.msg_type_basic_text(myMessages);\n util.post(userId, messages);\n resetFlag();\n }\n /* END OF CEK SALDO */\n \n /* CARA PAKAI */\n if(flagMenu === GLOBALS.CARA_PAKAI.PLEASE_REG) {\n var buttons =[\"Registrasi\", \"Ketentuan - ketentuan\"];\n var message = String.raw`Kamu belum registrasi layanan BCA Chat Banking. Untuk registrasi tekan tombol Registrasi di bawah ini. \\n\\nDengan melakukan registrasi, maka kamu menyetujui ketentuan - ketentuan yang berlaku.`;\n var messages = util.msg_buttons_without_pict_titlebuttons(buttons, message);\n util.post(userId, messages);\n }\n \n if(flagMenu === GLOBALS.CARA_PAKAI.INFO_PICT) {\n var buttons =[\"Registrasi\", \"Ketentuan - ketentuan\"];\n var message = String.raw`Kamu belum registrasi layanan BCA Chat Banking. Untuk registrasi tekan tombol Registrasi di bawah ini. \\n\\nDengan melakukan registrasi, maka kamu menyetujui ketentuan - ketentuan yang berlaku.`;\n var messages = util.msg_buttons_without_pict_titlebuttons(buttons, message);\n util.post(userId, messages);\n }\n /* END OF CARA PAKAI */\n \n /* REGISTRASI */\n if(flagMenu === GLOBALS.REG.STEP_1) {\n flagMenu = GLOBALS.REG.STEP_2;\n var messages = util.msg_type_basic_text(\"Silakan masukkan nomor kartu ATM kamu.\");\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.REG.STEP_2) {\n flagMenu = GLOBALS.REG.STEP_3;\n var myMessage ='{\"success\": true,\"MSISDNList\": [{\"MSISDNData\":{\"MSISDNID\": \"081299991234\",\"MSISDN\": \"0812xxxx1234\"}},{\"MSISDNData\":{\"MSISDNID\": \"081299991235\",\"MSISDN\": \"0812xxxx1235\"}}]}';\n var messages = util.msg_reg_activation(myMessage);\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.REG.STEP_3) {\n flagMenu = GLOBALS.REG.STEP_4;\n var messages = util.msg_reg_otp();\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.REG.STEP_4) {\n flagMenu = GLOBALS.REG.STEP_5;\n var messages = util.msg_type_basic_text(\"Silakan masukkan OTP\");\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.REG.STEP_5) {\n flagMenu = GLOBALS.MENU;\n var messages = util.msg_type_basic_text(\"Kamu telah terdaftar dalam layanan BCA Chat Banking. Silakan pilih transaksi yang ingin dilakukan dengan menekan tombol di bawah ini.\");\n util.post(userId, messages);\n resetFlag();\n }\n /* END OF REGISTRASI */\n \n /* CEK MUTASI */\n if(flagMenu === GLOBALS.MENU.CEK_MUTASI_REK) {\n var buttons =[GLOBALS.CEK_MUTASI_REK.REK_UTAMA.LABEL, GLOBALS.CEK_MUTASI_REK.REK_LAIN.LABEL];\n var message = String.raw`Silakan pilih jenis mutasi rekening.`;\n var messages = util.msg_buttons_without_pict_title(buttons, message);\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.CEK_MUTASI_REK.REK_UTAMA.VALUE) {\n var myMessages = String.raw`22/09 ETR Rp. 37,000.00 DB Naomi\\n20/09 ETR Rp. 50,000.00 DB\\n13/09 EPY Rp. 40,500.00 DB\\n09/09 EPY Rp. 42,500.00 DBB`;\n var messages = util.msg_type_basic_text(myMessages);\n util.post(userId, messages);\n resetFlag();\n } else if(flagMenu === GLOBALS.CEK_MUTASI_REK.REK_LAIN.VALUE) {\n flagMenu = GLOBALS.CEK_MUTASI_REK.REK_LAIN.STEP.STEP_1\n var buttons =[GLOBALS.BUTTON.BATAL];\n var message = String.raw`Ketik nomor rek. kamu pada aplikasi ini. Nomor rekening yang diketik adalah nomor rekening yang terhubung ke kartu ATM yang sama dengan nomor rekening utama`;\n var messages = util.msg_buttons_without_pict_title(buttons, message);\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.CEK_MUTASI_REK.REK_LAIN.STEP.STEP_1) {\n var myMessages = String.raw`22/09 ETR Rp. 37,000.00 DB Naomi\\n20/09 ETR Rp. 50,000.00 DB\\n13/09 EPY Rp. 40,500.00 DB\\n09/09 EPY Rp. 42,500.00 DBB`;\n var messages = util.msg_type_basic_text(myMessages);\n util.post(userId, messages);\n resetFlag();\n }\n /* END OF MUTASI */\n \n /* REGISTRASI KARTU KREDIT */\n if(flagMenu === GLOBALS.MENU.REG_KK) {\n flagMenu = GLOBALS.REG_KK.STEP_1;\n var buttons =[GLOBALS.BUTTON.BATAL];\n var message = String.raw`Silakan ketik nomor kartu kredit kamu pada aplikasi ini`;\n var messages = util.msg_buttons_without_pict_title(buttons, message);\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.REG_KK.STEP_1) {\n var bodyMessage = String.raw`Registrasi info kartu kredit BCA sudah selesai.\\n\\nProses persetujuan registrasi maksimal 3 hari kerja.`;\n var messages = util.msg_type_basic_text(bodyMessage);\n util.post(userId, messages);\n resetFlag();\n }\n /* END OF REGISTRASI KARTU KREDIT */\n \n \n /* TUTUP LAYANAN */\n if(flagMenu === GLOBALS.MENU.TUTUP_LAYANAN.VALUE) {\n var buttons =[\"Ya\", \"Tidak\"];\n var bodyMessage = String.raw`Apakah kamu yakin?`;\n var messages = util.msg_confirm(buttons, bodyMessage);\n util.post(userId, messages);\n } else if(flagMenu === GLOBALS.TUTUP_LAYANAN.YA.VALUE) {\n var bodyMessage = String.raw`Kamu sudah tidak terdaftar pada layanan BCA Chat Banking.\\n\\nTerima kasih telah menggunakan layanan BCA Chat Banking.`;\n var messages = util.msg_type_basic_text(bodyMessage);\n util.post(userId, messages);\n resetFlag();\n } else if(flagMenu === GLOBALS.TUTUP_LAYANAN.TIDAK.VALUE) {\n flagMenu = GLOBALS.DEFAULT_MESSAGE.MSG_1;\n }\n /* END OF TUTUP LAYANAN */\n\n\n /* DEFAULT MESSAGE */\n if(flagMenu === GLOBALS.DEFAULT_MESSAGE.MSG_1) {\n var bodyMessage = String.raw`Silakan pilih transaksi yang ingin dilakukan dengan menekan tombol di bawah ini.`;\n var messages = util.msg_type_basic_text(bodyMessage);\n util.post(userId, messages);\n resetFlag();\n }\n /* END OF DEFAULT MESSAGE */\n\n })\n }\n \n\n }\n catch (e) {\n console.log(\"entering catch block\");\n console.log(e);\n console.log(\"leaving catch block\");\n }\n finally {\n console.log(\"entering and leaving the finally block\");\n console.log(\"LINE FINISH\");\n }\n\n\n\n response.end('LINE It Works!! Path Hit: ' + request.url);\n}", "async function localServerStart() {\n var http = require('http');\n //creating server\n http.createServer(async function (request, response) {\n var body = [];\n request.on('error', (err) => {\n console.error(err);\n }).on('data', (chunk) => {\n body.push(chunk);\n }).on('end', async () => {\n var result = Buffer.concat(body).toString();\n // BEGINNING OF NEW STUFF\n response.on('error', (err) => {\n console.error(err);\n });\n //getting the request as an JSON obj\n var obj = JSON.parse(result);\n // console.log(\"obj below\");\n // console.log(obj);\n /**\n *sending the request to the handler and waiting for result\n */\n var answer = await handleRequest(obj);\n response.statusCode = 200;\n response.setHeader('Content-Type', 'application/json');\n //writing the response for the request\n if (obj.method == \"query\" || obj.method == \"pull\" || obj.method == \"blob\" || obj.method == \"gitClone\") {\n response.write(answer);\n }\n else {\n response.write(obj.method);\n }\n response.end();\n });\n }).listen(localServerExtensionPort); //the server object listens on port 8080\n}", "function messageHandler(req, res) {\n let agent = new WebhookClient({'request': req, 'response': res});\n console.log(\"ORIGINAL REQUEST: \" + agent.originalRequest);\n agent.handleRequest(intentMap);\n}", "async receive(request, response) {}", "function sendRequest() {\n var req = $req.val();\n var user = $username.val();\n socket.emit('req-send', req, user);\n }", "async function handle(request, response) {\n console.log('request coming!!');\n let content;\n let paras = parseUrl(request.url);\n if(!Object.keys(paras).includes('tag')){\n //no tag -> page request\n let url = '../client' + request.url;\n // console.log(url);\n if (url.endsWith(\"/\")) url = url + \"index.html\";\n if (! url.endsWith(\".html\")) return fail(response, BadType, \"Not .html\");\n let file = \"\" + url;\n let content;\n try { content = await FS.readFile(file); }\n catch (err) { return fail(response, NotFound, file + \" Not found\"); }\n }\n else {\n switch (paras.tag) {\n case 'login':\n content = '0';\n users_info_data.checkUsersBasicValid((result) => {\n if (result) {\n content = '1';\n }\n reply(response, content);\n }, paras.username, paras.password);\n break;\n case 'signup':\n content = '0';\n users_info_data.insertUsersBasic(-1, '\\'' + paras.username + '\\'', '\\'' + paras.password + '\\'', '\\'' + paras.email + '\\'', (result) => {\n if (result) {\n content = '1';\n }\n reply(response, content);\n });\n break;\n }\n }\n}", "subscribeOnServer(subscriptionData) {\n let requestData = {\n method: \"POST\",\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(subscriptionData),\n };\n\n NotificationPushService.fetchServer(new Request(this.apiEndPointSubscribeUser, requestData));\n }", "function start_listening() {\n\n\t// Endpoint to send one way messages to the team. If a message is important it will appear on a user's feed\n\tthis.server.get('api/messages/send/team', (req, res) => {\n\n\t\tvar address = addresses[decodeURIComponent(req.params.id)];\n\t\tvar type = (typeof req.params.type === 'string') ? req.params.type : 'text';\n\t\tvar isImportant = (typeof req.params.isImportant === 'string' && req.params.isImportant === 'true') ? true : false;\n\n\t\tif (!address) {\n\t\t\tres.send('Sorry cannot find your bot, please re-add the app');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log(`Sending Message to team: isImportant=${isImportant}`);\n\n\t\ttry {\n\n\t\t\tvar quote = faker.fake(\"{{lorem.sentence}}\");\n\t\t\tvar msg = new builder.Message().address(address);\n\t\t\tif (isImportant) msg.channelData = { notification: { alert: 'true' } };\n\n\t\t\tif (type === 'text') msg.text(quote);\n\t\t\tif (type === 'hero') msg.addAttachment(utils.createHeroCard(builder));\n\t\t\tif (type === 'thumb') msg.addAttachment(utils.createThumbnailCard(builder));\n\n\t\t\tif (type === 'text') res.send('Look on MS Teams, just sent: ' + quote);\n\t\t\tif (type === 'hero') res.send('Look on MS Teams, just sent a Hero card');\n\t\t\tif (type === 'thumb') res.send('Look on MS Teams, just sent a Thumbnail card');\n\n\t\t\tbot.send(msg, function (err) {\n\t\t\t\t// Return success/failure\n\t\t\t\tres.status(err ? 500 : 200);\n\t\t\t\tres.end();\n\t\t\t});\n\t\t} catch (e) { }\n\t});\n\n\t// Endpoint to send one way messages to individual users\n\tthis.server.get('api/messages/send/user', (req, res) => {\n\n\t\tvar guid = decodeURIComponent(req.params.id);\n\t\tvar address = addresses[guid];\n\t\tvar user = decodeURIComponent(req.params.user);\n\t\tvar type = (typeof req.params.type === 'string') ? req.params.type : 'text';\n\t\tvar isImportant = (typeof req.params.isImportant === 'string' && req.params.isImportant === 'true') ? true : false;\n\n\t\tif (!address) {\n\t\t\tres.send('Sorry cannot find your bot, please re-add the app');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!user) {\n\t\t\tres.send('Sorry cannot find your user, please re-add the app');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\tstartConversation(user, guid, function (data) {\n\t\t\t\tvar newConversationId = data.id;\n\t\t\t\taddress.conversation.id = newConversationId;\n\t\t\t\tsendMessageToUser(address, type, res, isImportant);\n\t\t\t});\n\t\t} catch (e) { }\n\t});\n\n\tthis.server.post('api/messages', c.listen()); // bind our one way bot to /api/messages\n\n\t// When a bot is added or removed we get an event here. Event type we are looking for is teamMember added\n\tbot.on('conversationUpdate', (msg) => {\n\n\t\tconsole.log('Notify got message');\n\n\t\tif (!rest_endpoint) rest_endpoint = msg.address.serviceUrl; // This is the base URL where we will send REST API request\t\t\n\t\tif (!msg.eventType === 'teamMemberAdded') return;\n\n\t\tconsole.log('Sample app was added to the team');\n\t\tconsole.log(JSON.stringify(msg, null, 1));\n\n\t\tif (!Array.isArray(msg.membersAdded) || msg.membersAdded.length < 1) return;\n\n\t\tvar members = msg.membersAdded;\n\n\t\t// We are keeping track of unique addresses so we can send messages to multiple users and channels at the same time\n\t\t// Clean up so we don't blow up memory (I know, I know, but still)\n\t\tif (addresses.length > 100) {\n\t\t\taddresses = {};\n\t\t\ttenant_id = {};\n\t\t\taccess_token = {};\n\t\t}\n\n\t\tvar botmessage = new builder.Message()\n\t\t\t.address(msg.address)\n\t\t\t.text('Hello, I am a sample app. I am looking for the team members and will shortly send you a message');\n\n\t\tbot.send(botmessage, function (err) { });\n\n\t\t// Loop through all members that were just added to the team\n\t\tfor (var i = 0; i < members.length; i++) {\n\n\t\t\t// See if the member added was our bot\n\t\t\tif (members[i].id.includes('8aefbb70-ff9e-409f-acea-986b61e51cd3') || members[i].id.includes('150d0c56-1423-4e6d-80d3-afce6cc8bace')) {\n\n\t\t\t\tvar guid = uuid.v4();\n\t\t\t\ttenant_id[guid] = msg.sourceEvent.tenant.id; // Extracting tenant ID as we will need it to create new conversations\n\n\t\t\t\t// Find all members currently in the team so we can send them a welcome message\n\t\t\t\tgetMembers(msg, guid).then((ret) => {\n\n\t\t\t\t\tvar msg = ret.msg;\n\t\t\t\t\tvar members = ret.members;\n\n\t\t\t\t\tconsole.log('got members');\n\n\t\t\t\t\t// Prepare a message to the channel about the addition of this app. Write convenience URLs so \n\t\t\t\t\t// we can easily send messages to the channel and individually to any user\t\t\t\t\t\n\t\t\t\t\tvar text = `##Just added the Sample App!! \\n Send message to: `\n\t\t\t\t\ttext += `[Text](${host}/api/messages/send/team?id=${encodeURIComponent(guid)}) [Important](${host}api/messages/send/team?id=${encodeURIComponent(guid)}&isImportant=true)`;\n\t\t\t\t\ttext += ` | [Hero Card](${host}/api/messages/send/team?type=hero&id=${encodeURIComponent(guid)}) [Important](${host}api/messages/send/team?type=hero&id=${encodeURIComponent(guid)}&isImportant=true)`;\n\t\t\t\t\ttext += ` | [Thumbnail Card](${host}/api/messages/send/team?type=thumb&id=${encodeURIComponent(guid)}) [Important](${host}api/messages/send/team?type=thumb&id=${encodeURIComponent(guid)}&isImportant=true)`;\n\t\t\t\t\taddresses[guid] = msg.address;\n\n\t\t\t\t\tfunction getEndpoint(type, guid, user, isImportant) {\n\t\t\t\t\t\treturn `${host}/api/messages/send/user?type=${encodeURIComponent(type)}&id=${encodeURIComponent(guid)}&user=${encodeURIComponent(user)}&isImportant=${encodeURIComponent(isImportant)}`;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Loop through and prepare convenience URLs for each user\n\t\t\t\t\ttext += '\\n\\n';\n\t\t\t\t\tfor (var i = 0; i < members.length; i++) {\n\t\t\t\t\t\tvar user = members[i].id;\n\t\t\t\t\t\tvar name = members[i].givenName || null;\n\t\t\t\t\t\tguid = uuid.v4();\n\n\t\t\t\t\t\tvar nameString = (name) ? name : `user number ${i + 1}`;\n\t\t\t\t\t\ttext += `Send message to ${nameString}: `\n\t\t\t\t\t\ttext += `[Text](${getEndpoint('text', guid, user, false)}), `;\n\t\t\t\t\t\ttext += `[Text alert](${getEndpoint('text', guid, user, true)}), `;\n\t\t\t\t\t\ttext += `[Hero](${getEndpoint('hero', guid, user, false)}), ` \n\t\t\t\t\t\ttext += `[Hero Alert](${getEndpoint('hero', guid, user, true)}), `;\n\t\t\t\t\t\ttext += `[Thumb](${getEndpoint('thumb', guid, user, false)}), `\n\t\t\t\t\t\ttext += `[Thumb Alert](${getEndpoint('thumb', guid, user, true)})`;\n\t\t\t\t\t\ttext += '\\n\\n';\n\n\t\t\t\t\t\taddresses[guid] = JSON.parse(JSON.stringify(msg.address)); // Make sure we mae a copy of an address to add to our addresses array\n\t\t\t\t\t\ttenant_id[guid] = msg.sourceEvent.tenant.id; // Extracting tenant ID as we will need it to create new conversations\n\t\t\t\t\t}\n\n\t\t\t\t\t// Go ahead and send the message\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar botmessage = new builder.Message()\n\t\t\t\t\t\t\t.address(msg.address)\n\t\t\t\t\t\t\t.textFormat(builder.TextFormat.markdown)\n\t\t\t\t\t\t\t.text(text);\n\n\t\t\t\t\t\tbot.send(botmessage, function (err) {\n\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.log(`Cannot send message: ${e}`);\n\t\t\t\t\t}\n\n\t\t\t\t}, (err) => {\n\n\t\t\t\t});\n\n\t\t\t}\n\t\t}\n\t});\n}", "function unifiedServer(req, res) {\n // Get the Url Object\n const parsedUrl = url.parse(req.url, true);\n // Get the trimmed path\n const { pathname } = parsedUrl;\n const trimmedPath = pathname.replace(/^\\/+|\\/+$/g, \"\");\n // Get the HTTP method\n const method = req.method.toLowerCase();\n\n // Get the payload\n const decoder = new StringDecoder(\"utf-8\");\n let buffer = \"\";\n\n req.on(\"data\", data => {\n buffer += decoder.write(data);\n });\n req.on(\"end\", () => {\n buffer += decoder.end();\n const handler =\n typeof router[trimmedPath] !== \"undefined\"\n ? handlers[trimmedPath][method]\n : handlers.notFound;\n\n handler(buffer, (statusCode, payloadString) => {\n res.setHeader(\"Content-Type\", \"application/json\");\n res.writeHead(statusCode);\n res.end(JSON.stringify(payloadString));\n });\n });\n}", "function onGetDefaultRequest(req, res) {\n console.log('\\n----------------On Request---------------------:');\n console.log( req.method + ': ' + req.originalUrl);\n if (globalWs && globalWs.readyState == WebSocket.OPEN) {\n const uuid = genUUID(); \n const data = genDataToWs(req);\n resStore[uuid] = res;\n data['uuid'] = uuid;\n data['cookie'] = req.headers.cookie;\n // console.log('\\n=== send');\n // console.log(data);\n globalWs.send(JSON.stringify( data ));\n }\n else {\n res.status(500).end('WebSocket Not connected!');\n }\n}", "function sendPostResponse() {\n\t\t\t\t\t\n\t\t\t\t\tvar delaySend = false;\n\t\t\t\t\t// build appropriate response\n\t\t\t\t\tswitch(command) {\n\t\t\t\t\t\tcase 'end':\n\t\t\t\t\t\tcase 'continue':\n\t\t\t\t\t\t\tutils.info('server : Building \"continue\" response');\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\tmessage = {Op:'ok', id:deviceId};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'device_ready':\n\t\t\t\t\t\t\tutils.info('server : Building \"device_ready\" response:');\n\t\t\t\t\t\t\tvar task = device.taskGroup.getNextTest();\n\t\t\t\t\t\t\tif(task) {\n\t\t\t\t\t\t\t\tutils.info('\\tSending next task: ' + task);\n\t\t\t\t\t\t\t\tmessage = {Op:'ok', test:task};\n\t\t\t\t\t\t\t} else { // no more tasks, report\n\n\t\t\t\t\t\t\t\tutils.info('server : Is test done: ' + clientConnection.isTestDone);\n\t\t\t\t\t\t\t\tif(!clientConnection.isTestDone) {\n\t\t\t\t\t\t\t\t\tutils.info('server : setting istestdone to true');\n\t\t\t\t\t\t\t\t\tclientConnection.isTestDone = true;\n\t\t\t\t\t\t\t\t\tclientConnection.reporter.createReport();\n\t\t\t\t\t\t\t\t\tif(File.exists(path.join(END_GAME_LOCATION, 'Code', 'Main.js'))) {\n\t\t\t\t\t\t\t\t\t\tutils.info('\\tSending EndGame');\n\t\t\t\t\t\t\t\t\t\tmessage = {Op:'ok', test:'/' + END_GAME_LOCATION};\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tutils.info('is the next test ready?',\n\t\t\t\t\t\t\t\t clientConnection.isNextTestReady);\n\t\t\t\t\t\t\t\tif(clientConnection.isNextTestReady) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tclientConnection.isTestDone = false;\n\t\t\t\t\t\t\t\t\tclientConnection.isNextTestReady = false;\n\t\t\t\t\t\t\t\t\tdevice.taskGroup.restart();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tutils.info('\\tNo more tasks.');\n\t\t\t\t\t\t\t\t\tmessage = {Op:'nada'};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'sdk_social_test_start':\n\t\t\t\t\t\t\tutils.info('Adding US Social test set');\n\t\t\t\t\t\t\tdevice.addToTaskGroup(AUTO_SDK_SOCIAL_TEST_LOC);\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'social_test_start':\n\t\t\t\t\t\t\tutils.info('setting tests to social_test_start');\n\t\t\t\t\t\t\tdevice.setTaskGroup('Social_Tests', AUTO_SOCIAL_TEST_LOC);\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'task_finished':\n\t\t\t\t\t\tcase 'log_start':\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'log_end':\n\t\t\t\t\t\t\t// hold off on sending response if previous messages\n\t\t\t\t\t\t\t// have yet to be received\n\t\t\t\t\t\t\tif(clientConnection.isLogFinished()) {\n\t\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// if previous message never gets resent, we need to send\n\t\t\t\t\t\t\t\t// the response after a timeout\n\t\t\t\t\t\t\t\tif(delaySend === false) {\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t\t\tif(clientConnection.isDelayedResponseSet() === true) {\n\t\t\t\t\t\t\t\t\t\t\tutils.info('Did not receive all past messages in 2 minutes --> sending response (' + deviceId + ')');\n\t\t\t\t\t\t\t\t\t\t\tclientConnection.flush();\n\t\t\t\t\t\t\t\t\t\t\tclientConnection.sendDelayedResponse();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}, 120000);\n\t\t\t\t\t\t\t\t\tdelaySend = true;\n\t\t\t\t\t\t\t\t\tclientConnection.setDelayedResponse(response);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tmessage = '';\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(!delaySend) {\n\t\t\t\t\t\tsendResponse(200, message);\n\t\t\t\t\t}\n\n\t\t\t\t}", "function handler(request, response) {\n let urlObj = url.parse(request.url, true, false)\n\n console.log(`REQUEST URL PATH : ${urlObj.pathname}`);\n console.log(`REQUEST DIRECTORY : ${ROOT_DIR + urlObj.pathname}`);\n console.log(`REQUEST METHOD : ${request.method}`);\n\n let receivedData = \"\"\n\n request.on(\"data\", function (chunk) {\n receivedData += chunk\n })\n\n request.on(\"end\", function () {\n console.log(`REQUEST END`);\n console.log(`receivedData : ${receivedData}`);\n console.log(`type : ${typeof receivedData}`);\n\n if (request.method == \"GET\") {\n\n if (urlObj.pathname === \"/\") {\n urlObj.pathname += \"index.html\"\n }\n\n fs.readFile(ROOT_DIR + urlObj.pathname, function (err, data) {\n if (err) {\n console.log(err);\n response.writeHead(404)\n response.end(JSON.stringify(err))\n }\n\n response.writeHead(200, {\n \"Content-Type\": get_mine(urlObj.pathname)\n })\n\n response.end(data)\n })\n }\n if (request.method == \"POST\") {\n //capture post token json string\n if (urlObj.pathname.indexOf(\"token\") !== -1) {\n // let player = {\n // name: 'bob',\n // color: 'red',\n // balls: team1,\n // teamName:'team1',\n // } \n playerNumber++\n state.playerNumber = playerNumber\n players.push(JSON.parse(receivedData))\n state.players = players\n console.log(`current player: ${playerNumber}`);\n\n\n response.writeHead(200, {\n \"Content-Type\": MIME_TYPES['txt']\n })\n let grantToken = true\n if (playerNumber > 2) {\n grantToken = false\n }\n\n let sendBackObj = {//send back\n token: grantToken,\n state:state\n //let state = {\n // playerNumber:playerNumber,\n // players:[]\n // }\n }\n \n\n\n response.end(JSON.stringify(sendBackObj))\n }\n\n //client emit beforeunload event for calculate current player numbers\n if (urlObj.pathname.indexOf(\"unload\") !== -1) {\n console.log(\"got unload\")\n playerNumber--\n console.log(`unload number:${playerNumber}`)\n \n\n }\n\n }\n\n\n })//request end\n\n}//end handler", "function handleWsMessage(_event) {\n dbgLog(\"handleWsMessage: event.data=\"+_event.data);\n var msg;\n try {\n msg = JSON.parse(_event.data);\n } catch(e) {\n dbgLog(\"Irregular Json received. Ignore.\");\n return;\n }\n\n var reqDictItem=null, reqObj=null;\n var sucCb=null, errCb=null;\n var action=null, reqId=null, svrSubId=null, cliSubId=null;\n if (msg.requestId != undefined) {\n reqId = msg.requestId;\n reqDictItem = g_reqDict.getRequestByReqId(reqId);\n } else if (msg.subscriptionId != undefined) {\n //reqIdなし、subIdあり=subscribe notification の場合\n svrSubId = msg.subscriptionId;\n reqDictItem = g_reqDict.getRequestBySvrSubId(svrSubId);\n }\n reqObj = reqDictItem.reqObj;\n sucCb = reqDictItem.sucCb;\n errCb = reqDictItem.errCb;\n\n if (reqObj)\n action = reqObj.action;\n\n // case of 'get'\n if (action === \"get\") {\n if (isGetSuccessResponse(msg)) {\n dbgLog(\"Get: response success\");\n // get のsuccess では value のみ返す\n sucCb(msg.value);\n\n } else if (isGetErrorResponse(msg)) {\n dbgLog(\"Get: response fail\");\n errCb(msg.error);\n }\n // delete request from requestHash. delete even in error case\n g_reqDict.deleteRequest(reqId);\n\n // case of 'set'\n } else if (action === \"set\") {\n //TODO:\n if (isSetSuccessResponse(msg)) {\n dbgLog(\"Set: response success\");\n // get のsuccess では value のみ返す\n sucCb();\n\n } else if (isSetErrorResponse(msg)) {\n dbgLog(\"Set: response fail\");\n errCb(msg.error);\n }\n // delete request from requestHash. delete even in error case\n g_reqDict.deleteRequest(reqId);\n\n } else if (action === \"subscribe\") {\n // subId 通知の場合\n if (isSubscribeSuccessResponse(msg)) {\n // VISS発行のsubId を Dictに格納する\n g_reqDict.addSvrSubId(msg.requestId, msg.subscriptionId);\n\n } else if (isSubscribeErrorResponse(msg)) {\n dbgLog(\"--: <== 'subscribe' request was rejected\");\n errCb(msg.error.number);\n g_reqDict.deleteRequest(msg.requestId);\n\n // value 通知の場合\n } else if (isSubscriptionNotification(msg)) {\n // case of subscribeNotification\n\n // callbackで通知\n dbgLog(\"Subscribe: notification success: val= \" + msg.value);\n sucCb(msg.value);\n\n } else if (isSubscriptionNotificationError(msg)) {\n // noting to do special here. continue subscribe.\n // callbackで通知\n dbgLog(\"Subscribe: notification fail\" + msg.error.number);\n errCb(msg.error);\n\n }\n\n // TODO: subscriptionNotification は action=='subscription' になったらしい\n } else if (action === \"subscription\") {\n // VISS は未対応なので、まだ使わない。\n\n } else if (action === \"unsubscribe\") {\n dbgLog(\"WsMsg:unSubscribe: received\");\n\n // TODO:\n // unsubscribe responseをVISSから受け取った場合\n\n // 失敗ケース\n // unsub request を reqDict から削除 \n if (msg.error != undefined) {\n dbgLog(\"WsMsg:unSubscribe: fail: err=\"+ msg.error.number);\n // unsubscribe failed\n // - delete unsubscribe request from requestTable\n g_reqDict.deleteRequest(reqId);\n errCb(msg.error);\n\n // 成功ケース\n // sub request を reqDictから削除\n // unsub request を reqDict から削除 \n } else {\n dbgLog(\"WsMsg:unSubscribe: success: svrSubId=\"+ msg.subscriptionId);\n // unsubscribe success\n // - delete subscribe request from requestTable\n // - delete unsubscribe request from requestTable\n var targ_svrSubId = msg.subscriptionId; //unsub対象のsubscribeのsubId\n var targ_reqId = g_reqDict.convertSvrSubIdToReqId(targ_svrSubId); //subscribeのreqId\n g_reqDict.deleteRequest(targ_reqId); // delete subscribe's entry in reqTable\n g_reqDict.deleteRequest(reqId); // delete unsub's entry in reqTable\n sucCb();\n }\n } else if (action === \"unsubscribeAll\") {\n dbgLog(\"WsMsg:unSubscribeAll: received\");\n //TODO:\n\n if (msg.error != undefined) {\n dbgLog(\"WsMsg:unSubscribeAll: fail: err=\"+ msg.error.number);\n // unsubscribe failed\n // - delete unsubscribe request from requestTable\n g_reqDict.deleteRequest(reqId);\n errCb(msg.error);\n\n\n } else {\n dbgLog(\"WsMsg:unSubscribeAll: success: svrSubId=\"+ msg.subscriptionId);\n\n //var targ_svrSubId = msg.subscriptionId; //unsub対象のsubscribeのsubId\n //var targ_reqId = g_reqDict.convertSvrSubIdToReqId(targ_svrSubId); //subscribeのreqId\n //g_reqDict.deleteRequest(targ_reqId); // delete subscribe's entry in reqTable\n\n // 成功ケース\n // すべてのsubscribeエントリを、g_reqDictから消去する\n // - すべての cliSubIdDict エントリに対応するreqIdを取得\n // - reqId のエントリを mainDictから削除\n // - svrSubIdDicについても同じことを行う(ただし、mainDictからすべて削除済みのはず)\n // - cliSubIdDictと、svrSubIdDictを空にする\n\n //TODO:surata: デバッガで動作確認のこと\n g_reqDict.deleteAllSubscription();\n\n g_reqDict.deleteRequest(reqId); // delete unsub's entry in reqTable\n sucCb();\n }\n\n } else if (action === \"authorize\") {\n if (isAuthorizeSuccessResponse(msg)) {\n dbgLog(\"authorize: response: success\");\n sucCb(msg.TTL);\n } else if (isAuthorizeErrorResponse(msg)) {\n dbgLog(\"authorize: response: failure\");\n errCb(msg.error);\n }\n g_reqDict.deleteRequest(reqId); // delete unsub's entry in reqTable\n\n } else if (action === \"getVSS\") {\n if (isVssSuccessResponse(msg)) {\n dbgLog(\"getVSS: response: success\");\n var vss = JSON.stringify(msg.vss);\n sucCb(vss);\n } else if (isVssErrorResponse(msg)) {\n dbgLog(\"getVSS: response: success\");\n errCb(msg.error);\n }\n g_reqDict.deleteRequest(reqId); // delete unsub's entry in reqTable\n }\n }", "function sendNotification() {\n http.get(`/subscription/${subscritionId}`);\n}", "process(req, res){}", "function sendEmailNotification(emailBodyParameters, callback){\n //Variable for Logging the messages to the file.\n\n var logger = log.logger_rfq;\n\n //emailBodyParameters = JSON.parse(emailBodyParameters);\n var WHICH_HOST = hostDetails.WHICH_HOST;\n var postData = JSON.stringify({\n \"notificationIdentifier\" : emailBodyParameters.notificationIdentifier,\n \"toEmails\" : emailBodyParameters.toEmails,\n \"ccEmails\" : emailBodyParameters.ccEmails !== undefined ? emailBodyParameters.ccEmails : [],\n \"bccEmails\" : emailBodyParameters.bccEmails !== undefined ? emailBodyParameters.bccEmails : [],\n \"toMobileNumber\" : emailBodyParameters.toMobileNumber,\n \"emailAttachment\" : emailBodyParameters.emailAttachment,\n \"attachmentParams\" : emailBodyParameters.attachmentParams,\n \"emailAttachmentFileName\" : emailBodyParameters.emailAttachmentFileName,\n \"emailBodyParams\" : emailBodyParameters.emailBodyParams,\n \"smsBodyParams\": emailBodyParameters.smsBodyParams\n });\n\n var finalResponse = '';\n var postOptions = {\n path: '/notification/api/v1.0/sendNotification',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(postData)\n }\n };\n postOptions.host = WHICH_HOST.host; //setting host and port dynamically based on environment.\n postOptions.port = WHICH_HOST.port;\n\n var postReq = http.request(postOptions, function(res){\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n finalResponse = finalResponse + chunk;\n });\n res.on('end', function () {\n var result = JSON.parse(finalResponse);\n\n if(result.http_code === \"200\")\n {\n logger.debug(TAG + \"email Sent successfully for emailIdentifier: \" + emailBodyParameters.notificationIdentifier);\n return callback(false, result);\n }\n else\n {\n logger.error(TAG + \"Error in sending email Notification. result: \" + JSON.stringify(result));\n return callback(true, result);\n }\n });\n res.on('error', function (error) {\n logger.error(TAG + \"Error in sending email Notification .error: \" + error);\n return callback(true, error);\n });\n });\n // post the data\n postReq.write(postData);\n postReq.end();\n}", "onWorkerMsg(msg){\n\n if (msg.replyTo!=null){\n\n if (messageBuffer[msg.replyTo]!=undefined){\n\n //Store the reply in the buffer.\n messageBuffer[msg.replyTo].reply = msg;\n\n //Send the response to the client.\n messageBuffer[msg.replyTo].client.json({response:msg.payload});\n\n }\n\n }\n\n }", "function onRequest(c_req, c_res) {\n\n console.log('Method used: ' + c_req.method);\n\n //sleep.msleep(options.delay);\n var parsedURL = url.parse(c_req.url);\n\n var reqOptions = {\n\n host: options.server,\n path: parsedURL.path,\n port: options.port,\n localport: options.local_port,\n max_requests: options.max_requests\n };\n\n // get clients browser record\n var br_rec = c_req.headers[\"user-agent\"];\n\n // ensure this browser has its record in our browserRecords\n if (browserRecords[br_rec] === undefined) {\n browserRecords[br_rec] = [];\n }\n\n // delete the timestamps older than 10 minutes (= 10 * 60 * 1000 miliseconds)\n if (browserRecords[br_rec].length > 0 && browserRecords[br_rec][0] <= (Date.now() - (10 * 60 * 1000))) {\n browserRecords[br_rec].shift();\n }\n\n // if browser exceeds max_requests\n if (browserRecords[br_rec].length >= reqOptions['max_requests']) {\n console.log(\"Max Request limit exceeded! Connection Refused!\");\n c_res.statusCode = 429; // TOO MANY REQUESTS\n c_res.end(\"429 - MAX REQUEST EXCEEDED!\"); // end response\n return;\n }\n\n // add timestamp for the new request to browserRecords\n browserRecords[br_rec].push(Date.now());\n\n var c_data = \"\";\n\n c_req.setEncoding('binary');// allows us to get all kinds of data\n\n //storing data coming in client request in a string\n c_req.on('data', function (chunk) {\n c_data += chunk;\n });\n\n // processing the data in an event handler\n c_req.on('end', function () {\n\n reqOptions.method = c_req.method;\n reqOptions.headers = c_req.headers;\n\n reqOptions.headers['host'] = reqOptions.host + \":\" + reqOptions.port;\n\n var s_data = \"\";\n\n callbackFunc = function (res) {\n\n res.setEncoding('binary');\n\n res.on('data', function (chunk) {\n s_data += chunk;\n });\n\n res.on('end', function () {\n\n // Handling Redirect errors by parsing the new URL\n if (res.statusCode == 301 || res.statusCode == 302 || res.statusCode == 303 || res.statusCode == 307 || res.statusCode == 308) {\n var temp = url.parse(res.headers.location);\n console.log(res.headers.location);\n\n if (temp.protocol.startsWith(\"https\")) {\n\n c_res.statusCode = 405;// Method not allowed\n c_res.end(\"405 - HTTPS REDIRECT DENIED!\");// end response\n\n return;\n }\n\n reqOptions.host = temp.hostname;\n reqOptions.path = temp.path;\n reqOptions.port = temp.port;\n reqOptions.headers['host'] = temp.host + \":\" + ((temp.port == null) ? '80' : temp.port);\n\n //Since 303 error makes it a compulsion to use GET instead of POST request\n if (res.statusCode == 303) {\n reqOptions.method = \"GET\";\n c_data = \"\";\n }\n\n s_data = \"\";\n var s_req = http.request(reqOptions, callbackFunc).end(c_data, 'binary');\n }\n else {\n // No redirect ERROR\n var ext = require('path').extname(reqOptions.path);\n \n c_res.writeHead(res.statusCode, res.headers);\n c_res.end(s_data, 'binary');\n }\n });\n }\n var request = http.request(reqOptions, callbackFunc).end(c_data, 'binary');\n });\n}", "function handle (request, reply) {\n \n // extract the sns message type\n let type = request.headers[\"x-amz-sns-message-type\"];\n\n // handle subscription confirmation\n if (type == \"SubscriptionConfirmation\") {\n\n let sns = new aws.SNS({\n region: 'us-west-2'\n });\n\n // parse json payload\n let payload = JSON.parse(request.payload);\n\n // format params\n let params = {\n Token: payload.Token,\n TopicArn: payload.TopicArn\n };\n\n // confirm subscription\n sns.confirmSubscription(params, (err, data) => {\n\n if (err) {\n return reply(Boom.badImplementation());\n }\n\n // successful confirmation\n return reply();\n\n });\n\n } else if (type == \"Notification\") {\n\n // parse the json payload\n let payload = JSON.parse(request.payload);\n\n // explicitly handle an S3 notification\n if (payload.Subject == \"Amazon S3 Notification\") {\n\n let message = JSON.parse(payload.Message);\n\n // a notification may contain multiple\n // S3 notifications in a single message\n message.Records.forEach(record => {\n\n if (record.s3.configurationId != \"MyUploadNotification\") {\n return reply(Boom.badImplementation());\n }\n\n // split the key so we can extract\n // the user related information\n let parts = record.s3.object.key.split('/');\n\n if (parts.length != 3) {\n return reply(Boom.badImplementation());\n }\n\n let replay = {\n size: record.s3.object.size,\n aws_key: record.s3.object.key,\n account_id: parseInt(parts[0]),\n filename: parts[2]\n };\n\n // save the replay to the database\n Replays.insert(replay, function (err, response) {\n\n if (err) {\n return reply(Boom.badImplementation());\n }\n\n // successful reply to AWS\n return reply();\n\n });\n\n });\n\n }\n\n } else {\n\n // unknown type possibly\n return reply(Boom.badRequest());\n\n }\n\n}", "function reqCallback(brokerId, reqId, err, res){\n self._socket.send([brokerId, utils.stringify({'reqId': reqId, 'err': err, 'res': res})]);\n}", "sendDataToServer1() {\n //send http-request to hemmo-backend butto\n let host = 'http://127.0.0.1:3001';\n let link = '/data_to_server1';\n\n // host + link = 127.0.0.3000/data_to_server // require that kind of end point to backend to handle http-request\n //FETCH -> POST (head , body -> content-type: JSON ) ,\n let postData = {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(this.state),\n };\n\n fetch(host + link, postData)\n .then(resp => {\n return resp.json();\n })\n .then(r => {\n console.log('Fetch done successfuly !');\n //back-end response here\n //*********************************************************************** */\n this.state.additionalValue = 'http-respond, method=POST ' + r;\n this.setState(this.state);\n })\n .catch(err => {\n console.log('404 error, page not found');\n console.log('ERR', err);\n });\n\n console.log('Send http-request to end-point : ' + host + link);\n console.log('current message is :' + this.state.fieldvalue);\n }", "function send(req, _res){\n client.send(req.body).then(\n (res) => {\n //Handle successful API call\n logger.info(res)\n },\n (err) => {\n //Handle error making API call\n logger.error(err)\n })\n}", "callSendAPI(senderId, response, meta) {\n // Construct the message body\n let request_body = this.setupBody(senderId, response, meta);\n let request_data = this.setupRequest(request_body);\n\n if (process.env.DEBUG) {\n console.log(this.LOG, 'callSendAPI', request_body);\n } else {\n console.log(this.LOG, 'callSendAPI');\n }\n return this.predefinedCallSendAPI(request_data);\n }", "sendRequest(options,data) {\n\n return new Promise((resolve,reject) =>\n {\n let req = http.request(options, res => {\n // console.log(`statusCode: ${res.statusCode}`)\n res.on('data', d => {\n d = d.toString('utf8');\n resolve(d)\n })\n })\n \n req.on('error', error => {\n console.log(error)\n console.log(\"Another player did not connect within 3 minutes, or the server is no longer available\")\n \n if (this.connected) {\n this.closeRequest().then((response =>{\n console.log(response)\n process.exit()\n }))\n }\n else {\n process.exit()\n }\n \n \n \n })\n \n if (data !== undefined) {\n // console.log(\"data wrote\")\n req.write(data)\n }\n \n req.end()\n });\n \n }", "_respondToCustomer(response) {\n console.log('Sending response to customer:', response);\n if (Array.isArray(response)) {\n response.forEach(message => {\n this.socket.emit(AppConstants.EVENT_CUSTOMER_MESSAGE, message);\n });\n return;\n }\n this.socket.emit(AppConstants.EVENT_CUSTOMER_MESSAGE, response);\n // We're using Socket.io for our chat, which provides a synchronous API. However, in case\n // you want to swich it out for an async call, this method returns a promise.\n return Promise.resolve();\n }", "function onNotificationGCM(e) {\n\n switch( e.event )\n {\n case 'registered':\n if ( e.regid.length > 0 )\n {\n $.get(server_url + \"/register_phone?access_token=\"+access_token+\"&token=\"+e.regid+\"&platform=\"+device.platform).done(function(res) {\n return true;\n }).fail(function(res) {\n alert('error when registering phone');\n return false;\n });\n }\n break;\n\n case 'message':\n\n notification = {};\n notification.foreground = e.foreground;\n notification.type = e.payload.custom.t;\n\n if(notification.type == 'message') {\n notification.title = e.payload.title;\n notification.sender_id = e.payload.custom.s;\n }\n\n if(notification.type == 'match') {\n notification.name = e.payload.custom.n;\n notification.picture_url = e.payload.custom.p;\n notification.user_id = e.payload.custom.u;\n }\n\n doNotification(notification);\n\n break;\n\n case 'error':\n alert('error = ' + e.msg);\n break;\n }\n}", "function sendAndResponseServer() {\n if (document.URL.includes(\"checkout.html\")) {\n document.querySelector(\".form\").addEventListener(\"submit\", function (e) {\n e.preventDefault();\n let formData;\n formData = new FormData(this);\n let contact = {};\n formData.forEach(function (value, key) {\n contact[key] = value;\n });\n let valid = true;\n for (let input of document.querySelectorAll(\"form input\")) {\n valid &= input.reportValidity();\n if (!valid) break;\n }\n let products = Object.values(listProduct);\n if (valid) {\n fetch(\"http://localhost:3000/api/teddies/order\", {\n method: \"post\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ contact, products }),\n })\n .then((res) => res.text())\n .then((informations) => {\n let clientInformations = JSON.parse(informations);\n confirmation(\n clientInformations.contact.firstName,\n clientInformations.contact.lastName,\n clientInformations.orderId\n );\n })\n .catch((err) => console.error(err));\n } else {\n //error message if form is not valid\n addErrorMessageForm();\n }\n });\n }\n}", "function worker_conec_req(client, data) {\n if(client.type === \"worker\") {\n console.log(\"Key :\"+data);\n if(typeof data === \"undefined\" || data === null || data.toString() !== config.auth_key) {\n console.log(\"Wrong authentification\");\n client.end();\n } else {\n console.log(\"Received correct authentification\");\n var buf = new Buffer(1);\n buf.writeInt8(0,0);\n var header = new Header(Header.RES, Header.WORKER_CONNEC);\n var finalB = header.appendHeader(buf);\n console.log(finalB);\n console.log(finalB.toString());\n client.write(finalB, \"binary\", function() {\n client.worker.specsRequest();\n });\n client.isAuthenticated = true;\n client.worker = new Worker();\n \n //Here a worker is assigned to that client, but it's still not available in the QueuesHandler\n //We need its specs first\n client.worker.socket = client;\n client.worker.ipAddress = client.remoteAddress;\n }\n } else {\n console.log(\"Client not a worker => kick !\");\n client.end();\n }\n}", "function serverHandler(request, response) {\n try {\n console.log('request received: ' + request.url);\n\n if(request.url === '/') {\n response.writeHead(200, {'Content-Type': 'text/html'});\n response.end(fs.readFileSync('../client/index.html'));\n } else if(request.url === '/webrtc.js') {\n response.writeHead(200, {'Content-Type': 'application/javascript'});\n response.end(fs.readFileSync('../client/webrtc.js'));\n }else if(request.url === '/index2.css') {\n response.writeHead(200, {'Content-Type': 'application/javascript'});\n response.end(fs.readFileSync('../client/index2.css'));\n }\n else{\n request.end();\n }\n } catch (e) {\n response.writeHead(404, {\n 'Content-Type': 'text/plain'\n });\n response.write('<h1>Unexpected error:</h1><br><br>' + e.stack || e.message || JSON.stringify(e));\n response.end();\n }\n}", "function start_server(){\n\t\tconsole.log(`Huawei4G NodeJS Websocket Server Started OK. Listening on ws port: ${port}`)\n\n\t\tserver.on('connection', function(socket) {\n\n\t\t\t\t\t socket.on('message', function(message) {\n\t\t\t\t\t\tconsole.log( `Received from client: ${message}` )\n\t\t\t\t\t\tprocess_request(message, socket)\n\t\t\t\t\t });\n\n\t\t\t\t\t socket.on('close', function(msg, disconnect) {\n\t\t\t\t\t\tconsole.log(`A client disconnected.`);\n\t\t\t\t\t });\n\n\t\t});\n}", "talkBack(req, res) {\n res.status(200).send('I can hear you'); //sends back health res\n }", "launch(server) {\n const wss = new WebSocket.Server({server: server});\n\n wss.on('connection', (ws, req) => {\n let user;\n\n ws.on('message', async message => {\n\n // Answer ping request\n if (message === '__ping__') {\n return ws.send('__pong__');\n }\n\n // Try to parse message\n try {\n message = JSON.parse(message);\n } catch (ignored) {\n return;\n }\n\n const {type, value} = message;\n switch (type) {\n case 'register': {\n if (typeof value === 'string' && value) {\n user = await userModel.findOne({apikeys: {$elemMatch: {key: value}}});\n\n if (!user) {\n return;\n }\n\n const userid = user.id;\n if (!(userid in userMap)) {\n userMap[userid] = {\n websockets: [],\n lastBroadcast: 0\n };\n } else if (userMap[userid].websockets.includes(ws)) {\n return;\n }\n\n // Lookup ip info\n const lu = geoip.lookup(req.connection.remoteAddress);\n\n ws._sessionInfo = {\n id: Math.floor(Math.random() * 1e15).toString(16) + Date.now().toString(16),\n city: lu ? lu.city : 'Unknown',\n country: lu ? i18nCountries.getName(lu.country, 'en') : 'Unknown',\n device: userAgentParser(req.headers['user-agent'])\n };\n\n // Push to redis\n redisClient.rpush(userid.toString(), JSON.stringify(ws._sessionInfo));\n\n websocket.broadcast({\n userid,\n data: {\n type: 'open-session',\n value: ws._sessionInfo\n }\n });\n\n // Append websocket\n userMap[userid].websockets.push(ws);\n\n if (ws.readyState === 1) {\n\n // Approve registration\n ws.send(JSON.stringify({\n type: 'registration-approval',\n value: {\n lastBroadcast: userMap[userid].lastBroadcast,\n sessions: await websocket.getSessionsBy(userid)\n }\n }));\n }\n }\n\n break;\n }\n case 'broadcast': {\n if (user) {\n const container = userMap[user.id];\n\n // Broadcast message\n websocket.broadcast({\n ignored: ws,\n userid: user.id,\n data: JSON.stringify({\n type: 'broadcast',\n value\n })\n });\n\n // Update last broadcast timestamp\n container.lastBroadcast = Date.now();\n }\n break;\n }\n }\n });\n\n ws.on('close', () => {\n\n // Check if socket was registered\n if (user) {\n const {websockets} = userMap[user.id];\n const idx = websockets.indexOf(ws);\n\n // Remove socket\n if (~idx) {\n const [socket] = websockets.splice(idx, 1);\n\n if (socket) {\n\n // Remove from redis list\n // TODO: Memory leak?\n redisClient.lrem(user.id.toString(), 1, JSON.stringify(socket._sessionInfo));\n\n websocket.broadcast({\n userid: user.id,\n data: {\n type: 'close-session',\n value: socket._sessionInfo\n }\n });\n }\n }\n\n // Clean up if no connection is open anymore\n if (!websockets.length) {\n delete userMap[user.id];\n }\n }\n });\n });\n }", "function serverCall(){\t\t \n\n\t\t chai.request(server)\n\t\t .post('/saveTAHistory')\n\t\t .send(requestBody)\n\t\t .end(function(error, response) {\n\t\t\t util.checkBasicStructureApplicantResp(response);\n\t\t\t done();\n\t\t });\n\t }", "__handleResponse() {\n this.push('messages', {\n author: 'server',\n text: this.response\n });\n }", "function main() {\n setReqURL()\n startMicroservice()\n registerWithCommMgr()\n}", "function handleRequest(request, response){\n response.end('It Works!! Path Hit: ' + request.url);\n\tconsole.log(request);\n\tconsole.log(response);\n\tcontact_remote();\n}", "function HandleClientRequest(request)\n{\n try {\n var connection = request.accept(\"cute\", request.origin);\n\n // add new connection to our list\n conn[conn.length] = connection;\n connection.cuteName = GetAddr(request);\n\n // define a few member functions\n connection.Activate = Activate;\n connection.SendData = function(str) { this.send(str, function ack(error) { }) };\n connection.Respond = function() {\n this.SendData('C <span class=res>'+EscapeHTML(Array.from(arguments).join(' '))+'</span><br/>');\n };\n connection.Log = function() {\n Log('['+this.cuteName+'] '+Array.from(arguments).join(' '));\n };\n connection.HandleServerCommand = HandleServerCommand;\n\n // handle all messages from users here\n connection.on('message', function(message) { this.HandleServerCommand(message) });\n\n connection.on('close', function(reason) {\n // close user connection\n for (var i=0; i<conn.length; ++i) {\n if (conn[i] == this) {\n this.Log('Closed connection');\n conn.splice(i,1); // remove from list\n break;\n }\n }\n });\n\n // send opening message to our client\n connection.Respond(kBanner);\n connection.Respond('(' + foundAVRs, 'AVRs connected)');\n\n connection.Log('Connected'); // log this connection\n\n // send message indicating whether or not we are active\n connection.SendData('D ' + active);\n // send current motor state\n connection.SendData('E ' + lastSpd);\n\n // send measurement history (packet \"B\")\n for (var i=history.length-1; i>=0; --i) {\n if (history[i].length < 3) continue; // (don't send empty entries)\n connection.SendData('B ' + ((historyTime - i) % kPosHisLen) +\n ' ' + history[i].join(' '));\n }\n }\n catch (err) {\n Log('Error handling client request');\n }\n}", "function spConnect() {\n\n // use 'PushManager' to request a new PushServer URL endpoint for 'Mail' notifications:\n endpointRequest = navigator.push.register();\n // the DOMRequest returns 'successfully':\n endpointRequest.onsuccess = function( event ) {\n // extract the endpoint object from the event:\n endpoint = event.target.result;\n\n // if it is the first registration, need to register\n // the 'pushEndpoint' with the UnifiedPush server.\n if ( endpoint.pushEndpoint ) {\n // assemble the metadata for registration with the UnifiedPush server\n var metadata = {\n deviceToken: mailEndpoint.channelID,\n simplePushEndpoint: mailEndpoint.pushEndpoint\n };\n\n var settings = {\n success: function() {\n //success handler\n alert('Success')\n },\n error: function() {\n //error handler\n }\n };\n\n settings.metadata = metadata;\n\n // register with the server\n UPClient.registerWithPushServer(settings);\n } else {\n console.log(\"'Endpoint' was already registered!\");\n }\n };\n // set the notification handler:\n navigator.setMessageHandler( \"push\", function( message ) {\n if ( message.channelID === mailEndpoint.channelID ) {\n // let's react on the endpoint\n }\n });\n }", "function unifiedServer(req, res) {\n const parsedUrl = new URL(req.url, `http://${req.headers.host}`);\n\n const path = parsedUrl.pathname;\n const trimmedPath = path.replace(/^\\/+|\\/$/g, '');\n\n const method = req.method;\n const requestQuery = parsedUrl.searchParams;\n\n const headers = req.headers;\n\n // decoder for decoding buffers\n const decoder = new StringDecoder('utf8');\n let buffer = '';\n\n // called only for requests with body to handle incomming chunks from the stream\n req.on('data', (chunk) => {\n buffer += decoder.write(chunk); // decode each chunk and append to the earlier received chunks\n });\n\n // called for all requests regardless if they contain a body\n req.on('end', () => {\n buffer += decoder.end();\n\n // check if request path is among the available routes\n const selectedCallback = handlers[trimmedPath] || handlers.notFound\n\n // construct data to be sent to all handlers\n const data = {\n 'path': trimmedPath,\n 'method': method,\n 'query': requestQuery,\n headers,\n 'payload': buffer\n }\n\n selectedCallback(data, function(statusCode = 200, payload = {}) {\n const responseData = JSON.stringify(payload);\n\n res.setHeader('Content-Type', 'application/json')\n res.writeHead(statusCode);\n res.end(responseData);\n })\n })\n}", "function go(e) {\n e.preventDefault();\n // create socket\n socket = new WebSocket(process.env.SOCKET_URL);\n socket.onmessage = ((event) => {\n const msg = JSON.parse(event.data);\n const id = parseInt(msg.id);\n\n // !! NEW !!\n if (msg.warning) {\n // Warnings can come for many reasons, here we are dealing \n // with headset connections\n data_obj['warning'] = msg.warning;\n return;\n }\n\n // !! NEW !!\n if(msg.sid && response_funcs.has(msg.sid)) {\n // handle subscription data...\n response_funcs.get(msg.sid)(msg);\n return\n }\n\n if (!response_funcs.has(id)) { \n console.log(\"Got a bad message??\");\n console.log(event.data);\n return\n }\n response_funcs.get(id)(msg); // send the data to the callback\n });\n socket.onerror = (() => {\n alert(\"Web socket got an error?!?\");\n });\n socket.onopen = (() => {\n requestAccess();\n });\n }", "function PubRequest(data, cb) {\n console.log('----------> send a broadcast to request. ');\n var pub = new Redis({ port: 6379, host: '127.0.0.1'});\n var clientid = data.clientid;\n var requestid = data.requestid;\n var brokerid = data.brokerid;\n pub.hgetall(\"hm-user.\"+brokerid, function(err, brokerprofile) {\n console.log('A broker says i have it to request id: ', requestid);\n\n var matchdata = {\n matchid: requestid+\".\"+brokerid,\n requestid: requestid,\n brokerid: brokerid,\n photo: brokerprofile.photo,\n firstname: brokerprofile.first_name,\n lastname: brokerprofile.last_name,\n brokerlisc: brokerprofile.brokerlisc,\n yrexam: brokerprofile.yrexam,\n matchcreated: Date.now()\n }\n\n pub.hmset(\"hm-match.\"+requestid+\".\"+brokerid, matchdata);\n\n // psubrooms(requestid,clientid,brokerid, function(result){\n // cb(\"broadcast\", JSON.parse(result));\n // });\n\n pub.publish(clientid+\".\"+requestid, JSON.stringify(brokerprofile)); //broadcast to client\n cb(\"success\", \"I have it sent to client.\");\n\n });\n}", "function handleRequest1(request, response) {\n\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"That hat looks great on you!\");\n}", "async function serverHandler(request, response) {\n const uri = url.parse(request.url).pathname;\n const filename = path.join(process.cwd(), uri);\n\n const collect = await require('./router/collect')(address, port, filename, request);\n if (typeof collect !== 'undefined') {\n response.writeHead(200);\n response.write(collect);\n response.end();\n return;\n }\n\n const identify = await require('./router/identify')(address, port, filename, request);\n if (typeof identify !== 'undefined') {\n response.writeHead(200);\n response.write(identify);\n response.end();\n return;\n }\n\n const generate = await require('./router/generate')(address, port, filename, request);\n if (typeof generate !== 'undefined') {\n response.writeHead(200);\n response.write(generate);\n response.end();\n return;\n }\n\n fs.exists(filename, function (exists) {\n if (!exists) {\n response.writeHead(404);\n response.write('404 Not Found: ' + filename + '\\n');\n response.end();\n return;\n }\n\n fs.readFile(filename, 'binary', function (err, file) {\n if (err) {\n response.writeHead(500);\n response.write(err + '\\n');\n response.end();\n return;\n }\n\n response.writeHead(200);\n response.write(file, 'binary');\n response.end();\n });\n });\n}", "function startServer(){\n listDevices.startAttendaceServer(UserName);\n startMessageServer();\n console.log('did');\n}", "function listenForAPICalls (port) {\n \n // Create a coap server with a callback handling all requests\n var coapServer = coap.createServer(function(request, response) {\n console.log(' Received request: ' + request.url + ' method: ' + request.method + ' CODE: ' + request.code + ' Observe flag (0 states Observe) ' +\n request.headers['Observe'] + ' Payload: ' + request.payload + ' Remote Socket: ' + JSON.stringify(request.rsinfo) );\n\n var parsedURL = url.parse (request.url); \n // console.log ('href = ' + parsedURL.href + ' pathname = ' + parsedURL.pathname + ' query string = ' + parsedURL.search); \n \n \n // Handle call to test API \n if (parsedURL.pathname == '/test') {\n \n // Normal GET request. Respond immediately that no fall has been detected\n if (request.headers['Observe'] !== 0) {\n response.end('test vakue');\n }\n \n // Observe\n else {\n // console.log ('Falldetect Observe GET request received');\n \n // First ACK that request has been received \n response.write('1st observe response, Ack on /test');\n console.log ('1st observe response sent, Ack on /test');\n \n // Then after 3 seconds send message that fall has been detected\n setTimeout(function() {\n response.write('2nd observe response'); \n console.log ('2nd observe response sent');\n }, 3000); \n \n } \n } \n \n // Illegal request \n else {\n console.log ('Illegal request. Pathname= ' + parsedURL.pathname);\n response.end('Illegal request. Pathname= ' + parsedURL.pathname); \n \n } \n \n\n\n }); \n \n // Setup the CoAP-server to listen to a port\n coapServer.listen(port, function() {\n console.log(' CoAP server is listening on port ' + port);\n });\n \n}", "function generalPOST ( genHost, genPath, post_data,portNum, err, res )\n{\n if( typeof(portNum) == 'undefined' )\n {\n portNum = '3000';\n if (debug) console.log(\"Using default port\");\n }\n // check if arg param err does not exist\n if (typeof(err) != \"function\")\n {\n err = function(e) \n {\n if(debug) console.log(\"Lost connection to \" + genHost + \"removing from ring\");\n\n removeRingMember(genHost);\n\n// processApproval(genHost);\n\n if(debug) console.log(\"generalPOST err called \"+ e);\n };\n }\n\n // check if arg param res does not exist\n if (typeof(res) != \"function\")\n {\n res = function(r) {} ;\n }\n\n var dataString = JSON.stringify( post_data );\n\n var headers = {\n 'Content-Type': 'application/json',\n 'Content-Length': dataString.length\n };\n\n var post_options = {\n host: genHost,\n port: portNum,\n path: genPath,\n method: 'POST',\n headers: headers\n };\n\n var post_request = http.request(post_options, function(res){\n res.setEncoding('utf-8');\n \n var responseString = '';\n\n res.on('data', function(data){\n responseString += data;\n });\n\n res.on('end', function(){\n //var resultObject = JSON.parse(responseString);\n });\n });\n \n post_request.on('error', err );\n post_request.write(dataString);\n post_request.end();\n}", "function handleResponse(req, cmd)\n\t{\n\t\treturn function()\n\t\t{\n\t\t\ttry \n\t\t {\n\t\t if (req.readyState === XMLHttpRequest.DONE) \n\t\t {\n\t\t if (req.status === 200) \n\t\t { \n\t\t var result = req.responseText;\n\t\t result = result.trim();\n\t\t \n\t\t if(result === \"Success\")\n\t\t { //Update the mode content\n\t\t \t updateContent(cmd);\n\t\t \t \n\t\t }\n\t\t else if(result.startsWith(\"SuccessCapture:\"))\n\t\t { //Update the mode content to capture with capture ip\n\t\t \t updateCaptureContent(cmd, result);\n\t\t }\n\t\t else if(result.startsWith(\"Error\"))\n\t\t {\n\t\t \t showMsg(result) ;\n\t\t }\n\t\t else\n\t\t {\n\t\t \t//Some other content such as redirection back to main login \n\t\t\t //when session expires\n\t\t\t window.location.reload(true);\n\t\t \t \n\t\t }\n\t\t } \n\t\t else \n\t\t {\n\t\t \tshowMsg(\"Error sending request to server \") ;\n\t\t }\n\t\t }\n\t\t }\n\t\t catch( e ) \n\t\t {\n\t\t \t showMsg(\"Error sending request to server \") ;\n\t\t }\n\t\t\t\n\t\t \n\t\t};\n\t\t\n\t}", "function initialRequests() {\n socketService.getUserData()\n .success(function (resp) {\n $rootScope.main.responseStatusHandler(resp);\n $scope.userData = globals.userData(resp.userData);\n $rootScope.main.broadcastUserData();\n\n if ($scope.userData.isRegistered) {\n //join a socketRoom for websocket connection, equivalent to user's uniqueCuid\n socket.emit('joinRoom', {\n room: resp.userData.uniqueCuid\n });\n }\n })\n .error(function (errResponse) {\n $rootScope.main.responseStatusHandler(errResponse);\n });\n }", "function handleRequestOne(request, response) { //whats the request? req to the url.\n//\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"You are a javascript wizard! \" + request.url);\n} //creates the strung & sends it back to the browser.", "function sendSubscriptionToPushServer() {\n http.post(\"/subscription\", userSubscrition).then(function(response) {\n subscritionId = response.id;\n sendPushNotificationButton.disabled = false;\n });\n}", "_scheduleSendResponseMessage() {\n\n }", "function handleRequestsInBrowser(listenForRequests) {\n // booted up with a listen function that gets requests sent from the baseServer\n }", "function reqHandler(req, res){\n console.log(\"We have a server request from \" + req.url);\n if(req.url === \"/\"){\n res.end(\"Welcome to my Hompage!\");\n }\n else if(req.url === \"/about\"){\n res.end(\"This is the about page\");\n }\n else if(req.url === \"/contact\"){\n res.end(message + randomNum());\n }\n else{\n res.end(\"Page not found\");\n }\n}", "function sendAlert(){\n\t\n\t// Request\n\tvar request = require('request');\n\t\n\t// Somebody has been detected\n\tif (value['value'] == true){\n\t\t\n\t\tvar subject = 'Alerte intrusion';\n\t\tvar message = 'Une présence a été détectée';\n\n\t// Nobody's here since few minutes\n\t} else {\n\n\t\tvar subject = 'Alerte intrusion terminée';\n\t\tvar message = 'Aucune présence détectée depuis 4 minutes';\n\t}\n\t\n // Configure the request to the multipush service\n var options = {\n url: \"http://localhost:9091/multipush\",\n method: 'GET',\n qs: {'subject': subject, 'message': message, 'canal': 'mail,sms,openkarotz'}\n } \n \n // Sending the request\n request(options, function (error, response, body) {\n if (!error && response.statusCode == 201) {\n \tconsole.info('Alert sent');\n } else {\n \tconsole.error('Alert error : %s', error);\n }\n });\n}", "function route(handle, pathname, response, postData) {\n console.log(\"The route for path: %s, data: %s\", pathname, postData);\n if ( pathname == '/') {\n response.write(\"The index pages is blank.\");\n response.end();\n return;\n }else if ( pathname == '/ws') {\n var wsclient = response;\n var message = postData;\n wsclient.send(\"I have got your message whose length is \" + postData.length);\n // Handle message\n handleWSMsg(wsclient, message);\n return;\n }else if ( pathname == '/callapi' ) {\n //This is for remote call api in internet browser.\n if ( postData === null || postData.length === 0 ){\n response.writeHead(404, {'Content-Type': 'text/plain'});\n response.write(\"Invalid callapi\");\n response.end();\n return;\n }\n var postDataJSON=JSON.parse(postData);\n var args=postDataJSON.args;\n var apiPathArr=postDataJSON.api.split(\".\");\n var sendresponse = function(){\n response.writeHead(200, {\"Content-Type\": mimeTypes[\"js\"]});\n response.write(JSON.stringify(Array.prototype.slice.call(arguments)));\n response.end();\n }\n args.unshift(sendresponse);\n handle[apiPathArr[0]][apiPathArr[1]].apply(null, args);\n return;\n }else if ( pathname.lastIndexOf(\"/callapp/\", 0) === 0) {\n // This is for remote open app in internet browser.\n // request url: /callapp/ + appID + / + request file name\n var url = pathname.replace(/^\\//, '').split('/'),\n sAppID = url[1],\n sFilename = path.join.apply(this, url.slice(2));\n // var sAppName=pathname.substring(9, pathname.indexOf('/', 10));\n // var sFilename=pathname.substring(9 + sAppName.length + 1, pathname.length);\n /* var runapp=null; */\n // var app;\n // for(var i = 0; i < config.AppList.length; i++) {\n // app = config.AppList[i];\n // if (app.name == sAppName) {\n // runapp=app;\n // break;\n // }\n /* } */\n\n var runapp = appManager.getRegistedInfo(sAppID),\n rootPath = (runapp.local ? '' : config.APPBASEPATH);\n if(runapp === null) {\n console.log(\"Error no app \" + sAppID);\n response.writeHead(404, {\n 'Content-Type': 'text/plain'\n });\n response.write(\"This request URL \" + pathname + \" was not found on this server.\");\n response.end();\n return;\n }\n\n if(sFilename === \"index.html\") {\n getRealFile(path.join(rootPath, runapp.path, sFilename), response);\n } else if(sFilename === \"lib/api.js\") {\n getRealFile(path.join(rootPath, runapp.path, \"lib/api_remote.js\"), response);\n } else if(sFilename.lastIndexOf(\"lib/api/\", 0) === 0 \n && sFilename.indexOf(\".js\", sFilename.length - 3) !== -1) {\n var modulename = sFilename.substring(8, sFilename.length - 3);\n getRemoteAPIFile(handle, modulename, response);\n } else {\n getRealFile(path.join(rootPath, runapp.path, sFilename), response);\n }\n return;\n } else {\n //Use api_remote.js for /lib/api.js\n var realPath;\n if (pathname == \"/lib/api.js\") {\n pathname = \"./lib/api_remote.js\";\n getRealFile(pathname, response);\n return;\n }else if (pathname.lastIndexOf(\"/lib/api/\", 0) === 0 && pathname.indexOf(\".js\", pathname.length - 3) !== -1) {\n var modulename = pathname.substring(9, pathname.length - 3);\n getRemoteAPIFile(handle, modulename, response);\n return;\n }else {\n getRealFile(pathname, response);\n return;\n }//end of /lib/api/***.js\n }//end of if callapi callapp and else\n}", "async handleRequest(req, sendResponse) {\n return this.handleRequestBody(req, sendResponse)\n }", "ServerCallback() {\n\n }", "registerPost (request, response) {\n // Save class this in variable as this is not defiend\n // as this router class inside callback functions.\n const router = this;\n // Send data to user controller for registration.\n this.users.register(request.body, function (error, result) {\n // Confirm there was no error in registration.\n if (!error){\n // Confirm the result.\n if (result){\n // If there was a result send json and set response message to success.\n response.writeHead(200, {\"Content-Type\": \"application/json\"}); // Status 200: All OK.\n response.end(JSON.stringify({status: true, message: 'You have been registered.'}));\n } else {\n // If there was a false result set message to the username was taken.\n response.writeHead(200, {\"Content-Type\": \"application/json\"}); // Status 409: Conflict.\n response.end(JSON.stringify({status: false, message: router.taken}));\n }\n } else {\n // If there was an error registering the user set message to error message.\n response.writeHead(200, {\"Content-Type\": \"application/json\"}); // Status 500: Internal server error.\n response.end(JSON.stringify({status: false, message: router.error}));\n console.error(error);\n }\n });\n }", "function run_request(req, reply){\n if(router){\n router(req, function(error, answer){\n if(error){\n logger.error(error);\n }\n reply(error, answer);\n }, function(){\n process.nextTick(function(){\n warehouse_proxy(req, reply); \n })\n })\n }\n else{\n process.nextTick(function(){\n warehouse_proxy(req, reply);\n })\n }\n }", "function replyFunction(err, data, response) {\n if(err) {\n console.log(\"Unable to to post reply!\");\n } else {\n console.log(\"Reply posted!\");\n }\n }" ]
[ "0.64631295", "0.6420052", "0.6390667", "0.6386358", "0.6368065", "0.62666863", "0.62128633", "0.6205268", "0.61738414", "0.6150401", "0.606214", "0.60494465", "0.6041068", "0.6037845", "0.6031522", "0.601927", "0.6010661", "0.5996427", "0.5984185", "0.5979232", "0.5976719", "0.59570986", "0.59371173", "0.591979", "0.5904682", "0.59009033", "0.5899294", "0.58832836", "0.58701", "0.5853858", "0.58494073", "0.5836276", "0.58288974", "0.5816025", "0.58093643", "0.580463", "0.58004355", "0.5789456", "0.5785296", "0.5782585", "0.57768106", "0.5762695", "0.57511973", "0.57453346", "0.57451016", "0.57426757", "0.5730291", "0.5727965", "0.570425", "0.5699773", "0.56920844", "0.5682711", "0.56820464", "0.5678067", "0.56670755", "0.5666747", "0.5656073", "0.5648066", "0.564422", "0.5631172", "0.562922", "0.562493", "0.5624518", "0.5618054", "0.56171346", "0.56132084", "0.56122106", "0.5607314", "0.56060475", "0.5605756", "0.56032276", "0.56022334", "0.55996037", "0.55989486", "0.5593659", "0.55931115", "0.5592474", "0.5583515", "0.5577255", "0.55719286", "0.5567166", "0.5562376", "0.55490357", "0.5548363", "0.55413", "0.5528088", "0.55262464", "0.5523741", "0.5516253", "0.5516043", "0.55129164", "0.55022496", "0.5500228", "0.54971117", "0.5492639", "0.5483849", "0.548304", "0.54805076", "0.54751873", "0.5474403" ]
0.5648917
57
Generating markup for each position from the array of the bookmarks. Stored in the model module in 'state' variable. Called in the controller module.
_generateMarkup() { return this._data.map(result => PreviewView.render(result, false)).join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderBookmarkList() {\n \n \n const bookmarkItemsString = generateBookmarksString(store.bookmarks);\n \n // insert that HTML into the DOM\n $('.js-bookmark-list').html(bookmarkItemsString);\n \n\n}", "function createBookmarksList(bookmarks) {\n\n // Reset next bookmark ID\n BookmarkShowcaseState.nextBookmarkId = 1;\n\n // Set bookmarks array to the report's fetched bookmarks\n BookmarkShowcaseState.bookmarksArray = bookmarks;\n\n // Build the bookmarks list HTML code\n var bookmarksList = $('#bookmarksList');\n for (let i = 0; i < BookmarkShowcaseState.bookmarksArray.length; i++) {\n bookmarksList.append(buildBookmarkElement(BookmarkShowcaseState.bookmarksArray[i]));\n }\n\n // Set first bookmark active\n if (bookmarksList.length) {\n let firstBookmark = $('#' + BookmarkShowcaseState.bookmarksArray[0].name);\n\n // Apply first bookmark state\n onBookmarkClicked(firstBookmark[0]);\n }\n}", "function render(){\n let bookmarks = [...STORE.bookmarks];\n // filter bookmark list\n if(STORE.searhTerm){\n bookmarks = bookmarks\n .filter(bookmark => bookmark.rating >= STORE.searhTerm);\n }\n const bookmarkString = generateHtmlString(bookmarks);\n console.log(bookmarks);\n // render html elements\n $('.js-container').html(bookmarkString);\n }", "render() {\n const bookmarkItems = this.state.bookmarks.map(item => (\n <BookmarkItem\n key={item.id}\n item={item}\n copyUrl={this.copyUrl}\n isCopied={this.state.isCopied}\n displayTooltip={this.displayTooltip}\n />\n ));\n return (\n <div className=\"bookmark-list-container\">\n <div className=\"bookmark-list\">{bookmarkItems}</div>\n </div>\n );\n }", "function renderBookmarkButton() {\r\n let bookmarklist = document.getElementsByClassName('bookmark');\r\n let list = document.getElementById('bookmarkButtons');\r\n while (list.hasChildNodes()) {\r\n list.removeChild(list.firstChild);\r\n }\r\n for (let i = 0; i < bookmarklist.length; i++) {\r\n let btn = document.createElement('button')\r\n btn.innerHTML = i;\r\n btn.addEventListener('click', function () { scrolltoBookmark(i) })\r\n list.appendChild(btn);\r\n }\r\n }", "function updateBookmarks() {\n bookmarksList.forEach((value) => {\n // Create a new div for bookmark to add it to the document\n const bookmark = document.createElement('div');\n bookmark.classList.add('bookmark');\n bookmark.setAttribute('data-index', value.id);\n // Set its innerHTML\n bookmark.innerHTML = `\n <img src=\"https://s2.googleusercontent.com/s2/favicons?domain=${value.url}\" alt=\"favicon\" class=\"head\" />\n <p class=\"body\">${value.title}</p>\n <div class=\"tail\">\n <a href=\"${value.url}\" target=\"_blank\"><i class=\"link fas fa-external-link-alt\"></i></a>\n <i class=\"trash fas fa-trash-alt\" onclick=\"deleteBookmark(${value.id})\"></i>\n </div>\n `;\n // Append to the bookmarks\n bookmarks.append(bookmark);\n });\n}", "function renderNotes() {\r\n for (var i = 0; i < notesListLS.length; i++) {\r\n createMarkup(i);\r\n }\r\n}", "function loadBookmarks(bm)\n {\n let lb = $(\"#listOfBookmarks\");\n\n\n //debug(bm);\n\n // bm and slider clear\n lb.empty();\n sliderBookMarks.empty();\n\n bm.sort((a, b) => {\n if (+a.pos > +b.pos)\n return 1;\n if (+a.pos < +b.pos)\n return -1;\n\n return 0;\n });\n\n for(let k in bm)\n {\n if (bm.hasOwnProperty(k))\n {\n let tmp = $(`<div data-id=\"${bm[k]._id}\">\n <div class=\"bookmark-pos hide\">${bm[k].pos}</div>\n <div class=\"bookmark-title contenteditable\">${bm[k].title}</div>\n <div class=\"bookmark-text contenteditable\">${bm[k].text}</div>\n <a class=\"icon btn-bookmark-goto\">${bm[k].pos}</a>\n <a class=\"icon btn-bookmark-edit online\">E</a>\n <a class=\"icon btn-bookmark-save online\">S</a>\n <a class=\"icon btn-bookmark-delete online\">D</a>\n </div>`).addClass(\"bookmark\").data(\"pos\", bm[k].pos);\n\n lb.append(tmp);\n\n let el = $(\"<div></div>\")\n .addClass(\"mark-user\")\n .css(\"top\", bm[k].pos / maxPos * sliderHeight)\n .data(\"pos\", bm[k].pos)\n .click(function() {\n thus.jmp($(this).data(\"pos\"));\n\t thus.selectEl($(this).data(\"pos\"), \"jump\");\n });\n\n sliderBookMarks.append(el);\n }\n\n }\n\n thus.__int__bookmark.reset();\n }", "function generateBookmarksListHTML(arrayOfBookmarks, filterValue) {\n return mapFilterBookmarks(\n filterBookmarks(arrayOfBookmarks, filterValue)\n );\n }", "function showBookmarks(bookmarks) {\n var links = getLinks();\n\n for (var i = 0; i < links.length; i++) {\n links[i].classList.remove('bookmarked');\n }\n\n\n bookmarks.forEach(function (bookmark) {\n element = document.getElementById(bookmark);\n element.classList.add('bookmarked');\n });\n}", "function render() {\n if (!store.started) {\n if(store.filtered === false){\n $(\"main\").html(template.startPage());\n const html = template.generateBookmarkStrings(store.items);\n $('#bookmarkResults').html(html);\n } else{\n $(\"main\").html(template.startPage());\n $('#minimumRating').val(store.minimum);\n const filter = store.items.filter(bookmark => {\n return bookmark.rating >= store.minimum;\n \n })\n const html = template.generateBookmarkStrings(filter);\n $('#bookmarkResults').html(html);\n }\n \n \n } else {\n $(\"main\").html(template.newBookmarkTemp());\n }\n}", "static displayBookmarks(){\n \tvar bookmarks = JSON.parse(localStorage.getItem('bookmarks'));\n var websiteList = document.querySelector(\".website-list\");\n websiteList.innerHTML = \"\";\nif(bookmarks !== null){\n for(var i=0; i<bookmarks.length; i++){\n \tlet name = bookmarks[i].name;\n \tlet url = bookmarks[i].url;\n \twebsiteList.innerHTML += `<div class=\"list\">\n \t<h3>${name}</h3>\n \t<a class=\"vis-web\" target=\"_blank\" href=\"${url}\">Visit</a>\n \t<a class=\"delete\" onclick=deleteBookMark(\"${url}\") href=\"#\">Delete</a>\n \t</div>`\n }\n}\n }", "set bookmarks(value) { this._bookmarks = value; }", "function fetchBookmarks() {\n // This simply defines it so on body in HTML file we need to put onload=fetchBookmarks() in <body> tag\n var bookmarks = JSON.parse(localStorage.getItem('bookmarks'));\n\n // Get output Id\n var bookmarksResults = document.getElementById('bookmarksResults');\n\n //Build output\n bookmarksResults.innerHTML = '';\n\n for (var i = 0; i < bookmarks.length; i++) {\n var name = bookmarks[i].name;\n var url = bookmarks[i].url;\n\n bookmarksResults.innerHTML += '<h3>' + name +\n ' <a class=\"btn btn-default\" target=\"_blank\" href=\"' + url + '\">Visit</a> ' +\n ' <a onclick=\"deleteBookmark(\\'' + url + '\\')\" class=\"btn btn-danger\" href=\"#\">Delete</a> ' +\n '</h3>' +\n '</div>';\n }\n}", "function generateBookmarkItem(bookmark){\n if (bookmark.expanded === true){\n return `\n <li class=\"list-item\" data-id=${bookmark.id}>\n <h2 class=\"click-to-expand\">${bookmark.title}</h2>\n <p>${bookmark.rating}</p>\n <p>${bookmark.desc}</p>\n <button class=\"url-button\">\n <a href=\"${bookmark.url}\">Visit site</a>\n </button>\n <button class=\"delete-button\">Delete</button>\n </li>\n `;\n } else {\n return `\n <li class=\"list-item\" data-id=${bookmark.id}>\n <h2 class=\"click-to-expand\">${bookmark.title}</h2>\n <p>Rating: ${bookmark.rating}</p>\n </li>\n `;\n };\n}", "function renderBookmarks(pageNumber = pagination.currentPage) {\n readAll(bookmarks => renderLinks(bookmarks, pageNumber));\n}", "function fetchBookmarks() {\n\t// Get bookmarks from localStorage (code duplicated from the else pathway in the saveBookmark function)\n\tconst bookmarks = JSON.parse(localStorage.getItem(\"bookmarks\"));\n\n\t// Get output id\n\tconst bookmarkResults = document.getElementById(\"bookmarkResults\");\n\n\t// Build the result outputs\n\tbookmarkResults.innerHTML = \"<li></li>\";\n\n\t//--- Now we're going to loop through all of the bookmarks in localStorage and output them into the unordered li as list items\n\t///--- The for() loop iterates over each bookmark in the array of bookmarks as stored in local storage\n\tfor (var i = 0; i < bookmarks.length; i++) {\n\t\t//--- This creates a variable storing the name and URL for each bookmark\n\t\tconst name = bookmarks[i].name;\n\t\tconst url = bookmarks[i].url;\n\n\t\tbookmarkResults.innerHTML +=\n\t\t\t\"<li>\" +\n\t\t\tname +\n\t\t\t' <a class=\"savedLink\" target=\"_blank\" href=\"' +\n\t\t\turl +\n\t\t\t'\">' +\n\t\t\turl +\n\t\t\t\"</a>\" +\n\t\t\t' <button class=\"deleteSavedBookmark\" onclick=\"deleteBookmark(\\'' +\n\t\t\turl +\n\t\t\t\"')\\\">Remove</button> \";\n\t\t(\"</li>\");\n\t}\n}", "function makeBookmarks(){\n for (var i=0; i<localStorage.length; i++) \n { \n var aKey = localStorage.key(i); \n $('#myeventlist').append( '<span style=\"font-weight:bolder;\">' + aKey + '</span><br><a class=\"btn btn-default\" href=\"' + localStorage.getItem(aKey) + '\" target=\"_blank\">Event Page</a><a id=\"bmr' + i.toString() + '\" class=\"btn btn-default href=\"javascript:void(0);\" onclick=\"removeOneBookmark(this.id)\">Remove This Bookmark</a><hr>')\n \n } \n}", "function generateHtmlString(bookmarks){\n const bookmarkString = bookmarks\n .map(bookmark => generateHtmlBookmarkElement(bookmark))\n .join('');\n\n let formString = '<div id=\"js-form-select\"><button type = \"button\" id =\"js-add-bookmark\" > Add Bookmark</button><select id=\"js-dropdown-rating\" class=\"dropdown-rating\"><option value=\"0\">Select minimum rating</option><option value=\"5\">5 Stars</option><option value=\"4\">4 Stars</option><option value=\"3\">3 Stars</option><option value=\"2\">2 Stars</option><option value=\"1\">1 Star</option></select></div>';\n\n if (STORE.isFormVisible){\n formString = `<form role=\"search\" id=\"js-add-bookmark-form\">\n <h3 id=\"bookmark-title\">Create a Bookmark:</h3>\n <input type=\"text\" name=\"title\" id=\"bookmark-title\" placeholder=\"Title\" required>\n <input type=\"number\" name=\"rating\" id=\"bookmark-rating\" min=\"1\" max=\"5\" placeholder=\"Rating\" required>\n <input type=\"url\" name=\"url\" id=\"bookmark-url\" placeholder=\"http://article.com\" required>\n <textarea type=\"text\" name=\"desc\" id=\"bookmark-description\" placeholder=\"Description...\" required></textarea> \n <button type=\"submit\">Submit</button>\n <button type=\"button\" class=\"js-close-form\">Close</button>\n </form>`;\n }\n\n return `<header role=\"banner\">\n <h1 id=\"title\">My Bookmarks</h1>\n </header>\n <div id=\"js-form-container\">${formString}</div>\n <ul id=\"js-bookmark-list\">${bookmarkString}</ul>`;\n }", "function showBookmarks() {\n\n //get the bookmarks from localStorage\n var bookmarks = JSON.parse(localStorage.getItem('fvrtwebs'));\n\n //get the result id\n var showBookmark = document.getElementById('bookmarkResult');\n\n showBookmark.innerHTML = ''\n\n //iterate the bookmarks\n for (var i = 0; i < bookmarks.length; i++) {\n\n var name = bookmarks[i].name\n var url = bookmarks[i].url\n\n showBookmark.innerHTML += '<div class=\"card card-body br-light text-center\">' +\n '<h3>' + name +\n '<a class=\"btn btn-outline-success ml-3\" target=\"_blank\" href=\"' + url + '\">Visit</a><a onclick=\"deleteBookmark(\\'' + url + '\\')\"class=\"btn btn-danger ml-3\" href=\"#\">Delete</a></h3></div>'\n }\n}", "function render(array) {\r\n for (i = 0; i < array.length; i++) {\r\n createTitle();\r\n createAuthor(); \r\n createPages();\r\n createReadButton();\r\n createDeleteButton();\r\n }\r\n }", "inputHandler(i) {\n this.setState({ input: i, output: myMarked(i) });\n }", "function updateBookMarkList(){\r\n \r\n //find the div just above the file list\r\n var targetTable = getElementByXpath('//*[@id=\"containerdiv\"]/div[2]');\r\n \r\n //remove the current style (default style disables mouse input)\r\n targetTable.setAttribute(\"style\",\"\");\r\n \r\n //define the bookmark element and bookmark list\r\n\tvar bmElement = document.getElementById(\"bbBookmarks\")\r\n var bmList;\r\n \r\n //if the bookmark element doesn't exist create it, otherwise use the existing one\r\n if(bmElement==null){\r\n\t bmList = document.createElement('div');\r\n targetTable.appendChild(bmList);\r\n \tbmList.setAttribute(\"id\",\"bbBookmarks\");\r\n \r\n }else{\r\n \tbmList = bmElement; \r\n bmList.innerHTML = '';\r\n }\r\n \r\n \r\n if(bookMarksArray.length == undefined){\r\n return; \r\n }\r\n \r\n //create the bookmark link and create the bookmark removal link\r\n for(var q=0;q<bookMarksArray.length;q++){\r\n var rLink = document.createElement(\"a\")\r\n rLink.setAttribute(\"myid\",String(q));\r\n rLink.setAttribute(\"href\",\"#\");\r\n rLink.setAttribute(\"style\",\"color:red\");\r\n rLink.innerText = \"[X]\";\r\n rLink.addEventListener(\"click\",removeMe)\r\n \t var cName = bookMarksArray[q].course;\r\n var cLink = bookMarksArray[q].link;\r\n var cTextN = bookMarksArray[q].textName;\r\n var cItem = document.createElement(\"p\")\r\n cItem.innerHTML = '<b>Bookmark:</b> ['+cName+']:<a href=\"#\" onclick=\"'+cLink+'\">'+cTextN+'</a> ';\r\n \t bmList.appendChild(cItem);\r\n \t\t cItem.appendChild(rLink);\r\n }\r\n \r\n \r\n}", "function render() {\r\n //does nothing if there is not a current error\r\n renderError();\r\n\r\n let html = '';\r\n\r\n//view state changes if user has chosen to add a new bookmark\r\n if (store.adding === true) {\r\n html = addBookmark()\r\n }\r\n //if the value of error has changed state from its initial value of null displayError will inject the msg into the html\r\n else if (store.error != null) {\r\n html = displayError()\r\n }\r\n \r\n //finally, if no errors are present the initial view of the app will render\r\n else { html = generateInitialView(generateBookmarkString) }\r\n $('main').html(html)\r\n store.filter = 0\r\n}", "function generateBookmarkList(bookmarkItem){\n const list = bookmarkItem.map((bookmark) => generateBookmarkItem(bookmark));\n return list.join('');\n}", "function render() {\n let html = generateHeader();\n\n if (store.error) {\n generateError();\n }\n\n // check if form displayed\n if (store.adding) {\n html += generateBookmarkForm();\n }\n\n html += generateAllBookmarkCards();\n\n $('main').html(html);\n }", "function showsbtext(id,index) {\r\nvar bookmarktext=document.getElementById(id);\r\nvar sbValues= new Array();\r\n sbValues[0] = 'Bookmark this post:';\r\n sbValues[1] = 'Add to <strong>Digg</strong>:';\r\n sbValues[2] = 'Add to <strong>Delicious</strong>:';\r\n sbValues[3] = 'Add to <strong>Blinklist</strong>:';\r\n sbValues[4] = 'Add to <strong>Yahoo Web</strong>:';\r\n sbValues[5] = 'Add to <strong>Netvouz</strong>:';\r\n sbValues[6] = 'Add to <strong>Ma.gnolia</strong>:';\r\n sbValues[7] = 'Add to <strong>Fark</strong>:';\r\n sbValues[8] = 'Add to <strong>Furl</strong>:';\r\n sbValues[9] = 'Add to <strong>Technorati</strong>:';\r\n sbValues[10] = 'Add to <strong>Simpy</strong>:';\r\n sbValues[11] = 'Add to <strong>Spurl</strong>:';\r\n sbValues[12] = 'Add to <strong>Newsvine</strong>:';\r\n sbValues[13] = 'Add to <strong>Blinkbits</strong>:';\r\n sbValues[14] = 'Add to <strong>Smarkings</strong>:';\r\n sbValues[15] = 'Add to <strong>Segnalo</strong>:';\r\n sbValues[16] = 'Add to <strong>De.lirio.us</strong>:';\r\n sbValues[17] = 'Add to <strong>Reddit</strong>:';\r\n sbValues[18] = 'Add to <strong>Wists</strong>:';\r\n sbValues[20] = 'Add to <strong>Google</strong>:';\r\n sbValues[19] = 'Add to <strong>Stumble</strong>:';\r\n sbValues[21] = 'Add to <strong>Twitter</strong>:';\r\n sbValues[22] = 'Add to <strong>Facebook</strong>:';\r\n\r\ndocument.getElementById(bookmarktext.id).innerHTML = sbValues[index];\r\n}", "function getBookmarks(){\n $.get(\"/api/bookmarks\", function(data) {\n var ulBookmarks = $('#bookmarkList');\n if(data){\n for(var i = 0; i < data.length; i++){\n var $li = $('<li>');\n var $a = $('<a href=\"#\">').text(data[i].title);\n $a.attr('data-snipId', data[i].SnipId).addClass('bookmark-link');\n $li.append($a);\n ulBookmarks.append($li);\n }\n } \n });\n }", "function renderBookmark(id, url, text) {\n return $('<li>').attr('id', id).append(\n $('<button>').addClass('delete').html('&times;')\n ).append(\n $('<span>').append(\n $('<button>').addClass('checkbox').html('&#x2713;')\n ).append(\n $('<span>').addClass('text').text(text)\n )\n )\n .addClass(url ? 'url=' + url : '');\n }", "function insertBookmarkBN (BN, index = -1, children = undefined) {\n//let t1 = (new Date ()).getTime();\n//trace(t1+\" Displaying <<\"+BN.id+\">><<\"+BN.title+\">><<\"+BN.type+\">><<\"+BN.url+\">> at level: \"+level+\" highest_open_level: \"+highest_open_level+\" and index: \"+index);\n//console.log(\"BN: \"+BN.id+\" type: \"+BN.type+\" dateAdded: \"+BN.dateAdded+\" dateGroupModified: \"+BN.dateGroupModified);\n\n // Insert new row at given place, or append a new row, inside the bookmarks table\n let row = bookmarksTable.insertRow(index);\n\n // Refresh highest_open_level if we finished one or more levels which were open\n let level = row.dataset.level = BN.level; // Keep level of bookmark in the data-level attribute\n if (level < highest_open_level) highest_open_level = level;\n else if (level > highest_open_level) { // If not in an open part, hide the row\n\trow.hidden = true; \n }\n row.draggable = true; // Always .. and we will use dataset.protect to forbid move\n \t\t\t\t\t\t// of special elements.\n \t\t\t\t\t\t// Note: it is false by default for <tr>\n row.dataset.protect = BN.protect;\n\n let BN_id = row.dataset.id = BN.id; // Keep unique id of bookmark in the data-id attribute\n curRowList[BN_id] = row;\n\n // Add bookmark items in row\n let cell = row.insertCell();\n cell.classList.add(\"brow\");\n cell.tabIndex = 0;\n// cell.draggable = false; // False by default for <td>\n\n // Append proper contents to the cell:\n // - if folder, a <div> of class \"bkmkitem_f\" with a margin-left corresponding to the level\n // or of class \"bkmkitem_s\" or \"bkmkitem_b\", for respectively separator or bookmark,\n // with a margin-left corresponding to the level + 16\n // containing:\n // - if folder, a <div> of class \"twistiena\", \"twistieac\" or twistieao\", depending if there\n // are no children, if closed or open, \n // - if separator, a <div> of class \"favseparator\"\n // - if folder or bookmark, an <img> (class \"favicon\"), or <div> if normal folder, and a\n // <span> with text (class \"favtext\")\n let type = row.dataset.type = BN.type;\n if (type == \"folder\") {\t\t\t\t// Folder\n\t// Retrieve saved state or set open by default\n\tlet is_open;\n\tif (savedFldrOpenList != undefined) { // Initial display\n\t is_open = curFldrOpenList[BN_id] = savedFldrOpenList[BN_id];\n\t}\n\telse {\n\t is_open = curFldrOpenList[BN_id];\n\t}\n\tif (is_open == undefined) { // Folder closed by default when no info\n\t is_open = curFldrOpenList[BN_id] = false;\n\t}\n\n\t// Update indicator of highest open level .. only if open and in an open part\n\tif (is_open && (highest_open_level == level))\n\t highest_open_level = level + 1;\n\n\t// Create elements\n\tlet div2;\n\tlet twistie;\n\tlet span;\n\tif (BN.fetchedUri) { // Special folder, load image now, there are not a big number of them\n\t div2 = SFolderTempl.cloneNode(true);\n\t let img = (twistie = div2.firstElementChild).nextElementSibling;\n\t img.src = BN.faviconUri;\n\t span = img.nextElementSibling;\n\t}\n\telse {\n\t div2 = FolderTempl.cloneNode(true);\n\t span = (twistie = div2.firstElementChild).nextElementSibling.nextElementSibling;\n\t}\n\tif (BN.inBSP2Trash) { // Set to italics\n\t span.style.fontStyle = \"italic\";\n\t}\n\t// Look at children to set the twistie\n//\tif (!options.delayLoad)\n\t children = BN.children;\n\tif ((children == undefined) || (children.length == 0))\n\t twistie.classList.add(\"twistiena\");\n\telse\n\t twistie.classList.add(is_open ? \"twistieao\" : \"twistieac\");\n\tif (level > 0) {\n\t div2.style.marginLeft = (LevelIncrementPx * level)+\"px\";\n\t}\n\tcell.appendChild(div2);\n\n\tspan.textContent = div2.title = BN.title;\n\tcell.appendChild(div2);\n }\n else if (type == \"separator\") {\t\t// Separator\n\t// Create elements\n\tlet div2 = SeparatorTempl.cloneNode(true);\n\tif (level > 0) {\n\t div2.style.marginLeft = (LevelIncrementPx * level + 16)+\"px\";\n\t}\n\tcell.appendChild(div2);\n }\n else {\t\t\t\t\t\t\t\t// Presumably a Bookmark\n\t// Create elements\n\tlet url = BN.url;\n\tlet title = BN.title;\n\tlet anchor;\n\tlet span;\n\tlet uri = BN.faviconUri;\n\tif ((uri == undefined) || (uri == \"/icons/nofavicon.png\")) { // Clone with nofavicon image background\n\t anchor = NFBookmarkTempl.cloneNode(true);\n\t span = anchor.firstElementChild.nextElementSibling;\n\t}\n\telse { // Clone normal one, we will fill the image later\n\t let img;\n\t anchor = BookmarkTempl.cloneNode(true);\n\t if (migration_img16 && BN.fetchedUri) { // Catch end of image load if we have to migrate\n\t\timg = anchor.firstElementChild;\n\t\timg.onload = migr16x16OnLoad;\n\t\tspan = img.nextElementSibling;\n\t }\n\t if (options.immediateFavDisplay\n\t\t || isDisplayComplete\t\t\t// Do not defer once initial load/display is complete\n\t\t ) {\n\t\tif (img == undefined) {\n\t\t img = anchor.firstElementChild;\n\t\t span = img.nextElementSibling;\n\t\t}\n\t\timg.src = uri;\n\t }\n\t if (img == undefined) {\n\t\tspan = anchor.firstElementChild.nextElementSibling;\n\t }\n\t}\n\tif (BN.inBSP2Trash) { // Set to italics\n\t span.style.fontStyle = \"italic\";\n\t}\n\t// We can attach an href attribute to <div> !!\n\t// Much better as it avoids any special behavior of <a> on clicks and look/CSS ..\n\tif (!url.startsWith(\"place:\")) {\n\t anchor.href = url;\n\t}\n\tif (level > 0) {\n\t anchor.style.marginLeft = (LevelIncrementPx * level + 16)+\"px\";\n\t}\n\n\tif (title == \"\") {\n\t anchor.title = url;\n\t span.textContent = suggestDisplayTitle(url);\n\t}\n\telse {\n\t anchor.title = title+\"\\n\"+url;\n\t span.textContent = title;\n\t}\n\tcell.appendChild(anchor);\n }\n\n return(row);\n}", "displaySetup(page,list){\n const end = ( (page*8+8<list.length)?(page*8+8) : list.length )\n this.setState({lastInd: end});\n return(list.slice((page*8), end));\n }", "function _drawTodos() {\n // console.log(\"working from constructor\", store.State.todos);\n let template = \"\";\n\n store.State.todos.forEach(td => (template += td.Template));\n document.querySelector(\"#input\").innerHTML = template;\n}", "function renderList(state, into) {\n\t\t\n\t\t// Iterate over each element in the object\n\t\tvar stateComments=state.comments;\n\t\t\n\t\t// get how many stars for each comment\n\t\tinto.innerHTML = \n\t\tObject.keys(stateComments).map((key) => {\n\t\t\tvar rating=stateComments[key].stars;\n\t\t\tvar maxRating = 5;\n\t\t\tvar output = ''\n\t\t\t\n\t\t\t// render how many gold stars after the committed comment\n\t\t\tfor (let i = 1; i <= rating; i++) {\n\t\t\t\toutput += renderCommentGoldStar()\n\t\t\t}\n\t\t\t\n\t\t\t// render how many blank stars after the committed comment\n\t\t\tfor (let i = rating + 1; i <= maxRating; i++) {\n\t\t\t\toutput += renderCommentBlankStar()\n\t\t\t}\n\t\t\t\n\t\t\t//create the comments list\n\t\t\treturn `\n\t\t\t<li data-id=\"${key}\">\n\t\t\t\t<input class=\"done-it\" type=\"checkbox\" ${stateComments[key].done ? \"checked\" : \"\"} />\n\t\t\t\t<div class=\"commentStarContainer\">${output}</div>\n\t\t\t\t${stateComments[key].comment}\n\t\t\t\t<button class=\"delete\">Delete</button>\n\t\t\t\t<button class=\"update\">Update</button>\n\t\t\t\t<p class=\"instruction\">Edit comment below, and click the update button</p>\n\t\t\t\t<input type=\"text\" class=\"edit-item shown\"/>\n\t\t\t</li>\n\t\t\t`\n\t\t}).join('');\n\t\n\t}", "function loadBookmarks(data) {\n for (var b in data.results) {\n var bookmark = data.results[b];\n var bookmarkTitle = bookmark.title;\n var bookmarkUrl = bookmark.url;\n var bookmarkId = bookmark.objectId;\n\n var $bookmark = createBookmark(bookmarkTitle, bookmarkUrl, bookmarkId);\n\n $('#bookmarks-holder').append($bookmark);\n }\n }", "function listAll ( booksArray ) {\r\n var arrayLength = booksArray.length;\r\n htmlText = '<p class=\"text-center mt-3 mb-2\">' + arrayLength +' book(s) matched</p>';\r\n if ( searchMode ) {\r\n htmlText += copyButtonHelp + editButtonHelp + deleteButtonHelp;\r\n }\r\n htmlText += '<ol>';\r\n for ( var i=0 ; i < arrayLength ; i++ ) {\r\n htmlText += '<li value=' + booksArray[i][bookNumberProperty] + '>';\r\n htmlText += makeTheHTMLforOneBook ( booksArray[i] );\r\n htmlText += '<p>' + nonBreakingSpaceText + '</p></li>';\r\n }\r\n print ( htmlText + '</ol>' );\r\n}", "function setListPageSensors()\n{\n var contentTemplate = \"\";\n\n $.each(cachedfeedsArray, function(i, feed) {\n\n //var isFavourite = getFavouriteValue(feed.id);\n var imageClass = \"sdfsdf\";//(isFavourite ? \"star\" : getMarkerClass(feed.category[0]));\n var className = \"sdfsdf\";//(isFavourite ? \" class='favourite'\" : \" class='nonfavourite'\");\n\n contentTemplate +=\n \"<li><a href='' onclick='overrideDetailClick(\\\"\" + feed.id + \"\\\"); return false;'>\" +\n feed.title + \"</a></li>\";\n }\n );\n \n\n return contentTemplate;\n}", "function fetchBookmarks() {\n // get bookmarkArray from local storage;\n var bookmarkArray = JSON.parse(localStorage.getItem('bookmarks'));\n\n var bookmarkResults = document.getElementById('bookmarksResult');\n\n bookmarkResults.innerHTML = '';\n\n //loop that iterates through the bookmarkArray from local storage\n for( var i = 0; i< bookmarkArray.length; i++){\n\n var siteName = bookmarkArray[i].name;\n var siteUrl = bookmarkArray[i].url;\n\n bookmarkResults.innerHTML+= '<div class=\"well\">'+\n '<h4 style=\"text-align: center\">Website Name : '+siteName+\n ' <br><br> <a class=\"btn btn-default\" target=\"_blank\" href=\"'+siteUrl+'\">Visit Site</a> '+\n ' <a onclick=\"deleteBookmark(\\''+siteUrl+'\\')\" class=\"btn btn-danger\" id=\"del\" href=\"#\">Delete Bookmark</a> '+\n '</h4>'+\n '</div>';\n }\n}", "function updateList() {\n $('#bookmarks').empty();\n\n var records = bookmarkTable.query();\n\n // Sort by creation time.\n records.sort(function (bookmarkA, bookmarkB) {\n if (bookmarkA.get('created') < bookmarkB.get('created')) return -1;\n if (bookmarkA.get('created') > bookmarkB.get('created')) return 1;\n return 0;\n });\n\n // Add an item to the list for each bookmark.\n for (var i = 0; i < records.length; i++) {\n var record = records[i];\n $('#bookmarks').append(\n renderBookmark(record.getId(),\n record.get('url'),\n record.get('bookmarkname')));\n }\n\n addListeners();\n $('#newBookmark').focus();\n }", "_generateMarkup() {\n // console.log(this._data); // data is in the form of an array. We want to return one of the below html elements for each of the elements in that array\n\n return this._data.map(this._generateMarkupPreview).join('');\n }", "function renderFavorites() {\r\n removeBooksFromDOM();\r\n favorites.forEach(function (book) {\r\n insertNewBook(book.id, book.title, book.author, book.subject, book.photoURL, book.vendorURL, book.favorite);\r\n })\r\n}", "function mapper_page_paint_markers(blob) {\n\n\t// mark all objects as stale\n\tmapper_mark_all_stale();\n\n // build icons\n mapper_page_paint_icons();\n\n\t// visit all the markers and add them\n\tvar markers = blob['results'];\n\tfor (var i=0; i<markers.length; i++) {\n\n\t\tvar item = markers[i]['note'];\n\n\t\tvar key = mapper_make_key(item);\n\t\tif( mapper_feature_exists_test_and_mark(key) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar id = item['id'];\n\t\tvar kind = item['kind'];\n\t\tvar lat = item['lat'];\n\t\tvar lon = item['lon'];\n\t\tvar title = item['title'];\n\t\tvar link = item['link'];\n\t\tvar description = item['description'];\n\t\tvar location = item['location'];\n\t\tvar created_at = item['created_at'];\n\t\tvar tagstring = item['tagstring'];\n\t\tvar statebits = item['statebits'];\n\t\tvar photo_file_name = item['photo_file_name'];\n\t\tvar photo_content_type = item['photo_content_type'];\n\t\tvar provenance = item['provenance'];\n\t\tvar owner_id = item['owner_id'];\n\t\tvar begins = item['begins'];\n\t\tvar ends = item['ends'];\n\n\t\tvar glyph = glyph_post;\n\t\tif( kind == \"KIND_USER\" ) glyph = glyph_person;\n\t\tif( kind == \"KIND_URL\" ) glyph = glyph_url;\n\n\t\t// Build map feature\n\t\t// TODO - i should publish all related parties by drawing lines\n\t\t// TODO - i should publish all the depictions from twitter as icons\n\t\tif(true) {\n var feature = {};\n\t\tfeature[\"kind\"] = \"marker\";\n\t\tfeature[\"title\"] = title;\n\t\tfeature[\"lat\"] = lat;\n\t\tfeature[\"lon\"] = lon;\n\t\tfeature[\"glyph\"] = glyph;\n\t\tmapper_inject_feature(feature);\n\t\t}\n\t}\n\n\t// sweep the ones that are not part of this display\n\tmapper_hide_stale();\n}", "function _drawLists() {\n store.saveState();\n let template = \"\";\n store.State.lists.forEach((list) => (template += list.Template));\n\n document.getElementById(\"list\").innerHTML = template;\n}", "function renderLinks(links, pageNumber) {\n pagination.totalBookmarks = links.length;\n pagination.currentPage = pageNumber;\n\n const lowerBound = pageNumber * pagination.limit;\n const upperBound = (pageNumber + 1) * pagination.limit;\n const bookmarkList = document.querySelector('.bookmark-list > ul');\n bookmarkList.innerHTML = ''; // clean list\n\n const generateLinkElement = (text, key) => {\n const anchor = document.createElement('a');\n anchor.appendChild(document.createTextNode(text));\n anchor.setAttribute('data-key', key);\n return anchor;\n };\n\n // render links\n links.slice(lowerBound, upperBound)\n .forEach(link => {\n const listElement = document.createElement('li');\n const name = document.createTextNode(`${link.name} - `);\n const anchor = generateLinkElement(link.url, link.key);\n const deleteLink = generateLinkElement('delete', link.key);\n const editLink = generateLinkElement('edit', link.key);\n\n anchor.setAttribute('title', link.name);\n anchor.setAttribute('href', link.url);\n anchor.setAttribute('target', '_blank');\n deleteLink.classList.add('delete');\n editLink.classList.add('edit');\n listElement.classList.add('bookmark');\n\n listElement.appendChild(name); // text into <li>\n listElement.appendChild(anchor); // <a> into <li>\n listElement.appendChild(document.createTextNode(' - ')); // separator into <li>\n listElement.appendChild(deleteLink); // add <a>delete</a> into <li>\n listElement.appendChild(document.createTextNode(' - ')); // separator into <li>\n listElement.appendChild(editLink); // add <a>edit</a> into <li>\n bookmarkList.appendChild(listElement); // <li> into <ul>\n });\n\n renderPagination();\n}", "function textObjectArrayHtml(content, relexMap) {\n let html = \"\";\n let isList = content.length > 1;\n if (isList) {\n html += \"<ul>\";\n }\n\n for (let textObject of content) {\n if (isList) {\n html += \"<li>\";\n }\n if (textObject.tag === undefined) {\n let lines = textObject.text.split(\"\\n\");\n for (let line = 0; line < lines.length; line++) {\n if (line > 0) {\n html += isList ? \"</ul><ul>\" : \"<br/>\";\n }\n html += \"<span class='nbx-text'>\" + encode(lines[line]) + \"</span>\";\n }\n }\n else {\n // Tagged element => entity with an offset as its id.\n html += \"<table>\";\n let relations = relexMap[textObject.offset];\n if (relations !== undefined) {\n for (let r = 0; r < relations.length; r++) {\n let relation = relations[r];\n let odd = r % 2 === 0 ? \"even\" : \"odd\";\n html += \"<tr class='nbx-RELEX-\" + odd + \"'><td>\" + encode(relation.type) + \"</td></tr>\";\n if (relation.endOffset !== relation.startOffset) {\n html += \"<tr><td class='nbx-ref-\" + odd + \" ref-\" + getId(relation.endOffset) + \"'>\" + encode(relation.endToken) + \"</td></tr>\";\n }\n }\n }\n\n let text = textObject.text.replace(/ *[\\n] */g, \" \");\n html +=\"<tr><td class='nbx-\" + textObject.tag + \"'>\" + encode(textObject.type) + \"</td></tr>\" +\n \"<tr><td class='ref-\" + getId(textObject.offset) + \" nbx-text' id='\" + getId(textObject.offset) + \"'>\" + encode(text) + \"</td></tr>\" +\n \"</table>\";\n if (textObject.text.includes(\"\\n\")) {\n html += isList ? \"</ul><ul>\" : \"<br/>\";\n }\n }\n if (isList) {\n html += \"</li>\";\n }\n }\n if (isList) {\n html += \"</ul>\";\n }\n return html;\n}", "function fetchBookmarks(){\r\n\r\n //getting bookmarks from localStorage\r\n let bookmarks = JSON.parse(localStorage.getItem('bookmarks'));\r\n //console.log(bookmarks);\r\n\r\n let entry = document.getElementById('entries');\r\n entry.innerHTML = '';\r\n\r\n for(i = 0; i < bookmarks.length; i++){\r\n entry.innerHTML += '<div class=\"jumbotron jumbotron-fluid text-center\">'+\r\n '<div class=\"container\">'+\r\n '<h3>'+bookmarks[i].name+\r\n '<a class=\"btn btn-success ml-3\" href=\"'+bookmarks[i].url+'\" target=\"_blank\">Visit</a> '+\r\n '<a onclick=\"deletebookmarks(\\''+bookmarks[i].url+'\\')\" href=\"#\" class=\"btn btn-danger\">Delete</a> '+\r\n '</h3>'+\r\n '</div>'+\r\n '</div>'\r\n }\r\n\r\n}", "get bookmarks() {\n if (isNullOrUndefined(this.mBookmarks)) {\n this.mBookmarks = [];\n }\n return this.mBookmarks;\n }", "get bookmarks() {\n return this.getSelBookmarks();\n }", "function createNotebook() {\n\n if (currentUser) {\n\n let sections = [];\n\n let section = {\n id: 0,\n title: 'Section 1',\n blocks: []\n }\n\n console.log(\"preview : \", preview);\n\n for (let element of preview) {\n\n switch (element.nodeName) {\n // So were going to save the section were working on, then create a new one..\n case \"H1\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H2\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"H3\":\n sections.push({...section});\n section = {\n id: sections.length + 1,\n title: element.innerText,\n blocks: []\n };\n break;\n\n case \"P\":\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n\n break;\n\n default:\n if (element.outerHTML !== '' && element.outerHTML !== ' ') {\n section.blocks.push(\n {\n body: element.outerHTML,\n position: section.blocks.length + 1\n }\n );\n }\n }\n }\n sections.push({...section});\n\n // NOTE: This was supposed to be the cool part of the project but due the the way I have my DB\n // set up I couldnt figure out how to create all the sections separately with a loop of async calls.\n // due to time constraints I had to give up on this and only allow users to see the preview.\n\n createNotebookFromTemplate(searchTerm, currentUser._id, sections, dispatch);\n // dispatch({type:\"CREATE_NOTEBOOK\", sections: sections, title: searchTerm});\n // console.log(\"the title should be :\", searchTerm);\n history.push(\"/notebook/edit/id\");\n\n } else {\n // there is no current user.\n alert(\"please log in to create a notebook\");\n }\n }", "function nextState(){\n for (var i = 3; i<=91; i++){\n $(\"#MathJax-Span-\"+i).css(\"color\",\"black\"); \n }\n var points = model.get_current_state_array();\n var pointdict = model.get_current_state();\n var numpoints = points.length;\n var newstate = [];\n \n state++;\n updateGraph();\n \n $(\".next-state\").attr(\"disabled\",false);\n $(\".previous-state\").attr(\"disabled\",false);\n \n $(\".span7\").append(\"<a name='bottom'><div class='chart-container chart\"+state+\"'></div></a>\");\n setupGraph(state);\n updateTopBubbles(state);\n setupSideLabels(state);\n $(\".span7\").append(\"<div class='row-fluid continue-row'><button class='arrow-transition btn btn-large'>See Transition Model</button></div>\");\n $(\".arrow-transition\").css(\"visibility\",\"visible\");\n $(\".arrow-transition\").on(\"click\",function(){\n $(this).closest('.row-fluid').remove();\n $('.num-label'+state).remove(); $('.first-prob'+state).remove(); //to remove the duplicate\n firstupdate(state);\n updateFirstInputRow(\"rest\");\n })\n }", "function render(state) {\n console.trace(state);\n\n let main = document.querySelector('main');\n main.innerHTML = \"\";\n\n switch (state.section) {\n case \"cyot_index\":\n renderCYOTIndex(localstorage.nodemap_cyot, localstorage.rootlist_cyot);\n break;\n case \"cyot_chapter\":\n if (state.nid) {\n // render chapter using state.nid\n renderCYOTNode(localstorage.nodemap_cyot, state.nid);\n } else {\n // fallback to rendering the index probably\n //state.section = \"cyot_index\";\n }\n break;\n case \"cyot_tree\":\n // renderCYOTTree(obj, state.nid);\n break;\n case \"story_index\":\n renderStoryList(localstorage.nodelist_story);\n break;\n case \"story\":\n renderStory(localstorage.nodelist_story, state.nid);\n break;\n case \"about\":\n // renderAboutPage();\n break;\n default:\n // render main menu\n break;\n }\n\n\n\n // if (state.position) {\n // // console.log(state.position);\n // switch (state.position) {\n // case \"chapterstart\":\n // // scroll to start of nid\n // if (state.nid) {\n // let article = document.querySelector('#cyot_chapter__' + state.nid);\n // article.scrollIntoView(true);\n // }\n // break;\n // case \"chapterend\":\n // // scroll to start of nid\n // if (state.nid) {\n // let article = document.querySelector('#cyot_chapter__' + state.nid);\n // article.scrollIntoView(false);\n // }\n // break;\n // case \"top\":\n // // scroll to top\n // window.scrollTo(0, 0);\n // break;\n // }\n // }\n // save the state to a cookie for this page, lasting for 365 days\n utilities.setCookie('state', JSON.stringify(state), 356);\n\n // attach handlers\n // var elems = document.querySelectorAll('.collapsible');\n // var options = {};\n // var instances = M.Collapsible.init(elems, options);\n reloadCollapsible();\n\n\n}", "function createIndexPoints(array, $el) {\n for (var i = 0; i < array.length; i++) {\n $el.append(\"<div class='index-point' id='index\" + i + \"'><div class='num'>\"+ i +\"</div></div>\")\n\n }\n}", "getMarkers() {\n const { locations, template } = this.props;\n const markers = [];\n\n const htmlToReactParser = new HtmlToReactParser();\n\n let i;\n // eslint-disable-next-line no-plusplus\n for (i = 0; i < locations.length; i++) {\n const loc = locations[i];\n const { Lat, Lng } = loc;\n markers[markers.length] = {\n position: {\n lat: Number(Lat),\n lng: Number(Lng),\n },\n key: loc.ID,\n defaultAnimation: 2,\n infoContent: (\n <div>\n {htmlToReactParser.parse(template(loc))}\n </div>\n ),\n };\n }\n return markers;\n }", "function initViz() {\n html = \"<table id='bmTable'><thead><tr>\";\n html += '<th>' + 'Id' + '</th>';\n html += '<th>' + 'Type' + '</th>'\n html += '<th>' + 'Created' + '</th>'\n html += '<th></th>';\n html += '</thead></tr>'\n\n storedBm = JSON.parse(localStorage.getItem(\"bookmarks\"));\n\n if (storedBm != null) {\n\n for (var i = 0; i < storedBm.length; i++) {\n\n var obj = storedBm[i];\n html += '<tr>';\n html += '<td align=\"center\">' + obj.qInfo.qId + '</td>';\n html += '<td align=\"center\">' + obj.qInfo.qType + '</td>';\n html += '<td align=\"center\">' + obj.creationDate + '</td>';\n html += '<td align=\"center\"><button class=\"ng-isolate-scope lui-button\">Apply</button></td>';\n html += '</tr>';\n }\n } else {\n html += \"<tr><td colspan='4' align='center'>No records available</td></tr>\";\n }\n html += \"</table>\";\n html += \"<p align='right' style='margin-top:20px'>\";\n html += \"<button id='btnCreate' class='ng-isolate-scope lui-button'>Create</button>\";\n html += \"<button id='btnClear' style='margin-left:10px' class='ng-isolate-scope lui-button'>Clear</button>\";\n html += \"</p>\";\n\n $element.append(html);\n }", "function PageObject()\n{\n\tvar filename;\n\tvar type;\n\tvar subindex;\n\tvar bSubIndexed; \n\tvar bNextButton;\n\tvar bBackButton;\n\tvar time;\n\tvar bScored;\n\tvar objectiveID;\n\tvar bObjectiveComplete;\n\tvar topicheading;\n\tvar comment = \"\"; //comment to be save on page\n\tvar bBookmark = false;\n\tvar bViewed = false;\n\tvar score;\n\tvar progress;\n\tvar points;\n\tvar id; //the index of the page array\n\t\n\t//methods bool is a boolean to set on or of\n\tthis.SetBackButton = function(boo)\n\t{\n\t\tthis.bBackButton = boo;\n\t}\n\t\n\tthis.SetNextButton = function(boo)\n\t{\n\t\tthis.bNextButton = boo;\n\t}\n\t\n\t//this function will update the display of the page based on variables back/next buttons, heading, and menu and progress\n\tthis.Update = function()\n\t{\n\t\t//update topicheading and breadcrumb\n\t\t//window.frames['content_frame'].document.getElementById('topicheading').innerHTML = this.topicheading;\n\t\t//window.frames['content_frame'].document.getElementById('breadcrumb').innerHTML = this.topicheading;\n\t\t\n\t\t//if comment exists for page\n\t\twindow.frames['content_frame'].document.getElementById(\"commentbox\").value = this.comment;\n\t\t\n\t\t//if bookmarked, show bookmarked\n\t\t//if (this.bBookmark)\n\t\t//{\n\t\t//\twindow.frames['content_frame'].document.getElementById('bookmark').style.display = \"inline\";\n\t\t//}\n\t\t\n\t\t//update back and next buttons\n\t\tif (this.bBackButton)\n\t\t{\n\t\t\twindow.frames['content_frame'].document.getElementById('back_btn').style.display = \"inline\";\n\t\t} else {\n\t\t\twindow.frames['content_frame'].document.getElementById('back_btn').style.display = \"none\";\n\t\t}\n\t\t\n\t\tif (this.bNextButton)\n\t\t{\n\t\t\twindow.frames['content_frame'].document.getElementById('next_btn').style.display = \"inline\";\n\t\t\twindow.frames['content_frame'].document.getElementById('back_btn').style.marginRight = \"0px\";\n\t\t} else {\n\t\t\t//window.frames['content_frame'].document.getElementById('next_btn').style.display = \"none\";\n\t\t\t//window.frames['content_frame'].document.getElementById('back_btn').style.marginRight = \"30px\";\n\t\t\twindow.frames['content_frame'].document.getElementById('next_btn').style.backgroundImage = \"url('assets/images/nextStatic.jpg')\";\n\t\t\twindow.frames['content_frame'].document.getElementById('next_btn').style.cursor = \"default\";\n\t\t\twindow.frames['content_frame'].document.getElementById('next_btn').href = \"javascript:void()\";\n\t\t}\n\t\t\n\t\t//if flash is enabled by diagnostics, show the flash form\n\t\tif (bFlash)\n\t\t{\n\t\t\t//window.frames['content_frame'].document.getElementById('choice').style.display = \"inline\";\n\t\t\tif (Format == \"flashversion\")\n\t\t\t{\n\t\t\t //window.frames['content_frame'].document.getElementById('radio1').checked=true;\n\t\t\t //window.frames['content_frame'].document.getElementById('radio2').checked=false;\n\t\t\t} else {\n\t\t\t //window.frames['content_frame'].document.getElementById('radio1').checked=false;\n\t\t\t //window.frames['content_frame'].document.getElementById('radio2').checked=true;\n\t\t\t}\n\n\t\t\tCheckFlash(); //check to see if the user would like flash or not\n\t\t} else { \n\t\t\t//window.frames['content_frame'].document.getElementById('choice').style.display = \"none\"; \n\t\t}\n\t\t\n\t\t//update progress bar\n\t\twindow.frames['content_frame'].document.getElementById('progress').style.width = ''+ this.GetProgress() +'%';\n\t\twindow.frames['content_frame'].document.getElementById('progress_score').innerHTML = ''+ PageArray[currentpage].GetProgress() +'% Complete';\n\t\t\n\t\t//update menu\n\t\tthis.updateMenu();\n\t}\n\t\n\tthis.AddComment = function()\n\t{\n\t\tthis.comment = window.frames['content_frame'].document.getElementById(\"commentbox\").value;\n\t\twindow.frames['content_frame'].document.getElementById(\"notesaved\").style.display = \"inline\";\n\t}\n\t\n\tthis.AddBookmark = function()\n\t{\n\t\tthis.bBookmark = true;\n\t\twindow.frames['content_frame'].document.getElementById('bookmark').style.display = \"inline\";\n\t}\n\t\n\t//this function will load the page into the current frame\n\tthis.Load = function()\n\t{\n\t\tdocument.getElementById(\"content_frame\").src = '' + this.filename;\n\t\tthis.bViewed = true;\n\t}\n\t\n\tthis.TellMe = function()\n\t{\n\t\talert(this.filename);\n\t}\n\t\n\t//return a suspend data string data is separated by a |\n\tthis.GetPageSuspendData = function()\n\t{\n\t\tvar view = \"\";\n\t\tvar booked = \"\";\n\t\tif (this.bViewed) { view = \"yes\"; } else { view = \"no\"; }\n\t\tif (this.bBookmark) { booked = \"yes\"; } else { booked = \"no\"; }\n\t\tvar datastring = \"P:\"+ this.id + \"|\" + \"V:\" + view + \"|\" + \"B:\" + booked + \"|\" + \"C:\" + this.comment;\n\t\treturn datastring;\n\t}\n\t\n\t//read data from suspend data string for this page.\n\tthis.ReadData = function(data)\n\t{\n\t\tvar dataobjects = data.split(\"|\");\n\t\tfor (a=0; a<dataobjects.length; a++)\n\t\t{\n\t\t\t//now break down data objects into name and value\n\t\t\tvar property = dataobjects[a].split(\":\");\n\t\t\tswitch(property[0])\n\t\t\t{\n\t\t\t\tcase \"P\":\n\t\t\t\t //do nothing\n\t\t\t\t break; \n\t\t\t\tcase \"V\":\n\t\t\t\t if (property[1] == \"yes\"){ this.bViewed = true; } else { this.bViewed = false; } \n\t\t\t\t \n\t\t\t\t break;\n\t\t\t\tcase \"B\":\n\t\t\t\t if (property[1] == \"yes\"){ this.bBookmark = true; } else { this.bBookmark = false; } \n\t\t\t\t break;\n\t\t\t\tcase \"C\":\n\t\t\t\t this.comment = property[1];\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t break;\n\t\t\t} //end switch\n\t\t} //end loop\n\t}\n\t\n\tthis.GetProgress = function()\n\t{\n\t\tvar progress = Math.round(this.id/(totalPages-1)*100); //stores a progress percentage even before completed\n\t\treturn progress;\n\t}\n\t//UPDATE MENU ITEM - TOPICS\n\tthis.updateMenu = function() {\n\t\twindow.frames['content_frame'].document.getElementById('menu' + Objectives[Number(this.objectiveID.substring(3))][1]).style.color = '#f58220';\n\t\twindow.frames['content_frame'].document.getElementById('menu' + Objectives[Number(this.objectiveID.substring(3))][1]).style.fontWeight = 'bold';\n\t}\n}", "function render(){\n\tvar src = \"\"\n\tfor(i in TodoList.items) src += ItemTemplate(TodoList.items[i]);\n\tel.innerHTML = src;\n}", "function keywordList(state) {\n // Iterate over each element in the object\n var keyLoop = Object.keys(state.list).map((key) => {\n return state.list[key].keyword;\n }).join('-');\n\n document.querySelector('#keyword-view').addEventListener('click', () => {\n\n var gifLink = 'https://crossorigin.me/http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=' + keyLoop\n loadGif(gifLink, true);\n\n // Empty the Takeover state\n document.querySelector('.take-over').innerHTML = ` `\n // Empty the Healines\n container.innerHTML = `\n <h1>👉 ${keyLoop}</h1>\n `\n // Reenable the keyboard lister\n window.addEventListener('keydown', keyboardCode, false);\n\n });\n\n}", "function DetailsPage(book_item_id, book_collection) {\n // Remove what's on that page to prep for what will be added\n const detailcontent = document.querySelector(\"#item_details\");\n\n console.log(\n document.querySelector(\"#item_details\"),\n \"Where details are going\"\n );\n\n console.log(book_collection, \"course code to find bookmark item\");\n\n // Add the course details to the page\n for (i = 0; i < book_collection.length; i++) {\n console.log(i);\n if (book_item_id.id === book_collection[i].course_id) {\n console.log(\n book_collection[i].course_id,\n \"this is items id in the collection of saved bookmarks\"\n );\n\n const coursedetail = book_collection[i];\n\n console.log(coursedetail);\n\n detailcontent.innerHTML = \"\";\n\n detailcontent.innerHTML += `\n <div id=\"for_bookmarks\">\n <div class='course-title-home' > \n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"course-code\">\n <p class=\"title\" id=\"courseID\">${coursedetail.course_id}</p>\n <p class=\"subtitle\" id=\"courseTitle\">${coursedetail.name}</p>\n </div>\n </div>\n </div>\n \n <!-- Course Stat Tiles -->\n <div class=\"course-stats\">\n <div class=\"tile is-ancestor\">\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"credit\">${coursedetail.credits}</p>\n <p class=\"subtitle\">Credits</p>\n </article>\n </div>\n \n \n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"gened\">${coursedetail.gen_ed}</p>\n <p class=\"subtitle\">Gen-Ed</p>\n </article>\n </div>\n <div class=\"tile is-parent\">\n <article class=\"tile is-child box\" id=\"course-stat\">\n <p class=\"title\" id=\"method\">${\n coursedetail.grading_method\n }</p>\n <p class=\"subtitle\">Grading Method</p>\n </article>\n </div>\n </div>\n </div>\n </div> \n <!-- Course Description -->\n <div class='course-description-home' > \n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"home-description\">\n <p class=\"title\" >Description</p>\n <p class=\"subtitle\" id=\"description\">${coursedetail.description}</p>\n </div>\n </div>\n </div>\n <!-- Average Grade -->\n <div class=\"tile is-parent\" >\n <div class=\"tile is-child box\" id=\"average-grade\">\n <p id=\"avgGrade\"><b>Average Grade: </b>\n ${avgGPA(coursedetail.course_id)}\n </p>\n </div>\n </div> `;\n }\n }\n}", "function paginationMaker(){\n var pagesArray =[];\n for (i=0; i<myPages.length; i++){\n pagesArray.push('<li class=\"pageItem\" onclick=\"classes();renderHtml(myPages['+i+']) \"><a>'+i+'</a></li>');\n }\n pagination = pagesArray;\n $('#pages').html(pagination);\n $('.pageItem').first().addClass('active');\n}", "function generate() {\n for (i = 0; i < points.length; i++ ){ \n points[i].offset = $(`ul.layer li#${[i]}`).offset();\n points[i].width = $(`ul.layer li#${[i]}`).width();\n points[i].height = $(`ul.layer li#${[i]}`).height();\n };\n }", "function render() {\n myLibrary.forEach(function(e, i){\n var li = document.createElement(\"li\");\n li.classList.add(\"row\");\n \n ul.appendChild(li);\n\n var div = document.createElement(\"div\");\n li.appendChild(div)\n div.classList.add(\"innercols\")\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.title\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.author\n \n var p = document.createElement(\"p\");\n div.appendChild(p);\n p.innerText = e.pages\n \n var p = document.createElement(\"p\"); \n p.classList.add('read');\n p.classList.add(i); //adds to index of the added book to the innercols div as a class. beginning at 0.\n div.appendChild(p);\n p.innerText = e.read\n\n readClicks();\n })\n}", "function Snippets({ title, model }) {\n\tfunction _executeBlock(itemText, index) {\n\t\tvar arr = [];\n\n\t\tvar returnedFromFunction = itemText(function (result) {\n\t\t\t// events.emit('example' + index, result);\n\t\t\tarr.push(<p key={ 'line-' + arr.length } >{result}</p>);\n\t\t});\n\n\t\treturn {\n\t\t\treturnedFromFunction: returnedFromFunction,\n\t\t\tarr: arr\n\t\t};\n\t}\n\n\treturn (\n\t\t<div>\n\t\t\t<h1 className=\"main-title\"> {title} </h1>\n\t\t\t{model.map((itemText, index) => {\n\t\t\t\tvar result = _executeBlock(itemText, index);\n\n\t\t\t\treturn (\n\t\t\t\t\t<pre id={'example-' + (index + 1)} className=\"example\" key={'code-block-' + (index + 1)}>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<h2>{ itemText.name }</h2>\n\t\t\t\t\t\t\t<div className=\"example\">\n\t\t\t\t\t\t\t\t{ itemText.toString() }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"example\">\n\t\t\t\t\t\t\t\t{ result.returnedFromFunction }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{ result.arr.map((item) => item) }\n\t\t\t\t\t\t\t<PrintConsole context={'example' + index} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</pre>\n\t\t\t\t);\n\t\t\t})}\n\t\t</div>\n\t);\n}", "function createNavButtons(array,$el){\n $el.append(\"<div id='prev' class='nav-button'>Prev</div>\");\n for(var i = 0; i < array.length; i++) {\n //we need i, 1 for each element\n $el.append(\"<div class='index-point' id='index\" + i + \"'></div>\")\n }\n $el.append(\"<div id='next' class='nav-button'>Next</div>\");\n\n//adding div class and id in a loop\n//function createIndexPoints(array, $el){\n //create something visual, Divs will work\n}", "function genHistoryList() {\n document.querySelector('#searchHistory').innerHTML = \"\"\n for (var idx = 0 ; idx < searchSave.length ; idx++) {\n document.querySelector('#searchHistory').innerHTML +=\n `\n <tr>\n <td scope=\"row\">${searchSave[idx]}</td>\n </tr>\n `\n }\n}", "function _draw() {\n let posts = store.State.posts;\n let templates = ''\n posts.forEach(post=>{\n templates += post.Template\n });\n document.getElementById('posts').innerHTML = templates;\n}", "function bookMarksList() {\n return `\n <ul class=\"bookmark-list js-bookmark-list\">\n <li></li>\n</ul>\n`;\n}", "function _drawLists() {\n let template = ''\n let lists = _store.State.lists\n let listId = ''\n\n\n lists.forEach(list => template += list.Template)\n\n document.getElementById(\"lists\").innerHTML = template\n}", "function showPage() {\n htmlPage = \"\"; // reset html code in every function calls\n for(let i = start; i <= end; i++){\n generateHTML(objArray[i]); // populate html code with the data\n }\n studentList.innerHTML = htmlPage;\n}", "function showBookmarksView() {\n var currentUser = userSession.getCurrentUser();\n if (currentUser) {\n var username = currentUser.username;\n var sessionToken = currentUser.sessionToken;\n\n $('#bookmarks-view').show();\n $('#bookmarks-holder').empty();\n $('#new-bookmark-div').show();\n $('#greet-user').text('Bookkmarks - ' + username);\n $('#logout-button').show();\n $('.login-register').hide();\n\n ajaxRequester.getSession(sessionToken, 'https://api.parse.com/1/classes/Bookmark',\n loadBookmarks, ajaxError);\n\n $('#bookmarks-holder').show();\n } else {\n showHomePage();\n }\n }", "function generateListItem(content, buffer) {\n var indent = '';\n for (var i = 0; i < buffer; i++) {\n indent += ' ';\n }\n return `${indent}- ${content}`;\n}", "function renderHtml(state, element) {\n var htmlStr = \"</span><div class='shopping-item-controls'><button class='shopping-item-toggle'><span class='button-label'>check</span></button> <button class='shopping-item-delete'><span class='button-label'>delete</span></button></div></li>\";\n function getFirstTags(index) {\n if (state.items[index].checked) {\n return \"<li id=\"+index+\"><span class='shopping-item shopping-item__checked'>\";\n } else {\n return \"<li id=\"+index+\"><span class='shopping-item'>\";\n }\n }\n var makeHtml = state.items.map(function(item, index) {\n return getFirstTags(index)+item['displayName']+htmlStr;\n });\n element.html(makeHtml);\n}", "function GnuBook() {\n this.reduce = 4;\n this.padding = 10;\n this.mode = 1; //1 or 2\n \n this.displayedLeafs = [];\t\n //this.leafsToDisplay = [];\n this.imgs = {};\n this.prefetchedImgs = {}; //an object with numeric keys cooresponding to leafNum\n \n this.timer = null;\n this.animating = false;\n this.auto = false;\n this.autoTimer = null;\n this.flipSpeed = 'fast';\n\n this.twoPagePopUp = null;\n this.leafEdgeTmp = null;\n \n this.searchResults = {};\n \n this.firstIndex = null;\n \n}", "function renderNextPage() {\n renderBookmarks(pagination.currentPage + 1);\n}", "function render(arr) {\n\tvar todoItems = '';\n\n\tdocument.querySelector('.txtArea').innerHTML = '';\n\tfor (var i = 0; i < arr.length; i++) {\n\t\n\ttodoItems = (todoItems + arr[i].toString() + '<br>'); \n\t}\n\tdocument.querySelector('.txtArea').innerHTML = todoItems; \n}", "function produceBlogs (event) {\n // Clear the blogs first before displaying the new ones\n blogEl.innerHTML = \"\"\n\n // Which number did the user click on?\n const pageNumber = parseInt(\n Array.from(event.target.classList)\n .find(clazz => {\n if (clazz.startsWith(\"page-\")) return clazz\n })\n .split(\"-\")[1]\n )\n\n // Change the class name of the previous arrow\n if ((pageNumber - 1) === 0) {\n previousEl.style.visibility = \"hidden\"\n } else {\n previousEl.style.visibility = \"visible\"\n previousEl.className = `page-${pageNumber - 1}`\n }\n\n // Change the class name of the next arrow\n if ((pageNumber + 1) > numberOfPages) {\n nextEl.style.visibility = \"hidden\"\n } else {\n nextEl.style.visibility = \"visible\"\n nextEl.className = `page-${pageNumber + 1}`\n }\n\n // Determine which items to display by slicing the array\n const itemsToDisplay = storedBlogs.articles.slice(\n (pageNumber - 1) * itemsPerPage, \n pageNumber * itemsPerPage\n )\n\n // Display a <section> representation of each data object\n for (let i = 0; i < itemsToDisplay.length; i++) {\n let currentBlog = itemsToDisplay[i];\n blogEl.innerHTML += `\n <section class=\"boxy ${currentBlog.title}\">\n <h3>\"${currentBlog.title}\"</h3>\n <h4>Post: ${currentBlog.id}</h4>\n <h5>${currentBlog.body}</h5>\n </section>\n `\n }\n}", "renderNotes(){\n return _.map(this.state.notes, (note, key)=>{\n return( \n <div key={key} className=\"champs1\"> \n \n <h3>{note.title}</h3>\n <p>{note.body}</p>\n </div>\n )\n });\n }", "function showIndices()\n\t{\n\t\n\tvar theLets = [ \"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\tvar i = 0;\n\n\tvar theIndex = \"\";\t// the html string we're constructing\n\t\n\tvar cr='<br\\>';\t\t// shortcut string for carriage return\n\t\n\tfor (i=0; i<26; i++)\n\t\t{\n\t\t\n\t\tif ( theLets[i] == thisIndex ) {\n\t\t\ttheIndex += '\\<span class=\"today\"\\>-&nbsp;' + theLets[i] + '&nbsp;-\\</span\\>' + cr;\n\t\t\t}\n\t\t\n\t\telse theIndex+='\\<a href=\"' + theLets[i] + '.html\"\\>' + theLets[i] +'\\</a\\>' + cr;\n\t\t\t\n\t\t}\n\t\t\n\t\tdocument.getElementById('datelink').innerHTML=theIndex;\n\t}", "function render(state)\n{\n let html = \"\"\n for(let i=0; i<state.length; i++)\n {\n if(state[i].striked)\n { html +=`<ul class=\"card toBeDeleted\"><li>${state[i].name}</li><li>${state[i].tel}</li><li>${state[i].address}</li><button class=\"delButton\">Delete</button></ul>`\n }\n else\n { html +=`<ul class=\"card\"><li>${state[i].name}</li><li>${state[i].tel}</li><li>${state[i].address}</li><button class=\"delButton\">Delete</button></ul>`\n }\n }\n return html\n}", "function loadNotes (data) {\r\n for (var n in data) {\r\n var i = data[n];\r\n if (data.hasOwnProperty(n)) {\r\n var note = $('<div class=\"note\" id=\"'+i[\"id\"]+'\"><p>'+i[\"text\"]+'</p><div class=\"d\">x</div></div>');\r\n note.css({\r\n top: i[\"y\"] + \"px\",\r\n left: i[\"x\"] + \"px\"\r\n }).show();\r\n addToPage(note);\r\n } \r\n }\r\n}", "function BlogIndex(conf) {\n\n var self = this;\n\n this.conf = conf;\n\n this.genBlogIndex = function() {\n\n /* write some HTML to format the data */\n var mdBodyObj = document.getElementById(gs_body_id);\n var ul = document.createElement('ul');\n appendAttribute(ul, 'class', 'list-group');\n mdBodyObj.appendChild(ul);\n\n var firstPost = 1;\n var reqPage = self.conf.requested_blog_index_page;\n var itemMax = self.conf.blog_items.length;\n\n if (self.conf.paginationIsActive()) {\n itemMax = self.conf.pagination;\n firstPost = (reqPage-1) * itemMax + 1;\n var gsPagination = new PageNav(gsConfig);\n gsPagination.genNavListTags();\n }\n\n var itemCnt = 0;\n for (index = firstPost; index < self.conf.blog_items.length; index++) {\n if (itemCnt >= itemMax) { break; }\n\n var item = self.conf.blog_items[index];\n var li = document.createElement('li');\n li.setAttribute('id', item);\n appendAttribute(li, 'class', 'list-group-item');\n ul.appendChild(li);\n\n self.PostPreviewToHTML(gs_post_path+'/'+item, item);\n itemCnt++;\n }\n };\n\n /* Download a post file (yaml + markdown), parse YAML, convert to HTML,\n * then post to given div-id. */\n this.PostPreviewToHTML = function(relpath, markdown_div) {\n var callback = function (text) {\n\n /* circumvent github's auto-meta parsing */\n text = text.replace(\"(((\",'---');\n text = text.replace(\")))\",'---');\n\n if ((isBlank(text)) || (text == null) || (text == 'null') ||\n (typeof text === 'undefined')) {\n var li = document.getElementById(markdown_div);\n li.innerHTML = 'Unable to load text for: '+relpath;\n return;\n }\n\n /* parse YAML header */\n var obj = jsyaml.loadFront(text)\n\n /* check for post meta data */\n var date = typeof obj.Date !== 'undefined' ? obj.Date.toDateString() : '';\n var author = typeof obj.Author !== 'undefined' ? obj.Author : '';\n var summary = typeof obj.Summary !== 'undefined' ? obj.Summary : '';\n var title = typeof obj.Title !== 'undefined' ? obj.Title : '';\n\n /* write some HTML to format the data */\n var li = document.getElementById(markdown_div);\n li.innerHTML = '<a href=?post='+markdown_div+'><b>'+title+\n '</b><br></a> ' + author + ' | <small>' + \n date + '</small><br><i>' + summary +\n '</i>';\n\n };\n getFile(relpath, callback);\n };\n\n this.genBlogIndex();\n}", "function google_bookmark_completer(input, pos, conservative) {\n var bookmarks = yield searchBookmarks(input);\n var titles = new Array();\n for (let i in bookmarks) {\n titles.push(bookmarks[i].title);\n }\n yield co_return({\n count: bookmarks.length,\n indexOf: function(x) { return titles.indexOf(x); },\n get_string: function(i) { return bookmarks[i].url; },\n get_description: function(i) { return bookmarks[i].title; },\n get_input_state: function(i) { return [bookmarks[i].title]; },\n get_value: function(i) {return bookmarks[i];}\n });\n}", "function _drawTodos() {\n let template = ''\n store.State.todos.forEach(item => {\n template += `<li class=\"action\">\n <div class =\"inline\"><input class=\"align-middle\" type=\"checkbox\" ${item.completed ? \"checked\" : \"\"}><div onclick=\"app.TodoController.toggleTodoStatus(${item._id})\">${item.description}</div></div><button class=\"btn btn-danger deleteBtn float-right\" onclick=\"app.TodoController.removeTodo(${item._id})\"></button></li>`\n });\n document.getElementById('list-items').innerHTML = template;\n // document.getElementById('task-count').innerText = \n}", "function makeList(stateArray) {\n var tempList = [];\n list.innerHTML = ''; //clears list \n var reviewList = (stateArray) ? stateArray.review : [];\n for (var i = 0; i < reviewList.length; i++) {\n tempList.unshift(reviewList[i])\n }\n tempList.forEach(listItem => newElement(listItem));\n if (localStorage.myInput) {\n myInputField.value = localStorage.myInput\n }\n}", "function bookMarkMe(e){\r\n\tvar linkToBookmark = e.target.getAttribute(\"mylink\");\r\n var bookMarkObject = new Object();\r\n bookMarkObject.link = linkToBookmark;\r\n bookMarkObject.course = courseName;\r\n bookMarkObject.textName = e.target.getAttribute(\"textName\");\r\n bookMarksArray.push(bookMarkObject);\r\n saveBookMarks();\r\n updateBookMarkList();\r\n}", "_generateJumpButtons(){\n /*jump control wrapper*/\n let jumpWrapper = this._carousel.find(this._elementSelectors.jumpWrapper);\n /*for each item:*/\n $(this._items).each((i, v) => {\n /*give item index attribute*/\n $(v).attr(this._itemIndexAttr, i);\n /*give create jump control for item*/\n let jumpControl = `<div class=\"${this._elementClasses.jump}\" ${this._itemIndexAttr}=\"${i}\"></div>`;\n $(jumpWrapper).append(jumpControl);\n });\n this._jumps = this._carousel.find(this._controlSelectors.jump);\n }", "getBookmarkTree() {\r\n chrome.bookmarks.getTree( (results) => {\r\n if ( !results[0] || !results[0].children ) {\r\n this.setState({ noBookmarks: true });\r\n } else {\r\n this.buildTree(results[0].children);\r\n }\r\n });\r\n }", "function renderBuilders(bookmark, hiddenStatus) {\n return `\n ${buildListItem(bookmark)}\n ${buildBookmarkLabel(bookmark)}\n ${buildDiv(hiddenStatus)}\n ${buildBookmarkDescription(bookmark)}\n ${buildBookmarkURL(bookmark)}${buildEdit()}\n ${buildDelete(bookmark)}\n ${buildListCloseTags()}\n `;\n }", "positions() {\n const originalString = this.state.originalString;\n return (\n originalString.map(function (item, i) {\n return <th scope=\"col\" className=\"tableheadleft\" key={i}>{i + 1}</th>\n }))\n }", "_createPageElements() {\n logger.debug('AnnotationListWidget#_createPageElements');\n const nav = this._nav;\n const pageRenderer = this._annoPageRenderer;\n\n for (let pageNum = 0; pageNum < this._canvases.length; ++pageNum) {\n let canvas = nav.getCanvas(pageNum);\n let pageElem = pageRenderer.createPageElement({\n pageNum: pageNum,\n canvasId: canvas['@id'],\n canvasLabel: canvas.label,\n layerId: this._layerId\n });\n\n this._rootElem.append(pageElem);\n pageElem.hide();\n nav.setPageElement(pageNum, pageElem);\n }\n }", "function _drawResults() {\n let songs = store.State.songs;\n console.log(songs);\n let template = \"\";\n songs.forEach(song => (template += song.Template));\n document.getElementById(\"search-results\").innerHTML = template;\n}", "function _drawLists() {\n let lists = store.State.lists;\n let template = '';\n lists.forEach(list => {\n template += list.Template;\n })\n \n document.getElementById('lists').innerHTML = template;\n}", "function generateAssignmentPageMarkers (currentPage) {\r\n //Generate Page Markers\r\n ///Empty out the current page marker row\r\n $(\"#assignment-page-markers\").empty();\r\n\r\n ///The number of assignments on a page, determined by a select box\r\n var pageSize = $(\"#frm-assignment-page-num\").val();\r\n\r\n ///How many markers to generate - truncated by parse int so one is added if there are extraneous assignments\r\n var numOfMarkers = parseInt(userSession.assignmentNum / pageSize);\r\n\r\n if(userSession.assignmentNum % pageSize != 0) {\r\n numOfMarkers++;\r\n }\r\n\r\n ///For the number of markers that need to be generated\r\n for(var i = 0; i < numOfMarkers; i++)\r\n {\r\n ///If it is the currently selected page\r\n if(i === currentPage) {\r\n ///Append a selected page marker\r\n $(\"#assignment-page-markers\").append('<a class=\"page-marker-selected\">' + i + '</a>');\r\n } else { \r\n ///If it is not the currently selected page append a normal page marker\r\n $(\"#assignment-page-markers\").append('<a class=\"page-marker\" onclick=\"setAssignmentPage(' + i + ')\">' + i + '</a>');\r\n }\r\n }\r\n}", "function render(list, d) {\n const item = document.createElement('li');\n item.className = 'bookmark';\n item.innerHTML = `<a href=\"${d.url}\">${d.title}</a>`;\n list.appendChild(item);\n}", "showfavorites() {\n if (this.state.favorites.length > 0) {\n var favs = []\n for (let i=0; i < this.state.favorites.length; i++) {\n favs.push(<div> <p style={favoriteNameStyle}> {this.state.favorites[i].name} </p> <p style={favoriteAddressStyle}> {this.state.favorites[i].title} </p> </div>)\n }\n return favs\n }\n }", "function setAutocomplete(tags){\n var dataArr = new Array();\n for ( var i = 0; i < tags.children.length; i++ ){\n for ( var j = 0; j < tags.children[i].children.length; j++ ){\n // use title, tag for label, category by tags\n var data = new Object();\n data['category'] = tags.children[i].title // tag name\n data['label'] = tags.children[i].children[j].title; // bookmark name\n dataArr.push(data);\n }\n }\n console.log(dataArr);\n $( \"#search\" ).bookmarkcomplete({\n delay: 0,\n source: dataArr\n });\n}", "function renderCYOTIndex(nodelist, roots) {\n console.log('renderCYOTIndex');\n console.trace(nodelist);\n\n let main = document.querySelector('#column-page');\n\n var t_tree = document.querySelector('#template__tree');\n // let t_menu = document.querySelector('#template__menu');\n // let menu = document.importNode(t_menu.content, true);\n var page = document.importNode(t_tree.content, true);\n var container = page.querySelector('.template__tree__ul');\n\n\n var t = document.querySelector('#template__cyot_short');\n for (var i in roots) {\n let nid = roots[i];\n // console.trace(nid);\n let node = nodelist[nid];\n // console.trace(nodelist, node);\n let item = document.importNode(t.content, true);\n\n let a = item.querySelector('.template__cyot_short__a');\n let title = item.querySelector('.template__cyot__title');\n let terms = item.querySelector('.template__cyot__terms');\n title.textContent = node.title;\n a.textContent = node.title;\n a.option = node.nid;\n a.onclick = function (e) {\n let state = {\n section: \"cyot_chapter\",\n nid: this.option,\n position: \"chapterstart\"\n };\n window.history.pushState(state, null, \"\");\n render(state);\n };\n\n\n\n let teaser = item.querySelector('.template__cyot_short__teaser');\n teaser.innerHTML = node.teaser;\n let author = item.querySelector('.template__cyot__author');\n author.textContent = (node.author ? node.author : 'an unknown author');\n\n\n\n renderTerms(node.terms, terms)\n\n container.appendChild(item);\n }\n\n\n // main.appendChild(menu);\n main.appendChild(page);\n\n // var cyot = document.createElement('ul');\n // cyot.classList.add('cyot');\n // for (i = 0; i < roots.length; i++) {\n // let rootnode = nodelist[roots[i]];\n // // console.trace(rootnode);\n // let li_node = document.createElement('li');\n // let a_node = document.createElement('a');\n // a_node.innerHTML = rootnode['title'];\n\n // a_node.option = rootnode.nid;\n // a_node.nodes = nodelist;\n // a_node.onclick = function(e) {\n // state = {\n // section: \"cyot_chapter\",\n // nid: this.option,\n // position: 'chapterstart'\n // };\n // window.history.pushState(state, null, \"\");\n // render(state);\n // };\n\n // var a_tree = document.createElement('a');\n // a_tree.innerHTML = \"view tree\";\n // a_tree.classList.add('link_secondary');\n // a_tree.option = rootnode.nid;\n // a_tree.nodes = nodelist;\n // a_tree.onclick = function(e) {\n // state = {\n // section: \"cyot_tree\",\n // nid: this.option\n // };\n // console.trace(a_tree.option);\n // window.history.pushState(state, null, \"\");\n // render(state);\n // window.scrollTo(0, 0);\n // };\n\n\n // li_node.appendChild(a_node);\n // var counter = document.createElement('span');\n // counter.classList.add('cyot_depth');\n // counter.innerHTML = rootnode['mindepth'] + \"|\" + rootnode['maxdepth'];\n // li_node.appendChild(counter);\n // li_node.appendChild(a_tree);\n // cyot.appendChild(li_node);\n // }\n\n // var container = document.getElementById('container');\n // container.innerHTML = \"\";\n // container.appendChild(cyot);\n\n // // scroll to top\n // window.scrollTo(0, 0);\n}", "questionPage() {\r\n //calls the renderButtons function with the current\r\n //question and answers list and returns on the\r\n //HTML Elements\r\n return this.renderButtons(\r\n //retrives the questions data from the state questions and points to\r\n //the questionNumber in the array\r\n this.state.questions[this.state.questionNum].question,\r\n this.state.questions[this.state.questionNum].answers\r\n );\r\n }", "function handleBookmarkExpandedClicked() {\n $('main').on('click', 'li', function(event) {\n let targetBookmark = $(this).data().bookmarkId\n store.bookmarks.forEach(currentBookmark => currentBookmark.id === targetBookmark ? currentBookmark.expanded = !currentBookmark.expanded : currentBookmark.expanded = false)\n render()\n })\n}", "function renderBooks() {\n let bookItems = CATALOG.map(describeBook);\n $(\".renderList\").html(bookItems.join(''));\n console.log(\"renderBook ran\")\n\n}", "function renderProjectPositions(){\n $('.project-item').each(function(){\n $(this).attr('data-project-position', $(this).index());\n });\n}", "function extractBookState() {\n //console.log('start extract');\n\n var book = {},\n $write = $('.active-page.write-page');\n book.title = $.trim($write.find('input[name=title]').val());\n book.author = $.trim($write.find('input[name=author]').val());\n book.categories = $write.find('.categories input[type=checkbox]:checked').map(function(i, v) {\n return $(v).prop('value'); }).get();\n book.type = $write.find('select[name=type]').val();\n book.audience = $write.find('select[name=audience]').val();\n book.language = $write.find('select[name=language]').val();\n var tags = $.trim($('input[name=tags]').val());\n tags = tags.replace(/[-.,\\/#!@#$%\\^&*()_=+\\[\\]{};:'\"<>?\\\\|`~]/g, \" \");\n tags = tags.replace(/\\s{2,}/g, \" \");\n book.tags = tags.split(' ');\n book.reviewed = $write.find('input[name=reviewed]:checked').length > 0;\n book.pages = $write.find('.write-pages li').map(function(i, p) {\n var $p = $(p),\n caption = $.trim($p.find('.thr-caption').html()) || '',\n img = $p.find('img.thr-pic'),\n width = parseInt(img.attr('data-width'), 10),\n height = parseInt(img.attr('data-height'), 10);\n return {\n text: caption,\n url: img.attr('src'),\n width: width,\n height: height\n };\n }).get();\n if (book.pages.length > 0) {\n var p = book.pages[0];\n var page = {\n text: book.title,\n url: p.url.replace('.jpg', '_t.jpg'),\n width: p.width > p.height ? 100 : Math.round(100 * p.width / p.height),\n height: p.width > p.height ? Math.round(100 * p.height / p.width) : 100\n };\n book.pages.unshift(page);\n }\n return book;\n }" ]
[ "0.6540716", "0.622713", "0.60755736", "0.5915292", "0.56479", "0.55604416", "0.55351645", "0.5514224", "0.54078996", "0.53795403", "0.5367853", "0.51981914", "0.518914", "0.5187464", "0.5167791", "0.5146413", "0.51034963", "0.5086719", "0.5007213", "0.49874547", "0.49817076", "0.4976121", "0.49759376", "0.4956512", "0.49396876", "0.4932931", "0.49294588", "0.49289548", "0.48897937", "0.4832485", "0.48217365", "0.48142025", "0.48132002", "0.4803891", "0.48013303", "0.48011842", "0.47957617", "0.4792305", "0.47858202", "0.4776472", "0.47628075", "0.47551036", "0.47442365", "0.4742603", "0.46852046", "0.46806934", "0.46752074", "0.46649405", "0.46631524", "0.46627083", "0.46546525", "0.46508503", "0.46460378", "0.463287", "0.46283224", "0.4627968", "0.46279424", "0.46126083", "0.4609578", "0.4606183", "0.46047744", "0.45933452", "0.458822", "0.45815676", "0.45762622", "0.45733622", "0.45721474", "0.4571816", "0.45697272", "0.4568147", "0.4567216", "0.45663822", "0.45645243", "0.45509237", "0.4549642", "0.45466185", "0.45396686", "0.4537848", "0.45291758", "0.45279086", "0.45265263", "0.45246607", "0.451097", "0.45079902", "0.45048943", "0.45034143", "0.4500691", "0.4498315", "0.44972095", "0.4492659", "0.44910568", "0.44835106", "0.44793606", "0.44790497", "0.4478593", "0.44766325", "0.4473233", "0.4470891", "0.44674346", "0.44634855" ]
0.49227783
28
class helper functions from bonzo
function welcome(){ var nickname = 'Hello, Halo, Hi.' $('#nickname').html(nickname) var t = new Date() var hour =t.getHours() var gretting = 'Good Morning !' if (hour >= 9 && hour <12){ gretting = 'Good Later Morning !' } if (hour >= 12 && hour <14){ gretting = 'Good Middle Day !' } if (hour >= 14 && hour <18){ gretting = 'Good Afternoon !' } if (hour >= 18 && hour <20){ gretting = 'Good Evening !' } if (hour >= 20 && hour <23){ gretting = 'Good Night !' } if (hour >= 23 && hour <24){ gretting = 'Good Later Night !' } if (hour >= 24 && hour <6){ gretting = 'Nice Dream !' } $('#gretting').html(gretting) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function HelperConstructor() {}", "obtain(){}", "function hobbitPrototype(){}", "function Bevy() {}", "function _beeswarm () {} // constructor ???", "transient protected internal function m189() {}", "function Utils() {}", "function Utils() {}", "constructur() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function Utils(){}", "__previnit(){}", "transient private internal function m185() {}", "private internal function m248() {}", "protected internal function m252() {}", "getBone(b) {\nreturn this.bones[b];\n}", "transient private protected internal function m182() {}", "function AeUtil() {}", "function Adapter() {}", "getBone4cc(b) {\nreturn this.bone4cc[b];\n}", "function Bare() {}", "function Bare() {}", "function _construct()\n\t\t{;\n\t\t}", "function Adaptor() {}", "function Burnisher () {}", "function Copcar(){}", "function ClassHandle() {\n}", "function Utils() {\n}", "function Ha(){}", "static private protected internal function m118() {}", "function Interfaz(){}", "constructor (){}", "function CCUtility() {}", "function H(a,b){this.cf=a;this.bb=b;Ug(this);var c=Vg(this)[0];this.sb=c[1];H.aa.constructor.call(this,c[0])}", "function wh(a){wh.j.constructor.call(this,a);this.zc()}", "function Helper() {}", "function Billonaire() { }", "transient private public function m183() {}", "transient final protected internal function m174() {}", "static protected internal function m125() {}", "function xh(a){xh.j.constructor.call(this,a);this.zc()}", "function Zt(){}", "static private internal function m121() {}", "function wa(){}", "function Bandcamp() {}", "function gh(a,b){var c;if(b){var d=this;c=function(a){var c=hh.call(d,a);a=void 0===c?a:null===c?d.yb():c;b.call(d,a);return c}}else c=hh;gh.aa.constructor.call(this,ih,c);this.Xa(a||\"\")}", "consructor() {\n }", "function miFuncion (){}", "function Util() {}", "function oi(){}", "function _____SHARED_functions_____(){}", "function Class(){}", "function Class(){}", "function Class(){}", "constructor () {\r\n\t\t\r\n\t}", "function zb(a,b,c){this.a=a;this.b=b||1;this.f=c||1}", "function B(a,b){this.oa=a;this.o=b||this.De()}", "function RgbaBase() {\n\n}", "function Alerter() {}", "transient private protected public internal function m181() {}", "getBones() {\nreturn this.bones;\n}", "transient final private protected internal function m167() {}", "function Zh(a){Zh.aa.constructor.call(this,a);this.ce()}", "function ug(a,b){ug.Z.constructor.call(this,a);this.cb=b}", "get Custom() {}", "get BC5() {}", "function hc(){}", "static transient private protected internal function m55() {}", "function Zg(a,b){this.h=a;this.m=null;this.type=b;this.N=this.ib=0;this.ob=!1;this.Fb=this.h.o.Bi}", "static BoneFromMuscle() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function tempCtor() {}", "constructor(a,b){\n this.a = a;\n this.b = b;\n }", "add(...args){ \n // value.constuctor.name; - return Class name \"Track,Artist,Album\";\n // value.name - return class.name \"Linkin park exemple\";\n // IF :for classes! if one value - this CLASS. if more value: first - Class, nexts - parameters this Class;\n //ELSE: For class parameters. If we have more then one parameters = > [new Class,...parametrs for this class ];\n let myArguments = [];\n myArguments.push(...args); \n // TRACK \n if(myArguments[0].constructor.name === \"Track\"){\n if(myArguments.length === 1){\n this.Track.push(myArguments[0]); \n }\n //FOR TRACK WE DON'T HAVE NECESSARY ADD ADDITIONAL PARAMETERS. IT'S NOT LOGICAL\n else{ return \"Pls using update for Track.\" } \n };\n\n // ALBUM\n if(myArguments[0].constructor.name === \"Album\"){\n if(myArguments.length === 1){\n this.Album.push(myArguments[0]);\n }\n else{\n this.Album.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n } \n }\n } \n });\n } \n };\n //ARTIST\n if(myArguments[0].constructor.name === \"Artist\"){\n if(myArguments.length === 1){\n this.Artist.push(myArguments[0]);\n }\n else{\n this.Artist.forEach(element => {\n if(element === myArguments[0]){\n for(let i = 1; i < myArguments.length; i++){\n if(Array.isArray(myArguments[i])){\n if(myArguments[i][i-1].constructor.name === \"Track\" ){ \n element.traks = element.traks.concat(myArguments[i]);\n }\n if(myArguments[i][i-1].constructor.name === \"Album\"){\n element.albums = element.albums.concat(myArguments[i]);\n } \n }\n if(myArguments[i].constructor.name === \"Track\"){\n element.traks.push(myArguments[i]);\n }\n if(myArguments[i].constructor.name === \"Album\"){\n element.albums.push(myArguments[i]);\n }\n \n }\n } \n });\n } \n }; \n }", "function ze(a,b){this.N=[];this.xa=a;this.ia=b||null;this.H=this.D=!1;this.F=void 0;this.ga=this.Da=this.R=!1;this.O=0;this.Of=null;this.J=0}", "function internalClass() { }", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "constructor() {\n\n\t}", "constructor( ) {}", "function Class() {}", "function ea(){}", "function Mobilmodern(nama,tahun_keluar){\n let mobil = Object.create(methodMobil) //* Terbaca sebagai Prototype di console log, inilah yang akan jadi cikal bakal class pada javascript\n mobil.nama = nama, \n mobil.tahun_keluar = tahun_keluar,\n mobil.bensin = 100\n\n return mobil\n}", "function PenguinClass() {}", "function z(a,b){this.pa=a;this.o=b||this.Ce()}", "static MuscleFromBone() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "function TempCtor() {}", "static transient private protected public internal function m54() {}", "function zi(){return zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zi.apply(this,arguments)}" ]
[ "0.60303414", "0.6020362", "0.6020362", "0.6013159", "0.5998919", "0.5954897", "0.59544575", "0.59524184", "0.5907265", "0.5897004", "0.5897004", "0.5885336", "0.58415973", "0.58415973", "0.58415973", "0.58415973", "0.5839296", "0.5778861", "0.5773885", "0.5765922", "0.5762175", "0.57253855", "0.5711453", "0.5697122", "0.5689565", "0.56778264", "0.5675206", "0.5675206", "0.56295633", "0.56135714", "0.5609524", "0.5607091", "0.5594646", "0.5590878", "0.5589793", "0.5570352", "0.55684954", "0.5565593", "0.5564564", "0.55275166", "0.55104494", "0.5491448", "0.54893744", "0.54861873", "0.54825664", "0.5482385", "0.5481491", "0.5472595", "0.54563034", "0.5456281", "0.54480267", "0.54405373", "0.54339653", "0.54336107", "0.5427158", "0.5421032", "0.54150057", "0.5414448", "0.5414448", "0.5414448", "0.5411419", "0.5408784", "0.53894866", "0.5372928", "0.5371222", "0.53544605", "0.53503764", "0.5345113", "0.5336681", "0.5334504", "0.53313315", "0.53235435", "0.5318028", "0.53110915", "0.5307898", "0.53031176", "0.53028446", "0.53028446", "0.53028446", "0.5299325", "0.52952456", "0.52844524", "0.5283364", "0.52757514", "0.52685237", "0.5266226", "0.525697", "0.52563035", "0.52504724", "0.52448237", "0.5241475", "0.52318424", "0.52278113", "0.52277", "0.52277", "0.52277", "0.52277", "0.52277", "0.52277", "0.5227511", "0.52257234" ]
0.0
-1
TODO: adjust this to corep2p
__filterPeers (peers) { let filteredPeers = peers .filter(peer => peer.status === 'OK') .filter(peer => peer.ip !== '127.0.0.1') filteredPeers = orderBy(filteredPeers, ['height', 'delay'], ['desc', 'asc']) const networkHeight = filteredPeers[0].height return { networkHeight, peers: filteredPeers .filter(peer => Math.abs(peer.height - networkHeight) <= 10) .map(peer => (`${peer.ip}:${peer.port}`)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get PSP2() {}", "private public function m246() {}", "obtain(){}", "get Prologic() {}", "transient private protected internal function m182() {}", "private internal function m248() {}", "set PSP2(value) {}", "constructPdpData() {\n const { productItem } = this.state;\n const { gtmDataLayer } = this.props;\n let enhancedAnalytics = { ...productItem };\n if (productItem.isGiftCard && productItem.gcAmounts && productItem.isGiftCard === 'Y') {\n const price = { ...productItem.price, salePrice: productItem.gcAmounts[0] };\n enhancedAnalytics = { ...productItem, price };\n }\n if (gtmDataLayer) {\n enhancedAnalyticsPDP({ gtmDataLayer, productItem: enhancedAnalytics });\n }\n this.getMixedMediaSetData(productItem);\n this.getAyorterm();\n }", "protected internal function m252() {}", "prepare() {}", "function SubProvider() {\n\t\n\t}", "function SRP2(state) {\n state.rp2 = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SRP2[]', state.rp2);\n }\n }", "function SubProvider() {\n\n\t}", "function test_candu_graphs_datastore_vsphere6() {}", "satisfied() { return false; }", "transient private internal function m185() {}", "transient protected internal function m189() {}", "function doSomething(p) { //p รับค่าจาก per2\n //p=per2 (memory address of per2 to p)\n p.name = 'Mary'; //pers2.name='Mary'\n\n}", "get _pool () {return this._p.pool;}", "prepare() {\n }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "function promoterenhancer(){\n\n}", "onModifySpA() {}", "_loadAllego() {\n let {webservice} = this.props.config;\n\n if (webservice.allegolrs) {\n requestUsersLRS({lrs: webservice.allegolrs}, getAllEmployeesInHierarchyTree().map(o => o.email))\n .fork(err => {\n console.warn('!!! Could not load Allego statements !!!', err);\n this._allDataLoaded();\n }, res => {\n //console.log('Allego LRS', res);\n AppStore.dispatch(SetAllegoLRS(res));\n this._allDataLoaded();\n });\n } else {\n this._allDataLoaded();\n }\n }", "function findPAndQ(context) {\n const pqFinder = new security.PQFinder(context.resPQ.pq)\n logger.debug('Start finding P and Q, with PQ = %s', pqFinder.getPQPairNumber())\n const pq = pqFinder.findPQ()\n logger.debug('Found P = %s and Q = %s', pq[0], pq[1])\n const buffers = security.PQFinder.getPQPair(pq)\n context.pBuffer = buffers[0]\n context.qBuffer = buffers[1]\n // const buffers = pq.map(security.PQFinder.toRawBytes)\n // context.pBuffer = buffers[0]\n // context.qBuffer = buffers[1]\n return context\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "prepare() {\n super.prepare()\n }", "function setup(p){\n\n}", "function specialtyAssignmentsProviderProcessing() {\n\n}", "buildSPS() {\n }", "function workFlowAu2Id(entitiesId1,entitiesId2) {\n\t\n var AfIds = getAuthorAfIds(entitiesId1);\n\tvar exprs = setExprAfIds(AfIds.array);\n\tgetAfIdsPlus(entitiesId2,exprs);\n\t\n\tif(entitiesId2[0].CC > 10) {\n\t\tvar exprs = setExprRefs(entitiesId1);\n\t\tgetCitationPlus(entitiesId2,exprs);\n\t} else {\n\t\tgetCitation(entitiesId2);\n\t}\n\t\n var paths = [];\n \n var Id1 = parseInt(entitiesId1.Id);\n var Id2 = parseInt(entitiesId2.Id);\n \n // 1-hop\n entitiesId2.forEach((entity) => {\n entity.AA.forEach( (itemAA) => {\n if(itemAA.AuId === entitiesId1.Id) {\n paths.push([Id1,Id2]);\n }\n });\n });\n \n // hops au-id-..-id\n entitiesId1.forEach((entity)=>{\n // console.log(`RId : ${JSON.stringify(entity)}`);\n entitiesId = [entity];\n entitiesId['Id'] = entity.Id;\n var subPaths = getHopId2Id(entitiesId,entitiesId2);\n subPaths.forEach( (path) => {\n path.unshift(Id1);\n paths.push(path);\n });\n });\n \n // hops au-af-au-id\n\tvar auIds = getEntityAuIds(entitiesId2[0]);\n var authorIndex = 0;\n // hops au-id-id-id\n var Ids = [];\n var citationIndex = 0;\n while(true) {\n if(globalAfIdsQueryCount <= 0 && globalCitationQueryCount <= 0) {\n if(authorIndex >= globalAuthorArray.length\n\t\t\t\t&& citationIndex >= globalCitationArray.length) {\n break;\n }\n } else {\n if(authorIndex >= globalAuthorArray.length\n\t\t\t\t&& citationIndex >= globalCitationArray.length) {\n deasync.sleep(5);\n\t\t\t\tcontinue;\n }\n }\n while(authorIndex < globalAuthorArray.length) {\n var AA = globalAuthorArray[authorIndex];\n if(AfIds.hasOwnProperty(AA.AfId) && auIds.hasOwnProperty(AA.AuId)) {\n\t\t\t\tpaths.push([Id1,AA.AfId,AA.AuId,Id2]);\n\t\t\t}\n authorIndex ++;\n }\n while(citationIndex < globalCitationArray.length) {\n var entity = globalCitationArray[citationIndex];\n Ids[entity.Id] = 1;\n citationIndex ++;\n }\n }\n \n entitiesId1.forEach((entity)=>{\n entity.RId.forEach((RId) => {\n if(Ids.hasOwnProperty(RId)) {\n paths.push([Id1,entity.Id,RId,Id2]);\n // console.log(`path: ${JSON.stringify(paths[paths.length-1])}`);\n }\n });\n });\n \n return paths;\n}", "getEntity() {}", "function SubProvider() {\n\n}", "function SubProvider() {\n\n}", "function SubProvider() {\n\n}", "static private protected internal function m118() {}", "function _____SHARED_functions_____(){}", "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires()\n }", "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires()\n }", "static async getInitialProps(context) {\n let platformSlug = context.query.id;\n\n let productSlug = context.query.pid;\n\n\n let platform = await API.makeRequest(\n 'get',\n '/api/platforms/slug/' + platformSlug,\n );\n\n let products = await API.makeRequest(\n 'get',\n '/api/products/platform/' + platformSlug,\n );\n\n\n products.map((elem) => {\n if (productSlug === elem.id)\n return elem\n })\n\n\n return {\n platform: platform,\n product: products[0],\n };\n }", "_loadHierarchyLearningData() {\n let {webservice} = this.props.config,\n currentUser = AppStore.getState().currentuser,\n audience = AppStore.getState().audiencemembers;\n\n getLearningForManagerHierarchy(webservice, currentUser.id, audience ,this._onLoadingProgress.bind(this)).fork(console.error, res => {\n console.log('hierarchy loaded', res);\n AppStore.dispatch(SetHierarchy(res));\n // this._loadAudience();\n this._loadAllego();\n });\n }", "resolve(parent,args){\n //code to get data from db/other sources\n //return _.find(authors,{id:args.id});\n return Author.findById(args.id)\n }", "initOrphaned() {}", "_FBPReady() {\n super._FBPReady();\n //this._FBPTraceWires();\n }", "fetch () {\n return PS.get();\n }", "init() {\n }", "function ProviderData() {}", "function ProviderData() {}", "function ProviderData() {}", "get _first() {return this._pp.first;}", "function SRP2(state) {\n state.rp2 = state.stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'SRP2[]', state.rp2);\n}", "prepareBaseData() { super.prepareBaseData(); }", "static private internal function m121() {}", "getRestChains (identifier){\n return local_RestChains.slice(); \t\n }", "static transient final private internal function m43() {}", "fork( obj){\n\t\tconst newProx= new (AggroProx())( obj, this)\n\t\treturn newProx.proxied\n\t}", "_FBPReady() {\n super._FBPReady();\n\n }", "resolve(parent,args){\n //code to get data from db/other sources\n //return _.find(books,{id:args.id});\n return Book.findById(args.id) //find the book by using the id\n\n }", "constructor () {\r\n\t\t\r\n\t}", "function workFlowId2Au(entitiesId1,entitiesId2) {\n getReference(entitiesId1);\n\t\n var AfIds = getAuthorAfIds(entitiesId2);\n\tvar exprs = setExprAfIds(AfIds.array);\n\tgetAfIdsPlus(entitiesId1,exprs);\n \n var paths = [];\n \n var Id1 = parseInt(entitiesId1.Id);\n var Id2 = parseInt(entitiesId2.Id);\n \n // 1-hop\n entitiesId1.forEach((entity) => {\n entity.AA.forEach( (itemAA) => {\n if(itemAA.AuId === entitiesId2.Id) {\n paths.push([Id1,Id2]);\n }\n });\n });\n \n // hops id-..-id-au\n entitiesId2.forEach((entity)=>{\n // console.log(`RId : ${JSON.stringify(entity)}`);\n entitiesId = [entity];\n entitiesId['Id'] = entity.Id;\n var subPaths = getHopId2Id(entitiesId1,entitiesId);\n subPaths.forEach( (path) => {\n path.push(Id2);\n paths.push(path);\n });\n });\n \n // hops id-au-af-au\n\tvar auIds = getEntityAuIds(entitiesId1[0]);\n var authorIndex = 0;\n // hops id-id-id-au\n var Ids = getEntitiesIds(entitiesId2);\n var referenceIndex = 0;\n while(true) {\n if(globalAfIdsQueryCount <= 0 && globalReferenceQueryCount <= 0) {\n if(authorIndex >= globalAuthorArray.length\n\t\t\t\t&& referenceIndex >= globalReferenceArray.length) {\n break;\n }\n } else {\n if(authorIndex >= globalAuthorArray.length\n\t\t\t\t&& referenceIndex >= globalReferenceArray.length) {\n deasync.sleep(5);\n\t\t\t\tcontinue;\n }\n }\n while(authorIndex < globalAuthorArray.length) {\n var AA = globalAuthorArray[authorIndex];\n if(AfIds.hasOwnProperty(AA.AfId) && auIds.hasOwnProperty(AA.AuId)) {\n\t\t\t\tpaths.push([Id1,AA.AuId,AA.AfId,Id2]);\n\t\t\t}\n authorIndex ++;\n }\n\t\t\n while(referenceIndex < globalReferenceArray.length) {\n var entity = globalReferenceArray[referenceIndex];\n \n if(entity.hasOwnProperty('RId')) {\n entity.RId.forEach((RId) => {\n if(Ids.hasOwnProperty(RId)) {\n paths.push([Id1,entity.Id,RId,Id2]);\n }\n });\n }\n referenceIndex ++;\n }\n }\n \n return paths;\n}", "getOrderDetails(orderId) {\r\n orderId = orderId || null\r\n let orderDetails = {}\r\n\r\n // Get order model\r\n let order = this.payload.order || null\r\n\r\n let buildOrderDetails = (order) => {\r\n if (order === null) return\r\n\r\n let orderDetails = {}\r\n orderDetails.order = order\r\n\r\n let serverOrderProducts = {}\r\n let orderProducts = []\r\n \r\n for (let serverOrderProduct in serverOrderProducts) {\r\n orderProduct = {}\r\n \r\n let product = {}\r\n orderProduct.image = product.image\r\n orderProduct.shipping = product.shipping\r\n orderProduct.updateStock = product.subtract\r\n\r\n orderProducts.push(orderProduct)\r\n }\r\n\r\n orderDetails.orderProducts = orderProducts\r\n\r\n let customerId = order.customerId\r\n if (customerId > 0) {\r\n let orderCustomer = this.customer\r\n orderDetails.orderCustomer = orderCustomer\r\n }\r\n\r\n /*let orderPaymentDetails = []\r\n let orderPayments = em.getRepository(PosOrderPayment::class).findBy(criteria)\r\n if (orderPayments instanceof Array &&\r\n orderPayments.length > 0) {\r\n for (let orderPayment in orderPayments) {\r\n orderPaymentDetail = {} //new PosOrderPaymentDetails()\r\n orderPaymentDetail.orderPayment = orderPayment\r\n orderPaymentType = em.find(PosPaymentType::class, orderPayment.getPaymentTypeId())\r\n orderPaymentDetail.type = orderPaymentType.type)\r\n orderPaymentDetail.name(orderPaymentType.name)\r\n\r\n orderPaymentDetails.push(orderPaymentDetail)\r\n }\r\n }*/\r\n\r\n //orderDetails.setOrderOptions(em.getRepository(PosOrderOption::class).findBy(criteria))\r\n //orderDetails.setOrderTotals(em.getRepository(PosOrderTotal::class).findBy(criteria, array('sortOrder' => 'ASC')))\r\n //orderDetails.setOrderPayments(orderPaymentDetails)\r\n\r\n return orderDetails\r\n }\r\n\r\n if (orderId !== null) {\r\n if (order !== null && orderId > 0) {\r\n this.fetchOrder(orderId,\r\n (data) => {\r\n // onSuccess\r\n orderDetails = buildOrderDetails(data.order)\r\n },\r\n () => {\r\n // onError\r\n })\r\n }\r\n } else {\r\n orderDetails = buildOrderDetails(this.payload.order)\r\n }\r\n\r\n return orderDetails\r\n }", "function listify(words: Array<string>): string {\n if (words.length === 1) { return words[0]; }\n return words.slice(0, words.length - 1).join(\", \") + \" and \" + words[words.length - 1];\n}\n\n\nlet cli = new CLI();\n\nabstract class EnsPlugin extends Plugin {\n _ethAddressCache: { [ addressOrInterfaceId: string ]: string };\n\n constructor() {\n super();\n ethers.utils.defineReadOnly(this, \"_ethAddressCache\", { });\n }\n\n getEns(): ethers.Contract {\n return new ethers.Contract(this.network.ensAddress, ensAbi, this.accounts[0] || this.provider);\n }", "function createExistingIdentities() {\n\n}", "async updateEndpointToSpIdMap () {\n let endpointToSPIdMap = {}\n try {\n const contentNodes = await this.audiusLibs.ethContracts.getServiceProviderList('content-node')\n contentNodes.forEach(cn => { endpointToSPIdMap[cn.endpoint] = cn.spID })\n } catch (e) {\n this.logError(`[updateEndpointToSpIdMap]: ${e.message}`)\n }\n\n if (Object.keys(endpointToSPIdMap).length > 0) this.endpointToSPIdMap = endpointToSPIdMap\n if (Object.keys(this.endpointToSPIdMap).length === 0) {\n this.logError('[updateEndpointToSpIdMap]: Unable to initialize this.endpointToSPIdMap')\n this.snapbackReconfigEnabled = false\n } else {\n this.snapbackReconfigEnabled = this.nodeConfig.get('snapbackReconfigEnabled')\n }\n }", "function _construct()\n\t\t{;\n\t\t}", "function ProviderData(){}", "_getOrigEntityHpPath() {\n throw new Error('Child class must implement `_getOrigEntityHpPath`');\n }", "function handleQuery(type,par,via,parentRange,prop,handleParse){\n\n return new Promise(resolveOutput=>{\n\n \n\n \n let appName = parentRange.appName\n var DBName = par.on\n var theDatabaseInfo = prop.database[DBName]\n if (!theDatabaseInfo) return resolveOutput({error:'Check collection name'})\n\n let collection = prop.db.collections[par.on]\n\n if(!collection) return resolveOutput({error:'db connection has not yet updated according to the new connection please re host'})\n\n if ( (type == 'update' || type == 'find') && !par.where) par.where = {}\n if (type === 'write' && par.where) return resolveOutput({error:\"where not a recognized under $write\"})\n \n if (!par.put) par.put = null\n\n let fieldsWithAttribute = {}\n let permissionToCheck\n\n switch(type){\n case 'update': \n permissionToCheck = 'updatable'\n break;\n case 'find': \n permissionToCheck = 'findable'\n break; \n case 'search': \n permissionToCheck = 'findable'\n break; \n case 'write': \n permissionToCheck = 'writable'\n break; \n case 'deletable': \n permissionToCheck = 'deletable'\n break; \n }\n\n function failure(failureData){\n return resolveOutput({error:'permission denied',errMsg:failureData})\n }\n\n\n function errorOccured(failureData,meta){\n if(!meta) meta = null\n return resolveOutput({error:failureData, meta:meta})\n }\n\n function resolve(data){\n //execute onAction like onUpdate or OnWrite or Onfind\n\n let onActionName = 'on'+capitalize(type)\n\n function reportErrorToLog(dataNmeta){\n let error = dataNmeta.error\n //save to log collection of that app\n }\n\n \n\n handleParse(prop,{ parse:theDatabaseInfo[onActionName], put:par.put, field:data, failure:reportErrorToLog, via:'action'})\n \n resolveOutput(data)\n }\n\n\n function permissionCheckAbstraction(toParse,field){\n return new Promise(permissionResolved=>{\n handleParse(prop,{ parse:toParse, put:par.put, field:field, failure: failure}).then(permissionResolved)\n })\n }\n\n\n\n for(let field in theDatabaseInfo.schema){\n if (typeof theDatabaseInfo.schema[field] !== 'object') continue\n for(let key in theDatabaseInfo.schema[field]){\n \n if(!fieldsWithAttribute[key]) fieldsWithAttribute[key] = {}\n fieldsWithAttribute[key][field] = theDatabaseInfo.schema[field][key]\n\n }\n }\n\n \n\n \n if(par.put) if(par.put.id) throw Error(`id can't be altered`)\n\n par.where = translateId(par.where)\n\n function translateId(query){\n\n\n for(let key in query){\n if(key == '_id'){\n \n let validId = mongoose.Types.ObjectId.isValid(query[key])\n if(!validId) throw Error('invalid id')\n query['_id'] = mongoose.Types.ObjectId(query[key])\n continue\n }\n }\n \n return query\n }\n\n \n \n //Note: why is field value not available to write, read and update parse: because it doesn't needs one it is only required for the permission parse as no one will say write $writer or read where $writer = user id they can just use the field name\n //exception: it is available for update put query \n\n function loopPremissionCheck(info_read, callback){\n \n if (info_read.length === 0) return callback(info_read)\n var filteredRows = []\n let loopStep = 0\n permissionLoopChecker()\n\n function permissionLoopChecker(){\n\n \n function checkComplete(returnedValue){\n if(returnedValue == true){\n filteredRows.push( info_read[loopStep] )\n CheckEndOrIncrement()\n }else{\n return failure(returnedValue)\n }\n }\n\n function CheckEndOrIncrement(){\n loopStep++\n if (loopStep >= info_read.length){\n return callback(filteredRows)\n }else{\n permissionLoopChecker()\n }\n }\n\n permissionCheckAbstraction(theDatabaseInfo[permissionToCheck], info_read[loopStep]).then(checkComplete)\n\n }\n\n }\n\n \n async function checkIndivisualFieldPermission(query,typeOfQuery){\n for(let field in fieldsWithAttribute[typeOfQuery]){\n\n let toParseObj = fieldsWithAttribute[typeOfQuery][field]\n\n if(par.select){ //to do \n if(!par.select[field]){\n noIcantreadThisField(false)//if this field is not in the select obj then don't read it and thus don't check permission to read it bu continuing \n continue\n }\n }\n\n \n let parsed = await permissionCheckAbstraction(toParseObj, query)\n \n\n //for indivisual permission undefined, it means allowed\n //for main permission undefined means not allowed\n\n if(query[field]) if(parsed == false && typeOfQuery !== 'findable') return failure('sub permission denied')\n if(query[field]) if(parsed == false) query[field] = 'not allowed to read';\n }\n\n return query\n }\n\n async function fillDefaultValues(query){\n \n for(let field in fieldsWithAttribute.default){\n\n if(!query[field]){\n let defaultValue = fieldsWithAttribute.default[field]\n //the default value could also we a function\n query[field] = await handleParse(prop, { via:'action', parse:defaultValue, put:par.put, failure: (data)=>{ errorOccured(data.error,'Error when setting default value') }})\n console.log(query[field],query)\n }\n\n }\n\n return query\n \n }\n\n\n\n // support for all the values listed here\n // https://docs.mongodb.com/manual/reference/operator/query/\n\n\n\n \n switch(type.toLowerCase()){\n \n case 'write':\n \n let writeFunction = ()=>{\n \n var vr_schema = new collection(par.put)\n vr_schema.save((error,writenObj)=>{\n \n if (error) return resolveOutput({error:error.message })\n\n return resolve(writenObj)\n\n })\n }\n\n let originalPut = {...par.put}\n\n \n\n fillDefaultValues(par.put).then(proceedTowrite) //it needs to be done even when query is requested via action\n \n\n function proceedTowrite(){\n \n \n \n if(via === 'action') return writeFunction()\n \n //we are giving original put here because default put values must not be regarded as write\n checkIndivisualFieldPermission(originalPut,'writable').then(function(){\n \n permissionCheckAbstraction(theDatabaseInfo[permissionToCheck]).then((parsed)=>{\n if(!parsed) return failure()\n \n writeFunction()\n })\n })\n\n }\n\n\n \n break\n case 'update'://only one update doing multiple updates may slow down server, multiple updates can occur on the client side, multiple update also doesn't has many applications\n \n \n collection.findOne(par.where, (err, info_read)=>{\n\n if(err) throw Error(err)\n if(!info_read) return errorOccured('docuemnt not found to be updated')\n if(via === 'action') return update([info_read])\n\n checkIndivisualFieldPermission(par.put,'updatable').then(proceedQuery)\n\n function proceedQuery(){\n loopPremissionCheck([info_read],update) //check if we can update this document\n }\n\n })\n\n //only one row is updated\n async function update(filteredRows){\n\n if(filteredRows.length === 0) return failure()\n\n collection.findOneAndUpdate({_id: filteredRows[0].id},par.put, {new: true} ,function(error, doc){\n if (error) return resolve( {error:error} )\n return resolve( doc)\n })\n }\n\n\n break\n case 'find':\n \n\n let sortBy = {sort:{}, limit: 50}//max results are 50\n if (par.limit) sortBy.limit = par.limit//document limit\n\n if (par.sort){\n sortBy.sort = par.sort\n }\n\n\n if(par.type == 'count'){//return the number of documents, pb: permission check does not happen but it is also not that necessary as no. of documents doesn't reveal much\n \n collection.countDocuments(par.where, function(err, info){\n if(err) throw Error(error)\n return resolve(info)\n })\n\n return\n }\n\n\n collection.find(par.where,null,sortBy,function(error, info_read){\n if (error) throw Error(error)\n if(via === 'action') return resolve(info_read)\n\n loopPremissionCheck(info_read,primePermissionCheckSuccessful)\n\n \n async function primePermissionCheckSuccessful(readDocumentsArray){ //now doing indivisual readable check\n \n let newDocArray = []\n \n for(let index of readDocumentsArray){\n newDocArray.push( await checkIndivisualFieldPermission( index ,'findable') )\n }\n\n resolve(newDocArray)\n }\n \n })\n break\n case 'delete':\n \n collection.find(par.where,function(error, info_read){\n if(error) throw Error(error)\n \n \n if(info_read.length === 0) resolve({error:'not found'})\n if(via === 'action') return checkComplete(info_read)\n\n loopPremissionCheck([info_read[0]], checkComplete)\n\n \n function checkComplete(){\n collection.deleteOne({_id: info_read[0].id}, function(err) {\n if(err) throw Error('delete error'+err)\n if(!err) resolve(true)\n })\n }\n\n\n })\n\n\n \n\n break\n case 'search':\n \n //Wildcard indexes cannot support queries using the $text operator so we switched to atlas full text search\n //atlas full text search: https://docs.atlas.mongodb.com/reference/atlas-search/tutorial/#fts-tutorial-ref\n //par.field could be a field to allow multiple fields\n\n let limit = 10\n if(par.limit) limit = par.limit\n\n if(!par.fields) throw Error( ' \"fields\" argument is mandatory for $search, use array for multiple field, string for indivisual field')\n\n\n collection.aggregate([\n\n {$search: {\n \"text\": {\n \"query\": par.where,\n \"path\": par.fields\n }\n }},\n { \"$limit\": limit },\n \n ]).exec((error, info_read)=>{\n\n if (error) return resolve( {error:error} )\n if(via === 'action') return resolve(info_read)\n loopPremissionCheck(info_read,resolve)\n\n })\n\n break \n }\n \n })\n}", "resolveParentContracts() {\n return { pausable: true };\n }", "getPersonId() {\n return this.#fetchAdvanced(this.#getPersonIdURL()).then((responseJSON) => {\n let personBOs = PersonBO.fromJSON(responseJSON);\n return new Promise(function (resolve) {\n resolve(personBOs);\n })\n })\n }", "function kp() {\n $log.debug(\"TODO\");\n }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function clientCode2(component1, component2) {\n // ...\n if (component1.isComposite()) {\n component1.add(component2);\n }\n console.log(\"RESULT: \" + component1.operation());\n // ...\n}", "_FBPReady() {\n super._FBPReady();\n // this._FBPTraceWires();\n }", "createOffer() {\n this.pc.createOffer()\n .then(this.getDescription.bind(this))\n .catch(err => console.log(err));\n return this;\n }", "transient private protected public internal function m181() {}", "static final private internal function m106() {}", "_FBPReady() {\n super._FBPReady();\n }", "constructor(ip, port, protocol = 'http', networkID = constants_1.DefaultNetworkID, XChainID = undefined, CChainID = undefined, hrp = undefined, skipinit = false) {\n super(ip, port, protocol);\n /**\n * Returns a reference to the Admin RPC.\n */\n this.Admin = () => this.apis.admin;\n /**\n * Returns a reference to the Auth RPC.\n */\n this.Auth = () => this.apis.auth;\n /**\n * Returns a reference to the EVMAPI RPC pointed at the C-Chain.\n */\n this.CChain = () => this.apis.cchain;\n /**\n * Returns a reference to the AVM RPC pointed at the X-Chain.\n */\n this.XChain = () => this.apis.xchain;\n /**\n * Returns a reference to the Health RPC for a node.\n */\n this.Health = () => this.apis.health;\n /**\n * Returns a reference to the Info RPC for a node.\n */\n this.Info = () => this.apis.info;\n /**\n * Returns a reference to the Metrics RPC.\n */\n this.Metrics = () => this.apis.metrics;\n /**\n * Returns a reference to the Keystore RPC for a node. We label it \"NodeKeys\" to reduce\n * confusion about what it's accessing.\n */\n this.NodeKeys = () => this.apis.keystore;\n /**\n * Returns a reference to the PlatformVM RPC pointed at the P-Chain.\n */\n this.PChain = () => this.apis.pchain;\n let xchainid = XChainID;\n let cchainid = CChainID;\n if (typeof XChainID === 'undefined'\n || !XChainID\n || XChainID.toLowerCase() === 'x') {\n if (networkID.toString() in constants_1.Defaults.network) {\n xchainid = constants_1.Defaults.network[networkID].X.blockchainID;\n }\n else {\n xchainid = constants_1.Defaults.network[12345].X.blockchainID;\n }\n }\n if (typeof CChainID === 'undefined'\n || !CChainID\n || CChainID.toLowerCase() === 'c') {\n if (networkID.toString() in constants_1.Defaults.network) {\n cchainid = constants_1.Defaults.network[networkID].C.blockchainID;\n }\n else {\n cchainid = constants_1.Defaults.network[12345].C.blockchainID;\n }\n }\n if (typeof networkID === 'number' && networkID >= 0) {\n this.networkID = networkID;\n }\n else if (typeof networkID === \"undefined\") {\n networkID = constants_1.DefaultNetworkID;\n }\n if (typeof hrp !== \"undefined\") {\n this.hrp = hrp;\n }\n else {\n this.hrp = helperfunctions_1.getPreferredHRP(this.networkID);\n }\n if (!skipinit) {\n this.addAPI('admin', api_1.AdminAPI);\n this.addAPI('auth', api_2.AuthAPI);\n this.addAPI('xchain', api_3.AVMAPI, '/ext/bc/X', xchainid);\n this.addAPI('cchain', api_4.EVMAPI, '/ext/bc/C/avax', cchainid);\n this.addAPI('health', api_5.HealthAPI);\n this.addAPI('info', api_6.InfoAPI);\n this.addAPI('keystore', api_7.KeystoreAPI);\n this.addAPI('metrics', api_8.MetricsAPI);\n this.addAPI('pchain', api_9.PlatformVMAPI);\n }\n }", "function SRP2(state) {\n state.rp2 = state.stack.pop();\n\n if (DEBUG) console.log(state.step, 'SRP2[]', state.rp2);\n}", "get STATE_RESP_P() { return 4; }", "function getProdExtension(sc,callback){\n var query = \" SELECT product.prod_id prodId,\" +\n \"product.floor_price AS floorPrice, product.wholesale_price AS wholesalePrice,min_purchase_quantity minPurchaseQuantity, \" +\n \"tax_included taxIncluded, tax, transport_fee_payee transportFeePayee\"+\n \" FROM product where product.tenant= ? and product.prod_id=? \";\n var paramArr=[],i=0;\n paramArr[i++] =sc.tenant;\n paramArr[i++] =sc.prodId;\n db.dbQuery(query,paramArr,function(error,rows){\n logger.debug(' getProdExtensions');\n return callback(error,rows);\n })\n}", "static transient final private protected internal function m40() {}", "transient final protected internal function m174() {}", "function Pc(){return Pc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pc.apply(this,arguments)}", "livelyPrepareSave() {\n }", "function SRP1(state) {\n state.rp1 = state.stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'SRP1[]', state.rp1);\n }\n }", "function comportement (){\n\t }", "* queryPlatformTransactonList({ payload }, { call, put }) {\n const res = yield call(service.queryPlatformTransactonList, { ...payload.tableParam });\n const detail = parseResponse(res);\n if (detail.rspCod === '200') {\n yield put({\n type: 'updateState',\n payload: { chnPlatformParam: payload.tableParam, chnPlatformList: detail.rspList, chnPlatformTotal: detail.total, chnPlatformCurrentPage: payload.tableParam.currentPage, platformInfoTableModalVisible: true },\n });\n }\n }", "function XMPCEPHelper() {}", "static checkNew(to,t,p,cb){\n\t\tquery.execute(conn, 'echec','ASK {{:cell'+to+' rdf:type :CellPieceN} UNION {:cell'+to+' rdf:type :CellPieceB}}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(res =>{\n\t\t\tif(res.body.boolean == true){\n\t\t\t\tthis.checkPiece(to,t,p,cb);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.insertNew(to,t,p,cb);\n\t\t\t}\n\t\t}).catch(e=> {console.log(e);});\n\t}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}" ]
[ "0.60746676", "0.5352841", "0.52485436", "0.51821196", "0.51505977", "0.5141365", "0.49691093", "0.49618715", "0.49363482", "0.48408335", "0.4803663", "0.4758082", "0.4723983", "0.4706467", "0.4681579", "0.4676185", "0.46706092", "0.46465266", "0.4643425", "0.46395966", "0.46216398", "0.46216398", "0.4617205", "0.4615711", "0.46059203", "0.45929655", "0.45843714", "0.45843714", "0.4557291", "0.45557535", "0.4545201", "0.45378795", "0.4533776", "0.4525926", "0.452491", "0.452491", "0.452491", "0.4514809", "0.4509044", "0.450017", "0.450017", "0.44974875", "0.44942695", "0.44829226", "0.447984", "0.44749916", "0.44704774", "0.4464922", "0.4458807", "0.4458807", "0.4458807", "0.44557112", "0.4453662", "0.44521424", "0.44481215", "0.44474247", "0.44446415", "0.44389898", "0.44371536", "0.44356045", "0.4435013", "0.4434756", "0.44322166", "0.44302353", "0.44234526", "0.4420824", "0.44204804", "0.44200256", "0.44177923", "0.4417673", "0.44038048", "0.4398516", "0.43974066", "0.4396609", "0.4396609", "0.4396609", "0.4396609", "0.43953964", "0.43916646", "0.43885672", "0.43870473", "0.4382554", "0.43821162", "0.43770763", "0.43762147", "0.43726867", "0.4371928", "0.43717745", "0.43694675", "0.43667242", "0.43605122", "0.43562302", "0.43525586", "0.43512627", "0.43495178", "0.43424088", "0.43423665", "0.43423665", "0.43423665", "0.43423665", "0.43423665" ]
0.0
-1
const [buttonClick, setButtonClick] = useState([true, false]);
function sortData(dataA) { if (order.column === 'Name') { const DATA = sortString(dataA); return DATA; } const DATA = sortNumber(dataA); return DATA; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buttonClicked() {\n this.setState({\n button_clicked: true\n })\n }", "handleClick() {\n this.setState({ devModeOn : !this.state.devModeOn });\n }", "handleClick( item ) {\n this.setState( prevState => ( \n { [ item ]: !prevState[ item ] } \n ) )\n }", "handleClick( item ) {\n this.setState( prevState => ( \n { [ item ]: !prevState[ item ] } \n ) )\n }", "handleClick(){\n this.setState(prevState => ({\n status: !prevState.status\n }))\n }", "onButtonPress(value){\n if (this.state[value]){\n return this.setState({[value]: false });\n } else {\n this.setState({[value]: true });\n }\n }", "handleClick() {\n // When clicked flip between flagged/not flagged\n this.setState(prevState => ({\n flagged: !prevState.flagged\n }));\n }", "function Button() {\n // state object\n const [counter, setCounter] = useState(5);\n return <button onClick={() => setCounter(counter * 2)}>{counter}</button>\n}", "handleClick() {\n this.setState(prev => ({ visible: !prev.visible }))\n }", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter \n return <button onClick={() => setCounter(counter * 2)}> {counter}</button>\n}", "handleClick(){\n this.setState({willPower: !this.state.willPower});\n }", "function MygtukasFunkcinis() {\n const [x, set3X] = useState(3);\n const [z, set7Z] = useState(7);\n // const x = 3;\n // const set3X = set3X\n const do3 = () => {\n const newX = x + 3;\n set3X(newX);\n }\n const do7 = () => {\n const newZ = z+7;\n set7Z(newZ)\n }\n return (\n <>\n <button className=\"baton\" id=\"baton\" onClick={do3} >\n {x}\n </button> \n <button className=\"baton\" id=\"baton\" onClick={do7} >\n {z}\n </button> \n </>\n )\n\n}", "function Button() {\n\tconst [counter, setCounter] = useState(0);\n const handleClick = () => setCounter(counter+1); \n\treturn (<button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "handleClick() {\n this.setState((state) => ({\n visible: !state.visible,\n }));\n }", "function Button() {\n const [counter, setCounter] = useState(0); //counter is getter, while setCounter is setter \n return <button onClick={() => console.log(Math.random())}> {counter}</button>\n}", "function Switch() {\n let on = false;\n let setOn = () => { };\n\n function enableSwitch() {\n // Bad\n [on, setOn] = useState(false);\n }\n\n return (\n <button onClick={enableSwitch}>\n Enable light switch state\n </button>\n );\n}", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter, useState() is called hook. \n const handleClick = () => setCounter(counter * 2);\n return (\n <button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter, useState() is called hook. \n const handleClick = () => setCounter(counter * 2);\n return (\n <button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "function Button() {\n const [counter, setCounter] = useState(5); //counter is getter, while setCounter is setter, useState() is called hook. \n const handleClick = () => setCounter(counter * 2);\n return (\n <button onClick={handleClick}>\n {counter}\n </button>\n );\n}", "function useBoolean(initialState) {\n var _a = react__WEBPACK_IMPORTED_MODULE_0__.useState(initialState), value = _a[0], setValue = _a[1];\n var setTrue = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return function () {\n setValue(true);\n }; });\n var setFalse = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return function () {\n setValue(false);\n }; });\n var toggle = (0,_useConst__WEBPACK_IMPORTED_MODULE_1__.useConst)(function () { return function () {\n setValue(function (currentValue) { return !currentValue; });\n }; });\n return [value, { setTrue: setTrue, setFalse: setFalse, toggle: toggle }];\n}", "function Button() {\n // state object\n const [counter, setCounter] = useState(1);\n return <button onClick={\n function logRandom() {\n console.log(Math.random());\n }\n }>{counter}</button>\n}", "function Button() {\n const [counter, setCounter] = useState(0); //counter is getter, while setCounter is setter \n return <button onClick={() => setCounter(counter + 1)}> {counter}</button>\n}", "handleClick(i, event) {\n const newDisplayDetails = [...this.state.displayDetails]\n newDisplayDetails[i] = !newDisplayDetails[i]\n this.setState({\n displayDetails: newDisplayDetails\n })\n }", "function handleClick() {\n setHam((old) => !old);\n }", "function Button() {\n // state object\n const [counter, setCounter] = useState(1);\n return <button onClick={() => setCounter(counter + 1)}>{counter}</button>\n}", "function Button() {\n // state object\n const [counter, setCounter] = useState();\n return <button>{Math.random()}</button>\n}", "handleClick() {\n this.setState((prevState) => ({\n isCrossedOut: !prevState.isCrossedOut,\n }));\n }", "handleClick() {\n this.setState(prevState => ({\n showMenu: !prevState.showMenu\n }));\n }", "handleShowButton() {\n this.setState({\n showButtonTutor: true,\n showButtonStudent: true,\n questionAnswered: true\n })\n }", "setButtonHidden() {\n this.setState((prevState) => ({ buttonHidden: !prevState.buttonHidden }));\n }", "userHasClicked(target) {\n this.setState({\n [target]: true,\n });\n }", "handleClick(i) {\r\n //Copy my btns array\r\n const btns = this.state.btns.slice();\r\n\r\n //If the game has a winner or the user selects the full square, the app returns nothing!\r\n if (this.calculateWinner(btns) || btns[i]) return;\r\n\r\n //Update status(put X or O)\r\n btns[i] = this.state.xIsNext ? \"X\" : \"O\";\r\n\r\n //Update the actual state\r\n this.setState({\r\n btns: btns,\r\n xIsNext: !this.state.xIsNext,\r\n });\r\n }", "function Button() {\n // state object\n const [counter, setCounter] = useState(1);\n //official click handler function - can use any name - commonly named handleClick\n const handleClick = () => setCounter(counter + 1)\n\n // return uses parenthesis instead of curly braces as we are not returning an object\n // we are returning a function call\n return (\n <button onClick = {handleClick}>\n {counter}\n </button>\n );\n}", "handleClick1(){\n this.setState({chart_or_table:true})\n }", "function Button() {\n // state object\n const [counter, setCounter] = useState();\n return <button>Save</button>\n}", "function buttonState(inputValue) {\n // necesito una variable para guardar inputValue: DONE (86)\n // necesito una variable para controlar el estado del boton: DONE (87)\n // necesito comprobar el valor de mi variable: DONE (89)\n // si mi variable tiene algo --> cambio el valor del estado del boton: DONE (90)\n\n let bState = false; //Definir el estado inicial del boton --> deshabilitado \n\n if (inputValue) { // Condicional\n bState = true; // Estado final del algoritmo\n } \n}", "handleChanson2(){\n let click = \"2\"; \n this.setState({ afficherChanson: click }); \n }", "function handleClick() {\n // Show depressed state of button!\n}", "function useToggle(initialOn = false) {\n const [on, setOn] = useState(initialOn);\n const toggle = () => setOn(!on);\n return {\n on,\n toggle\n };\n}", "handleChanson3(){\n let click = \"3\"; \n this.setState({ afficherChanson: click }); \n }", "handleClick() {\n this.setState({\n isForcedDone: true\n });\n }", "_handleClick() {\n this.setState({\n showArtist: !this.state.showArtist\n });\n}", "render() {\n return (\n <button onClick={this.handleClick}>\n {this.props.on ? 'on' : 'off'}\n </button>\n );\n }", "function UseStateBasic() {\nconst [day, setday] = useState(\"Today is a rainy day\");\nconst handleClick=()=>{\n if(day === \"Today is a rainy day\"){\n setday(\"Today is a sunny day\")\n }else{\n setday(\"Today is a rainy day\"); \n }\n \n} \nreturn (\n <div>\n <h1>{day}</h1>\n <button type=\"button\" className=\"btn\" onClick={handleClick}>Click Me!</button> \n \n \n </div>\n )\n}", "handleClick() {\n this.setState({ viewShips: !this.state.viewShips })\n }", "handleClickMakeEffect() {\n this.setState(state => ({\n words: [...state.words, 'marklar']\n }));\n }", "setActiveButton(act) {\n //set the button active\n let button = this.state.activeButton;\n button[act] = \"active\";\n this.setState({ button });\n }", "handleButtonClick(e){\n e.preventDefault();\n console.log('Button Clicked');\n this.setState({\n counter: this.state.counter + 1,\n counter2: this.state.counter2 - 1\n });\n }", "function UseStateBasics() {\n const [Heading, setHeading] = useState(\"Hooks\");\n const handleClick = () => {\n Heading === \"Hooks\"\n ? setHeading(\"React Hooks Are Awesome!!!\")\n : setHeading(\"Hooks\");\n };\n return (\n <div className=\"container\">\n <h2>{Heading}</h2>\n <button type=\"button\" onClick={handleClick} className=\"btn\">\n Change\n </button>\n </div>\n );\n}", "handleClick2(){\n this.setState({tabletype: 1})\n this.setState({chart_or_table:false})\n }", "function useToggle(initialState) {\n const [value, setState] = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useState\"])(initialState);\n return {\n value,\n toggle: Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useCallback\"])(() => setState(state => !state), []),\n setTrue: Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useCallback\"])(() => setState(true), []),\n setFalse: Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useCallback\"])(() => setState(false), [])\n };\n}", "submitButtonHandler() {\n\n var arr = [this.refs.in_roll.value, this.refs.in_name.value, this.refs.in_major.value]\n this.setState({ 'edit_mode_name': '' });\n this.setState({ 'edit_mode_id': '' });\n this.setState({ 'edit_mode_major': '' });\n debugger;\n this.props.onButtonClick(arr, this.edit_mode_toggle);\n }", "handleToggleClickA(){\n this.setState({\n toggleStateA: !this.state.toggleStateA\n })\n }", "handleToggleClickA(){\n this.setState({\n toggleStateA: !this.state.toggleStateA\n })\n }", "function Click() {\n state = (state == 0) ? 1 : 0; // shorthand if-statement, aka \"inline if\"\n\n}", "renderBtns(i) {\r\n return (\r\n <Btn value={this.state.btns[i]} onClick={() => this.handleClick(i)} />\r\n );\r\n }", "handleClick(product, params) {\n if (params === '0'|| params==='1') {\n this.setState({\n product: product,\n showParam: params,\n });\n window.switch_caregory = false;\n }\n}", "function Button() {\n // state object\n const [counter, setCounter] = useState(1);\n\n // return uses parenthesis instead of curly braces as we are not returning an object\n // we are returning a function call\n return (\n <button onClick = () => setCounter(counter + 1 )>\n {counter}\n </button>\n\n );\n\n}", "function mousePressed() {\n if(mouseOnButton) {\n on = !on\n }\n}", "handleClick3(){\n this.setState({tabletype: 2})\n this.setState({chart_or_table:false})\n }", "handleClick(correct) {\n // this prevents a user from using multiple answers\n this.setState({\n disableBtn:true\n })\n this.state.callback(correct);\n }", "takeQuizbtn() {\n this.setState({\n takequiz: true,\n takequizcondition: true\n })\n\n }", "enableButton() {\n this.setState({\n canSubmit: true,\n });\n }", "_onPressButtonTres(){\nthis.setState({ pulsado: 1 });\nthis.setState({ showCamera: false });\n}", "handleClick4(){\n this.setState({tabletype: 3})\n this.setState({chart_or_table:false})\n }", "handleRetour(){\n let click = \"1\"; \n this.setState({ afficherChanson: click }); \n }", "onButtonToggle() {\n let newState = this.state.showList ? false : true;\n\n this.setState({\n showList: newState\n });\n }", "function useToggle(initialVal = false) {\n // call useState 'reserve piece of state'\n const [state, setState] = useState(initialVal);\n\n // turning into a generic toggle with use of state\n function toggle() {\n setState(!state);\n }\n\n // return piece of state and func to toggle it\n return [state, toggle];\n}", "_handleClick(){\n // if (!this.state.showVillager){\n this.props.villagerClicked(!this.state.showVillager);\n this.setState((previousState) => {\n return {\n showVillager : !previousState.showVillager\n }\n }\n )\n // }\n // console.log(this.state.showVillager);\n }", "navItemClick() {\n let htmlTopicClicked = false;\n let cssTopicClicked = false;\n let javaScriptTopicClicked = false;\n this.setState({ htmlTopicClicked, cssTopicClicked, javaScriptTopicClicked })\n }", "_onPressButtonCuatro(){\nthis.setState({ pulsado: 2 });\nthis.setState({ showCamera: false });\n}", "handleChangeToggle(e)\n { \n let togglelocal=\"false\";\n if(e)\n {\n \n togglelocal=\"true\";\n\n }\n this.setState({status: togglelocal});\n }", "addClick(){\n this.setState(prevState => ({\n words: [...prevState.words, \"\"]\n }))\n }", "handleClick (event) {\n let futureChecked = !this.state.checked\n let futureValue = futureChecked ? this.props.value : ''\n this.setState({checked: futureChecked, value: futureValue})\n }", "click3() {\n console.log('click-3');\n this.setState((preVal) => ({\n msg: 'Clicked by button 3'\n }))\n }", "function useToggleState(initialVal = false) {\n const [isFormOn, setIsFormOn] = useState(initialVal);\n\n const toggleForm = () => {\n setIsFormOn(!isFormOn);\n };\n\n return [isFormOn, toggleForm];\n}", "handleHitBtn () {\n this.setState({\n mode: 'hit'\n })\n }", "checkButtonState() {\n const { agree } = this.props;\n const {\n buttonDisabled,\n isAgreeValid,\n isEmailValid,\n isEmail,\n } = this.state;\n\n const isButtonDisabled = !agree || !isAgreeValid || !isEmailValid || !isEmail;\n\n if (isButtonDisabled !== buttonDisabled) {\n this.setState({\n buttonDisabled: isButtonDisabled,\n });\n }\n }", "function App() {\n const [numOfLike, addLike] = useState(true) \n\n// Function to increment like on each click\n function handleClick() { \n addLike(numOfLikes++)\n}\n\n// If statement to that shows \"like\" if only one like, and \"likes\" if zero or plural\nfunction pluralLikes(item) { \n if (numOfLikes === 1) {\n return (item = item[1])\n } else {\n return (item = item[0])\n }\n}\n\n// Returns button that starts with zero \"numOfLikes\", as well as \"pluralLikes\" set to \"likes\"\n// Uses \"handleClick\" on each click to increment \"numOfLikes\"\n// \"pluralLikes\" will then switch from \"likes\" at zero, to \"like\" at one, and back to \"likes\" at two or greater clicks\n return (\n <div>\n <button className=\"likeButton\" onClick={handleClick}>\n {numOfLikes} {pluralLikes(likes)}\n </button>\n </div>\n );\n}", "function UseStateBasic() \n{\n const [day,setDay]= useState(\"Today is a rainy day\");\n const handleClick =() => {\n if(day ===\"Today is a rainy day:(\"){\n setDay(\"Today is a bright and beautiful day!\")\n }\n else\n setDay(\"Today is a rainy day:(\")\n }\n\nreturn (\n <div>\n <>\n\n <h1>{day}</h1>\n <button type=\"button\" className=\"btn\" onClick={handleClick} >\n change my day\n </button>\n </>\n\n </div>\n )\n}", "handleClickWithoutArrowFunction(e) {\n console.log(e);\n this.setState(state => ({\n isToggleOn: !state.isToggleOn,\n }));\n }", "toggleButton() {\n let buttonVisible = this.state.buttonVisible\n\n window.scrollY > 500?\n !buttonVisible && this.setState({buttonVisible:true})\n :\n buttonVisible && this.setState({buttonVisible:false})\n }", "function Calculator(){\n const [ calculate, setCalculate] = useState(20);\n return(\n <div>\n <h1>INITIAL: {calculate} </h1>\n <h1>TEST mouse event hadler n STATE</h1>\n <button onClick={() => setCalculate(calculate+1)}>TIPO</button>\n <button onClick={() => setCalculate(calculate-1)}>Komao</button>\n </div>\n )\n }", "handleChanson4(){\n let click = \"4\"; \n this.setState({ afficherChanson: click }); \n }", "handleButtonClick(){\n this.setState(state => ({isLoggedIn: !this.state.isLoggedIn }))\n }", "filterClick(e) {\n const newFilters = { ...this.state.filters };\n\n newFilters[e.target.id][0] = !this.state.filters[e.target.id][0];\n this.setState({ filters: newFilters });\n }", "function LikeBtn() {\n const [likes, setLikes] = useState(null)\n const [dislikes, setDislikes] = useState(null)\n\n return (\n <div className=\"like-box\">\n <button onClick={() =>setLikes(likes + 1)} className=\"like-btn\">&#8593;</button>\n <div className=\"like-count\">{likes}</div>\n <button onClick={() =>setDislikes(dislikes + 1)} className=\"dislike-btn\">&#8595;</button>\n <div className=\"like-count\">{dislikes}</div>\n\n </div>\n )\n}", "setCreatePost(e, boolValue) {\n this.setState({\n createPost: boolValue\n });\n }", "function handleClick(){\n // alert(\"tesss\");\n console.log(\"before = \",state1);\n setState1(1);\n console.log(\"after = \",state1);\n }", "handleClick(event) {\n this.setState({\n clicks: this.state.clicks + 1\n });\n }", "handleOnClick(value) {\n this.setState({\n text: value,\n potentials: []\n });\n }", "handleCheckBoxClick(){\n this.setState({\n ...this.state,\n remindMe : !this.state.remindMe\n })\n }", "handleRed(){\n this.setState(state => ({\n isToggleOn: !state.isToggleOn\n }))\n }", "function Button(props) {\n // creating a new state name counter and setCounter function\n // This useState function is called a hook in the react world.\n //() => setCounter(counter + counter) arrow function example\n const handleClick = () => props.onClickFunction(props.increment);\n return (\n <button onClick={handleClick}> Increment by +{props.increment}</button>\n )\n\n}", "handleClick(product) {\n this.setState({\n currentProduct: product,\n currentProductUpdateForm: false\n });\n }", "_onPressButtonCinco(){\nthis.setState({ pulsado: 3 });\nthis.setState({ showCamera: false });\n}", "handleGameClik() {\r\n this.setState({ disabled: !this.state.disabled });\r\n }", "click4() {\n console.log('click-4');\n\n this.setState((preVal) => ({\n msg: 'Clicked by button 4'\n }))\n }", "buttonState(btn){\n\n if(btn == false)\n {\n this.setState({\n icon:<AddPlayer />,\n label:'Add',\n iconClass:'AddPlayer_to_Favs',\n Action:this.handleAdd,\n });\n }\n else{\n this.setState({\n icon:<SyncIcon />,\n label:'Fetching',\n iconClass:'Remove_Player_From_Favs',\n Action:this.handleRemove,\n });\n }\n \n}", "handleRetour2(){\n let click = \"0\"; \n this.setState({ afficherChanson: click }); \n }", "ringCheckbox()\n {\n this.setState({\n ring:!this.state.ring\n })\n this.settings[0] = !this.settings[0]\n // console.log(this.settings);\n\n }" ]
[ "0.6907572", "0.6715152", "0.66576374", "0.66576374", "0.66321546", "0.66091675", "0.6592989", "0.6592443", "0.6576014", "0.6515604", "0.6511741", "0.6510355", "0.64627206", "0.64487743", "0.64435005", "0.644126", "0.6411399", "0.6411399", "0.6411399", "0.63956875", "0.6364852", "0.6362145", "0.63546103", "0.6347049", "0.63466793", "0.6344264", "0.62647694", "0.6246079", "0.62382567", "0.6142879", "0.61377853", "0.61329025", "0.6109195", "0.6097452", "0.60944885", "0.6084913", "0.608076", "0.60625523", "0.6053708", "0.60447574", "0.6041835", "0.6040398", "0.60296065", "0.6028975", "0.6025846", "0.60223436", "0.60132724", "0.6006456", "0.6000927", "0.59938866", "0.5990967", "0.5979088", "0.5968129", "0.5968129", "0.5966157", "0.59631103", "0.5956934", "0.5953208", "0.59438294", "0.5939682", "0.5932118", "0.59227926", "0.5914548", "0.5907475", "0.5907458", "0.59062403", "0.59032124", "0.5900156", "0.5896727", "0.5882085", "0.5880918", "0.58747786", "0.5871633", "0.58564276", "0.5849781", "0.58396316", "0.58352315", "0.5832302", "0.58303684", "0.5825293", "0.5822518", "0.5817503", "0.5816585", "0.57860434", "0.57787144", "0.5777691", "0.57771295", "0.57760763", "0.5770576", "0.5763207", "0.57564265", "0.5739077", "0.57389504", "0.57244253", "0.5722259", "0.57176554", "0.57109153", "0.56995314", "0.56981516", "0.5697891", "0.56960887" ]
0.0
-1
open the popup Form
function openForm(){ document.getElementById("myForm").style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\n }", "function openModalForm(){\n createForm();\n openModalWindow();\n}", "function openForm() {\r\n formPopup.style.display = \"block\";\r\n formBackground.style.display = \"block\";\r\n}", "function openSchedule() {\r\n document.getElementById(\"popupForm\").style.display = \"block\";\r\n}", "function tpPopup(formWin) {\n window.open(formWin,'tp','width=350,height=600').focus();\n}", "function openForm() {\n document.getElementById(\"loginPopup\").style.display=\"block\";\n}", "function popup (url) {\n fenster = window.open(url, \"Diese Seite Teilen\", \"width=500,height=350,resizable=yes\");\n fenster.focus();\n return false;\n}", "function showARBFormDialog() {\n\tdocument.getElementById('arbpopupModal').style.display = \"block\";\n $(\"body\").addClass('sidebar-collapse').trigger('collapsed.pushMenu');\n\n}", "function showDSFormDialog() {\n\tdocument.getElementById('dspopupModal').style.display = \"block\";\n\tpushMenu();\n}", "function openForm(){\n document.getElementsByClassName('container-toDO')[0].style.display = 'none';\n let PopUp = document.getElementsByClassName('pop-up')[0];\n PopUp.classList.remove('hides');\n document.getElementById(\"myForm\").style.display = \"block\";\n}", "function showCSFormDialog() {\n\tdocument.getElementById('cspopupModal').style.display = \"block\";\n $(\"body\").addClass('sidebar-collapse').trigger('collapsed.pushMenu');\n}", "_openPopup() {\n if (this._datepicker) {\n this._datepicker.open();\n }\n }", "_openPopup() {\n if (this._datepicker) {\n this._datepicker.open();\n }\n }", "_openReservationPopup() {\n let popup = new Popup(this._state.reservation.popup.settings.el, this._state.reservation.productID);\n popup.init();\n }", "function openForm(hiddenFormID) {\n\tvar allFormPopups = document.getElementsByClassName('form-popup');\n\tfor (x = 0; x < allFormPopups.length; x++) {\n\t\tdocument.getElementsByClassName('form-popup')[x].style.display = 'none';\n\t}\n\tdocument.getElementById(hiddenFormID).style.display = 'block';\n}", "function openULForm(data){\n\t$m.open(\"Edit Lead for IPT\", \"/IncomePlanner/UpdateLeadForm.html\",data.data);\n}", "function openPopup (isEditingAPage) {\n initPopup();\n getPermissionsFromServer(showPopup, isEditingAPage);\n }", "function show_popup() {\n\tdocument.getElementById(\"popup\").style.display=\"block\";\n}", "function openPop(e, pdf, survey) {\n\te.preventDefault();\n\t//if pdf is not left blank, use it as the globalurl\n\tif (pdf !== undefined)\n\t{\n\t\t$(\"#overlay_form1\").html('<h2>Embed the PDF </h2> <p>Copy the code below and paste it in an HTML editor to embed the PDF</p> <textarea rows=\"3\" cols=\"50\" onclick=\"this.focus();this.select()\" readonly=\"readonly\">&lt;iframe src=\"/Surveys/'+ survey + pdf + '&embedded=true\" style=\"width:100%; height=1000px;\"&gt;&lt;/iframe&gt;</textarea><a href=\"#\" onclick=\"closePop(event)\" id=\"close\">Close</a>');\n\t}\n\t/*else\n\t{\n \t$(\"#overlay_form1\").html('<h2>Embed the PDF </h2> <p>Copy the code below and paste it in an HTML editor to embed the PDF</p> <textarea rows=\"3\" cols=\"50\" onclick=\"this.focus();this.select()\" readonly=\"readonly\">&lt;iframe src=\"' + globalurl + '\" style=\"width:100%; height=1000px;\"&gt;&lt;/iframe&gt;</textarea><a href=\"#\" onclick=\"closePop(event)\" id=\"close\">Close</a>');\n }*/\n $(\"#overlay_form1\").fadeIn(1000);\n $(\"#overlay_form1\").css({\n left: ($(window).width() - $('#overlay_form').width()) / 3,\n top: ($(window).width() - $('#overlay_form').width()) / 7,\n position: 'absolute'\n });\n //Scroll to top\n $(\"html, body\").animate({ scrollTop: 0 }, \"fast\");\n}", "function openSignUp() {\n\tif (validateEmail()) {\n\t\tvar url = '/' + channel + '/Content.ice?page=Sign-Up-For-Fashion-News&pgForward=popup' + '&email=' + document.getElementById('email').value;\n open(url,'SignupForFashionNews','width=700,height=500');\n var tmp = open(url,'SignupForFashionNews','width=700,height=500');\n\t\ttmp.focus();\n\t}\n\treturn false;\n}", "function maj_etat(ipop_id) {\n \n mywindow=open('PopupActes.php?id='+id,'myname','resizable=yes,width=800,height=470,status=yes,scrollbars=yes');\n mywindow.location.href = 'PopupActes.php?id='+id+'&date_interv='+date_inv;\n if (mywindow.opener == null) mywindow.opener = self;\n}", "function openModal() {\n getRecipeDetails();\n handleShow();\n }", "function open_add_plant_modal(open) {\n\t$(\"#add-plant\").css(\"display\", open ? \"block\" : \"none\");\n}", "controlClick() {\n\t\tif (!this.refs.popup) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.refs.popup.show();\n\t}", "function openRepairForm($loadpage) \r\n{\r\n window.open('loadRepairForm.php');\r\n \r\n window.location.href = $loadpage;\r\n}", "function PopMoreSmiles(form,name) {\r\n newWin=window.open('index.php?page=moresmiles&form='+form+'&text='+name,'moresmile','height=500,width=450,resizable=yes,scrollbars=yes');\r\n if (window.focus) {newWin.focus()}\r\n}", "function showDialog(panel){\n // create an iframe with ID = modalFrameId in the dialog window, then open the dialog\n $(\"#dialogPanelId\").html('<iframe id=\"modalIframeId\" width=\"100%\" height=\"100%\" marginWidth=\"0\" marginHeight=\"0\" frameBorder=\"0\" scrolling=\"auto\" />').dialog(\"open\");\n\n // locate the iFrame and set the iFrame source to be the Xi form to run. Add in the form parameter by locating the value of the hidden form field contained in the panel that was clicked.\n $(\"#modalIframeId\").attr(\"src\",\"/ufs/ufsmain?formid=ES030513_DIALOG_POPUP&P1=\"+$(panel).find('.panelValue').first().val());\n}", "function openForm() {\n\tdocument.getElementById('myForm').style.display = 'block';\n}", "function open_popup(page)\n{\n var windowCfg=\"left=350,top=50,screenX=350,screenY=50,fullscreen=no,resizable=yes,\" + \n \"toolbar=no,status=no,menubar=no,scrollbars=yes,directories=no,location=no,\" +\n \"width=400,height=650\";\n window.open(page, \"_blank\",windowCfg);\n return true;\n}", "function loadForm() {\n var $this = $(this),\n type = $this.attr('id').split('-')[2],\n opts = options[type];\n\n $.showCustomModal(\n opts.buttonText,\n opts.form,\n {\n id: 'requestWindow',\n width: 650,\n buttons: [{\n id: 'cancel',\n message: 'Cancel',\n handler: function () {\n $('#requestWindow').closeModal();\n }\n }, {\n id: 'submit',\n defaultButton: true,\n message: 'Save',\n handler: function () {\n submitForm(opts);\n }\n }],\n callback: function() {\n // Fire hook for scripts that use the form\n mw.hook('vstf.reportsform').fire();\n }\n }\n );\n }", "function showpopupimageselection(){\n\t\t$('#imageselectionpopupmenu').popup('open');\n\t}", "function openPopup() {\n popup.style.display = \"block\";\n usernameInput.placeholder = username;\n }", "function wqc_open_modal( ui, v ) {\n\n\t\t\teditor.windowManager.open( {\n\t\t\t\ttitle : 'Quick Checkout',\n\t\t\t\tid : 'wqc_shortcode_dialog',\n\t\t\t\twidth : 600,\n\t\t\t\theight : 450,\n\t\t\t\tresizable : true,\n\t\t\t\tscrollbars: true,\n\t\t\t\turl : ajaxurl + '?action=wqc_shortcode_iframe'\n\t\t\t}, {\n\t\t\t\tshortcode : ed.getLang( 'wqc.shortcode_tag' ),\n\t\t\t\tshortcode_params: window.decodeURIComponent( v )\n\t\t\t} );\n\t\t}", "function showEditForm(){\nfrmEditProfile.show();\n}", "function open(dialog) {\n\t\n}", "function openAnagraficaPopUp(Url, idFieldName, descFieldName, idHidID, idHinCognome, idHidNome, btnSblocca, userFilter, idHidIDUtente, autoPostBack) {\n var urlToOpen = Url + '?valField=' + idFieldName + '&descField=' + descFieldName + '&HidID=' + idHidID + '&HidCognome=' + idHinCognome + '&HidNome=' + idHidNome + '&btnSblocca=' + btnSblocca + '&userFilter=' + userFilter + '&HidIDUtente=' + idHidIDUtente;\n if (autoPostBack == 'True')\n urlToOpen = urlToOpen + '&AutoPostBack=1';\n\n var winUser = window.open(urlToOpen, 'userpopup_window', 'width=600,height=450,left=330px,top=300px');\n winUser.focus();\n}", "function newPopup()\n{\n window.open(\n \"forgotPass.html\",\n 'popUpWindow',\n 'height=150,width=550,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes'\n );\n}", "function getUserCreateForm(){\n showCreateDialog();\n}", "function openSetupClickHandler() {\n openPopup();\n }", "open() {\n this.modal.jQueryModalFade.addClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'block');\n this.jQueryName.focus();\n }", "function openPopup (isEditingAPage) {\n popup || initPopup();\n getPermissionsFromServer(showPopup, isEditingAPage);\n }", "function openModal() {\n setOpen(true);\n }", "function popup_acceso(){\r\n\tif (typeof MiBrowWind.document == \"object\") {\r\n\t\tMiBrowWind.close()\r\n\t}\r\n cuerpo = centrar_popup(400,200);\r\n //MiBrowWind= \r\n window.open(\"login.php?SIS=1\",'',cuerpo);\r\n\r\n}", "function openFormCreate(elem)\n{\n\t//Clean form data\n\tdocument.getElementById('formEnreg').reset();\t\n\t//Cache table list film\n\trendreInvisible(elem);\n\t//Display form\n\t$(\"#divFormFilm\").show();\n}", "function openItemSearchPop( code_input, w_size, h_size ) { \r\n\r\n\t// popup 창의 input box 표시 data : search code \r\n\tvar code_input = document.getElementById(code_input).value; \r\n\r\n\tif( !(w_size) ) { \r\n\t\tvar w_size = 400; \r\n\t\tvar h_size = 400; \r\n\t} \r\n\t\r\n\tvar service_url = \"service.do?_moon_service=item_search_popup&code_input=\" + code_input; \r\n\tservice_url += \"&_moon_perpage=200&_moon_pagenumber=1\"; \r\n\t\r\n\t// 제품구분 선택시 \r\n\tif( document.frm.selected_itype.value != null && document.frm.selected_itype.value != \"\" ){\r\n\t\tservice_url += \"&itype=\" + document.frm.selected_itype.value;\r\n\t}\r\n\t\r\n\tvar pop_win_style = \"titlebar=no, menubar=no, toolbar=no, status=yes, scrollbars=no, resizable=yes, width=\" + w_size + \", height=\" + h_size + \", top=0, left=0\"; \r\n\tvar newWin = window.open(service_url, \"Code_Search\", pop_win_style); \r\n\tnewWin.focus(); \r\n\t\r\n}", "function popup(){\r\n\talert(\"You opened a popup!\")\r\n\t}", "function showPopup (editor) {\n var popupObject, propertiesToSend;\n popupObject = preparePopupObject();\n\n propertiesToSend = {\n window: window,\n editor_id : editor.editor_id,\n popup: popupObject\n };\n\n popup = editor.windowManager.open(popupObject, propertiesToSend);\n editor.windowManager.setParams(popupObject);\n }", "function openPopup() {\r\n \"use strict\";\r\n popup.style.display = \"block\";\r\n}", "function showBOMFormDialog() {\n\tdocument.getElementById('myModal').style.display = \"block\";\n $(\"body\").addClass('sidebar-collapse').trigger('collapsed.pushMenu');\n\n}", "function MUP_Open(){\n //console.log(\" ----- MUP_Open ----\")\n\n // --- show modal\n $(\"#id_mod_upload_permits\").modal({backdrop: true});\n } // MUP_Open", "function popUp(url) {\n popUpWindow = window.open(\"survey.html\",'popUpWindow','height=700,width=900,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');\n}", "function ShowModalPopup() {\n $find(\"mpe\").show();\n return false;\n}", "function admissionOpen(){\n window.open('/admissionopen.html','popUpWindow','height=470,width=960,left=100,top=100,resizable=no,scrollbars=no,toolbar=yes,menubar=no,location=no,directories=no, status=yes');\n}", "function openProfile() {\n var profileRef = 'DataEntryProfileCK|UserPK|' + $USER_ID + '|DataEntryProfilePK|' + $scope.selectedDataEntryProfileId + '';\n\n var uri = $BASE_PATH + 'reviewBudget/';\n var form = angular.element(\n '<form id=\"flatFormEditorPopUp\" action=\"' + uri + '\" method=\"post\" target=\"_blank\">' +\n '<input id=\"selectedStructureElementId\" name=\"selectedStructureElementId\" type=\"hidden\" value=\"' + $scope.selectedStructureElementId + '\">' +\n '<input id=\"modelId\" name=\"modelId\" type=\"hidden\" value=\"' + $scope.selectedModelId + '\">' +\n '<input id=\"budgetCycleId\" name=\"budgetCycleId\" type=\"hidden\" value=\"' + $scope.selectedBudgetCycleId + '\">' +\n '<input id=\"submitModelName\" name=\"submitModelName\" type=\"hidden\" value=\"' + $scope.selectedModelVisId + '\">' +\n '<input id=\"submitCycleName\" name=\"submitCycleName\" type=\"hidden\" value=\"\">' +\n '<input id=\"selectedDataEntryProfileId\" name=\"profileRef\" type=\"hidden\" value=\"' + profileRef + '\">' +\n '</form>'\n );\n\n angular.element(document.body).append(form);\n\n form[0].submit();\n form.remove();\n }", "function openCreateLightbox()\n{\n\tif (!CorbisUI.GlobalVars.SearchResults.isAnonymous)\n\t{\n\t\tnew CorbisUI.Popup('createLightboxModalPopup', { \n\t\t\tshowModalBackground: false,\n\t\t\tcenterOverElement: 'SearchBuddy',\n\t\t\tcloseOnLoseFocus: true,\n\t\t\tpositionVert: '60', \n\t\t\tpositionHoriz: '5'\n\t\t}); \n\n\t\t//Reposition because getCoordinate() does not work so well for Safari.\n\t\tvar SB = $('SearchBuddy');\n\t\t$('createLightboxModalPopupWindow').setStyles({\n\t\t\ttop: SB.offsetTop + window.getScroll().y + 60,\n\t\t\tleft: SB.offsetLeft + window.getScroll().x + 5\n\t\t});\n\t\t\n\t}\n}", "function openNewRatingForm() {\n $('#newRatingModal').modal('show');\n}", "function show_popup(id) {\n\t// show the popup\n\t$('#'+id).show();\n}", "function showPasswordPopUp(){\n $(\"#popup1\").show()\n}", "onOpenForm() {\n// Add a timeout to allow the active window to close...\nthis.runDelayed(() => {\nif (!this._settings.getShowProperties() && !this._settings.getDontShowOpenForm()) {\ndispatcher.dispatch('Dialog.Hint.OpenForm', {});\n}\n});\n}", "function openPopup(url, name, pWidth, pHeight, features, snapToLastMousePosition) {\n openPopupFocus (url, name, pWidth, pHeight, features, snapToLastMousePosition, true);\n}", "function openUserPopUp(Url, idFieldName, autoPostBack, VisualizzaSottoAgenti, NascondiUtentiDisabilitati) {\n var urlToOpen = Url + '?valField=' + idFieldName;\n\n if (autoPostBack == 'True')\n urlToOpen = urlToOpen + '&AutoPostBack=1';\n if (VisualizzaSottoAgenti == 'True')\n urlToOpen = urlToOpen + '&VisualizzaSottoAgenti=1';\n if (NascondiUtentiDisabilitati == 'True')\n urlToOpen = urlToOpen + '&NascondiUtentiDisabilitati=1';\n\n var winUser = window.open(urlToOpen, 'userpopup_window', 'width=400,height=350,left=430px,top=450px');\n winUser.focus();\n}", "function popupSendIt(doc_id,loc) {\r\n\twindow.open(app_path_webroot+'SendIt/upload.php?loc='+loc+'&id='+doc_id,'sendit','width=830, height=700, toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1');\r\n}", "function openForm() {\n document.getElementById(\"form\").style.display = \"block\";\n}", "customShowModalPopup() { \n this.customFormModal = true;\n }", "function PopupShow(event) {\n event.preventDefault();\n popup.classList.remove('zoomOut');\n popup_wrapper.classList.remove('fadeOut');\n popup.classList.add('show', 'zoomIn');\n popup_wrapper.classList.add('show', 'fadeIn');\n \n if (storage_name) {\n name.value = storage_name;\n phone.focus();\n if (storage_phone) {\n phone.value = storage_phone;\n btn_form.focus();\n } \n } else {\n name.focus();\n }\n }", "function popupForm(id){\n\t//TODO: apply formData.activityList to activityListHtml\n}", "show(){\n\t\tthis.modalShadow.show();\n\t\tthis.modalBody.show();\n\t}", "function tourpopup()\n{\t\n\tMM_openBrWindow('/admission/flash/onlinetour_detect.html','flashpopup','width=768,height=500');\n\treturn false;\n\twindow.focus()\n}", "function openDataResolutionIntroPopup() {\r\n\t$.post(app_path_webroot+\"DataQuality/data_resolution_intro_popup.php?pid=\"+pid, { }, function(data){\r\n\t\tvar json_data = jQuery.parseJSON(data);\r\n\t\tsimpleDialog(json_data.content,json_data.title,'drw_intro_popup',700);\r\n\t\tfitDialog($('#drw_intro_popup'));\r\n\t});\r\n}", "function openForm() {\n const form = document.querySelector('#form')\n form.style.display = 'block';\n}", "function trigger_popup(message)\n{\n\tconsole.log(\"in popup\");\n\tconsole.log(message);\n\tpopup_shown=true;\n\tdocument.getElementById(\"popup_message\").innerHTML=message;\n\ttau.openPopup(document.getElementById(\"error_popup\"));\n}", "function creaPrenotazione() {\n\t$('#modPrenotazione').window('open');\n\n}", "function basicPopup(url) {\r\npopupWindow = window.open(url,'popUpWindow','height=300,width=700,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes')\r\n\t}", "function popitup(url) {\n // Opens a new browser window called newwindow. url specifies the URL of the page to open.\n newwindow=window.open(url,'name','height=400,width=350',\"_parent\");\n // Sets focus to the new window if the focus is on the previous page.\n if (window.focus) {\n newwindow.focus()\n }\n return false;\n}", "function createPopUp() {\n\n}", "function displayFormWindow(){\r\n if(!AddPriceWindow.isVisible()){\r\n resetPriceForm();\r\n AddPriceWindow.show();\r\n } else {\r\n AddPriceWindow.toFront();\r\n }\r\n\r\n\r\n }", "function popupOpen(e) {\n \n // The quill editor introduces a toolbar (div) which is about 75px in height.\n // This throws off leafletjs which originally sized the popup to not include the toolbar.\n // When a popup is opened near the top of the viewscreen leafletjs tries to pan the map \n // to include the popup but is now unaware that the popup is larger and part of the popup\n // is opened out of the bounds of the viewscreen. To fix this problem a temporary spacer \n // is added when the popup is first created and in this step must now be removed.\n\n // Remove temporary spacer\n $(`#popup_editor_spacer_${e.target.properties.id}`).remove();\n\n // Update popup html\n popupContent = L.Util.template(template, e.target.properties);\n\n // Create a popup\n e.target.setPopupContent(popupContent);\n\n // Instantiate the popup editor\n quill = new Quill(`#popup_editor_${e.target.properties.id}`,\n {\n theme: 'snow'\n });\n\n // Load the editor contents\n quill.setContents(e.target.properties.content);\n \n}", "function openEntityModifyWindow(url) {\r\n var mainwin = window.open(url ,'CISPopup','width=1000,height=650,resizable=yes,scrollbars=yes,status=yes,top=5,left=5');\r\n if(mainwin)\r\n mainwin.focus();\r\n closeWindow();\r\n}", "function showForm(frm){\n\t\tdocument.getElementById(\"divBgModal\").style.display=\"block\";\n\t\tfrm.style.display=\"block\";\t\n\t}", "function ouvreFenetre(monURL) {\n\twindow.open(monURL, \"popup\", \"width=450px;height=80px;\");\n}", "onLoad() {\n this.openType = 'popup';\n this.opened = false;\n // this.open();\n }", "function submitPopupForm(form_obj) {\n var funcaosubmit = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><script>' +\n 'function submitform(){ document.forms[0].submit(); }</script></head><body>';\n var popup = window.open('about:blank', 'popup', 'titlebar=1,menubar=0,scrollbars=0,status=1,resizable=1,height=167,width=170,top=50,left=50');\n popup.document.writeln('<b>Enviando ...</b><br><br><br><br>');\n popup.document.writeln(funcaosubmit);\n if (isIE()) {\n popup.document.writeln('<form action=\"' + form_obj.action + '\" method=\"POST\">' + form_obj.innerHTML + '</form></body></html>');\n } else {\n popup.document.writeln('</body></html>');\n popup.document.body.appendChild(form_obj.cloneNode(true));\n }\n\n popup.document.close();\n popup.submitform();\n}", "function showContracts()\r\n{\r\n openModalDialog('../popup/cm_contracts_search_listing.htm',screen.width-50,'400');\r\n \r\n return;\r\n}", "function makePopupSolicitud(){ \n\n}", "function openPopup() {\n setup.classList.remove('hidden');\n setupPosition.left = setup.offsetLeft + 'px';\n setupPosition.top = setup.offsetTop + 'px';\n setupSimilar.classList.remove('hidden');\n document.addEventListener('keydown', onPopupEscPress);\n setupUserName.addEventListener('focus', onSetupUserNameFocus);\n setupUserName.addEventListener('blur', onSetupUserNameBlur);\n}", "function popUp(URL) \r\n\t\t\t\t{\r\n\t\t\t\tday = new Date();\r\n\t\t\t\tid = day.getTime();\r\n\t\t\t\teval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=500,left = 50,top = 20');\");\r\n\t\t\t\t}", "function displayFormWindow(){\n if(!schdTitleCreateWindow.isVisible()){\n resetSchdTitleForm();\n schdTitleCreateWindow.show();\n schdField.focus(\"\",10);\n } else {\n schdTitleCreateWindow.toFront();\n schdField.focus(\"\",10);\n }\n }", "function ShowDetailsDialog(){\n $('#DetailsDialog').dialog('open');\n}", "function popup(url){\r\n\r\n\t// aww poor widdle baby doesn't know how to play games? let's make a help file to get them on track.\r\n\tnewwindow=window.open(url,'name','height=400,width=256');\r\n\tif (window.focus) {newwindow.focus()}\r\n\treturn false;\r\n} // help window popup", "function openform2() {\n document.getElementById(\"myform2\").style.display = \"block\";\n}", "function popUp()\n{\n}", "function openContactDetails() {\n\t\tconst contactId = Number(this.id);\n\t\tupdateContactDetails(contactId);\n\t\tmodal.style.display = \"block\";\n\t}", "function openSendToModal()\n\t{\n\t\tclearSendto();\n\t\t$(\"#sendto\").modal(\"show\");\n\t\t\n\t}", "function popUp(URL, type) \n{\n switch(type)\n {\n\t case \"guestbook\":\n\t width = 675;\n\t height = 500;\n\t break;\t \n\t case \"forum\":\n\t width = 675;\n\t height = 500;\n\t break;\t \n default:\n width = 550;\n height = 580;\n }\n\n var token = URL.indexOf('?') > -1 ? '&amp;' : '?';\n uniqueId = genUniqueId();\n URL=URL+genUniqueParam(token);\n\n var leftPosition = (screen.width - width - 20) / 2;\n var topPosition = (screen.height - height) / 4;\n\n //open centered\n eval(\"win = window.open(URL, '\"+type+\"', 'toolbar=0,scrollbars=1,location=0,status=1,resizable=1,menubar=0,width=\"+width+\",height=\"+height+\",left=\"+leftPosition+\",top=\"+topPosition+\"');\");\n\n if (parseInt(navigator.appVersion) >= 4) \n { \n win.window.focus(); \n }\n}", "function open() {\n ModalService.showModal({\n templateUrl: \"views/wizard-template.html\",\n controller: 'WizardController',\n inputs: {\n wizard: modal.config\n }\n }).then(function (modal) {\n //below method will execute when close the popup\n modal.close.then(function (result) {\n $rootScope.$emit('wizard.close', result)\n });\n });\n return this;\n }", "function showAddItemPopup1()\n{\n\t$(\"#popup_item_desc\").val(\"\");\n\t$(\"#popup_part_no\").val(\"\");\n\t$(\"#popup_quantity\").val(\"\");\n\t$(\"#popup_ship_date\").val(\"\");\n\t$(\"#pop_multiplier\").val(\"\");\n\t$(\"#popup_price\").val(\"\");\n\t\n\t$(\"#quote_add_item_popup\").show();\n\t\n\t$(\"#from_form\").val(\"PopUpQuoteForm\");\n\t\n\t$(\"#popup_item_desc\").focus();\n}", "function popup(windowname) {\n\twindow_pos(windowname);\n\ttoggle(windowname);\t\t\n}", "function open() {\n if (selectedFinanceCubeId != 0 && $scope.selectedDataEntryProfileId != 0) {\n openModal(selectedFinanceCubeId, $scope.selectedDataEntryProfileId);\n }\n }", "function openCaseFormManual()\n{\n openCaseForm(document.getElementById('caseIDForm').value);\n}", "open() {\n this._open();\n }" ]
[ "0.7928303", "0.7556579", "0.7388117", "0.73147434", "0.7191848", "0.7182122", "0.7030674", "0.6980471", "0.69788677", "0.69731677", "0.68084675", "0.6800486", "0.67939425", "0.67939425", "0.67651755", "0.67256606", "0.671159", "0.65500116", "0.6547953", "0.65468943", "0.6542285", "0.65410364", "0.6523087", "0.6510245", "0.65019053", "0.648462", "0.6484386", "0.64767087", "0.6470434", "0.6459859", "0.64571863", "0.64558506", "0.6454213", "0.6445215", "0.6444289", "0.64310205", "0.64310086", "0.64301467", "0.6427401", "0.6420874", "0.64193004", "0.64179957", "0.6415092", "0.6414683", "0.6413487", "0.63971794", "0.63954955", "0.6390862", "0.63839245", "0.63789284", "0.63774824", "0.6376591", "0.6355091", "0.63546544", "0.6347042", "0.6347008", "0.6342025", "0.6333844", "0.63321704", "0.6329913", "0.632764", "0.6324216", "0.6323975", "0.6318826", "0.63176465", "0.6316377", "0.63163704", "0.6314045", "0.63126785", "0.6310217", "0.6301486", "0.63004375", "0.6297856", "0.62941957", "0.6291388", "0.62912804", "0.629098", "0.62881994", "0.628227", "0.6282131", "0.6265293", "0.62597746", "0.6244393", "0.6242665", "0.6237449", "0.623491", "0.6228196", "0.6219359", "0.62187135", "0.621611", "0.62146604", "0.6214396", "0.6213687", "0.6211959", "0.6211875", "0.62111783", "0.6209565", "0.620571", "0.6203109", "0.62013435", "0.6199507" ]
0.0
-1
close the popup Form
function closeForm() { document.getElementById("myForm").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close() {\n super.close();\n this._popupForm.reset();\n }", "function closeForm() {\r\n document.getElementById(\"popupForm\").style.display = \"none\";\r\n document.getElementById(\"taForm\").style.display = \"none\";\r\n document.getElementById(\"anmtForm\").style.display = \"none\";\r\n}", "function closeForm() {\n $('.add-parent-popup').hide();\n $('.overlay').hide();\n clearFields();\n $('#pin-message').hide();\n}", "close() {\n this._showPopup = false;\n }", "function closeForm(){\n document.getElementsByClassName('container-toDO')[0].style.display = 'block';\n let PopUp = document.getElementsByClassName('pop-up')[0];\n PopUp.classList.add('hides');\n document.getElementById(\"myForm\").style.display = \"none\";\n }", "function closePopupWindow() {\r if ($('.popupWrapper').css('display') !== 'none') {\r $('.popupWrapper').fadeOut('600','swing');\r $('.charForm').hide();\r // $('INPUT').val('');\r $('[class~=\"invalidField\"]').removeClass('invalidField');\r $('.addCharSubmit').removeClass('submitEnabled');\r valid = true;\r }\r }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closePopup() {\n $modalInstance.dismiss();\n }", "function closePopup() {\n\tpopup.style.display = \"none\";\n}", "closeCleanup() {\n this.hide();\n this.addPopUpListener();\n }", "function Cancelpopup()\n{\n\twindow.close();\n}", "function close_popup() {\n\twindow.close();\n}", "function closeDialog()\n{\n\tdocument.getElementById(dialogID + \"_popup\").style.display = \"none\";\n\n\t/* soporte para lightbox */\n\tvar overlay = document.getElementById('_overlay');\n\tif (overlay!=null)\n\t\toverlay.style.display='none';\n}", "function close() {\n $mdDialog.hide();\n }", "close() {\n this.closeButton.on('click', null);\n this.modal(false);\n this.window.remove();\n }", "closeModal() {\n this.close();\n }", "function closeDialog() {\n $.fancybox.close();\n }", "function close_popup(id) {\n $('#edit').attr('disabled', false);\n $('#reg_submit').attr('disabled', false);\n $('.avatar-loading').hide();\n\n $('#image_name').val('');\n $('.crop-file').val('')\n\n // hide the popup\n $('#' + id).hide();\n}", "function closePopup() {\n\twindow.close();\n}", "function closePopUp() {\n popUpSection.style.display = \"none\";\n }", "function close_dialog() {\r\n\t dialog.hide();\r\n\t return_focus.focus();\r\n\t return false;\r\n\t }", "function closePopup() {\n\t$('.popup__close, .sf-btn-finish').on('click', function (e) {\n\t\te.preventDefault();\n\t\t$('html').removeClass('lock');\n\t\t$('.popup-container').addClass('popup-hide')\n\t\t$('.popup-backdrop').addClass('popup-hide')\n\t\t$('.popup').addClass('popup-hide')\n\t})\n}", "function gfont_close_popup() {\n var popup = $('ja-popup-gfont');\n var display = popup.getStyle('display');\n if (display == 'block') {\n popup.setStyle('display', 'none');\n }\n}", "static popup_close() {\n const context = Utils.popup_context.pop();\n if (typeof AGGrid !== 'undefined')\n AGGrid.popGridContext();\n Utils.popEnterContext();\n $('#' + context.id).hide();\n Utils.globalEnterHandler(context.globalEnterHandler);\n Utils.popup_zindex -= 2;\n if (Utils.popup_zindex < 10)\n Utils.popup_zindex = 10;\n }", "function closeDialog() {\n setDialogOpen(false)\n }", "function closePopup() {\n\t\t$('.overlay-bg, .overlay-content').hide(); // hide the overlay\n\t}", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "function closeForm() {\n document.getElementById(\"msgForm\").style.display = \"none\";\n}", "function close() {\n $modalInstance.dismiss();\n }", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "function closePopup()\n{\n\tconsole.log(\"closing popup\");\n\ttau.closePopup();\n\tstopService();\n\ttizen.application.getCurrentApplication().exit();\n}", "function closeQuoteForm()\n\t{\n\t\tdocument.getElementById('quote_form').style.display=\"none\";\n\t}", "function win_close() {\n\n\twindow.opener.frmMain.submit();\n\tself.close();\n}", "function modalClose() {\t\t\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif($('mb_Error')) $('mb_Error').remove();\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\n\t\t$('mb_center').style.display = 'none';\n\t\t\n\t\t$('mb_contents').getChildren()[0].remove();\n\t\t$('mb_overlay').setStyle('opacity',0);\n\t\t$('mb_frame').setStyle('opacity',0);\n\t\twindow.location.reload(true); \n}", "function close_ok_dialog() {\r\n\t \tdialog.hide();\r\n\t \treturn_focus.focus();\r\n\t }", "function closeDialog() {\n $mdDialog.hide();\n }", "closeDialog() {\n // Trigger the popup to close\n tableau.extensions.ui.closeDialog();\n }", "function cancelPopup() {\n window.close()\n}", "function buttonPoweClicked()\n{\n this.window.close();\n}", "function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\";\n document.getElementById('openBtn').style.display = 'block';\n // clear channel poller running in window\n clearInterval(window.poller);\n}", "function closeDialog() {\n\t\t\tdocument.getElementById(\"newBookmarkConfirmation\").open = false;\n\t\t}", "function popupClose(e) {\n\n // Grab form field data\n e.target.properties.title = L.DomUtil.get(`popup_title_${e.target.properties.id}`).value;\n\n // Save the editor contents into the\n // the geoJSONMarker's properties\n e.target.properties.content = quill.getContents();\n quill = null;\n\n // Save marker data\n saveMarkers();\n\n}", "function popup_close(wloc){\n document.getElementById('popupper').style.display = 'none'\n if (wloc) {\n location.href = wloc\n }\n}", "function AccountNotesPopupClose() {\n AccountNotesPopup.Hide();\n}", "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function closePopup() {\r\n \"use strict\";\r\n popup.style.display = \"none\";\r\n}", "function handleClose() {\n setDialog(false);\n }", "function handleClose() {\n setDialog(false);\n }", "static close() {\n store.closePopup();\n }", "function closeModal() {\n clearForm();\n props.onChangeModalState();\n }", "function onClose() {\n\t\t\t$mdDialog.hide()\n\t\t}", "function closePopup(e) {\n $('#OverlayPopup').hide();\n return false;\n}", "function closeDialog() {\n document.querySelector(\"#inq_student\").classList.add(\"hide\");\n document.querySelector(\"#inq_student .closebutton\").removeEventListener(\"click\", closeDialog);\n }", "function closePopUp(){\n $('#popup').fadeOut();\n}", "function closeModal() {\n modalbg.style.display = 'none'; //modalbg: name previously given to the form container (see DOM elements)\n myForm.style.display = \"block\";\n document.getElementById(\"confirmation\").style.display = \"none\";\n}", "function closeDialog() {\n document.querySelector(\"#expel_student\").classList.add(\"hide\");\n document.querySelector(\"#expel_student .closebutton\").removeEventListener(\"click\", closeDialog);\n document.querySelector(\"#expel_student #expel_button_modal\").removeEventListener(\"click\", expelStudent);\n }", "function closeOption(param) {\n\n gw_com_api.hide(\"frmOption\");\n\n}", "function closeForm() {\n setTimeout(function () {\n document.querySelector(\".bg-modal\").style.display = \"none\";\n }, 250);\n}", "function closeDltEmpModal() {\n document.getElementById('dlt-pop-screen').style.display = \"none\";\n}", "function ClosePopup() {\n document.getElementById('popup').style.display='none'; \n document.getElementById('shadow').style.display='none';\n \n setSquareNums();\n saveSudoku();\n}", "function closeFPOpenCurrent(id) {\n\tif (document.getElementsByClassName('form-popup').style.display != 'none') {\n\t\tdocument.getElementsByClassName('form-popup').style.display = 'none';\n\t\tdocument.getElementById(id).style.display = 'block';\n\t}\n}", "function slide_closeMsgBox() {\n slide_hideExifInfos();\n slide_hideOptions();\n slide_hideHelp();\n slide_addBinds();\n return true;\n}", "function closeSignupAdminModal() {\n parentModalSignupAdmin.style.display = 'none';\n}", "function closePopUp(){\n\n\t// remove image src\n\tdocument.getElementById('mainPopImage').src = \"\";\n\n\t// close the popup\n\tdocument.getElementById('vis-popup').style.display = \"none\";\n}", "function closeForm () {\n $(\"#overlay\").css(\"display\",\"none\")\n}", "function closefeesModal2() {\n document.getElementById('fees-pop-screen').style.display='none';\n}", "function closePop() {\n document.querySelector('#popupImage').onclick = function closeView() {\n popupWindow.style.display = 'none';\n document.querySelector('#popupbg').style.visibility = 'hidden';\n };\n\n document.querySelector('#popupbg').onclick = function closeView() {\n popupWindow.style.display = 'none';\n document.querySelector('#popupbg').style.visibility = 'hidden';\n };\n }", "closeDialog() {\n this.dialog = false;\n this.errors = \"\";\n this.valid = true;\n }", "function closeCVVPopup() {\n\tactivateCheckoutPayButton(); \n\t$('#cvvValue').val('');\n\tcloseAnimatedPopup('cvvFill', 'mainContainIdNewPop');\n}", "onSubmit() {\n this.activeModal.close(1);\n }", "function closePopup()\n{\n modal.style.display = \"none\";\n pagecontent.className = pagecontent.className.replace(\n \" de-emphasized\", \"\");\n}", "function handlePopupClose() {\n setModalMessage('')\n setActionCode('')\n setConfirmationModalShow(false)\n }", "function sleepScoreCalculatorPopupClose() {\n $('.sleep-score-calculator-popup--close-button').on('click', function (e) {\n e.preventDefault();\n $(this).closest('.sleep-score-calculator-popup').fadeOut(500);\n $('.body-overlay').removeClass('sleep-score-popup--visible');\n\n $(\"body\").removeClass('sleep-score-popup-open-scroll-lock');\n }); \n }", "function close_popup(p, view) {\n if (p !== null) {map.closePopup(p);}\n if (view === null) {view = next_view();}\n CANCEL_REQUEST = false;\n map.fitBounds(view, ANIM_OPTIONS);\n if ($('.leaflet-popup-content-wrapper').length === 0) {\n $('.leaflet-draw-section').show();\n map.dragging.enable();\n $('#done-ctn').show();\n }\n has_given_all_answers();\n}", "function closeEditRolePopUp() {\n\tdocument.getElementById(\"txtEditRoleName\").value='';\n\tobjCommon.removePopUpStatusIcons('#txtEditRoleName');\n\tdocument.getElementById(\"editPopupRoleErrorMsg\").innerHTML = \"\";\n\t$('#roleEditModalWindow, .window').hide(0);\n}", "function closeCreateAccount() {\n\t$('.popUpCreateAccountContent').find('input:text').val('');\n\t$('.popUpCreateAccountContent').find('input:password').val('');\n\t$('.asidePopupErrorMessageCommon').html('');\n\t$('#createAccModal, .window').hide(0);\n}", "function close_popup(id) {\n\t// hide the popup\n\t$('#'+id).hide();\n}", "function closeDPEntryPopup(){\r\n\t// remove overlay div to enable the parent page\r\n\t$(\"div\").removeClass(\"modalOverlay\");\r\n\t\r\n\tif ($('#dp_entry_validation').css('display') == 'block')\r\n\t\t$('#dp_entry_validation').css('display','none');\r\n\t\t\r\n\t$('#dp_code_section_page_change').css('display','none');\r\n}", "function closeDialog() {\n jQuery('#oexchange-dialog').hide();\n jQuery('#oexchange-remember-dialog').hide();\n refreshShareLinks();\n }", "function closeForm() {\n document.getElementById(\"myForm\").style.display = \"none\";\n document.getElementById(\"post-start\").style.display = \"none\";\n document.getElementById(\"post-start-title\").style.display = \"none\";\n document.getElementById(\"delete\").disabled = false;\n document.getElementById(\"add\").disabled = false;\n document.getElementById(\"upload\").disabled = false;\n}", "function closeCreateUserForm() {\n document.getElementById(\"createUserForm\").style.display = \"none\";\n}", "function closePopup() {\n $('.popup__close, .sf-btn-finish').on('click', function (e) {\n e.preventDefault();\n $('html').removeClass('lock');\n $('.popup-container').addClass('popup-hide')\n $('.popup-backdrop').addClass('popup-hide')\n $('.popup').addClass('popup-hide')\n })\n}", "function forcedClose_p () {\n// --------------------------------------------------------\n window_o.close(true);\n}", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "function close() {\n\t\t\ttry {\n\t\t\t\t$dialog.close();\n\t\t\t} catch (e) {\n\t\t\t}\n\t\t\twindow.clearTimeout(timer);\n\t\t\tif (opts.easyClose) {\n\t\t\t\t$document.unbind(\"mousedown\", close);\n\t\t\t}\n\t\t}", "close() {\n this.panelNode.classList.remove(gShownCssClass);\n if (this.onClose !== undefined) {\n this.onClose();\n }\n }", "function closeParentDialog() {\n\tif (top.opener && isWindowPopup(top.opener)) {\n\t\troot = top.opener.top.opener;\n\t\ttop.opener.close();\n\t\ttop.opener = root;\n\t}\n}", "function closeForm() {\n document.getElementById(\"modalForm\").style.display = \"none\";\n document.getElementById(\"formType\").value = \"Small\";\n document.getElementById(\"formCapacity\").value = \"1\";\n document.getElementById(\"formLocation\").value = \"\";\n document.getElementById(\"formDescription\").value = \"\";\n document.getElementById(\"formPrice\").value = \"\";\n document.getElementById(\"formImage\").value = \"\";\n document.getElementById(\"errorMsg\").innerHTML = \"\";\n document.getElementById(\"previewImg\").src = \"\";\n}", "function closeFilterPopup() {\n properties.screen.closePopup(properties.filterPopupName);\n }", "close() {\r\n \r\n if (!this.value || !this.selectedDisplay) {\r\n if (this.freeSolo === false) {\r\n this.clear();\r\n }\r\n }\r\n \r\n this.Focusinputbox = false;\r\n if(!this.disableCloseOnSelect)\r\n {\r\n this.results =[];\r\n this.icon = false;\r\n }\r\n \r\n this.error = null;\r\n this.removeEventListener();\r\n this.$emit(\"close\");\r\n }", "function closeOpDialog(e) {\n e.stopPropagation();\n $(\"#dlgairops\").css(\"display\", \"none\");\n $(\"#dlgoverlay\").css(\"display\", \"none\");\n}", "function closeAppeal(f) {\n f.submit();\n window.close();\n}", "function closeCreateIssueForm(elt) {\n $j(elt).closest('.code-issue-create-form').remove();\n return false;\n}", "function closeRuleModal () {\n rulesModalContainer.style.display = 'none'\n welcomeDiv.style.display = 'block'\n}", "function closeUploadRule() {\n // hide popup\n document.getElementById('uploadRuleModal').style.display = 'none';\n // reset popup\n document.getElementById('path').innerHTML = 'No File Selected';\n document.getElementById('startUploadRule').disabled = true;\n}", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "function closeCreatePollModal() {\n \n var backdropElem = document.getElementById('modal-backdrop');\n var createPollElem = document.getElementById('create-poll-modal');\n\n // Hide the modal and its backdrop.\n backdropElem.classList.add('hidden');\n createPollElem.classList.add('hidden');\n \n //clearInputValues();\n}" ]
[ "0.842297", "0.8010219", "0.800799", "0.78565913", "0.78311396", "0.77245045", "0.767624", "0.767624", "0.7561124", "0.7459362", "0.74384135", "0.7411449", "0.73706293", "0.73184854", "0.7302026", "0.7291647", "0.7288605", "0.7269356", "0.7205403", "0.71939963", "0.71902674", "0.7176243", "0.7172568", "0.71705043", "0.7168089", "0.71603054", "0.7159907", "0.7158394", "0.7150895", "0.7144733", "0.71441966", "0.7132111", "0.7124254", "0.71237516", "0.71150273", "0.7109834", "0.7091497", "0.70845604", "0.70491886", "0.70460707", "0.70366246", "0.7030008", "0.7026713", "0.7006331", "0.70040816", "0.69943357", "0.6993864", "0.6992909", "0.69924176", "0.6986252", "0.6986252", "0.6967906", "0.6965077", "0.6957376", "0.69545645", "0.69465184", "0.69431835", "0.6939863", "0.6935066", "0.69310904", "0.69158304", "0.69121903", "0.69112813", "0.69112617", "0.69110715", "0.69076234", "0.6898886", "0.6898473", "0.6891111", "0.6887187", "0.68857557", "0.6883985", "0.68806577", "0.6879033", "0.687279", "0.68705165", "0.687006", "0.68687123", "0.68679726", "0.6859769", "0.68564683", "0.68465394", "0.6841011", "0.6839525", "0.68365234", "0.68334246", "0.68179137", "0.68179137", "0.6816729", "0.68135935", "0.68108356", "0.6806105", "0.6801207", "0.6795821", "0.6794072", "0.6781605", "0.67782545", "0.6777805", "0.6774823", "0.6773607" ]
0.7137235
31
for details on configuring this project to bundle and minify static web assets. Write your Javascript code.
async function Test() { await CefSharp.BindObjectAsync("boundAsync"); console.log("this is Html"); boundAsync.div(9, 1).then(function (rs) { //document.URL = "http://www.baidu.com"; self.location = "http://www.baidu.com"; alert(rs); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function javascript() {\n return gulp.src('src/assets/js/*.js')\n //.pipe($.sourcemaps.init())\n //.pipe($.babel())\n //.pipe($.concat('appfou.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n //.pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n }", "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['html2canvas.js', 'quill.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/scripts'));\n}", "function javascript() {\n return gulp.src('./src/scripts/**/*.js')\n .pipe($.sourcemaps.init())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('./dist/js/'));\n}", "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => {\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.uglify()\n .on('error', e => {\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.distJS));\n}", "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['vue.js','vue-resource.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/public/js'));\n}", "function javascript() {\n return gulp.src(PATHS.javascript.vendor.concat(PATHS.javascript.project))\n .pipe($.sourcemaps.init())\n .pipe($.if(!WATCHER, $.babel()))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify({\n \"output\": {\n ascii_only: true\n },\n \"mangle\": false,\n \"compress\": {\n dead_code: false,\n hoist_funs: false\n }\n })))\n .on('error', function (e) {\n console.log(e);\n })\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "function jsTask() {\n\treturn src([\n\t\t'node_modules/jquery/dist/jquery.js',\t\n\t\t'node_modules/foundation-sites/dist/js/foundation.js',\n\t\t'./js/**/*.js',\n\t])\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(concat('theme.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(dest('./assets/'));\n}", "function javascript() {\r\n\treturn gulp.src(CONF.PATHS.entries)\r\n\t\t.pipe(named())\r\n\t\t.pipe($.sourcemaps.init())\r\n\t\t.pipe(webpackStream(webpackConfig, webpack2))\r\n\t\t.pipe($.if(PRODUCTION, $.uglify()\r\n\t\t\t.on('error', e => { console.log(e); })\r\n\t\t))\r\n\t\t.pipe($.if(!PRODUCTION, $.sourcemaps.write()))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/js'));\r\n}", "function mainJs() {\n notify('Building JS files...');\n return gulp.src('src/js/main/**/*.js')\n .pipe(sourcemaps.init())\n .pipe(uglify())\n .pipe(concat('scripts.min.js'))\n .pipe(plumber())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('_site/assets/js/'))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest('assets/js'));\n}", "function js() {\n\n let streamJs = gulp.src('.');\n\n const tsPath = `${src.ts}/inits/${appName}.init.ts`;\n\n if (fs.existsSync(tsPath)) {\n\n // 1 - pegue o arquivo \"init\" typescript do app\n // 2 - compile o arquivo para javascript\n // 3 - aplique pollyfills caso seja necessário \n let scripts = browserify(tsPath)\n .plugin(tsify, { typeRoots: [\"./node_modules/@types\", \"./type-definitions\"], target: \"esnext\" })\n .transform(stringify, {\n appliesTo: { includeExtensions: ['.html'] },\n minify: true,\n minifyOptions: {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n removeEmptyAttributes: true,\n removeRedundantAttributes: true,\n sortAttributes: true,\n sortClassName: true,\n trimCustomFragments: true\n }\n })\n .transform(babelify, {\n presets: [\n [\n '@babel/preset-env',\n {\n 'useBuiltIns': 'usage',\n 'corejs': 3\n }\n ]\n ],\n extensions: ['.ts']\n })\n .transform('exposify', { expose: { angular: 'angular' }, filePattern: /\\.ts/ })\n .external(['angular']);\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique os seguintes plugins:\n // 1 - Aplique as configurações de produção\n // 2 - Minifique cada módulo (arquivo .ts) individualmente\n // 3 - Remove exports não utilizados\n // 4 - Simplifica os 'require' do js final para variáveis\n scripts = scripts.transform('envify', { global: true })\n .transform(uglifyify, { global: true })\n .plugin('common-shakeify')\n .plugin('browser-pack-flat/plugin');\n }\n\n // junte os arquivos e coloque o arquivo final na pasta de destino\n scripts = scripts.bundle();\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique o seguinte plugin:\n // 1 - minifica o arquivo js final\n scripts = scripts.pipe(minifyStream({ sourceMap: false }));\n }\n\n scripts = scripts.pipe(source(`${appName}.min.js`))\n .pipe(buffer());\n\n scripts = scripts.pipe(gulp.dest(dest.js));\n\n streamJs = scripts;\n }\n\n return streamJs;\n }", "function scripts() {\n var jsFile = [\n \"src/js/jquery.js\",\n \"src/js/script.js\"\n ];\n return gulp\n .src(jsFile, { sourcemaps: true })\n .pipe(plumber())\n .pipe( concat( 'theme.js' ) )\n .pipe(gulp.dest(`${config.src.root}/js`, { sourcemaps: true }))\n .pipe(gulp.dest(`${config.dist}/js`, { sourcemaps: true }))\n .pipe(rename({ suffix: \".min\" }))\n .pipe( uglify())\n .pipe(gulp.dest(`${config.src.root}/js`, { sourcemaps: true }))\n .pipe(gulp.dest(`${config.dist}/js`, { sourcemaps: true }));\n}", "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "function js() {\n return src(source + 'js/*.js')\n .pipe(concat('main.js'))\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest(destination + 'js'));\n}", "function jsFn(){\n\tgulp.src(jsDirectory + '*.js')\n\t.pipe( gulpif( !dev , uglify() ) )\n\t.pipe(plumber())\n\t.pipe(gulp.dest(doc+'assets'+'/js'));\n}", "function js()\n{\n var streams = pathConfig.js.map( function( folder )\n {\n return gulp.src(getGlob( folder ) )\n .pipe( !folder.thirdParty && !$.util.env.production ? $.jsHint(): $.util.noop() )\n .pipe( !folder.thirdParty && !$.util.env.production ? $.jsHint.reporter( 'default' ) : $.util.noop() )\n .pipe( $.util.env.production ? $.uglify() : $.util.noop() )\n .pipe( gulp.dest( folder.dist ) );\n } );\n\n return $.mergeStream( streams );\n}", "function jsTask () {\n return src(['src/assets/js/**/*.js'])\n .pipe(concat('application.js'))\n .pipe(uglify())\n .pipe(dest('output/js'))\n}", "function js() {\n\twatch([paths.js + '/**/*.*', '!' + paths.js + '/**/*.min.js'], {ignoreInitial: false}, function () {\n\t\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\t\treturn scripts.forEach(function(obj){\n\t\t\treturn src(obj.src, { sourcemaps: true })\n\t\t\t\t.pipe(plumber({errorHandler: onError}))\n\t\t\t\t.pipe(concat(obj.name))\n\t\t\t\t.pipe(dest(paths.js, { sourcemaps: true }));\n\t\t});\n\t});\n}", "function minifyJs() {\n\n return gulp.src('./src/assets/js/**/*.js', { matchBase: './src/assets/js/' })\n .pipe(ugly({compress: true}))\n .pipe(gulp.dest('./src/assets/css/'))\n .pipe(browserSynnc.stream());\n}", "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "function js(cb){\n src([jquery,bootstrap_js]).pipe(dest(jsDest));\n cb();\n}", "function make_bundle () {\n\t\tconsole.log( chalk.blue('Building Javascript') );\n\n\n\n\t\treturn bundler.bundle()\n\t\t .pipe(source('main.js'))\n\t\t .pipe(bufferify())\n\t\t .pipe(gulpif( args.prod, uglify() ))\n\t\t .pipe(gulp.dest(dir.compiled.js));\n\t}", "function js() {\n return gulp.src( 'src/assets/js/*' )\n .pipe( gulp.dest( './build/assets/js/' ) );\n}", "function compileJs() {\n return merge(\n // config-theme.js\n src(['src/assets/js/*.js', '!src/assets/js/indonez/*.js'])\n .pipe(beautify({js: {file_types: ['.js']} })) \n .pipe(dest('dist/js')),\n\n // indonez.min.js\n src('src/assets/js/indonez/*.js')\n .pipe(concat('indonez.min.js', {newLine: '\\r\\n\\r\\n'}))\n //.pipe(babel({presets: ['babel-preset-env']}))\n .pipe(minify({minify: true, minifyJS: {sourceMap: false}}))\n .pipe(dest('dist/js/vendors')),\n\n // uikit.min.js\n src('node_modules/uikit/dist/js/uikit.min.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors')),\n\n // js vendors\n src('src/assets/js/vendors/*.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors'))\n )\n}", "function optimizeJS() {\n console.log(chalk.yellow('\\n Optimizing files:\\n'));\n\n webpackManifest.assets.forEach((asset) => {\n if ( !asset.name.endsWith('.js') ) {\n return;\n }\n const filename = path.resolve(__dirname, `../public/js/${asset.name}`);\n fs.writeFileSync(\n filename,\n optimizeJs(fs.readFileSync(filename, {encoding: 'utf-8'}))\n );\n });\n\n console.log(' OK');\n}", "function jsTask(){\r\n return src([\r\n files.jsPath\r\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\r\n ])\r\n .pipe(concat('main.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('dist/js')\r\n );\r\n}", "function js(){\r\n return src(paths.js)\r\n .pipe(concat('scripts.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('dist/js'))\r\n .pipe(browserSync.stream());\r\n}", "function jsProd() {\n return src([\n 'js/**/*.js',\n 'node_modules/bootstrap/dist/js/bootstrap.js'\n ])\n .pipe(\n babel({\n presets: ['@babel/env']\n })\n )\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest('dist'));\n}", "function scripts() {\n return (\n gulp\n .src(javascript_sources)\n .pipe(sourcemaps.init())\n .pipe(concat('concat.js'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(rename('package.js'))\n .pipe(uglify())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(browsersync.stream())\n );\n}", "function js() {\n return src(paths.js.src)\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(rename({ extname: '.min.js' }))\n .pipe(dest(paths.js.dist))\n .pipe(browserSync.stream())\n}", "function minify_app_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/app.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "function js() {\n\treturn src( folder.src + 'js/*.js' )\n\t\t.pipe( deporder() )\n\t\t.pipe( concat( 'app.js' ) )\n\t\t//.pipe( uglify() )\n\t\t.pipe( dest( folder.build + 'js' ) )\n}", "function jsTask() {\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest(\"dist/js\"));\n}", "function js() {\n return browserify(config.src + 'js/main.js', {\n debug: true\n })\n .transform(babelify, {\n presets: [es2015]\n })\n .bundle()\n .on(\n 'error',\n gulp_notify.onError(function(error) {\n return 'Message to the notifier: ' + error.message;\n })\n )\n .pipe(source('main.js'))\n .pipe(buffer())\n .pipe(gulp_sourcemaps.init())\n .pipe(gulp_uglify())\n .pipe(gulp_sourcemaps.write())\n .pipe(gulp_rename('main.min.js'))\n .pipe(gulp.dest(config.assets + 'js/'))\n .pipe(gulp_notify('JS compiled'));\n}", "function minifyJs() {\n return Elixir.Plugins.uglify(\n Elixir.config.js.uglify.options\n );\n}", "cleanScript(jsfile) {// N/A in web\n }", "function js() {\n return gulp.src(path.src.js)\n .pipe(uglify())\n .pipe(concat('main.js'))\n .pipe(gulp.dest(path.build.js))\n .pipe(reload({stream:true}))\n}", "function combineJs() {\r\n return gulp\r\n .src(configJs.src)\r\n .pipe(concat('site.min.js'))\r\n .pipe(uglify())\r\n .pipe(header(banner))\r\n .pipe(gulp.dest('./wwwroot/js/'))\r\n}", "function vendorJavascript() {\n gutil.log('updating vendor js');\n return gulp.src(PATHS.vendor)\n .pipe($.concat('vendor.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/js'))\n}", "function js() {\n return gulp.src(jsFiles)\n .pipe(concat(\"main.js\"))\n .pipe(uglify({\n mangle: {\n toplevel: false\n }\n }))\n .pipe(gulp.dest(\"./dist/js\"))\n .pipe(browserSync.stream());\n}", "function script(cb) {\n src(js.in)\n .pipe(sourcemaps.init())\n // .pipe(concat(\"app.js\")) //Will make all seperate file.\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(js.out))\n watch(js.watch, series(script, browsersync.reload))\n cb()\n}", "function kia_promo_scripts_promo() {\n\treturn src(projects.kia_promo.scripts_promo.src)\n\t.pipe(concat(projects.kia_promo.scripts_promo.output))\n\t// .pipe(uglify()) // Minify js (opt.)\n\t.pipe(header(projects.kia_promo.forProd))\n\t.pipe(dest(projects.kia_promo.scripts_promo.dest))\n\t.pipe(browserSync.stream())\n}", "function headJavascript() {\n gutil.log('updating head js');\n return gulp.src(PATHS.head)\n .pipe($.concat('head.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/js'))\n}", "function bundle_js(bundler) {\n\treturn b.bundle()\n\t\t.on('error', map_error)\n\t\t.pipe(source('app.js'))\n\t\t.pipe(buffer())\n\t\t.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n\t .pipe(sourcemaps.write('../js/maps')) // writes .map file\n\t .pipe(gulp.dest(project.theme.js_dist))\n\t .pipe(livereload());\n}", "function scripts() {\n return (\n gulp\n .src([\"./assets/js/**/*\"])\n .pipe(newer(\"./docs/assets/js\"))\n .pipe(babel({presets: ['@babel/preset-env']}))\n .pipe(minify({noSource: true, ext: {min: '.min.js'}}))\n .pipe(gulp.dest(\"./docs/assets/js/\"))\n );\n}", "function grind(grunt) {\n\n // grunt.loadNpmTasks('grunt-closure-compiler');\n\n // Project configuration.\n var config = {\n pkg: '<json:../package.json>',\n meta: {\n banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +\n '<%= grunt.template.today(\"yyyy-mm-dd\") %>\\n' +\n '<%= pkg.homepage ? \"* \" + pkg.homepage + \"\\n\" : \"\" %>' +\n '* Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %>;' +\n ' Licensed <%= _.pluck(pkg.licenses, \"type\").join(\", \") %> */',\n original: '/* View original: <%= pkg.name %>-<%= pkg.version %>.js */'\n },\n lint: {\n files: ['grunt.js', 'js/**/*.js']\n },\n concat: {\n dist: {\n // built dynamically\n // src: ['<banner:meta.banner>', 'public/js/intro.js', 'public/js/*.js', 'public/js/**/*.js', 'public/js/outro.js'],\n src: [],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.js'\n }\n },\n min: {\n dist: {\n src: ['<banner:meta.original>', '<banner:meta.banner>', '<config:concat.dist.dest>'],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.min.js'\n }\n },\n watch: {\n files: '<config:lint.files>',\n tasks: 'lint'\n },\n jshint: {\n options: {\n curly: true,\n eqeqeq: true,\n immed: true,\n latedef: true,\n newcap: true,\n noarg: true,\n sub: true,\n undef: true,\n boss: true,\n eqnull: true,\n browser: true\n },\n globals: {\n jQuery: true,\n jsbin: true\n }\n }\n ,\n 'closure-compiler': {\n frontend: {\n root: 'js/',\n js: '', // completed dynamically\n jsOutputFile: '<%= pkg.name %>-<%= pkg.version %>.min.js',\n sourcemap: '<%= pkg.name %>-<%= pkg.version %>.map',\n options: {\n create_source_map: '<%= pkg.name %>-<%= pkg.version %>.map',\n source_map_format: 'V3',\n compilation_level: 'ADVANCED_OPTIMIZATIONS',\n language_in: 'ECMASCRIPT5_STRICT'\n }\n }\n }\n };\n\n var scripts = require('../scripts.json'),\n scriptsRelative = scripts.map(function (script) {\n return script.substring(1);\n });\n\n config.lint.files = scriptsRelative;\n config.concat.dist.src = scriptsRelative;\n config['closure-compiler'].frontend.js = scripts.map(function (script) {\n return script.substring(4);\n });\n config.concat.dist.src.unshift('js/intro.js');\n config.concat.dist.src.unshift('<banner:meta.banner>');\n config.concat.dist.src.push('js/outro.js');\n\n grunt.initConfig(config);\n // Default task.\n grunt.registerTask('default', 'concat min');\n grunt.registerTask('sourcemap', 'closure-compiler');\n // grunt.registerTask('lint', 'lint');\n\n}", "function bundle(name){\n var path = 'client/' + name + '/index';\n var js = path + '.js';\n var css = path + '.css';\n var scss = path + '.scss';\n var dest = 'build/bundles/' + name;\n var assets_source = 'client/common/branding/assets';\n var assets_destination = dest + '/assets';\n\n function build(){\n // browserify\n browserifyFile(js, dest);\n // sass\n sassFile(scss, dest);\n //assets\n assets(assets_source, assets_destination);\n }\n\n function watch(){\n // browserify\n browserifyFile(js, dest, {watch:true});\n\n // sass\n sassFile(scss, dest)\n gulp.watch('client/' + name + '/**/*.scss', function(){\n return sassFile(scss, dest, {watch:true});\n });\n }\n\n return {\n build: build,\n watch: watch\n }\n}", "function JSFormat() {\n\treturn gulp.src(config.js)\n\t\t.pipe(concat('combined.js'))\n\t\t.pipe(gulpif(config.settings.isBuild, uglify()))\n\t\t.pipe(gulp.dest(config.distJS))\n}", "function javaScriptDevlopmentBuild(cb) {\r\n return src(javaScriptSource)\r\n .pipe(concat('app.js'))\r\n .pipe(rename({\r\n extname: '.min.js',\r\n }))\r\n .pipe(dest(javaScriptDestination));\r\n cb();\r\n}", "function jsProd() {\n\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\n\tscripts.forEach(function(obj){\n\t\tsrc(obj.src)\n\t\t\t.pipe(concat(obj.name))\n\t\t\t.pipe(uglify())\n\t\t\t.pipe(dest(paths.js));\n\t});\n\n\treturn Promise.resolve('the value is ignored');\n}", "function jsTask() {\n\n return src(files.jsPath)\n\n .pipe(concat('script.js'))\n\n .pipe(minify())\n\n .pipe(dest('src/js'));\n\n}", "function jsTask(){\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest('./docs/**/*.js'))\n .pipe(browserSync.reload({stream:true}))\n}", "function scriptsCSSans() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js'])\n .pipe(concat('cssans.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./dist/'))\n );\n}", "function scripts(watch) {\n\tif (watch) {\n\t\t$.gutil.log(chalk.green(\"Inside scripts - js-watchify\"));\n\t}\n\telse {\n\t\t$.gutil.log(chalk.green(\"Inside scripts - js-browserify\"));\n\t}\n\t\n\n\t$.glob(config.client.js.srcDir + '/**/*.js', {ignore: config.client.js.srcDir + '/assets/**/*.*'}, function (err, files) { \n\t if (err) {\n\t \tlet errmsg = err.msg || err.message;\n\t\t\t$.gutil.log(chalk.red(\"Error : \") + chalk.blue(errmsg));\n\t }\n\n\t $.gutil.log(chalk.magenta(\"files list : \") + chalk.green(files));\n\n\t let tasks = files.map(entry => {\n\t \t$.gutil.log(chalk.magenta(\"entry file : \") + chalk.green(entry));\n\n\t \tlet filePathFromSrc = $.path.relative(config.client.js.srcDir, entry);\n\t \tlet outputDir = $.path.resolve(config.client.js.outputDir, $.path.dirname(filePathFromSrc));\n\n\t \tlet browserifyOpts = {\n\t \t\tentries: [entry],\n\t\t extensions: ['.js'],\n\t\t debug: !isProduction,\n\t\t fullPaths: watch\n\t \t};\n\n\t \tlet browserifyOpts_w_watchify = {\n\t \t\tentries: [entry],\n\t\t extensions: ['.js'],\n\t\t cache: {},\n\t\t packageCache: {},\n\t\t debug: !isProduction,\n\t\t fullPaths: watch\n\t \t};\n\n\t \tlet bundler;\n\t \t\n\t \tif(watch) {\n\t \t\tlet opts = $.assign({}, $.watchify.args, browserifyOpts_w_watchify);\n\t \t\t$.gutil.log(chalk.magenta(\"opts : \") + chalk.green(opts));\n\t \t\t\n\t \t\tbundler = $.browserify(opts);\n\t \t\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\n\t \t\tbundler = $.watchify(bundler);\n\t \t\t$.gutil.log(chalk.magenta(\"watchify instance started\"));\n\t \t\t}\n\t \t\telse {\n\t \t\t\tbundler = $.browserify(browserifyOpts);\n\t \t\t\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\t \t\t}\n\n\t \t\tbundler.transform($.babelify);\n\t \t\t$.gutil.log(chalk.magenta(\"babelify transform done..\"));\n\n\t \tlet bundle = function() {\n\n\t \t\t$.gutil.log(chalk.magenta(\"Inside bundle funtion\"));\n\n\t \t\tlet stream = bundler.bundle();\n\n\t \t\t$.gutil.log(chalk.magenta(\"stream bundle creted\"));\n\t\t\t\t\n\t\t\t\treturn stream.pipe($.source($.path.basename(entry)))\n\t\t\t\t.pipe($.buffer())\n\t\t\t\t.pipe($.plumber({\n\t\t\t\t\terrorHandler: mapError\n\t\t\t\t})) \n\t\t\t\t.pipe($.duration('browserify bundling')) \n\t\t\t\t.pipe($.cache('scripts')) \n\t\t\t\t// .pipe($.changed(config.client.js.outputDir, {extension: '.bundle.js', hasChanged: $.changed.compareSha1Digest}))\t\t\t\t\n\t\t\t\t.pipe($.rename({\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Rename output from to '.bundle.js'\n\t\t\t\t\textname: config.client.js.outputFileBundleExt\n\t\t\t\t})) \n\t\t\t\t.pipe(gulp.dest(outputDir))\t\t\t\t\t\t\t\t\t\t// Save 'bundle.js' to output directory\t\t\t\t\n\t\t\t // .pipe($.gulpif(isProduction, $.sourcemaps.init({\t\t\t\t\t\t\t\t\t// loads map from browserify file\n\t\t\t // \tloadMaps: true\n\t\t\t // }), $.gutil.noop())) \t\t\t\t\n\t\t\t // Add transformation tasks to the pipeline here.\n\t\t \t// .pipe($.gulpif(isProduction, $.uglify(), $.gutil.noop()))\t\t\t\t\t\t\t// uglify only whene production environment\n\t\t \t// .pipe($.gulpif(isProduction, $.rename({ extname: config.client.js.outputFileMinExt}), $.gutil.noop()))\n\t\t \t.pipe($.uglify())\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// always uglify regardless of production or development environment\n\t\t \t.pipe($.rename({\n\t\t \t\textname: config.client.js.outputFileMinExt\n\t\t \t}))\n\t\t\t // Transformtions ended here\n\t\t\t // .pipe($.gulpif(isProduction, $.sourcemaps.write({destPath: config.client.js.mapDir}), $.gutil.noop())) \t\t// writes .map file\t\t\t \t\n\t\t\t .pipe(gulp.dest(outputDir));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Save 'bundle.min.js' to output directory\n\t\t\t};\n\n\n\t \tif (watch) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add event handlers to watchify bundler\n\t\t \tbundler.on('update', bundle);\n\t\t \tbundler.on('log', $.gutil.log.bind($.gutil)); \t\t\t\t\t\t\t\t// output build logs to terminal\n\t\t \t\t\n\t\t } \t \t\t\t\t\t\n\t \t\n\t \t$.gutil.log(chalk.magenta(\"returning bundle\"));\n\t \treturn bundle();\n\t \n\t });\n\n\t // Call tasks as a merged array stream\n\t $.gutil.log(chalk.magenta(\"calling es.merge\"));\n\t \n\t $.es.merge(tasks).on('end', $.gutil.log.bind($.gutil));\n\t});\n}", "function prodScripts(){\n return gulp\n .src(config.scripts.src)\n .pipe($.babel())\n .pipe($.concat(config.scripts.bundle))//after babel transpiling\n .pipe($.uglify())//now minify app.js\n .pipe(gulp.dest(config.scripts.dest)); \n}", "function js() {\n return src(PATHS.src.js.files, {\n sourcemaps: true\n })\n .pipe(babel({\n presets: ['@babel/preset-env']\n }))\n .pipe(uglify())\n .pipe(dest(PATHS.public.js.folder))\n}", "function scripts() {\n return gulp.src(paths.scripts.src)\n .pipe(uglify())\n .pipe(rename({ suffix: '.min' }))\n .pipe(gulp.dest(paths.scripts.dest));\n}", "function uglifyScripts(){\n var uglified = uglify.minify(getScripts());\n fs.writeFile(path.join(__dirname, '../', 'preload/scripts.js'), uglified.code, function (err){\n if(err) {\n console.log(err);\n } else {\n console.log(\"Scripts combined, minified and saved in:\", 'scripts.js');\n }\n });\n}", "function compressJS(callB) {\n pump([\n gulp.src(\"./js/*.js\", {\n sourcemaps: true\n }),\n uglify(),\n concat('main.min.js'),\n gulp.dest(\"./bundle\")\n ],\n callB\n );\n}", "function buildScript() \n{\n var path = \"static/js/*.js\", // Path to scripts\n dist = \"static/dist/js\"; // Destiny\n\n // Building script\n return gulp.src(path) // Defning source of js scripts\n .pipe(concat(\"scripts.js\")) // Concating all scripts from path\n .pipe(rename({suffix: '.min'})) // Renaming scripts.js\n .pipe(uglify()) // Uglifying scripts.min.js\n .pipe(gulp.dest(dist)) // Destiny of scripts.min.js\n .pipe(notify({ message: \"Scripts task complete\" })); // Notify when done\n}", "function publishJavaScript(done) {\n return gulp.src(\"src/js/**/*\").pipe(gulp.dest(\"dist/js\"));\n}", "function process_js() {\n $.util.log($.util.colors.yellow(\"Combining, transpiling, and minifying JavaScript files\\n\"));\n // get js files and attach src to beginning\n var js_import = (function () {\n var js_src = settings.js.src,\n i, arr = [],\n src = settings.js.files;\n\n for (i = 0; i <= src.length - 1; i++) {\n arr.push(js_src + src[i]);\n }\n return arr;\n }());\n\n // compile Babel & combine all js files in folder, starting alphabetically\n var concat = gulp.src(js_import)\n .pipe($.sourcemaps.init())\n .pipe($.replace(settings.assets.tag, $path))\n .pipe($.concat(settings.js.name + '.js')).on('error', settings.error)\n .pipe($.babel({\n presets: [['env', {\n modules: false\n }]]\n })).on('error', settings.error);\n\n // minify javascript file\n var ugly = concat.pipe($.clone())\n .pipe($.uglify()).on('error', settings.error)\n .pipe($.replace(settings.assets.tag, $path))\n .pipe($.rename(settings.js.name + '.min.js'));\n\n // merge pipes and output separate files with sourcemaps.\n return merge(concat, ugly)\n .pipe($.sourcemaps.write('.'))\n .pipe(gulp.dest(settings.js.dest))\n .pipe(browser_sync.stream());\n}", "function jsTask() {\n return src(files.jsPath)\n .pipe(babel())\n .pipe(conCat('main.js'))\n //terser minifies the files after concat put them togheter\n .pipe(terser())\n .pipe(dest('pub/js'));\n}", "function buildJavascript() {\n return buildGenerator('javascript', 'JavaScript');\n}", "function compileFiles(appName) {\n\n let stream;\n\n const cssOnly = process.argv.indexOf('--css-only') !== -1;\n const jsOnly = process.argv.indexOf('--js-only') !== -1;\n\n let styles;\n let scripts;\n\n if (cssOnly) {\n\n styles = css();\n\n stream = styles;\n }\n\n if (jsOnly) {\n\n scripts = js();\n\n stream = scripts;\n }\n\n if (!cssOnly && !jsOnly) {\n\n styles = css();\n scripts = js();\n\n stream = merge(styles, scripts);\n }\n\n return stream;\n\n // realiza processos para gerar os arquivos js\n function js() {\n\n let streamJs = gulp.src('.');\n\n const tsPath = `${src.ts}/inits/${appName}.init.ts`;\n\n if (fs.existsSync(tsPath)) {\n\n // 1 - pegue o arquivo \"init\" typescript do app\n // 2 - compile o arquivo para javascript\n // 3 - aplique pollyfills caso seja necessário \n let scripts = browserify(tsPath)\n .plugin(tsify, { typeRoots: [\"./node_modules/@types\", \"./type-definitions\"], target: \"esnext\" })\n .transform(stringify, {\n appliesTo: { includeExtensions: ['.html'] },\n minify: true,\n minifyOptions: {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n removeEmptyAttributes: true,\n removeRedundantAttributes: true,\n sortAttributes: true,\n sortClassName: true,\n trimCustomFragments: true\n }\n })\n .transform(babelify, {\n presets: [\n [\n '@babel/preset-env',\n {\n 'useBuiltIns': 'usage',\n 'corejs': 3\n }\n ]\n ],\n extensions: ['.ts']\n })\n .transform('exposify', { expose: { angular: 'angular' }, filePattern: /\\.ts/ })\n .external(['angular']);\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique os seguintes plugins:\n // 1 - Aplique as configurações de produção\n // 2 - Minifique cada módulo (arquivo .ts) individualmente\n // 3 - Remove exports não utilizados\n // 4 - Simplifica os 'require' do js final para variáveis\n scripts = scripts.transform('envify', { global: true })\n .transform(uglifyify, { global: true })\n .plugin('common-shakeify')\n .plugin('browser-pack-flat/plugin');\n }\n\n // junte os arquivos e coloque o arquivo final na pasta de destino\n scripts = scripts.bundle();\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique o seguinte plugin:\n // 1 - minifica o arquivo js final\n scripts = scripts.pipe(minifyStream({ sourceMap: false }));\n }\n\n scripts = scripts.pipe(source(`${appName}.min.js`))\n .pipe(buffer());\n\n scripts = scripts.pipe(gulp.dest(dest.js));\n\n streamJs = scripts;\n }\n\n return streamJs;\n }\n\n // realiza processos para gerar os arquivos css\n function css() {\n\n // 1 - pegue o arquivo sass/scss referente ao app\n // 2 - compile o arquivo para css\n // 3 - aplique atributos compatíveis com a versão de browser especificada na propriedade \"browserslist\" do arquivo package.json\n // 4 - crie os arquivos e coloque o compilado css na pasta de destino\n // 5 - minifique o arquivo css\n // 6 - renomeie o arquivo minificado\n // 7 - coloque minificado css na pasta de destino\n let css = gulp.src(`${src.sass}/${appName}.{scss,sass}`)\n .pipe(sassCompiler().on('error', sassCompiler.logError))\n .pipe(autoprefixer())\n .pipe(csso())\n .pipe(rename({ extname: '.min.css' }))\n .pipe(gulp.dest(dest.css));\n\n if (uploadFiles) {\n\n // aplique a stream de upload de arquivos\n css = upload(css, dest.css);\n }\n\n return css;\n }\n}", "function jsComp(cb){\n return src(\"./src/js/**/*.js\")\n .pipe(gulpIf(buildEnv === 'prod', uglify()))\n .pipe(conCat('main.min.js'))\n .pipe(dest(buildDir+\"js/\"))\n cb();\n}", "function scripts() {\r\n return gulp\r\n .src('src/js/**/*.js')\r\n .pipe(plumber())\r\n .pipe(concat('main.js'))\r\n .pipe(terser())\r\n .pipe(gulp.dest('assets/js/'))\r\n .pipe(gulp.dest('_site/assets/js/'))\r\n .pipe(bsync.stream());\r\n}", "function buildJS() {\n const bundler = browserify('src/assets/js/app.js').transform(\n 'babelify',\n { presets: ['@babel/preset-env'],\n plugins: [\"@babel/transform-runtime\"]\n }\n )\n return bundler.bundle()\n .on('error', handleError)\n .pipe(source('app.js'))\n .pipe(buffer())\n .pipe(terser({\n mangle: false,\n compress: true,\n }))\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest('dist/assets/js/'));\n}", "function _generateScriptTags() {\n var root = path.join(__dirname, '../../dist/');\n var files = glob.sync([\n //vendors libraries\n root + \"js/vendors/jquery*.js\",\n root + \"js/vendors/angular.js*\",\n root + \"js/vendors/angular*.js\",\n root + \"js/vendors/*\",\n //application files\n root + \"js/app/**/module.js\",\n root + \"js/app/**/*.js\",\n root + \"js/app/bootstrap.js\",\n root + \"js/templates.js\"\n ]);\n\n return _.reduce(files, function(acc, it) {\n it = it.replace(root, \"\");\n acc.push('<script src=\"' + it + '\"></script>');\n return acc;\n }, []).join(\"\\n\");\n}", "function uglify() {\n\t\t\tvar settings = config.styles.uglify;\n\n\t\t\treturn gulp.src( settings.src )\n\t\t\t // Deal with errors.\n\t\t\t .pipe( plugins.plumber( {errorHandler: handleErrors} ) )\n\n\t\t\t .pipe( plugins.rename( {suffix: '.min'} ) )\n\t\t\t .pipe( plugins.uglify( {\n\t\t\t\t mangle: false\n\t\t\t } ) )\n\t\t\t .pipe( gulp.dest( settings.dest ) ).on( 'end', function () {\n\t\t\t\t\t\t\tplugins.util.log( plugins.util.colors.bgGreen( 'Scripts are now minified....[uglify()]' ) );\n\t\t\t\t\t\t} )\n\t\t\t .pipe( plugins.notify( {message: 'Scripts are built.'} ) );\n\t\t}", "function buildJS(cb) {\n src([\"src/js/main.js\"]).pipe(concat(\"main.js\")).pipe(dest(destFolderJS));\n\n cb();\n}", "function jsBuild() {\n return gulp.src(paths.js.src)\n .pipe(uglify({\n mangle: false\n }))\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(gulp.dest(paths.js.build))\n .pipe(gulp.dest('_site/javascripts/build'))\n .pipe(browserSync.reload({stream: true}));\n}", "function bundler(options) {\n var allFiles = {};\n var bundles = {};\n var dir = options.src;\n var dest = options.dest;\n var resourcesFile = options.resourceJson;\n var indexBundles = options.indexBundles;\n var titleIndexBnudles = {};\n var traversed_bundles = {}, traversed_files = {}, excluded_bundles = {};\n var resourcesJs = {};\n for (var key in options) {\n resourcesJs[key] = options[key];\n }\n resourcesJs.bundles = bundles;\n\n function getFiles(packageName, files, bundledFile, includedBundles) {\n if (!traversed_bundles[packageName] && !excluded_bundles[packageName]) {\n traversed_bundles[packageName] = true;\n var bundle = resourcesJs.bundles[packageName];\n if (bundle) {\n bundle.bundled = bundle.bundled || [];\n bundle.bundled_html = bundle.bundled_html || [];\n bundle.in = bundle.in || [];\n for (var i in bundle.on) {\n files = getFiles(bundle.on[i], files, bundledFile, includedBundles);\n }\n for (var j in bundle.js) {\n var _file2 = cleanURL(dir + \"/\" + bundle.js[j]);\n if (!traversed_files[_file2]) {\n files.js.push(_file2);\n traversed_files[_file2] = packageName;\n }\n }\n if (files.js.length > 0) {\n bundle.bundled.push(bundledFile + \".js\");\n }\n\n for (var i in bundle.html) {\n var _file = cleanURL(dir + \"/\" + bundle.html[i]);\n if (!traversed_files[_file]) {\n files.html.push(_file);\n traversed_files[_file] = packageName;\n }\n }\n if (files.html.length > 0) {\n bundle.bundled_html.push(bundledFile + \".html\");\n }\n\n includedBundles.push(packageName);\n }\n }\n return files;\n }\n\n if (TASK_BUNDLIFY || TASK_SCAN) {\n grunt.file.recurse(dir, function(abspath, rootdir, subdir, filename) {\n if (filename === \"module.json\" && abspath.indexOf(dest) !== 0) {\n var packageInfo = {};\n if (grunt.file.exists(subdir + \"/.bower.json\")) {\n var bowerJson = grunt.file.readJSON(subdir + \"/.bower.json\");\n packageInfo.bowerName = bowerJson.name;\n packageInfo.bowerVersion = bowerJson.version;\n }\n if (grunt.file.exists(subdir + \"/composer.json\")) {\n var composerJson = grunt.file.readJSON(subdir + \"/composer.json\");\n packageInfo.composerName = composerJson.name;\n packageInfo.composerVersion = composerJson.version;\n }\n var _bundles = grunt.file.readJSON(abspath);\n var packageName = _bundles.name;\n if (_bundles.exclude) {\n for (var i in _bundles.exclude) {\n excluded_bundles[_bundles.exclude[i]] = true;\n }\n }\n if (packageName !== undefined) {\n titleIndexBnudles[packageName] = [];\n for (var bundleName in _bundles) {\n if ((bundleName === packageName || bundleName.indexOf(packageName + \"/\") === 0) && !excluded_bundles[bundleName]) {\n if (bundles[bundleName]) {\n console.log(\"====Duplicate Package\", bundleName);\n } else if (!toIgnore(bundleName)) {\n titleIndexBnudles[packageName].push(bundleName);\n }\n bundles[bundleName] = { js: [], on: [], css: [], html: [], packageInfo: packageInfo};\n for (var file_i in _bundles[bundleName].js) {\n var js_file = subdir + \"/\" + _bundles[bundleName].js[file_i];\n bundles[bundleName].js.push(js_file);\n if (!allFiles[js_file]) {\n allFiles[js_file] = js_file;\n } else {\n console.log(\"====Duplicate File\" + js_file);\n }\n }\n for (var file_j in _bundles[bundleName].css) {\n var css_file = subdir + \"/\" + _bundles[bundleName].css[file_j];\n bundles[bundleName].css.push(css_file);\n if (!allFiles[css_file]) {\n allFiles[css_file] = css_file;\n } else {\n console.log(\"====Duplicate File\" + css_file);\n }\n }\n for (var file_k in _bundles[bundleName].html) {\n var html_file = subdir + \"/\" + _bundles[bundleName].html[file_k];\n bundles[bundleName].html.push(html_file);\n if (!allFiles[html_file]) {\n allFiles[html_file] = html_file;\n } else {\n console.log(\"====Duplicate File\" + html_file);\n }\n }\n bundles[bundleName].on = _bundles[bundleName].on || [];\n console.log(\"╬═╬ Module.json\", abspath);\n //console.log(bundleName, _bundles[bundleName].on);\n }\n }\n }\n }\n });\n\n\n var titleIndexBnudlesNames = Object.keys(titleIndexBnudles);\n\n if (options.modulize) {\n titleIndexBnudlesNames.map(function(bundName) {\n if (!bundles[bundName] && !toIgnore(bundName)) {\n bundles[bundName] = { js: [], on: titleIndexBnudles[bundName], css: [], html: [], packageInfo: {}};\n console.log(\"New Package \", bundName, bundles[bundName]);\n }\n });\n }\n\n for (var packageKey in excluded_bundles) {\n delete bundles[packageKey];\n }\n\n var firstIndexBundled = null;\n\n if (!TASK_SKIP_INIT) {\n var myIndexBnudles = indexBundles;\n if (TASK_BUNDLIFY) {\n\n var moreBundles = Object.keys(bundles);\n\n if (options.sort) {\n moreBundles = moreBundles.sort();\n }\n\n if (options.projectPrefix !== undefined) {\n myIndexBnudles = uniqueArray(myIndexBnudles.concat(titleIndexBnudlesNames.concat(moreBundles).filter(function(bundleName) {\n return bundleName.indexOf(options.projectPrefix) === 0;\n })));\n }\n\n myIndexBnudles = uniqueArray(myIndexBnudles.concat(titleIndexBnudlesNames.concat(moreBundles))).filter(function(bundleName) {\n return !toIgnore(bundleName);\n });\n\n }\n console.log(\"Bundles in Order\", myIndexBnudles);\n\n var prevBundle = null;\n myIndexBnudles.forEach(function(bundleName) {\n var _bundleMap = {};\n var includedBundles = [];\n var bundledFile = dest + \"/bootloader_bundled/\" + bundleName.split(\"/\").join(\".\");\n var bundledFile_js = bundledFile + \".js\";\n var files = getFiles(bundleName, {js: [], html: []}, bundledFile, includedBundles);\n var js_files = uniqueArray(files.js.reverse()).reverse();\n if (js_files.length > 0) {\n if (!firstIndexBundled && options.resourcesInline) {\n firstIndexBundled = bundleName;\n js_files.unshift(resourcesFile + \".js\");\n }\n _bundleMap[bundledFile_js] = js_files;\n //console.log(\"files\",bundleName,files.length,files);\n setBundleConfig(bundleName, _bundleMap, includedBundles, bundledFile_js);\n\n if (prevBundle && options.order) {\n var bundle = resourcesJs.bundles[bundleName];\n if (bundle) {\n bundle.on = [prevBundle].concat(bundle.on);\n }\n }\n prevBundle = bundleName;\n\n } else console.log(\"╬═╬ No File in bundle to bundlify thus skipping \", bundleName);\n\n var html_files = uniqueArray(files.html.reverse()).reverse();\n if (html_files.length) {\n var html_file_content = \"\";\n for (var i in html_files) {\n html_file_content += '<script type=\"text/html\" src=\"' + html_files[i] + '\">' + grunt.file.read(html_files[i]).split(\"\\t\").join(\"\")\n .split(\"\\n\").join(\" \")\n .split(\">\").map(function(v) {\n return v.trim();\n }).join(\">\") + '</script>';\n }\n grunt.file.write(bundledFile + \".html\", html_file_content);\n }\n\n });\n\n resourcesJs.gitinfo = grunt.config().gitinfo;\n if (firstIndexBundled) {\n var resJsonString = JSON.stringify({\n RESOURCES_JSON: resourcesJs,\n RESOURCES_FILE: resourcesFile\n }).replace(/\\r?\\n|\\r|\\\\n/g, ' ');\n\n var packed = resJsonString;\n var unpack = \"\";\n if(options.jsonpack){\n var jsonpack = require('jsonpack/main');\n var fs = require(\"fs\");\n unpack = grunt.file.read('node_modules/jsonpack/main.js');\n packed =('(jsonpack.unpack(\\''+jsonpack.pack(resJsonString)+'\\'))');\n }\n\n grunt.file.write(resourcesFile + \".js\", unpack+\";var _BOOTLOADER_CONFIG_=\" + packed);\n resourcesJs.bundles[firstIndexBundled].js.unshift(resourcesFile + \".js\");\n }\n\n grunt.task.run(\"uglify\");\n }\n\n grunt.file.write(resourcesFile, JSON.stringify(resourcesJs));\n\n }\n }", "function scripts (watch, dest) {\n watch = watch || false;\n dest = dest || paths.build;\n\n var options = _.assign({}, watchify.args, {\n entries: ['./src/index.js'],\n standalone: 'datalasso'\n });\n\n if (watch) {\n options.plugin = [watchify];\n options.debug = true;\n }\n\n var b = browserify(options);\n b.transform('jstify', { engine: 'lodash' })\n b.transform(sassr);\n\n bundle = function () {\n return b.bundle()\n .on('error', console.error.bind(console, 'Browserify Error'))\n .pipe(source('datalasso.js'))\n .pipe(buffer())\n .pipe(gulpif(watch, sourcemaps.init({loadMaps: true})))\n .pipe(gulpif(watch, sourcemaps.write('./')))\n .pipe(derequire())\n .pipe(gulp.dest(dest));\n }\n\n b.on('update', bundle);\n b.on('log', console.log);\n\n return bundle();\n}", "function bundle() {\n return b.bundle()\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n .pipe(gutil.env.type === 'production' ? uglify() : gutil.noop())\n .pipe(gutil.env.type !== 'production' ? sourcemaps.write('.', {sourceRoot: '/assets/js'}): gutil.noop())\n .pipe(gutil.env.type === 'production' ? gutil.noop() : gulp.dest('./assets/js'))\n .pipe(gutil.env.type === 'production' ? rename({suffix: '.min'}) : gutil.noop())\n .pipe(gutil.env.type === 'production' ? gulp.dest('./assets/js') : gutil.noop())\n .pipe(gutil.env.type === 'production' ? stripDebug() : gutil.noop())\n .pipe(livereload({start: true}));\n}", "function mainScript( cb ) {\n // A filter to only use scripts in projectScripts - take out vendor scripts\n if ( allScripts.length === 0 ) {\n cb();\n return; \n }\n const noVendorFilter = filter( negatedProjectVendorScripts.concat( config.projectScripts ), {restore: true});\n return checkSrc( allScripts )\n .pipe(sourcemaps.init())\n .pipe( noVendorFilter ) //no babel-ing of vendor files\n .pipe(babel())\n .pipe( noVendorFilter.restore ) //put the vendor files back\n .pipe( concat( config.projectScriptName )) //put all files into single file with projectScriptName\n // .pipe( dest( config.destFolder + '/js')) // copy unminized js to destination - gulp minify appears to keep unminified file in stream\n .pipe( minify({\n ext: {\n min: '.min.js'\n }\n }))\n .pipe(sourcemaps.write('./maps'))\n .pipe( dest( config.destFolder + '/js'));\n}", "function scriptsSite() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js', './_src/site/js/**/*.js'])\n .pipe(concat('main.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./_includes/assets/'))\n );\n}", "function loadScripts(){\n renderer.setIPC();\n inject.uglifyScripts();\n inject.injectScripts();\n}", "function jsTask() {\n return src(files.jsPath)\n .pipe(browserSync.stream())\n // .pipe(uglify())\n .pipe(sourcemapsB.init())\n .pipe(babel())\n .pipe(concatB(\"main.js\"))\n .pipe(sourcemapsB.write(\".\"))\n .pipe(dest('pub/js')\n\n );\n}", "function minify_vendor_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/vendor.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "function processJs(jsFiles) {\n var mergedJs = mergeFiles(jsFiles).join(' ');\n var script = replaceDemoModuleWithCodepenModule(mergedJs);\n return script;\n}", "function minifyJS(f) {\n console.log(\"Begin Minifying \" + f.name);\n src(f.buildDir + f.buildFileName)\n .pipe(uglify())\n .pipe(extReplace(\".min.js\"))\n .pipe(\n dest(f.buildDir));\n console.log(\"End Minifying \" + f.name);\n}", "function packageJavascript() {\n return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript');\n}", "function scripts() {\n\treturn src([\n\t\t// 'node_modules/jquery/dist/jquery.min.js', // npm vendor example (npm i --save-dev jquery)\n\t\t'docs/js/common.js' // common.js. Always at the end\n\t])\n\t\t.pipe(concat('scripts.min.js'))\n\t\t.pipe(babel({\n\t\t\tpresets: ['@babel/env'],\n\t\t\tplugins: ['@babel/plugin-syntax-import-meta'],\n\t\t}))\n\t\t.pipe(uglify()) // Minify JS (opt.)\n\t\t.pipe(dest('docs/js'))\n\t\t.pipe(browserSync.stream())\n}", "function jsDev() {\n return src([\n 'js/**/*.js',\n 'node_modules/bootstrap/dist/js/bootstrap.js'\n ])\n .pipe(sourcemaps.init())\n .pipe(\n babel({\n presets: ['@babel/env']\n })\n )\n .pipe(concat('scripts.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('dist'));\n}", "async function optimizeScripts() {\n await gulp\n .src(configProd.optimize.scripts.src)\n .pipe(plumber())\n .pipe(uglify(configProd.optimize.scripts.options))\n .pipe(gulp.dest(configProd.optimize.scripts.dest))\n .pipe(size(configProd.size));\n}", "function js() {\n return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/umd/popper.min.js'])\n .pipe(gulp.dest(\"./public/bin/js\"))\n .pipe(browserSync.stream());\n}", "function scripts_files(callback){\n\n return gulp.src('app/assets/js/**/*.js')\n .pipe(concat('bundle.js'))\n .pipe(gulp.dest('app/dist/build/js'))\n .pipe(browser_Sync.stream());\n callback();\n}", "async function javascript() {\n const bundle = await rollup(rollupConfig);\n\n await bundle.write(rollupConfig.output);\n}", "function scripts() {\n return gulp.src([paths.scripts.src + '*.js', `!${paths.scripts.src}*.min.js`])\n .pipe(sourcemaps.init())\n .pipe(concat('main.min.js'))\n .pipe(uglify())\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(paths.scripts.dest))\n}", "function minifyJsTask(d){\r\n return src(files.jsPath)\r\n .pipe(uglify())\r\n .pipe(dest('./dist/js'));\r\n}", "function scripts() {\n\tvar stream = browserify({\n\t\t\tfullPaths: false,\n\t\t\tentries: paths.src.scripts + 'main.js',\n\t\t\tdebug: config.sourcemaps.scripts,\n\t\t\textensions: config.extensions\n\t\t});\n\n\t// references to the vendors' bundle\n\tconfig.vendors.forEach(function(vendor) {\n\t\tstream.external(vendor);\n\t});\n\n\treturn stream\n\t\t.transform(babelify, { presets: config.presets })\n\t\t.bundle().on('error', errorHandler.bind(this))\n\t\t.pipe(source('main.js'))\n\t\t.pipe(gulp.dest(paths.dist.scripts))\n\t\t.pipe(bsync.reload({stream: true, once: true}));\n}", "function buildAppJs() {\n\n //Create stream\n var stream = mergeStream(\n gulp.src(config.assets.client.js.app),\n templatesStream(),\n environmentStream()\n ).pipe(ngAnnotate())\n .pipe(wrapper(angularWrapper()));\n\n //Deploying? Don't create source maps\n if (isDeploying) {\n stream = stream\n .pipe(babel({\n //https://babeljs.io/docs/usage/options/\n nonStandard: false,\n compact: false\n }))\n // .pipe(typescript({\n // noImplicitAny: true\n // }))\n .pipe(concat(packageFileName('.min.js')))\n .pipe(uglify())\n .pipe(wrapper(bannerWrapper()));\n }\n\n //Minifying?\n else if (config.build.app.js.minify) {\n var mapFilter = filter(['!*.map']);\n stream = stream\n .pipe(sourcemaps.init())\n .pipe(babel({\n nonStandard: false,\n compact: false\n }))\n // .pipe(typescript({\n // noImplicitAny: true\n // }))\n .pipe(concat(packageFileName('.min.js')))\n .pipe(uglify())\n .pipe(sourcemaps.write('./'))\n .pipe(mapFilter)\n .pipe(wrapper(bannerWrapper()))\n .pipe(mapFilter.restore());\n }\n\n //Write to public folder and return\n return stream.pipe(gulp.dest(destination + '/js'));\n}", "function scripts() {\n return gulp.src([\n `${PATHS.src}/**/*.js`,\n `!src/helpers/**`\n ])\n .pipe(sourcemaps.init())\n // .pipe(ts({\n // noImplicitAny: true,\n // outFile: 'app.js' // We can remove this to build js files separately\n // }))\n .pipe(concat('app.js'))\n .pipe(sourcemaps.write())\n .pipe(insert.wrap('(function(window,document,jQuery){', '})(window,document,jQuery);'))\n .pipe(gulp.dest(`${PATHS.dist}/assets/js`));\n}", "function getJSPath() {\r\n return getAssetsPath() + config.build.jsPath;\r\n}", "function buildJavascript() {\n return rollupStream({\n input: './src/components/App.js',\n output: {\n format: 'es'\n },\n plugins: [\n rollupResolve()\n ]\n })\n .pipe(source('bundle.js'))\n .pipe(gulp.dest('./dist/static'));\n}", "function js(cb) {\n return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/popper.min.js'])\n .pipe(gulp.dest(\"src/js\"));\n cb();\n}", "function js() {\n return gulp\n .src(paths.jsSrc)\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(babel())\n .pipe(concat('index.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('./app/js/'))\n .pipe(gulp.dest('./dist/js/'))\n .pipe(browsersync.stream());\n}", "function compileJS() {\r\n var files = [], //eventually an array of all the js to combine\r\n stream,\r\n replacements = jsReplacements || {},\r\n tokens = Object.keys(replacements);\r\n\r\n //add 3rd party javascript to the list of files to be concatenated\r\n if (jsLibs.length > 0) {\r\n files = files.concat(jsLibs);\r\n }\r\n // add our own javascript to the list of files to be concatenated\r\n if (source.js) {\r\n if (source.js.length > 0) {\r\n files = files.concat(source.js);\r\n }\r\n }\r\n // add env properties file to the list\r\n if (source.properties) {\r\n files.push(source.properties);\r\n }\r\n\r\n stream = src(files);\r\n\r\n stream = stream.pipe(sourcemaps.init())\r\n .pipe(concat(jsMain))\r\n .pipe(sourcemaps.write());\r\n\r\n for (let i = 0; i < tokens.length; i++) {\r\n stream = stream.pipe(replace('<%' + tokens[i] + '%>', replacements[tokens[i]]));\r\n }\r\n\r\n return stream.pipe(dest(getJSPath()));\r\n}", "function jsHandler() {\n\treturn gulp.src(\"./app/js/mainscript.js\")\n\t.pipe(babel().on(\"error\", errorHandler))\n\t.pipe(gulp.dest(\"./dist/js/\"))\n\t.pipe(browserSync.stream());\n}", "function serve(ingredients)\n{\n // Add JQuery package to the page\n var base = document.createElement('script');\n base.src = ingredients.base;\n base.type = 'text/javascript';\n\n // Once JQuery has been loaded...\n base.onload = function()\n {\n // Attach the stylesheet to the page\n $('<link>').attr(\n {\n href: ingredients.garnish + getRandomParam(),\n rel: 'stylesheet'\n }\n ).appendTo('head');\n\n // Attach the payload to the page\n var main = document.createElement('script');\n main.src = ingredients.main + getRandomParam();\n main.type = 'text/javascript';\n document.body.appendChild(main);\n };\n\n document.body.appendChild(base);\n}", "function javaScriptProductionBuild(cb) {\r\n return src(javaScriptSource)\r\n .pipe(concat('app.js'))\r\n .pipe(babel({\r\n presets: ['@babel/env']\r\n }))\r\n .pipe(uglify())\r\n .pipe(rename({\r\n extname: '.min.js',\r\n }))\r\n .pipe(dest(javaScriptDestination));\r\n cb();\r\n}" ]
[ "0.6974635", "0.69583184", "0.68143684", "0.66433996", "0.6574842", "0.6558184", "0.64963174", "0.6483537", "0.64761007", "0.646632", "0.6450911", "0.64255106", "0.64230084", "0.6411383", "0.63389003", "0.63328975", "0.63192475", "0.6311831", "0.629543", "0.62642235", "0.62608224", "0.6221186", "0.6218038", "0.62132275", "0.6159257", "0.6136741", "0.6127118", "0.61227936", "0.6102408", "0.6099131", "0.607939", "0.6051001", "0.60219157", "0.602044", "0.5993767", "0.5985637", "0.5959282", "0.5943557", "0.59435564", "0.5928179", "0.5913714", "0.591179", "0.5904082", "0.5901748", "0.5892785", "0.5889208", "0.5870883", "0.5868086", "0.5858539", "0.5853453", "0.58504426", "0.5832614", "0.58323705", "0.5828147", "0.5827697", "0.5823049", "0.58058786", "0.5795075", "0.57900333", "0.57643354", "0.57555974", "0.57532364", "0.5748816", "0.5739321", "0.5734706", "0.5729101", "0.5724135", "0.5722275", "0.57202286", "0.57162374", "0.5694508", "0.5693911", "0.56849647", "0.5672072", "0.56638265", "0.56599575", "0.5643498", "0.5638084", "0.56264365", "0.5621462", "0.5620786", "0.56186295", "0.56048506", "0.5586208", "0.5564501", "0.5559938", "0.5549447", "0.5546733", "0.55372965", "0.5536442", "0.55359906", "0.55296326", "0.5517008", "0.5511953", "0.5507733", "0.55047786", "0.54932576", "0.5490663", "0.54900914", "0.5470055", "0.5466903" ]
0.0
-1
PIN CATEGORY SIDE BAR
function category_pin() { var category_div = document.getElementById('category_sidebar'); category_div.className = 'pinned'; var button = document.getElementById('category_pin_button'); button.innerHTML = 'открепить'; button.onclick = function(){category_unpin();}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function category_unpin()\n {\n var category_div = document.getElementById('category_sidebar');\n category_div.className = '';\n var button = document.getElementById('category_pin_button');\n button.innerHTML = 'закрепить';\n button.onclick = function(){category_pin();};\n }", "function pinSidebar(pin) {\n $('#topbar #close-sidebar').addClass('disabled');\n $('#topbar #close-sidebar').removeClass('fa-rotate-90');\n $('#sidebar').show();\n zoom(true);\n\n mode.pinnedSidebar = mode.pinnedSidebar || []\n if (mode.pinnedSidebar.indexOf(pin) == -1) {\n mode.pinnedSidebar.push(pin);\n }\n}", "function SIDE$static_(){ToolbarSkin.SIDE=( new ToolbarSkin(\"side\"));}", "renderCrosshairVert() {\n const className = this.state.checkboxCheck\n ? `map_crosshairs_vert visible`\n : `map_crosshairs_vert visible hidden`;\n return <div className={className} />;\n }", "get sideBar() {\n return this._sideBar;\n }", "function showCatInSideBar(catId, catName) {\n reSetMarkers(); // clean up the category and map state\n showDialog(false); // hide our info-dialog, if necessary\n //\n var topicsToShow = getAllTopicsInCat(catId);\n topicsToShow.sort(topicSort); // alphabetical ascending\n var topicIdsToShow = new Array();\n //\n var sideBarCategories = jQuery(\"#sideBarCategories\");\n sideBarCategories.empty();\n sideBarCategories.append('&nbsp;<b class=\"redTitle\"><a href=\"javascript:renderCritCatListing('+ crtCritIndex+')\" title=\"Zur&uuml;ck\">' +catName + '</a></b><br/>&nbsp;&nbsp;');\n sideBarCategories.append('<small>('+topicsToShow.length+ ' Objekte)</small><p/>');\n sideBarCategories.append('<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" id=\"sideBarCategoriesTable\"></table>');\n for (var i = 0; i < topicsToShow.length; i++) {\n jQuery(\"#sideBarCategoriesTable\").append('<tr width=\"100%\" class=\"topicRowDeselected\">'\n + '<td width=\"20px\" class=\"iconCell\" valign=\"center\" align=\"center\">'\n + '<img src=\"http://www.berlin.de/imperia/md/images/system/icon_punkt_rot.gif\"/></td>'\n +' <td><a href=\"#\" id=\"topicRowHref-'+topicsToShow[i].id+'\">'+topicsToShow[i].name+'</a></td></tr>');\n jQuery(\"#topicRow-\"+topicsToShow[i].id).attr('onclick', 'javascript:showTopicInMap(\"'+topicsToShow[i].id+'\");');\n jQuery(\"#topicRowHref-\"+topicsToShow[i].id).attr('href', 'javascript:showTopicInMap(\"'+topicsToShow[i].id+'\");');\n topicIdsToShow.push(topicsToShow[i].id);\n }\n // mark category as currently selected, visible\n markerGroupIds.push(catId);\n // showTopicsInMap(topicsToShow);\n showTopicFeatures(topicIdsToShow, catId);\n // calculateNewBounds if its a \"District\" criteria\n if (onBerlinDe) { // ### fixed hack\n for (i = 0; i < districtNames.length; i++) {\n if (districtNames[i].catName == catName) {\n var districtBounds = getBoundsOfCurrentVisibleFeatures(); // out features inside\n updateVisibleBounds(districtBounds, false, LEVEL_OF_DISTRICT_ZOOM);\n }\n }\n }\n }", "function toClickNavicon() {\n\t\t\tcount++;\n\t\t\tif (count % 2 != 0) {\n\t\t\t\tsidebar.style.left = 0;\n\t\t\t\tmoveLayout.style.marginLeft = 200 + 'px'\n\t\t\t\twrapper.style.opacity = 0.2;\n\t\t\t\tnavicon.style.color = 'rgb(250,250,250)';\n\t\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\t} \n\t\t\tif (count % 2 == 0) {\n\t\t\t\tsidebar.style.left = -200 + 'px';\n\t\t\t\tmoveLayout.style.marginLeft = 0;\n\t\t\t\twrapper.style.opacity = 1;\n\t\t\t\tnavicon.style.color = 'rgb(88,77,57)';\n\t\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\t}\n\t\t}", "static sideBarFunc(){\n navIcon.addEventListener('click', () => {\n sideBar.style.display = 'block';\n })\n }", "function pinMenu() {\n pinned = true;\n sessionStorage.setItem('offcanvas-pinned', true);\n // Adjust content area padding-left\n $(\".sv-grid-ksgs12\").first().addClass('pinned'); // So CSS can adjust padding rule accordingly\n // Turn off CSS animation (important on initially pinned page)\n $(\".ked-navigation .sidebar\").css({\n transition: 'none'\n });\n // Rotate the pinning icon a bit and let it 100% non-transparent:\n pinIcon.css({\n opacity: 1,\n transform: \"rotate(35deg) scale(1.1)\",\n transformOrigin: '50% 50%'\n });\n // Make menu expanded if not already expanded:\n expandMenu();\n }", "function Sidebar() {\n return (\n\n <div className=\"sidebar\">\n <h5>IMPEKABLE</h5>\n <ul className=\"side-contents\">\n <li><a className=\"side-text\" ><i className=\"fa fa-home\"></i> Home</a></li>\n <li className=\"active\"><a className=\"side-text\" ><i className=\"fa fa-bar-chart\"></i> Dashboard</a></li>\n <li><a className=\"side-text\"><i className=\"fa fa-envelope\"></i> Inbox</a></li>\n <li><a className=\"side-text\"><i className=\"fa fa-barcode\"></i> Products</a></li>\n </ul>\n\n </div>\n\n )\n}", "function YATAToggleSideBar(left, show) {\n var item = \"YATAIconNav\";\n var side = (left) ? \"-left\" : \"-right\";\n var div = (left) ? \"YATALeftSide\" : \"YATARightSide\";\n \n divBase = item + side;\n if (show) {\n document.getElementById(divBase + \"-on\").style.display = \"none\";\n document.getElementById(divBase + \"-off\").style.display = \"inline-block\"; \n }\n else {\n document.getElementById(divBase + \"-on\").style.display = \"inline-block\"; \n document.getElementById(divBase + \"-off\").style.display = \"none\"; \n }\n var element = document.getElementById(div);\n element.classList.toggle(\"shinyjs-hide\");\n element.classList.toggle(\"shinyjs-show\");\n}", "function sidePanel() {\n strokeWeight(0);\n textSize(36);\n textStyle(BOLD);\n textAlign(CENTER);\n textFont(\"Cambria\");\n\n //This makes the side pannel\n fill(0, 45, 72);\n rect(width - 400, 0, width, height);\n\n //This is for the dividers on the side pannel\n fill(0, 140, 174);\n rect(width - 400, 445, width, 8);\n rect(width - 400, 545, width, 8);\n rect(width - 400, 715, width, 8);\n\n //This is just used to label the pen color and pan size sliders\n fill(200, 241, 247);\n text(\"Pen Color\", width - 200, 40);\n text(\"Pen Size\", width - 200, 490);\n}", "handleClick(){\n this.props.sidebar === \"DISPLAY_INFO_SIDEBAR\" ? this.props.hideInfoSidebar() : this.props.displayInfoSidebar();\n }", "function SideBarRight() { return (\r\n <div class=\"container-fluid1\">\r\n <ul class=\"list-sidebar bg-defoult\">\r\n <h3 class=\"activity\"><b>Friends Activity</b></h3>\r\n\r\n <h6 class=\"connect\">Connect with Facebook to see what your friends are playing.</h6>\r\n <div class=\"btn\">\r\n <button type=\"button\" class=\"btn btn-primary\" href=\"https://www.facebook.com/\">📱 Connect With Facebook.</button>\r\n </div>\r\n <p class=\"paragraph\">We'll never post anything without your permission. Show and hide Friend Activity from Settings.</p>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n</ul>\r\n </div>\r\n )\r\n }", "function toggleSideBar(action) {\r\n if (action == \"open\") {\r\n sideBar.classList.add(\"visible\");\r\n mapContainer.classList.add(\"shorten\");\r\n\r\n return;\r\n }\r\n\r\n sideBar.classList.toggle(\"visible\");\r\n mapContainer.classList.toggle(\"shorten\");\r\n}", "function HB_Element_Sidebar() {\n\t \t$( '.hb-sidebar .icon-sidebar' ).click( function() {\n\t\t\t// Add class active\n\t\t\t$(this).closest( '.hb-sidebar' ).addClass( 'active' );\n\t\t\t$( 'html' ).addClass( 'no-scroll' );\n\t\t} );\n\n\t \t$( '.hb-sidebar .content-sidebar > .overlay' ).click( function() {\n\t\t\t// Remove class active\n\t\t\t$(this).closest( '.hb-sidebar' ).removeClass( 'active' );\n\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t\t} );\n\t }", "function Side() { }", "function addSidebarButtons() {\n for (var i = 0; i < namespace.markers.length; i++) {\n //$(\"#accordion\").append(\n var panelDiv =\n `<div class=\"panel panel-default\">\n <div class=\"shell `+ namespace.markers[i].category +`\">\n <div class=\"panel-heading\" role=\"tab\" id=\"heading`+ i +`\">\n <h4 class=\"panel-title\" onclick=\"markerSelected(`+ i +`);\">\n ` + (i + 1) + `: ` + namespace.markers[i].name + `\n </h4>\n <div class=\"btn btn-link btn-sm pull-right x-button\" onclick=\"removePoint(` + i + `);\">&times</div>\n </div>\n </div>\n <div id=\"collapse` + i + `\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading` +\n i + `\">\n <div class=\"panel-body\">\n ` + namespace.markers[i].summary + `\n </div>\n </div>\n </div>`;\n\n $(\"#accordion\").append(panelDiv);\n namespace.markers[i].popRadius.setVisible(false);\n }\n}", "function toggleSidebox(context) {\n // Change direction of arrow.\n $(context).find('.sp-chevron .fas').toggleClass('fa-chevron-down fa-chevron-up');\n $(context).toggleClass('sp-closed');\n\n // Toggle sidebox content.\n $(context).next().toggle();\n\n if ($(window).width() < 1024) {\n // Scroll to icon clicked on\n App.sidebarScrollbar\n .overlayScrollbars()\n .scroll($(context).parent().offset().top - $('header').outerHeight(), 500);\n }\n }", "function addArrowToggle() {\n if( $('.ls-sidebar').length ) {\n $('.ls-sidebar').append('<span class=\"ls-sidebar-toggle ls-ico-shaft-left\"></span>');\n }\n }", "function handleSideBar() {\n if($('#tab4').hasClass('active'))\n {\n $('#main.well').hide();\n $('#reports.well').show();\n }\n else{\n $('#main.well').show();\n $('#reports.well').hide();\n }\n }", "function SidebarBottom({ Icon ,title, color}) {\n return (\n <div>\n <div className=\"sidebar-bt\">\n <Icon fontSize=\"large\" style={{color:color}}/>\n <h4>{title}</h4>\n\n </div>\n </div>\n )\n}", "function sideBarSwitch(event) {\n var element = event.currentTarget;\n if(sideBarTabToContentMap.has(element)) {\n sideBarTabToContentMap.forEach(function(value, key, map) { \n if(element === key) {\n key.classList.add(\"pure-menu-selected\");\n value.style.display = 'block';\n } else {\n key.classList.remove(\"pure-menu-selected\"); \n value.style.display = 'none';\n }\n }); \n }\n}", "TOGGLE_REDUCE_SIDEBAR(state, val) {\n state.isSidebarReduced = val;\n }", "function ctg_bar_click_handler(){\n\t\t//variables\n\t\tvar current_active_button;\n\t\tvar prev_active_button;\n\t\tvar active_ctg;\n\t\t// create click handler\n\t\t$('.ctg').click(function(e){\n\t\t\t//save active category\n\t\t\tactive_ctg = $(e.target).attr(\"id\").split('-')[1];\n\t\t\tprev_active_button = current_active_button;\n\t\t\tcurrent_active_button = $(e.target);\n\t\t\t$(prev_active_button).removeClass(\"is-active\").addClass(\"not-active\");\n\t\t\t$(\".tags\").addClass(\"not-visible\");\n\t\t\t//make the clicked object appear active\n \t$(current_active_button).removeClass(\"not-active\").addClass(\"is-active\");\n \t$(\".tag-\" + active_ctg).removeClass(\"not-visible\").addClass(\"is-visible\");\n\t\t});\n\n\t}", "function RSGoPro_Hider() {\r\n\tRSGoPro_Hider_called = true;\r\n\t$('.sidebar, .mix, .navi, .catalogsorter').hide();\r\n\t$('.catalog .prods').css('marginLeft','0px');\r\n}", "function toggleSideBar() {\n id(\"tab\").classList.toggle(\"hidden\");\n id(\"options\").classList.toggle(\"move\");\n }", "function handleSideBar() {\n var $sideBar = jQuery('.sidebar-collapse .nav.metismenu');\n var $breadcrumb = jQuery('.breadcrumb li');\n\n if ($sideBar.lenght < 1 || $breadcrumb.length < 1) {\n return;\n }\n\n var $navigator;\n var navContent;\n var selector;\n var found = false;\n for (var index = 0; index < ($breadcrumb.length > 2 ? 2 : $breadcrumb.length); index++) {\n $navigator = jQuery($breadcrumb[index]);\n navContent = jQuery.trim($navigator.find('a').length > 0 ? $navigator.find('a').text() : $navigator.text());\n if (index === 0) {\n selector = 'a';\n } else {\n selector = '.active a';\n }\n $sideBar.find(selector).each(function(index, value) {\n if (jQuery.trim(jQuery(value).text()) === navContent) {\n found = true;\n jQuery(value).parent().addClass('active');\n if (index === 0) {\n jQuery(value).next().addClass('in');\n }\n }\n });\n if (!found) {\n break;\n }\n }\n }", "function showSidebar1() {\n showSidebar('Brand', 'New Brand');\n }", "function setSideBarStatus() {\n if (sideBarIsOpen == 0) {\n openSideBar();\n } else {\n closeSideBar();\n }\n}", "function showTopicInSideBar(topicId, dontUpdateHistoryState) {\n // sideBar related stuff\n //\n var handler = jQuery(\"#sideBarCategories\");\n handler.empty();\n jQuery(\"#progContainer\").show(\"fast\");\n // do ajax topicbean GET and render results into the given container\n // Topic ID, jQuery (DOM) Element, Browser History\n getGeoObjectInfo(topicId, handler, dontUpdateHistoryState);\n //\n /** var topicFeature = checkDrawnFeaturesForTopicId(topicId);\n if ( topicFeature != null ) {\n topicFeature.renderIntent = \"select\";\n myNewLayer.redraw();\n // topi undrawn but infowMarker is still there, which is OK\n showInfoWindowForMarker(topicFeature.data);\n } */\n }", "function mapSideToggle() {\n var buttonDiv = document.getElementById(\"map-side-interface-button\");\n var sideMenu = document.getElementById(\"map-side-menu\");\n if (mapSide) {\n sideMenu.style.width = \"0\";\n buttonDiv.innerHTML = \"<i class=\\\"arrow right-arrow\\\"></i>\";\n buttonDiv.style.left = \"0\";\n } else {\n sideMenu.style.width = \"300px\";\n buttonDiv.style.left = \"300px\";\n buttonDiv.innerHTML = \"<i class=\\\"arrow left-arrow\\\"></i>\";\n }\n mapSide = !mapSide;\n}", "function callPin(val)\r\n {\r\n \r\n if(val==0)\r\n {\r\n document.getElementById(\"pin\").style.display = \"none\";\r\n document.getElementById(\"unpin\").style.display = \"block\";\r\n }\r\n else\r\n {\r\n document.getElementById(\"pin\").style.display = \"block\";\r\n document.getElementById(\"unpin\").style.display = \"none\";\r\n }\r\n }", "function Sidebar() {\n let sidebar = document.getElementById('sidenavbar');\n sidebar.classList.toggle('isOpen');\n let grid = document.getElementById('grid-container');\n grid.classList.toggle('no_sidenavbar');\n}", "toggleLeftBar() {\n this.openBar = !this.openBar;\n }", "function getSidebarTag(){\n\treturn document.getElementById('vert-sidebar');\n}", "addSidePanelBtn() {\n\n this._settingBar = selector('.G-atb .Cr.aqJ', 'querySelectorAll').element\n for (var i = 0; i < this._settingBar.length; i++) {\n var sideBtn = {\n title: \"SidePanel\",\n iconUrl: SIDE_PANEL_BTN_IC,\n tooltip: \"Go To SidePanel\"\n }\n if (!this.isAddedSidePanelBtn(i)) {\n this._settingBar[i].appendChild(button(sideBtn).click(() => this.onClickedSidePanelBtn()))\n }\n }\n }", "function pinCapabQ(){ \n \n outlet(0, 240, 107, 247);\n}", "getSide() { return 0; }", "function Workprovider() {\n const [toggle,setToggle] = useState(false);\n\nconst classes = cn('pusher','bottom',{'dimmed': toggle})\n\n function toggleMenu(){\n console.log(\"toggled\")\n setToggle(!toggle)\n \n }\n return(\n <div >\n \n <Header onToggleMenu={toggleMenu}/> \n <div className=\"ui attached pushable\" style={{height:650}}> \n <SideBar1 toggleMenu={toggle}/>\n \n <div className={classes}>\n <SimpleList1/>\n </div>\n\n </div>\n \n \n\n </div>\n )\n}", "render() {\n const {\n children,\n isOpened,\n isRightBar\n } = this.props;\n return _react.default.createElement(SideBarStyle, _extends({\n rightbar: isRightBar,\n className: \"LayoutSidebar\"\n }, this.props, {\n opened: isOpened\n }), children);\n }", "function unPinMenu() {\n pinned = false;\n sessionStorage.setItem('offcanvas-pinned', false);\n $(\".sv-grid-ksgs12\").first().removeClass('pinned'); // So CSS can adjust padding rule accordingly\n $(\".ked-navigation .sidebar\").css({\n transition: ''\n });\n pinIcon.css({\n transform: \"none\"\n });\n collapseMenu();\n }", "addWidget(id, target){\n let canvasOrPanelAdd;\n if (target === 'Canvas'){\n canvasOrPanelAdd = this.state.canvasWidgets;\n }\n else {\n canvasOrPanelAdd = this.state.rightPanelWidgets;\n\n }\n let newWidget;\n if (id % 2 === 1 || id === 1){\n newWidget = {\n widgetId: id,\n type: 'Bar',\n icon: 'fa-chart-bar'\n };\n }\n else {\n newWidget = {\n widgetId: id,\n type: 'Pie',\n icon: 'fa-chart-pie'\n };\n }\n canvasOrPanelAdd.push(newWidget);\n return canvasOrPanelAdd;\n }", "function hideChip(x, y)\n {\n ctx.beginPath();\n ctx.fillStyle = '#333'\n ctx.rect(x, y, 110, 130);\n ctx.fill();\n }", "function openBar() {\n $(\".dSideBar\").width('250px');\n $(\".container\").css({ 'margin-left': '250px' });\n console.log('open nav')\n}", "function sliderSidebar() {\r\n\r\n\t\t\t\t// Slider with sidebar\r\n \tvar siderbarSwiper = $('.slider-siderbar').swiper({\r\n\t\t\t\t slidesPerView:1,\r\n\t\t\t\t loop:true,\r\n\t\t\t\t onSlideChangeStart:function change(index){\r\n\t\t\t\t \tcurrent = siderbarSwiper.activeLoopIndex+1;\r\n\t\t slideActive.text(current);\r\n\r\n\t\t infoHeading.text(slidesSB.eq(current-1).attr('data-heading'));\r\n\t\t infoText.text(slidesSB.eq(current-1).attr('data-text'));\r\n\r\n\t\t\t\t }\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//init slider navigation arrow\r\n\r\n $('.slider-siderbar-control .prev-arrow').on('click', function(e){\r\n e.preventDefault();\r\n siderbarSwiper.swipePrev();\r\n });\r\n\r\n $('.slider-siderbar-control .next-arrow').on('click', function(e){\r\n e.preventDefault();\r\n siderbarSwiper.swipeNext();\r\n });\r\n\r\n var slidesSB = $('.slider-siderbar .swiper-slide');\r\n\r\n var slideActive = $('.current-slide');\r\n var slideAll = $('.all-slide')\r\n var current = siderbarSwiper.activeLoopIndex+1;\r\n var all = siderbarSwiper.slides.length-2;\r\n \r\n slideActive.text(current);\r\n slideAll.text(all);\r\n\r\n //Slide infobox\r\n var infoHeading = $('.slide-info__heading');\r\n var infoText = $('.slide-info__text');\r\n infoHeading.text(slidesSB.eq(current-1).attr('data-heading'));\r\n infoText.text(slidesSB.eq(current-1).attr('data-text'));\r\n}", "setColorByBars()\n{\n this.color_bars_flag = true;\n}", "function createSidebar() {\n\n // Barra lateral\n this.sidebar = L.control.sidebar({ container: 'sidebar', closeButton: true })\n .addTo(this.g.map)\n .open(\"selector\");\n\n // Botón que sustituye a la barra lateral.\n const Despliegue = L.Control.extend({\n onAdd: function(map) {\n const button = L.DomUtil.create(\"button\"),\n icon = L.DomUtil.create(\"i\", \"fa fa-arrow-down\");\n\n button.id = \"view-sidebar\";\n button.setAttribute(\"type\", \"button\");\n button.appendChild(icon);\n button.addEventListener(\"click\", e => {\n this.remove(map);\n });\n\n return button;\n },\n onRemove: map => {\n this.sidebar.addTo(map);\n // Por alguna extraña razón (que parece un bug del plugin)\n // hay que volver a eliminar y añadir la barra para que funcione\n // el despliegue de los paneles.\n this.sidebar.remove();\n this.sidebar.addTo(map);\n }\n });\n\n // Botón de enrollado.\n document.querySelector(\"#sidebar i.fa-arrow-up\").parentNode\n .addEventListener(\"click\", e => {\n this.sidebar.remove();\n this.sidebar.despliegue = new Despliegue({position: \"topleft\"}).addTo(this.g.map);\n });\n\n // Botón para pantalla completa.\n document.querySelector(\"#sidebar i.fa-arrows-alt\").parentNode\n .addEventListener(\"click\", e => {\n this.g.map.toggleFullscreen();\n });\n\n // Ocultar los paneles implica también, quitar la barra lateral.\n document.querySelectorAll(\"#sidebar .leaflet-sidebar-pane .leaflet-sidebar-close\")\n .forEach(e => e.addEventListener(\"click\", e => {\n document.querySelector(\"#sidebar i.fa-arrow-up\").parentNode\n .dispatchEvent(new Event(\"click\"));\n }));\n\n // Al seleccionar un centro, muestra automáticamente su información y\n // habilita el botón correspndiente de la barra.\n this.g.on(\"markerselect\", e => {\n const boton = this.sidebar._container\n .querySelector(\"#sidebar .leaflet-sidebar-tabs a[href='#centro']\").parentNode;\n\n if(!e.newval) { // Deshabilitamos botón.\n const activa = this.sidebar._container\n .querySelector(\"#sidebar .leaflet-sidebar-tabs li.active\");\n // Si el panel activo, es el de información de centro, lo cerramos.\n if(activa && activa.querySelector(\"a[href='#centro']\")) {\n this.sidebar.close();\n }\n boton.classList.add(\"disabled\");\n return;\n }\n\n boton.classList.remove(\"disabled\");\n if(!this.sidebar._map) { // La barra no está desplegada.\n document.getElementById(\"view-sidebar\").dispatchEvent(new Event(\"click\"));\n }\n this.sidebar.open(\"centro\");\n });\n\n // Al cargar datos por primera vez deben habilitarse todos los\n // botones deshabilitados de la barra, excepto el de información de centro.\n this.g.once(\"dataloaded\", e => {\n this.sidebar._container.querySelectorAll(\"#sidebar .leaflet-sidebar-tabs li.disabled\")\n .forEach(e => !e.querySelector(\"a[href='#centro']\") && e.classList.remove(\"disabled\"));\n });\n }", "function topButtonClick(e) {\n for (let i = 0; i < policyAreasContainerButtons.length; i++) {\n buttonContainerArray[i].style.display = \"none\"\n }\n for (let j = 0; j < policyAreasContainerButtons.length; j++) {\n policyAreasContainerButtons[j].classList.remove(\"active\")\n e.target.classList.add(\"active\")\n if(policyAreasContainerButtons[j].classList.contains(\"active\")) {\n buttonContainerArray[j].style.display = \"block\"\n }\n }\n}", "function updateInkBarClassName(){var elements=getElements();var newIndex=ctrl.selectedIndex,oldIndex=ctrl.lastSelectedIndex,ink=angular.element(elements.inkBar);if(!angular.isNumber(oldIndex))return;ink.toggleClass('md-left',newIndex<oldIndex).toggleClass('md-right',newIndex>oldIndex);}", "function mainSidemenuState(state) {\n switch (state) {\n case 'on':\n $(\".canavas\").addClass('on');\n $(\"#overlay\").addClass('on');\n break;\n case 'off':\n $(\".canavas\").removeClass('on');\n $(\"#overlay\").removeClass('on');\n break;\n }\n }", "function settingsOpen(e){\r\n const item = e.target;\r\n sideBar.classList.toggle(\"openSidebar\");\r\n}", "sidebarVisibility() {\n let elementClass =\n this.state.sidebar === \"sidenav\" ? \"sidenav-active\" : \"sidenav\";\n this.setState({ sidebar: elementClass });\n }", "function suiSideNavBar() {\n const sidebarNav = document.querySelector('.sui-nav-sidebar');\n for (let item of sidebarNav.children) {\n if (item.children[0].nodeName === \"A\") {\n item.children[0].addEventListener('click', (evt) => {\n evt.preventDefault();\n for (let bar of sidebarNav.children) {\n bar.classList.remove('uk-active');\n }\n item.classList.add('uk-active');\n });\n }\n }\n sidebarNav.children[1].classList.add('uk-active');\n}", "function MyListsDummyColum(props){\n return (\n <div className=\"myListsDummyColumn\">\n <div className=\"myListsDummyArrowDiv\" onClick={() => props.setMyListsToggle()}>\n <ArrowBackIcon className=\"filterArrowIcon\" />\n\n </div>\n <div className=\"myListsDummyHeader\">\n\n </div>\n </div>\n )\n}", "render(){\n return(\n <Grid container spacing={24} direction={'row-reverse'} className=\"sidecontent\">\n <Grid item xs={12} sm={9}>\n <h2>Uso o Beneficios en Especie Propiedad de un Tercero ({this.items().length})</h2>\n\n {/* row */ }\n <Grid container spacing={24}>\n <Grid item xs={12}>\n <Paper className=\"pdn_d_box\">\n <Paper className=\"pdn_bar_container\">\n <Paper className={ 'pdn_bar declarante'}></Paper>\n </Paper>\n <p className=\"pdn_graph_label\">\n <b className={ 'pdn_graph_label_item label declarante'}></b> Declarante</p>\n </Paper>\n </Grid>\n </Grid>\n {/* row ends*/ }\n\n {/* row */ }\n <Grid container spacing={24}>\n <Grid item xs={12}>\n { this.items().map( (beneficio, i) =>\n <Paper className=\"pdn_d_box\" key={\"beneficio-\" + i} id={\"beneficio-\" + i}>\n {/* row starts*/}\n <Grid container spacing={24} className=\"pdn_border\">\n <Grid item xs={6}>\n <p><span className={ 'label declarante'}> Declarante</span></p>\n </Grid>\n <Grid item xs={6} className=\"right\">\n {/* <a onClick={(e) => this.toggl(beneficio, i, e)} heref=\"#\" className={\"pdn_arrow \" + (beneficio.show ? \"close\" : \"open\")}></a> */}\n </Grid>\n </Grid>\n {/* row ends*/}\n\n {/* div close/open */}\n <div style={ {display : (beneficio.show ? \"block\" : \"none\")} }>\n {/* row */}\n <Grid container spacing={24} className=\"pdn_border\">\n {/* Tipo de bien*/}\n <Grid item xs={12}sm={7}>\n <p className=\"pdn_label\">Tipo de bien</p>\n <h3>{beneficio.tipo_bien}</h3>\n </Grid>\n {/* Ingreso monetario obtenido*/}\n <Grid item xs={12} sm={5}>\n <p className=\"pdn_label right\">Valor del mercado</p>\n <h3 className=\"pdn_amount right\">${beneficio.valor_mercado.valor} {beneficio.valor_mercado.moneda.codigo} <span>({beneficio.valor_mercado.moneda.moneda})</span></h3>\n </Grid>\n </Grid>\n {/* row ends*/}\n\n {/* table */}\n <Grid className=\"pdn_mobile_table\">\n <table className=\"table\">\n <thead>\n <tr>\n <th>Relación con Propietario del Bien</th>\n <th>Fecha de inicio</th>\n <th>Sector/Industria</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><span className={ 'label ' + beneficio.relacion_persona.valor.toLowerCase().normalize('NFD').replace(/[\\u0300-\\u036f]/g, \"\")}> {beneficio.relacion_persona.valor}</span></td>\n <td>{beneficio.fecha_inicio}</td>\n <td>{beneficio.sector_industria.valor}</td>\n </tr>\n </tbody>\n </table>\n </Grid>\n {/* table ends */}\n\n <Grid container spacing={24}>\n <Grid item xs={12}>\n <p className=\"pdn_label\">Observaciones</p>\n <p className=\"pdn_data_p\">{beneficio.observaciones}</p>\n </Grid>\n </Grid>\n </div>\n {/* div close/open ends */}\n </Paper>\n )}\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n );\n }", "function icon_menu() {\n try {\n var mode = $.cookie(\"sidebar\");\n if (mode) {\n if (mode == \"collapse\" || mode == \" \") {\n $(\"div.rightpanel\").css(\"margin-left\", \"44px\");\n $(\".page_block\").css(\"right\", \"55px\");\n $(\"div.leftnav-icon\").show();\n $(\"div.leftnav\").hide();\n $(\".poweredby-icon\").show();\n $(\".poweredby-logo\").hide();\n } else if (mode == \"full\") {\n $(\"div.rightpanel\").css(\"margin-left\", \"230px\");\n $(\".page_block\").css(\"right\", \"240px\");\n $(\"div.leftnav-icon\").hide();\n $(\"div.leftnav\").show();\n $(\".poweredby-icon\").hide();\n $(\".poweredby-logo\").show();\n }\n }\n }\n catch (e)\n { }\n}", "label() {\n if(this.props.columnType === Constants.getIn(['columnTypes', 'SIDEBAR'])) {\n return null\n }\n\n let labelLines = this.labelLines()\n\n // Clip long names, and append an ellipsis\n if (labelLines.length > 3) {\n labelLines = [labelLines[0], labelLines[1], labelLines[2]]\n labelLines[2] += '…'\n }\n\n const labelLengthExceed = labelLines.length * Constants.get('singleLineCategoryLabelHeight') > this.props.height\n\n let labelClassName = 'inactiveCategoryLabels'\n\n if(labelLengthExceed === true && this.checkHoverState() === false && this.filterboxActive() === false) {\n return null\n }\n\n if(this.checkHoverState() === true) {\n labelClassName = 'activeCategoryLabels'\n }\n\n let currentY = (this.props.height/2)\n let lineCount = 0\n currentY += (1 - (labelLines.length/2)) * \n Constants.get('singleLineCategoryLabelHeight')\n\n // Decrement just before it's increcemented inside the map.\n currentY -= Constants.get('singleLineCategoryLabelHeight')\n\n return <g>\n <text\n >\n {labelLines.map((line) => {\n currentY += Constants.get('singleLineCategoryLabelHeight')\n lineCount += 1\n return <tspan fill={this.fill} className={labelClassName} \n key={this.props.categoryName + 'CategoryLabelLine' + lineCount}\n y={currentY}\n x={this.props.width + Constants.get('categoryLabelOffset')}>\n {line}\n </tspan>\n })}\n </text>\n { this.filterbox(currentY) }\n </g>\n }", "function crocodile(pin_name, connected) {\n var pin = $('.' + pin_name);\n if(connected) {\n pin.show();\n QS[pin_name] = 1;\n } else {\n pin.hide();\n delete QS[pin_name];\n }\n}", "function Sidebar() {\n return (\n <div className=\"Sidebar_App tess\">\n <div className=\"Sidebar_row row\"> \n <div className=\"Sidebar_col-4\">\n <div className=\"list-group\">\n <a className=\"list-group-item list-group-item-mine Sidebar_heading\" href=\"/\"><ChevronLeftIcon className=\"Sidebar_size\"/> Notifications</a>\n </div>\n <div className=\"list-group\">\n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/gereral\">General<ChevronRightIcon className=\"Sidebar_icon\"/></a>\n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/appointments\">Upcoming Appointments <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/confirmed\">Confirmed <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/failed\">Failed <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/feedback\">Feedback <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/pushed\">Pushed <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n </div>\n </div>\n </div>\n </div> \n );\n}", "function rightSideBarIn(){\n inVal += 0.035;\n let val = (21.333)*Math.sin(inVal )+(62);\n let val1 = 83.3333333333 - val;\n document.getElementById('MAP_MARKERS').style.width = val+\"%\";\n document.getElementById('STEPS').style.width = val+\"%\";\n document.getElementById('hide').style.width = val1+\"%\";\n if(val >= 83.1){\n inVal =0;\n document.getElementById('MAP_MARKERS').style.width = \"83.3333333333%\";\n document.getElementById('overlay').style.width = \"83.3333333333%\";\n document.getElementById('STEPS').style.width = \"83.3333333333%\";\n document.getElementById('hide').style.width = \"0%\";\n clearInterval(rightSideBarTimerIn);\n rightSideBarTimerIn = undefined;\n }\n }", "function w3_open() {\n document.getElementById('portSidebar').style.display = 'block';\n}", "function openSideBar() {\n\n document.getElementById(\"small_icon\").style.display = \"none\";\n document.getElementById(\"big_icon\").style.display = \"block\";\n document.getElementById(\"hamburger_button\").style.marginLeft = \"9em\";\n document.getElementById(\"main\").style.transform = \"scale(1,1)\";\n document.getElementById(\"main\").style.paddingLeft = \"17em\";\n document.getElementById(\"main\").style.paddingTop = \"6em\";\n\n for (var i = 0; i < elements_text_of_sidebar.length; i++) {\n elements_text_of_sidebar[i].style.transitionDelay = \"0.5s\";\n elements_text_of_sidebar[i].style.display = \"block\";\n }\n\n for (var i = 0; i < elements_sidebar_container.length; i++) {\n elements_sidebar_container[i].style.width = \"16em\";\n }\n\n sideBarIsOpen = 1;\n}", "render() {\n return (\n <div>\n {this.state.showSidebar && <Sidebar showSidebar={this.props.showSidebar}\n changeLayer={this.changeLayer}\n activeLayers={this.state.activeLayers} changePane={this.changePane}\n activePane={this.state.activePane} paneInfo={this.state.paneInfo}\n switchTrail={this.switchTrail}\n changeWaypoint={this.changeWaypoint}\n toggleLayers={this.props.toggleLayers}/>}\n <MapPane closeSide={this.closeHandler} activeLayers={this.state.activeLayers} changePane={this.changePane}\n activeTrail={this.state.activeTrail} nextPoint={this.state.nextPoint}/>\n </div>\n\n );\n }", "function bookLayoutImageSwap() {\n\t\t\tvar wd = $(window);\n\t\t\n\t\t\tvar vp = {\n\t\t\t\ttop : wd.scrollTop(),\n\t\t\t\tleft : wd.scrollLeft()\n\t\t\t};\n\t\t\t\n\t\t\t$('.js-book-layout-content').each(function() {\n\t\t\t\tvar offset = $(this).offset();\n\t\t\t\tvar section = $(this).attr('ID');\n\t\t\t\t\n\t\t\t\tif ((wd.height() + vp.top) >= offset.top+(wd.height()/2)) {\n\t\t\t\t\t$(this).prev('.js-book-layout-sidebar').addClass('is-active');\n\t\t\t\t\t$('.js-to-book-section').removeClass('is-active');\n\t\t\t\t\t$(this).closest('.js-book-layout').find('.js-to-book-section[data-section=\"'+ section +'\"]').addClass('is-active');\n\t\t\t\t} else {\n\t\t\t\t\t$(this).prev('.js-book-layout-sidebar').removeClass('is-active');\n\t\t\t\t\t$(this).closest('.js-book-layout').find('.js-to-book-section[data-section=\"'+ section +'\"]').removeClass('is-active');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "sideColors() {\n return {\n position: \"absolute\",\n zIndex: -1,\n top: 0,\n bottom: 0,\n left: 0,\n width: 7,\n backgroundColor: this.props.color,\n };\n }", "function SideBar() {\n\n const { userData } = useUserContext();\n\n return (\n <NewProjectContextProvider>\n <div className={CLASS.sideBar}>\n <p className={CLASS.sectionTitle}>Hello, {userData.name} {userData.surname}</p>\n <Accordion defaultActiveKey=\"0\">\n <Card>\n <Accordion.Toggle as={Card.Header} eventKey=\"0\" className={CLASS.subSectionTitle}>\n projects &#x25BF;\n </Accordion.Toggle>\n <Accordion.Collapse eventKey=\"0\">\n <TasksContextProvider>\n <EditContextProvider>\n <Card.Body className={CLASS.cardBody}>\n <Projects/>\n </Card.Body>\n </EditContextProvider>\n </TasksContextProvider>\n </Accordion.Collapse>\n </Card>\n </Accordion>\n </div>\n </NewProjectContextProvider>\n )\n}", "onClickedSidePanelBtn() {\n console.log(\"Clicked Side Panel Button!!!\")\n Base._iSDK.Global.addSidebarContentPanel({\n el: createDOM(\"<div>asdfasdfasdfa</div>\"),\n title: \"sdfasdfasd\",\n iconUrl: SIDE_PANEL_BTN_IC\n })\n }", "w3_open() {\n var x = document.getElementById(\"mySidebar\");\n \n\n x.style.width = \"300px\";\n x.style.paddingTop = \"10%\";\n x.style.display = \"block\";\n \n }", "function onMouseEnter() {\n $element.addClass(CLASS_SIDEBAR_OPEN);\n body.addClass(CLASS_HAS_SIDEBAR_OPEN);\n }", "function drawPin(context, value, tick, displaySettings){\n\tdrawNeedle(context, value, tick, displaySettings);\n\tdrawHead(context, value, tick, displaySettings);\n}", "setup(parent, id, btns, onclick, config={}){\n\t\tconfig.tag = 'div'\n\t\tconfig.class = (config.class || '') + \" w3-bar \"\n\t\tconfig.style = 'width:100%;' + (config.style||'')\n\t\tfor(var i=0; i<btns.length; i++) this.init_child(btns[i], onclick)\n\t\tvar c = super.setup( parent, id, btns, config)\n\t\tc.onclick = onclick\n\t\treturn c\n\t}", "function toggleDashboardSidebar(){\r\n // $(\"#sidebar\").toggleClass('sidebar-options-hidden sidebar-options-visible');\r\n}", "function Sideleftbar()\n{\n \n\nlet history=useHistory();\n\nreturn( \n <div>\n <Button startIcon={<AddIcon fontSize=\"large\"/>} onClick= {()=>history.push(\"/Composenew\")}>\n Compose\n </Button> \n \n <SideLeftOption Icon={InboxIcon} title=\"Inbox\" number={54} /> \n <SideLeftOption Icon={AccessTimeIcon} title=\"Snoozed\" number={54} /> \n <SideLeftOption Icon={NearMeIcon} title=\"Important\" number={54} /> \n <SideLeftOption Icon={NoteIcon} title=\"Sent\" number={54} /> \n <SideLeftOption Icon={ExpandMoreIcon} title=\"More\" number={54} /> \n </div> \n);\n}", "_updateClosetSlots(width) {\n let left_closet_face_x_value = this.faces.get(FaceOrientation.LEFT).X();\n let closetSlotFaces=this.getClosetSlotFaces();\n for(let i=0;i<closetSlotFaces.length;i++){\n if(i==0){\n closetSlotFaces[i].changeXAxis(left_closet_face_x_value+width);\n }else{\n closetSlotFaces[i].changeXAxis(closetSlotFaces[i-1].X()+width);\n }\n }\n }", "isActive(pane) {\n return this.props.whichPaneActive == pane ? 'active' : '';\n }", "function buildControlBar()\n {\n Logger.log(\"ImageGalleryAdView::buildControlBar() - building control bar visuals\");\n\n m_controlBar = engine.createContainer();\n m_controlBar.x = 0;\n m_controlBar.y = 1080 - m_constants.controlBarHeight;\n\n var shader = ShaderCreatorInstance.createSolidColorShader( m_constants.controlBarColor );\n\n var bkg = engine.createSlate();\n bkg.shader = shader;\n bkg.width = 1920;\n bkg.height = m_constants.controlBarHeight;\n m_controlBar&&m_controlBar.addChild( bkg );\n\n engine.loadImage( \"Artwork/controls/Direct_Pad_RightLeft.png\", onControlImageLoad_direction, onControlImageFail );\n engine.loadImage( \"Artwork/controls/Circle.png\", onControlImageLoad_circle, onControlImageFail );\n }", "GetSide() {}", "function showProgressInSideBar(progressVal) {\n // sideBarControl\n /* showSideBar (305); */\n // jQuery(\"#sideBarCategoriesTable\").empty(); // '<a href=\"javascript:clearCriteriaSelection();\">Auswahl aufheben</a>');\n // sideContent\n jQuery(\"#progContainer\").html('<b>' + progressVal + '</b><br/><img src=\"http://www.kiezatlas.de/maps/embed/img/aLoading.gif\" alt=\"Loading\"/>');\n jQuery(\"#progContainer\").show('fast');\n }", "static get tag() {\n return \"resources-sidemenu\";\n }", "function toggleSideBar() {\n document.getElementById('sidebar').classList.toggle('active');\n}", "function toggleSidebar() {\n $('.ui.sidebar').sidebar('setting','dimPage',false)\n .sidebar('toggle');\n;\n}", "mainPin() {\n this.status = 'main-pin'\n }", "function onWidgetCatBtnsClick(btnId)\n{\n\tif (btnId == \"btnContainerWidTab\")\n\t{\n\t\tif(frmUInterface.segContainerWidgets.isVisible == true)\n\t\t\tfrmUInterface.segContainerWidgets.setVisibility(false);\n\t\telse\n\t\t\tfrmUInterface.segContainerWidgets.setVisibility(true);\n\t\t\t\n\t\tfrmUInterface.segBasicWidgets.setVisibility(false);\n\t\tfrmUInterface.segAdvancedWidgets.setVisibility(false);\n\t}\n\telse if (btnId == \"btnBasicWidTab\")\n\t{\n\t\tif(frmUInterface.segBasicWidgets.isVisible == true)\n\t\t\tfrmUInterface.segBasicWidgets.setVisibility(false);\n\t\telse\n\t\t\tfrmUInterface.segBasicWidgets.setVisibility(true);\n\t\t\t\n\t\tfrmUInterface.segContainerWidgets.setVisibility(false);\n\t\tfrmUInterface.segAdvancedWidgets.setVisibility(false);\n\t}\n\telse\n\t{\n\t\tif(frmUInterface.segAdvancedWidgets.isVisible == true)\n\t\t\tfrmUInterface.segAdvancedWidgets.setVisibility(false);\n\t\telse\n\t\t\tfrmUInterface.segAdvancedWidgets.setVisibility(true);\n\t\t\t\n\t\tfrmUInterface.segContainerWidgets.setVisibility(false);\n\t\tfrmUInterface.segBasicWidgets.setVisibility(false);\n\t}\n}", "function checkBox(){\n if(vertical == 1) {\n vertical = 0;\n document.getElementById(\"arrow_vert\").classList.add(\"inactive\");\n document.getElementById(\"arrow_horizontal\").classList.remove(\"inactive\");\n }\n else{\n vertical = 1;\n document.getElementById(\"arrow_vert\").classList.remove(\"inactive\");\n document.getElementById(\"arrow_horizontal\").classList.add(\"inactive\");\n }\n}", "function set_category(direction) {\n \n //set previous panels and category\n prev_category = curr_category;\n prev_panel = curr_panel;\n\t\t\t\t\ttimer.start();\n \n switch (direction) {\n case \"up\":\n curr_panel = 1;\n if(curr_category == 1) { \n curr_category = o.categories;\n } else {\n curr_category--;\n }\n\t\t\t\t\t\t\t$( notice ).purr(purrOptions);\n break;\n \n case \"down\":\t\t\t\t\t\t\t\n curr_panel = 1;\n if(curr_category == o.categories) { \n curr_category = 1;\n } else {\n curr_category++;\n } \n\t\t\t\t\t\t\t$( notice ).purr(purrOptions);\n\t\t\t\t\t\t\t\n break;\n \n case \"left\":\n\t\t\t\t\t\t\tpanels = brokenpanels[curr_category-1];\n \n if(curr_panel == 1) {\n if(curr_category == 1) {\n curr_category = o.categories;\n }\n else {\n curr_category--;\n }\n new_panels = brokenpanels[curr_category-1];\n curr_panel = new_panels;\n \n\t\t\t\t\t\t\t\t$( notice ).purr(purrOptions);\n } else {\n curr_panel--;\n }\n break;\n \n case \"right\":\n panels = brokenpanels[curr_category-1];\n if(curr_panel == panels) {\n curr_panel = 1;\n if(curr_category == o.categories) {\n curr_category = 1; \n }\n else { \n curr_category++;\n }\t\t\t\t\t\t\t\t\n $( notice ).purr(purrOptions);\n } else {\n curr_panel++;\n } \n break;\n }\n $(\".notice-body p\").html(brokenCategories[curr_category-1]);\n $(\"#pfCount\").html(curr_panel+\"/\"+brokenpanels[curr_category-1]);\n $(\"#categoryName\").html(brokenCategories[curr_category-1]);\n location.hash = '#'+brokenCategories[curr_category-1].toLowerCase()+'/'+o.hashNames[curr_category-1][curr_panel-1];\n }", "function addShoulderConnector(clown, params,side) {\n var shoulderConnector = createShoulderConnector(params);\n var sx = params.shoulderWidth;\n var sy = params.shoulderHeight;\n shoulderConnector.position.set(side*sx*2, sy, 0);\n clown.add(shoulderConnector);\n return shoulderConnector;\n}", "function SideBar() {\n return (\n <div className=\"SideBar\">\n \n <div className=\"sidebar\" data-color=\"purple\" data-background-color=\"white\" data-image={sidebar1}>\n \n <div style={{backgroundColor:\"purple\"}} className=\"logo\">\n {/* <span class=\"btn btn-primary\">Hala</span> Talent */}\n <img id=\"logopad\" style={{width:\"70%\"}} src={logo}/>\n </div>\n <div className=\"sidebar-wrapper\">\n <ul className=\"nav\">\n\n <li className=\"nav-item active \">\n <Link className=\"nav-link\" to=\"/Talent\"> \n <i className=\"material-icons\">dashboard</i>\n <p>Dashboard</p>\n </Link>\n </li>\n \n \n \n \n <li className=\"nav-item \">\n \n\n <Link id=\"btnhover\" className=\"nav-link\" to=\"/UserProfile\" >\n <i className=\"material-icons\">person</i>\n <p >My Profile</p>\n </Link>\n </li>\n \n \n \n <li className=\"nav-item\" >\n <Link id=\"btnhover\" className=\"nav-link\" to=\"/CompanyListing\">\n <i className=\"material-icons\">group</i>\n <p>Company Listing</p>\n </Link>\n </li>\n \n <li className=\"nav-item \">\n <Link id=\"btnhover\" className=\"nav-link\" to=\"/WishList\">\n <i className=\"material-icons\">favorite</i>\n <p>Company Wishlist</p>\n </Link>\n \n \n </li>\n \n \n <li className=\"nav-item \">\n <Link id=\"btnhover\" className=\"nav-link\" to=\"/Faqs\">\n <i className=\"material-icons\">live_help</i>\n <p>FAQs</p>\n </Link>\n \n \n </li>\n </ul>\n </div>\n </div>\n </div>\n );\n }", "function CategorySwitch(x,y,w,h,categoryBoundary,t,ts,textOffset=5,onColor=[165,230,250]){\n this.switchedOn = false;\n\n this.update = function(){\n if(!this.switchedOn){\n fill(255);\n }else{\n fill(onColor[0],onColor[1],onColor[2]);\n }\n noStroke();\n rect(x,y,w,h,10);\n stroke(0);\n textSize(ts);\n fill(0);\n text(t,x+textOffset,y+h-12);\n strokeWeight(1);\n if(mouseIsPressed&&mouseX>x&&mouseX<x+w&&mouseY>y&&mouseY<y+h){\n this.switchedOn = true;\n }else if(mouseIsPressed\n &&mouseX>categoryBoundary[0]&&mouseY>categoryBoundary[1]&&mouseX<categoryBoundary[2]&&mouseY<categoryBoundary[3]\n &&(mouseX<x||mouseX>x+w||mouseY<y||mouseY>y+h)){\n this.switchedOn = false;\n }\n }\n}", "function sideHighlight(angle,side){ \n\t\tangle+=90-o.lightAngle;\n\t\tif (angle >= 360) angle %= 360; if (angle < 0) angle += 360; \n\t\tvar lightColor = \"#fff\"; var darkColor = \"#000\"; \n\t\tif (angle > 0 && angle < 180)\n\t\t\tif (side ==\"right\") return darkColor; else return lightColor;\n\t\telse\n\t\t\tif (side ==\"left\") return darkColor; else return lightColor;\n\t}", "IS_SIDEBAR_ACTIVE(state, value) {\n state.isSidebarActive = value;\n }", "function changeToCivilians()\r\n{\r\n academyFlag = true;\r\n //document.getElementById(\"USNavyBtn\").checked = true;\r\n changeDisplayCategory();\r\n loadUSNavy();\r\n makeCivBar();\r\n}", "function mSidebarToggle(state) {\n var w;\n var d = \"inline-block\";\n var l = \"\";\n var icon = \"fa-bars\";\n if (state == \"wide\") {\n w = \"0\";\n setState(\"hidden\");\n } else {\n w = \"200px\";\n setState(\"wide\");\n }\n sidebarAnimate(w, d, l, icon, false);\n }", "function showConnectedButtons(){\n\n $(\"#addPinItem\").show();\n $(\"#deletePinButton\").show();\n $(\"#commentPinButton\").show();\n $(\"#photoButton\").show();\n $(\"#editPinButton\").show();\n $(\"#myFriendsItem\").show();\n $(\"#myMapsItem\").show();\n $(\"#requestItem\").show();\n $(\"#logoutButtonCont\").show();\n\n}", "function ToggleSwitchControl(action) {\n if ($(this).hasClass('active')) {\n $(this).removeClass('active');\n $(this).parent().removeClass('active');\n }\n else {\n $(this).addClass('active');\n $(this).parent().addClass('active');\n }\n // Change Text and React based on ID\n switch ($(this).attr('id')) {\n case 'pieceTypeLine':\n {\n $(this).hasClass('active') ? $(this).html('Line') : $(this).html('Shape');\n $('#PTcutout').css('display', $(this).hasClass('active') ? 'none' : 'inline-block');\n $('#PTcutoutLbl').css('display', $('#PTcutout').css('display'));\n for (var _i = 0, selectedPieces_3 = selectedPieces; _i < selectedPieces_3.length; _i++) {\n var piece = selectedPieces_3[_i];\n piece.Line = $(this).hasClass('active');\n }\n Redraw();\n break;\n }\n case 'spotTypeConnect':\n {\n $(this).hasClass('active') ? $('#spotTypeTension').removeClass('folded') :\n $('#spotTypeTension').addClass('folded');\n $(this).hasClass('active') ? $(this).html('Curve') : $(this).html('Corner');\n // Whole Piece\n if (selectedSpots.length < 1) {\n for (var _a = 0, selectedPieces_4 = selectedPieces; _a < selectedPieces_4.length; _a++) {\n var piece = selectedPieces_4[_a];\n for (var _b = 0, _c = piece.Data; _b < _c.length; _b++) {\n var spot = _c[_b];\n spot.Connection = $(this).hasClass('active') ? Connector.Curve : Connector.Corner;\n }\n }\n }\n // Selected Spots\n else {\n for (var _d = 0, selectedSpots_3 = selectedSpots; _d < selectedSpots_3.length; _d++) {\n var spot = selectedSpots_3[_d];\n spot.Connection = $(this).hasClass('active') ? Connector.Curve : Connector.Corner;\n }\n }\n Redraw();\n break;\n }\n }\n}", "function toggleCategory(slider, data){\r\n\t\tvar currentSlide = slider.slick('slickCurrentSlide') + 1;\r\n\t\tvar thing = '{\"slider\":\"'+data.slider+'\",\"slide\":\"'+currentSlide+'\"}';//Using data here to get the string of the slider's class, not the slider itself\r\n\t\ts.selectButtons.removeClass('wc-active');\r\n\t\ts.selectButtons.filter(\"[data-slide-control='\" + thing + \"']\").addClass('wc-active'); \r\n\t}", "function Pin({ type }) {\n let category = type.category;\n useEffect(() => {\n displayMarker(category);\n }, []);\n\n const [pin, setPin] = useState();\n const displayMarker = (category) => {\n // Switch statement for each pin\n switch (category) {\n case (category = \"anime\"):\n setPin(\n <img\n src={anime}\n alt=\"anime\"\n style={{ width: \"26px\", height: \"26px\" }}\n />\n );\n\n break;\n case (category = \"beach\"):\n setPin(\n <img\n src={beach}\n alt=\"beach\"\n style={{ width: \"26px\", height: \"26px\" }}\n />\n );\n\n break;\n case (category = \"birthday\"):\n setPin(\n <img\n src={birthday}\n alt=\"birthday\"\n style={{ width: \"26px\", height: \"26px\" }}\n />\n );\n\n break;\n case (category = \"car\"):\n setPin(\n <img src={car} alt=\"car\" style={{ width: \"26px\", height: \"26px\" }} />\n );\n\n break;\n\n case (category = \"drinks\" || \"liquor\"):\n setPin(\n <img\n src={beer}\n alt=\"beer\"\n style={{ width: \"26px\", height: \"26px\" }}\n />\n );\n break;\n case (category = \"disco\"):\n setPin(\n <img\n src={disco}\n alt=\"disco\"\n style={{ width: \"26px\", height: \"26px\" }}\n />\n );\n break;\n case (category = \"food\"):\n setPin(\n <img\n src={food}\n alt=\"food\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"games\"):\n setPin(\n <img\n src={games}\n alt=\"games\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"general\" || \"default\"):\n setPin(\n <svg\n style={{ fill: \"#1f4980\" }}\n height=\"20\"\n viewBox=\"0 0 24 24\"\n x=\"0px\"\n y=\"0px\"\n >\n <path\n d=\"M20.2,15.7L20.2,15.7c1.1-1.6,1.8-3.6,1.8-5.7c0-5.6-4.5-10-10-10S2,4.5,2,10c0,2,0.6,3.9,1.6,5.4c0,0.1,0.1,0.2,0.2,0.3\n c0,0,0.1,0.1,0.1,0.2c0.2,0.3,0.4,0.6,0.7,0.9c2.6,3.1,7.4,7.6,7.4,7.6s4.8-4.5,7.4-7.5c0.2-0.3,0.5-0.6,0.7-0.9\n C20.1,15.8,20.2,15.8,20.2,15.7z\"\n />\n </svg>\n );\n break;\n case (category = \"home\"):\n setPin(\n <img\n src={home}\n alt=\"home\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"karaoke\" || \"sing\"):\n setPin(\n <img\n src={karaoke}\n alt=\"karaoke\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"outdoor\"):\n setPin(\n <img\n src={outdoor}\n alt=\"outdoor\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"park\"):\n setPin(\n <img\n src={park}\n alt=\"park\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"party\"):\n setPin(\n <img\n src={party}\n alt=\"party\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"theme-park\"):\n setPin(\n <img\n src={themePark}\n alt=\"theme-park\"\n style={{ width: \"24px\", height: \"24px\" }}\n />\n );\n break;\n case (category = \"zoo\"):\n setPin(\n <img src={zoo} alt=\"zoo\" style={{ width: \"26px\", height: \"26px\" }} />\n );\n break;\n default:\n break;\n }\n };\n\n return <>{pin}</>;\n}", "handleSideBarClick () {\n // Hide the navigation bar\n this.setState({showNavBar: false})\n // Show the side bar\n this.setState({showSideBar: true})\n }", "renderDrawerButton() {\n return createPortal(\n <Hidden\n mdUp={\n this.pluginIsWidget(this.props.options.target) ||\n this.props.options.target === \"control\"\n }\n >\n <ListItem\n button\n divider={true}\n selected={this.state.windowVisible}\n onClick={this.handleButtonClick}\n >\n <ListItemIcon>{this.props.custom.icon}</ListItemIcon>\n <ListItemText primary={this.title} />\n </ListItem>\n </Hidden>,\n document.getElementById(\"plugin-buttons\")\n );\n }", "_DrawingToolsToggle() {\n if(!this.state.toolsOpen) { // if the drawing toolBar is closed \n styles.DrawingButtons = { // Spand the toolBar\n height: 210,\n marginTop: 0,\n display : \"flex\",\n flexDirection : \"column\",\n justifyContent : \"space-around\",\n alignItems : \"center\",\n }\n this.setState({ toolsOpen : true }); // use it to change to change the button image and detect toolBar state\n } else if(this.state.toolsOpen) {\n styles.DrawingButtons = { // Shrink the toolBar\n height: 0,\n marginTop: 30,\n display : \"flex\",\n flexDirection : \"column\",\n justifyContent : \"space-around\",\n alignItems : \"center\",\n }\n let action = { type: \"disabled\", value: \"\" } // reset the globale state to disable drawing\n this.props.dispatch(action)\n\n this.setState({ toolsOpen : false });\n } \n }" ]
[ "0.6158295", "0.60753703", "0.591074", "0.5605908", "0.54719955", "0.5331518", "0.53056294", "0.5298818", "0.5294535", "0.52878004", "0.5282211", "0.5244853", "0.51596785", "0.513349", "0.5128288", "0.51180726", "0.5116166", "0.5092711", "0.50923866", "0.5052136", "0.50391245", "0.5015874", "0.50099415", "0.5008464", "0.50012237", "0.49952704", "0.49595734", "0.49561125", "0.49383682", "0.4926704", "0.4923514", "0.49231863", "0.49181786", "0.4911941", "0.49082357", "0.48911324", "0.48748028", "0.48742086", "0.48555997", "0.48542136", "0.4852884", "0.48486844", "0.4848104", "0.48456535", "0.48448893", "0.48445126", "0.4843401", "0.48402846", "0.4829059", "0.48258364", "0.48066697", "0.48027626", "0.48023078", "0.47939286", "0.47929668", "0.4792402", "0.47910511", "0.47889274", "0.47878817", "0.4781931", "0.47795293", "0.47604144", "0.4759529", "0.4755631", "0.4749227", "0.4747948", "0.4746049", "0.47431406", "0.4735233", "0.47307146", "0.47293556", "0.47260377", "0.47215265", "0.47170258", "0.4711762", "0.47083947", "0.47081226", "0.47061843", "0.47028038", "0.47000155", "0.4698506", "0.4698397", "0.46965295", "0.4683447", "0.46833673", "0.46814013", "0.46797335", "0.46793124", "0.466926", "0.46675593", "0.46632197", "0.46610346", "0.4655465", "0.4654666", "0.46543407", "0.46527964", "0.46460018", "0.46448517", "0.4642155", "0.4641051" ]
0.6795635
0
UNPIN CATEGORY SIDE BAR
function category_unpin() { var category_div = document.getElementById('category_sidebar'); category_div.className = ''; var button = document.getElementById('category_pin_button'); button.innerHTML = 'закрепить'; button.onclick = function(){category_pin();}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function category_pin()\n {\n var category_div = document.getElementById('category_sidebar');\n category_div.className = 'pinned';\n var button = document.getElementById('category_pin_button');\n button.innerHTML = 'открепить';\n button.onclick = function(){category_unpin();};\n }", "function SIDE$static_(){ToolbarSkin.SIDE=( new ToolbarSkin(\"side\"));}", "function showCatInSideBar(catId, catName) {\n reSetMarkers(); // clean up the category and map state\n showDialog(false); // hide our info-dialog, if necessary\n //\n var topicsToShow = getAllTopicsInCat(catId);\n topicsToShow.sort(topicSort); // alphabetical ascending\n var topicIdsToShow = new Array();\n //\n var sideBarCategories = jQuery(\"#sideBarCategories\");\n sideBarCategories.empty();\n sideBarCategories.append('&nbsp;<b class=\"redTitle\"><a href=\"javascript:renderCritCatListing('+ crtCritIndex+')\" title=\"Zur&uuml;ck\">' +catName + '</a></b><br/>&nbsp;&nbsp;');\n sideBarCategories.append('<small>('+topicsToShow.length+ ' Objekte)</small><p/>');\n sideBarCategories.append('<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" id=\"sideBarCategoriesTable\"></table>');\n for (var i = 0; i < topicsToShow.length; i++) {\n jQuery(\"#sideBarCategoriesTable\").append('<tr width=\"100%\" class=\"topicRowDeselected\">'\n + '<td width=\"20px\" class=\"iconCell\" valign=\"center\" align=\"center\">'\n + '<img src=\"http://www.berlin.de/imperia/md/images/system/icon_punkt_rot.gif\"/></td>'\n +' <td><a href=\"#\" id=\"topicRowHref-'+topicsToShow[i].id+'\">'+topicsToShow[i].name+'</a></td></tr>');\n jQuery(\"#topicRow-\"+topicsToShow[i].id).attr('onclick', 'javascript:showTopicInMap(\"'+topicsToShow[i].id+'\");');\n jQuery(\"#topicRowHref-\"+topicsToShow[i].id).attr('href', 'javascript:showTopicInMap(\"'+topicsToShow[i].id+'\");');\n topicIdsToShow.push(topicsToShow[i].id);\n }\n // mark category as currently selected, visible\n markerGroupIds.push(catId);\n // showTopicsInMap(topicsToShow);\n showTopicFeatures(topicIdsToShow, catId);\n // calculateNewBounds if its a \"District\" criteria\n if (onBerlinDe) { // ### fixed hack\n for (i = 0; i < districtNames.length; i++) {\n if (districtNames[i].catName == catName) {\n var districtBounds = getBoundsOfCurrentVisibleFeatures(); // out features inside\n updateVisibleBounds(districtBounds, false, LEVEL_OF_DISTRICT_ZOOM);\n }\n }\n }\n }", "function RSGoPro_Hider() {\r\n\tRSGoPro_Hider_called = true;\r\n\t$('.sidebar, .mix, .navi, .catalogsorter').hide();\r\n\t$('.catalog .prods').css('marginLeft','0px');\r\n}", "TOGGLE_REDUCE_SIDEBAR(state, val) {\n state.isSidebarReduced = val;\n }", "get sideBar() {\n return this._sideBar;\n }", "function hideSideActions() {\n $('.side-actions').removeClass('active');\n $('.side-actions .item').removeClass('show');\n $('.help-tips').removeClass('hidden');\n}", "turnActiveOffCatBtns() {\n this.$categoryButtons.children().each(function (index) {\n $(this).removeClass('active');\n });\n }", "function HB_Element_Sidebar() {\n\t \t$( '.hb-sidebar .icon-sidebar' ).click( function() {\n\t\t\t// Add class active\n\t\t\t$(this).closest( '.hb-sidebar' ).addClass( 'active' );\n\t\t\t$( 'html' ).addClass( 'no-scroll' );\n\t\t} );\n\n\t \t$( '.hb-sidebar .content-sidebar > .overlay' ).click( function() {\n\t\t\t// Remove class active\n\t\t\t$(this).closest( '.hb-sidebar' ).removeClass( 'active' );\n\t\t\t$( 'html' ).removeClass( 'no-scroll' );\n\t\t} );\n\t }", "function closeGraphSideBar() {\n document.getElementById(\"graphsidebar\").style.width = \"0\";\n}", "deactivateCondensedSidebar() {\n this.body.removeAttr('data-leftbar-compact-mode');\n }", "function toggleSideBar(action) {\r\n if (action == \"open\") {\r\n sideBar.classList.add(\"visible\");\r\n mapContainer.classList.add(\"shorten\");\r\n\r\n return;\r\n }\r\n\r\n sideBar.classList.toggle(\"visible\");\r\n mapContainer.classList.toggle(\"shorten\");\r\n}", "function hideMediaInfoSidebar() {\n $rightSideBar.addClass('d-none');\n }", "function changeTwoSidedNoData() {\r\n \r\n // change the title\r\n setTitleTwoSided(\"Data is not available for refugees from \" + currentConflictCountryName + \" in \" + countryTwoSided);\r\n\r\n // remove the bars\r\n removeBarsTwoSided(\"rect.left\", dataMale);\r\n removeBarsTwoSided(\"rect.right\", dataFemale);\r\n\r\n // remove all the text\r\n removeAllTextTwoSided();\r\n}", "function CollectJS_Hider() {\n\tCollectJS_Hider_called = true;\n\t$('.sidebar, .mix, .navi, .catalogsorter').hide();\n\t$('.catalog .prods').css('marginLeft','0px');\n}", "function toClickNavicon() {\n\t\t\tcount++;\n\t\t\tif (count % 2 != 0) {\n\t\t\t\tsidebar.style.left = 0;\n\t\t\t\tmoveLayout.style.marginLeft = 200 + 'px'\n\t\t\t\twrapper.style.opacity = 0.2;\n\t\t\t\tnavicon.style.color = 'rgb(250,250,250)';\n\t\t\t\tdocument.body.style.overflow = 'hidden';\n\t\t\t} \n\t\t\tif (count % 2 == 0) {\n\t\t\t\tsidebar.style.left = -200 + 'px';\n\t\t\t\tmoveLayout.style.marginLeft = 0;\n\t\t\t\twrapper.style.opacity = 1;\n\t\t\t\tnavicon.style.color = 'rgb(88,77,57)';\n\t\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\t}\n\t\t}", "function hideCategoryTitles() {\n\t\tsvg.selectAll(\".category\").remove()\n\t}", "function closeSideBar(){\n setVideochat(false);\n setPeoples(false);\n }", "function set_category(direction) {\n \n //set previous panels and category\n prev_category = curr_category;\n prev_panel = curr_panel;\n\t\t\t\t\ttimer.start();\n \n switch (direction) {\n case \"up\":\n curr_panel = 1;\n if(curr_category == 1) { \n curr_category = o.categories;\n } else {\n curr_category--;\n }\n\t\t\t\t\t\t\t$( notice ).purr(purrOptions);\n break;\n \n case \"down\":\t\t\t\t\t\t\t\n curr_panel = 1;\n if(curr_category == o.categories) { \n curr_category = 1;\n } else {\n curr_category++;\n } \n\t\t\t\t\t\t\t$( notice ).purr(purrOptions);\n\t\t\t\t\t\t\t\n break;\n \n case \"left\":\n\t\t\t\t\t\t\tpanels = brokenpanels[curr_category-1];\n \n if(curr_panel == 1) {\n if(curr_category == 1) {\n curr_category = o.categories;\n }\n else {\n curr_category--;\n }\n new_panels = brokenpanels[curr_category-1];\n curr_panel = new_panels;\n \n\t\t\t\t\t\t\t\t$( notice ).purr(purrOptions);\n } else {\n curr_panel--;\n }\n break;\n \n case \"right\":\n panels = brokenpanels[curr_category-1];\n if(curr_panel == panels) {\n curr_panel = 1;\n if(curr_category == o.categories) {\n curr_category = 1; \n }\n else { \n curr_category++;\n }\t\t\t\t\t\t\t\t\n $( notice ).purr(purrOptions);\n } else {\n curr_panel++;\n } \n break;\n }\n $(\".notice-body p\").html(brokenCategories[curr_category-1]);\n $(\"#pfCount\").html(curr_panel+\"/\"+brokenpanels[curr_category-1]);\n $(\"#categoryName\").html(brokenCategories[curr_category-1]);\n location.hash = '#'+brokenCategories[curr_category-1].toLowerCase()+'/'+o.hashNames[curr_category-1][curr_panel-1];\n }", "collapse() {\n this._sideBar.currentTitle = null;\n }", "hideSortCapsule() {\n this.props.dispatch(couponsActions.toggleSort(true, 4, 'hidden'));\n this.props.dispatch(couponsActions.requestCouponsByCategory(this.props.coupons.filter, 4));\n }", "function unPinMenu() {\n pinned = false;\n sessionStorage.setItem('offcanvas-pinned', false);\n $(\".sv-grid-ksgs12\").first().removeClass('pinned'); // So CSS can adjust padding rule accordingly\n $(\".ked-navigation .sidebar\").css({\n transition: ''\n });\n pinIcon.css({\n transform: \"none\"\n });\n collapseMenu();\n }", "function showMediaInfoSidebar() {\n $rightSideBar.removeClass('d-none');\n }", "function hideCategoryNav() {\n var $tooltipBackground = $('.tooltip-background');\n // Check if a disclaimer is not open or if it doesn't exist\n if ($tooltipBackground.length <= 0 || $tooltipBackground.is(':hidden')) {\n navModelSelect.removeClass(NAV_OPEN_CLASS);\n navModelSelect.find(ACTIVE_SELECTOR).removeClass(ACTIVE_CLASS).stop(true, true).slideUp(SLIDE_DURATION);\n categoriesContainer.find(ACTIVE_SELECTOR).removeClass(ACTIVE_CLASS);\n document.getElementById(\"predictive-container-large\").style.display = \"none\";\n }\n }", "function YATAToggleSideBar(left, show) {\n var item = \"YATAIconNav\";\n var side = (left) ? \"-left\" : \"-right\";\n var div = (left) ? \"YATALeftSide\" : \"YATARightSide\";\n \n divBase = item + side;\n if (show) {\n document.getElementById(divBase + \"-on\").style.display = \"none\";\n document.getElementById(divBase + \"-off\").style.display = \"inline-block\"; \n }\n else {\n document.getElementById(divBase + \"-on\").style.display = \"inline-block\"; \n document.getElementById(divBase + \"-off\").style.display = \"none\"; \n }\n var element = document.getElementById(div);\n element.classList.toggle(\"shinyjs-hide\");\n element.classList.toggle(\"shinyjs-show\");\n}", "handleClick(){\n this.props.sidebar === \"DISPLAY_INFO_SIDEBAR\" ? this.props.hideInfoSidebar() : this.props.displayInfoSidebar();\n }", "function closeCenterSideBar(){\n notifyScreenreader(\"closed accessibility settings\");\n removeSideBar(\"#centerSidebar\", \"#centerSidebarCollapse\");\n}", "function mSidebarToggle(state) {\n var w;\n var d = \"inline-block\";\n var l = \"\";\n var icon = \"fa-bars\";\n if (state == \"wide\") {\n w = \"0\";\n setState(\"hidden\");\n } else {\n w = \"200px\";\n setState(\"wide\");\n }\n sidebarAnimate(w, d, l, icon, false);\n }", "function sidebarNoAnimate(width, icon, hide) {\n sideBar.css(\"width\", width);\n toggleIcon.attr(\"class\", \"fa \" + icon);\n mainContent.css(\"padding-left\", width);\n toggle.css(\"left\", \"0\");\n if (hide) {\n span.css(\"display\", \"none\");\n h1.css(\"display\", \"none\");\n }\n }", "renderCrosshairVert() {\n const className = this.state.checkboxCheck\n ? `map_crosshairs_vert visible`\n : `map_crosshairs_vert visible hidden`;\n return <div className={className} />;\n }", "function toggleSidebar() {\n $('.ui.sidebar').sidebar('setting','dimPage',false)\n .sidebar('toggle');\n;\n}", "toggleLeftBar() {\n this.openBar = !this.openBar;\n }", "function disableClass() {\n $(o.btnPrev).removeClass();\n $(o.btnNext).removeClass();\n $(o.btnUp).removeClass('active');\n $(o.btnDown).removeClass('active');\n $(\"#pfCategoryTop\").html(\"&nbsp;\");\n $(\"#pfCategoryBottom\").html(\"&nbsp;\");\n }", "function reorderCmpSidebar() {\n $('#sidebar')\n .find('> ul > li.domain-settings')\n .addClass('selected')\n .parent().find('> li.campaign-settings > ul > li.delimiter')\n .removeClass('selected')\n .find('> ul > li:not(:first-child)')\n .removeClass('sub-item-l2').addClass('sub-item')\n .insertAfter('#sidebar > ul > li.campaign-settings > ul > li:nth-child(2)');\n }", "function allcategory_minus()\n{\n\t$('#allcategory_plus').removeClass('dnone').addClass('dblock');\n\t$('#allcategory_minus').removeClass('dblock').addClass('dnone');\n}", "function closesidebar(){\n document.getElementById(\"sidebar\").style.width = \"0px\";\n}", "function closeSideBar() {\n\n document.getElementById(\"small_icon\").style.display = \"block\";\n document.getElementById(\"big_icon\").style.display = \"none\";\n document.getElementById(\"hamburger_button\").style.marginLeft = \"3em\";\n document.getElementById(\"main\").style.transform = \"scale(1.1,1.1)\";\n document.getElementById(\"main\").style.paddingLeft = \"12em\";\n document.getElementById(\"main\").style.paddingTop = \"7em\";\n\n for (var i = 0; i < elements_text_of_sidebar.length; i++) {\n elements_text_of_sidebar[i].style.display = \"none\";\n }\n\n for (var i = 0; i < elements_sidebar_container.length; i++) {\n elements_sidebar_container[i].style.width = \"4.5em\";\n }\n\n sideBarIsOpen = 0;\n}", "function hideInfoSidebar() {\n sidebar = document.getElementById(\"image-info-and-purchase\");\n sidebar.classList.toggle(\"d-none\");\n}", "function SideBarRight() { return (\r\n <div class=\"container-fluid1\">\r\n <ul class=\"list-sidebar bg-defoult\">\r\n <h3 class=\"activity\"><b>Friends Activity</b></h3>\r\n\r\n <h6 class=\"connect\">Connect with Facebook to see what your friends are playing.</h6>\r\n <div class=\"btn\">\r\n <button type=\"button\" class=\"btn btn-primary\" href=\"https://www.facebook.com/\">📱 Connect With Facebook.</button>\r\n </div>\r\n <p class=\"paragraph\">We'll never post anything without your permission. Show and hide Friend Activity from Settings.</p>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n <div class=\"strain\"></div>\r\n</ul>\r\n </div>\r\n )\r\n }", "function toggleSideBar() {\n id(\"tab\").classList.toggle(\"hidden\");\n id(\"options\").classList.toggle(\"move\");\n }", "function Side() { }", "function ctg_bar_click_handler(){\n\t\t//variables\n\t\tvar current_active_button;\n\t\tvar prev_active_button;\n\t\tvar active_ctg;\n\t\t// create click handler\n\t\t$('.ctg').click(function(e){\n\t\t\t//save active category\n\t\t\tactive_ctg = $(e.target).attr(\"id\").split('-')[1];\n\t\t\tprev_active_button = current_active_button;\n\t\t\tcurrent_active_button = $(e.target);\n\t\t\t$(prev_active_button).removeClass(\"is-active\").addClass(\"not-active\");\n\t\t\t$(\".tags\").addClass(\"not-visible\");\n\t\t\t//make the clicked object appear active\n \t$(current_active_button).removeClass(\"not-active\").addClass(\"is-active\");\n \t$(\".tag-\" + active_ctg).removeClass(\"not-visible\").addClass(\"is-visible\");\n\t\t});\n\n\t}", "function Sidebar() {\n return (\n\n <div className=\"sidebar\">\n <h5>IMPEKABLE</h5>\n <ul className=\"side-contents\">\n <li><a className=\"side-text\" ><i className=\"fa fa-home\"></i> Home</a></li>\n <li className=\"active\"><a className=\"side-text\" ><i className=\"fa fa-bar-chart\"></i> Dashboard</a></li>\n <li><a className=\"side-text\"><i className=\"fa fa-envelope\"></i> Inbox</a></li>\n <li><a className=\"side-text\"><i className=\"fa fa-barcode\"></i> Products</a></li>\n </ul>\n\n </div>\n\n )\n}", "function showTopicInSideBar(topicId, dontUpdateHistoryState) {\n // sideBar related stuff\n //\n var handler = jQuery(\"#sideBarCategories\");\n handler.empty();\n jQuery(\"#progContainer\").show(\"fast\");\n // do ajax topicbean GET and render results into the given container\n // Topic ID, jQuery (DOM) Element, Browser History\n getGeoObjectInfo(topicId, handler, dontUpdateHistoryState);\n //\n /** var topicFeature = checkDrawnFeaturesForTopicId(topicId);\n if ( topicFeature != null ) {\n topicFeature.renderIntent = \"select\";\n myNewLayer.redraw();\n // topi undrawn but infowMarker is still there, which is OK\n showInfoWindowForMarker(topicFeature.data);\n } */\n }", "function Sidebar() {\n let sidebar = document.getElementById('sidenavbar');\n sidebar.classList.toggle('isOpen');\n let grid = document.getElementById('grid-container');\n grid.classList.toggle('no_sidenavbar');\n}", "static sideBarFunc(){\n navIcon.addEventListener('click', () => {\n sideBar.style.display = 'block';\n })\n }", "function hideCatalog(){\n\t$('.cookSidebar').removeClass(\"cookSidebar_isActive\");\n\t$('.cookNavTrigger').removeClass(\"cookNavTrigger_isActive\");\n}", "function toggleCategories(sett) {\n for (var i = 0; i < categoryStyle.length; i++) {\n categoryStyle[i].style.display = sett;\n\n }\n}", "unVisibleDrawer(){\n Navigation.mergeOptions(this.props.componentId, {\n sideMenu: {\n left: {\n visible: false,\n enabled: false,\n screen: \"third\"\n }\n },statusBar: {\n style: 'dark',\n animate: true ,\n backgroundColor :'red'\n }\n });\n }", "function pinSidebar(pin) {\n $('#topbar #close-sidebar').addClass('disabled');\n $('#topbar #close-sidebar').removeClass('fa-rotate-90');\n $('#sidebar').show();\n zoom(true);\n\n mode.pinnedSidebar = mode.pinnedSidebar || []\n if (mode.pinnedSidebar.indexOf(pin) == -1) {\n mode.pinnedSidebar.push(pin);\n }\n}", "function w3_close() {\r\n mySidebar.style.display = \"none\";\r\n}", "function w3_close() {\r\n mySidebar.style.display = \"none\";\r\n}", "function w3_close() {\r\n mySidebar.style.display = \"none\";\r\n}", "function w3_close() {\n mySidebar.style.display = \"none\";\n }", "function sortInactive(item, index, offset) {\n changeColorofBar(item + 1, false);\n putAtPosition(item, index + offset);\n}", "function suiSideNavBar() {\n const sidebarNav = document.querySelector('.sui-nav-sidebar');\n for (let item of sidebarNav.children) {\n if (item.children[0].nodeName === \"A\") {\n item.children[0].addEventListener('click', (evt) => {\n evt.preventDefault();\n for (let bar of sidebarNav.children) {\n bar.classList.remove('uk-active');\n }\n item.classList.add('uk-active');\n });\n }\n }\n sidebarNav.children[1].classList.add('uk-active');\n}", "function handleSideBar() {\n if($('#tab4').hasClass('active'))\n {\n $('#main.well').hide();\n $('#reports.well').show();\n }\n else{\n $('#main.well').show();\n $('#reports.well').hide();\n }\n }", "function closeSidebar() {\n docBar.style.width = '0';\n document.getElementById('main').style.marginLeft = '0';\n}", "function redraw_sidebar(){\n\n}", "function mainPanelOff() {\n (Settings.niceView) ? mainPanel1.setAttributeNS(null, \"fill\", \"#000\") : mainPanel0.setAttributeNS(null, \"fill\", \"#000\");\n}", "function closeLeftSidebar(){\n $('.filterImg').attr('src', 'img/filter.png');\n $('.leftSidebar').removeClass('come-in-left');\n $('.blurDiv').removeClass('is-active');\n $('.push').removeClass('push-left');\n }", "function w3_close() {\n mySidebar.style.display = \"none\";\n}", "function w3_close() {\n mySidebar.style.display = \"none\";\n}", "function w3_close() {\n mySidebar.style.display = \"none\";\n}", "onClickUnderlay_() {\n this.portraitToggleScene(false, true);\n }", "function hideSideBar() {\n if (isMenuOpen) {\n setSideBarClass('hide');\n setMainScreenClass('col-sm-12');\n setArrowSide(openLogo);\n setIsMenuOpen(false);\n setMainScreenArrowClass('img-fluid arrow-img')\n } else {\n setSideBarClass('col-sm-2 sidebar-col');\n setMainScreenClass('col-sm-10');\n setArrowSide(closeLogo);\n setIsMenuOpen(true);\n setMainScreenArrowClass('hide')\n }\n\n }", "function hideUselessBtns() {\n $(\"#navCat\").attr(\"class\",\"hide\");\n $(\"#navFav\").attr(\"class\",\"hide\");\n disableCopy();\n}", "function showSidebar1() {\n showSidebar('Brand', 'New Brand');\n }", "function w3_close()\n{\n document.getElementById(\"mySidebar\").style.display = \"none\";\n}", "close() {\n let sidebar = JSON.parse(JSON.stringify(this.style.sidebar));\n sidebar.transform = 'translate(0, 0)';\n this.style.sidebar = sidebar;\n this.setState({open: false});\n }", "function closeLeftSideBar(){\n notifyScreenreader(\"closed user settings\");\n removeSideBar(\"#leftSidebar\", \"#leftSidebarCollapse\");\n}", "_refreshVisibility() {\n this._sideBar.setHidden(this._sideBar.titles.length === 0);\n this._stackedPanel.setHidden(this._sideBar.currentTitle === null);\n }", "function sidebarOut() {\n let sidebarWidth = window.innerWidth\n let outerContainer = document.getElementById('container54')\n\n document.getElementById('sidenav').style.left = \"0%\" // I'm using left to make it look animated like the sidenav is moving\n document.getElementById('main').style.marginLeft = '20%'\n document.getElementById('main').style.paddingLeft = '20px'\n\n if(sidebarWidth<1000) {\n document.getElementById('styledit').innerHTML += \"<div id=\\'styledit2\\'><style>#firstcontainer54 {opacity: 0.3}</style></div>\"\n }\n document.getElementById('showsetting').onclick = function() {sidebarIn()}\n document.getElementById('showsetting').innerHTML = \"Hide Settings\"\n}", "function toggleSidebar() {\r\n var x = document.getElementById(\"container\");\r\n if (x.classList.contains(\"sidebarOpen\")) {\r\n x.classList.remove(\"sidebarOpen\");\r\n x.classList.add(\"sidebarClosed\");\r\n return;\r\n }\r\n if (x.classList.contains(\"sidebarClosed\")) {\r\n x.classList.remove(\"sidebarClosed\");\r\n x.classList.add(\"sidebarOpen\");\r\n return;\r\n }\r\n}", "w3_close() {\n this.mySidebar.style.display = \"none\";\n this.overlayBg.style.display = \"none\";\n }", "function hideAllMenuAction() {\n $$('.third-toolbar').removeClass('show');\n $$('.floating-product-color ').removeClass('show');\n}", "deactivateScrollableSidebar() {\n this.body.removeAttr('data-leftbar-compact-mode');\n $('#left-side-menu-container').addClass('slimscroll-menu');\n $('#side-sm-main-logo').attr('src', './public/images/logo_sm_dark.png');\n this._resetSidebarScroll();\n }", "static closeSideBarFunc(){\n closeSideBar.addEventListener('click', () => {\n sideBar.style.display = 'none' \n })\n }", "function w3_close() {\n document.getElementById(\"mySidebar\").style.display = \"none\";\n}", "function vizToggleCleanup(){\n setRangeSliderThumbOpacity();\n layerObj[id].visible = layer.visible;\n layerObj[id].opacity = layer.opacity;\n }", "function closeAside() {\n document.getElementById(\"toc_aside\").style.right = \"-100vw\";\n }", "function SideNav() {\n return null;\n}", "function toggleAxis(axis){\n\n }", "function toggleAxis(axis){\n\n }", "function toggleDashboardSidebar(){\r\n // $(\"#sidebar\").toggleClass('sidebar-options-hidden sidebar-options-visible');\r\n}", "function hideSideBar(activeClass) {\n\t\toverlay.addEventListener('click', () => {\n\t\t\tif(sideBar.classList.contains(activeClass)) {\n\t\t\t\tsideBar.classList.remove(activeClass)\n\t\t\t}\n\t\t});\n\t}", "handleSideBarClick () {\n // Hide the navigation bar\n this.setState({showNavBar: false})\n // Show the side bar\n this.setState({showSideBar: true})\n }", "deactivateSideBySide() {\n this.sideBySideActive = false;\n this.closeSidebarOnDocumentClick = true;\n this.pdfContainer.style.width = 'auto';\n this.pdfContainer.classList.remove('hypothesis-side-by-side');\n }", "function sidebarToggleVisibility() {\n this.hideSidebar();\n this.hideSidebarByCookieValue();\n}", "function Sidebar() {\n return (\n <div className=\"Sidebar_App tess\">\n <div className=\"Sidebar_row row\"> \n <div className=\"Sidebar_col-4\">\n <div className=\"list-group\">\n <a className=\"list-group-item list-group-item-mine Sidebar_heading\" href=\"/\"><ChevronLeftIcon className=\"Sidebar_size\"/> Notifications</a>\n </div>\n <div className=\"list-group\">\n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/gereral\">General<ChevronRightIcon className=\"Sidebar_icon\"/></a>\n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/appointments\">Upcoming Appointments <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/confirmed\">Confirmed <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/failed\">Failed <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/feedback\">Feedback <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n <a className=\"list-group-item list-group-item-mine Sidebar_items\" href=\"/pushed\">Pushed <ChevronRightIcon className=\"Sidebar_icon\"/></a> \n </div>\n </div>\n </div>\n </div> \n );\n}", "function closeNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"0\";\r\n }", "function removeCat(position) {\n cells[position].classList.remove(catClass)\n }", "function updateInkBarClassName(){var elements=getElements();var newIndex=ctrl.selectedIndex,oldIndex=ctrl.lastSelectedIndex,ink=angular.element(elements.inkBar);if(!angular.isNumber(oldIndex))return;ink.toggleClass('md-left',newIndex<oldIndex).toggleClass('md-right',newIndex>oldIndex);}", "sidebarActions() {\n return <div className={'sidebar-actions'}>\n <h3>I don't like these results...</h3>\n <button\n type={'button'}\n onClick={this.props.onBack}\n >\n Change my selection\n </button>\n <h3>Looks good!</h3>\n <button\n type={'button'}\n onClick={this.props.onNextView}\n >\n Show me the mods to move\n </button>\n </div>\n }", "closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n }", "function hideElements() {\n $(\"#collapse_icon\").html(\"show\");\n $(\".sidebar_elements\").addClass(\"hidden\").fadeTo(600, 0).css('dispaly', 'flex');\n $(\"#cross\").removeClass(\"hidden\").fadeTo(600, 1).css('dispaly', 'flex');\n}", "destroy() {\n const bar = this.items[this.index][0];\n const content = this.items[this.index][1];\n hide(content);\n bar.removeAttribute(ATTRIBUTE_ACTIVE);\n content.removeAttribute(ATTRIBUTE_ACTIVE);\n }", "label() {\n if(this.props.columnType === Constants.getIn(['columnTypes', 'SIDEBAR'])) {\n return null\n }\n\n let labelLines = this.labelLines()\n\n // Clip long names, and append an ellipsis\n if (labelLines.length > 3) {\n labelLines = [labelLines[0], labelLines[1], labelLines[2]]\n labelLines[2] += '…'\n }\n\n const labelLengthExceed = labelLines.length * Constants.get('singleLineCategoryLabelHeight') > this.props.height\n\n let labelClassName = 'inactiveCategoryLabels'\n\n if(labelLengthExceed === true && this.checkHoverState() === false && this.filterboxActive() === false) {\n return null\n }\n\n if(this.checkHoverState() === true) {\n labelClassName = 'activeCategoryLabels'\n }\n\n let currentY = (this.props.height/2)\n let lineCount = 0\n currentY += (1 - (labelLines.length/2)) * \n Constants.get('singleLineCategoryLabelHeight')\n\n // Decrement just before it's increcemented inside the map.\n currentY -= Constants.get('singleLineCategoryLabelHeight')\n\n return <g>\n <text\n >\n {labelLines.map((line) => {\n currentY += Constants.get('singleLineCategoryLabelHeight')\n lineCount += 1\n return <tspan fill={this.fill} className={labelClassName} \n key={this.props.categoryName + 'CategoryLabelLine' + lineCount}\n y={currentY}\n x={this.props.width + Constants.get('categoryLabelOffset')}>\n {line}\n </tspan>\n })}\n </text>\n { this.filterbox(currentY) }\n </g>\n }", "function onWidgetCatBtnsClick(btnId)\n{\n\tif (btnId == \"btnContainerWidTab\")\n\t{\n\t\tif(frmUInterface.segContainerWidgets.isVisible == true)\n\t\t\tfrmUInterface.segContainerWidgets.setVisibility(false);\n\t\telse\n\t\t\tfrmUInterface.segContainerWidgets.setVisibility(true);\n\t\t\t\n\t\tfrmUInterface.segBasicWidgets.setVisibility(false);\n\t\tfrmUInterface.segAdvancedWidgets.setVisibility(false);\n\t}\n\telse if (btnId == \"btnBasicWidTab\")\n\t{\n\t\tif(frmUInterface.segBasicWidgets.isVisible == true)\n\t\t\tfrmUInterface.segBasicWidgets.setVisibility(false);\n\t\telse\n\t\t\tfrmUInterface.segBasicWidgets.setVisibility(true);\n\t\t\t\n\t\tfrmUInterface.segContainerWidgets.setVisibility(false);\n\t\tfrmUInterface.segAdvancedWidgets.setVisibility(false);\n\t}\n\telse\n\t{\n\t\tif(frmUInterface.segAdvancedWidgets.isVisible == true)\n\t\t\tfrmUInterface.segAdvancedWidgets.setVisibility(false);\n\t\telse\n\t\t\tfrmUInterface.segAdvancedWidgets.setVisibility(true);\n\t\t\t\n\t\tfrmUInterface.segContainerWidgets.setVisibility(false);\n\t\tfrmUInterface.segBasicWidgets.setVisibility(false);\n\t}\n}", "function addSidebarButtons() {\n for (var i = 0; i < namespace.markers.length; i++) {\n //$(\"#accordion\").append(\n var panelDiv =\n `<div class=\"panel panel-default\">\n <div class=\"shell `+ namespace.markers[i].category +`\">\n <div class=\"panel-heading\" role=\"tab\" id=\"heading`+ i +`\">\n <h4 class=\"panel-title\" onclick=\"markerSelected(`+ i +`);\">\n ` + (i + 1) + `: ` + namespace.markers[i].name + `\n </h4>\n <div class=\"btn btn-link btn-sm pull-right x-button\" onclick=\"removePoint(` + i + `);\">&times</div>\n </div>\n </div>\n <div id=\"collapse` + i + `\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading` +\n i + `\">\n <div class=\"panel-body\">\n ` + namespace.markers[i].summary + `\n </div>\n </div>\n </div>`;\n\n $(\"#accordion\").append(panelDiv);\n namespace.markers[i].popRadius.setVisible(false);\n }\n}" ]
[ "0.6633049", "0.61525327", "0.5794614", "0.5732173", "0.5698377", "0.5660663", "0.56453115", "0.5632748", "0.5581395", "0.5539151", "0.5536879", "0.5531846", "0.5501331", "0.547862", "0.5447614", "0.54385215", "0.54380804", "0.5434021", "0.5430503", "0.5367485", "0.5366992", "0.53460044", "0.53456336", "0.5345364", "0.5326591", "0.53211987", "0.53037506", "0.5292615", "0.529041", "0.5284797", "0.52820593", "0.52793777", "0.52769727", "0.52708465", "0.52649355", "0.52514833", "0.52486366", "0.52404785", "0.5234476", "0.5232144", "0.5222329", "0.5215643", "0.52048653", "0.5203622", "0.5195533", "0.51910746", "0.51677525", "0.51676565", "0.51654404", "0.51598877", "0.5154088", "0.5154088", "0.5154088", "0.51523805", "0.51516414", "0.5150224", "0.51406544", "0.5133973", "0.51305616", "0.5128121", "0.5121863", "0.5115856", "0.5115856", "0.5115856", "0.511372", "0.5111812", "0.5110072", "0.5107719", "0.51050043", "0.51036584", "0.5102126", "0.51000965", "0.5088976", "0.50872034", "0.50870365", "0.50866157", "0.5080875", "0.5067425", "0.50646985", "0.5056913", "0.50514585", "0.5051395", "0.50484467", "0.50484467", "0.504661", "0.50465363", "0.5043794", "0.5038609", "0.50244355", "0.50235283", "0.5022219", "0.50210655", "0.50148535", "0.50147635", "0.50132877", "0.50118077", "0.50105125", "0.50090545", "0.50076735", "0.50002676" ]
0.6570702
1
Drag functionality of beaker
function dragAndDrop_Beaker(current_test_beaker_name) { machine_container.getChildByName(current_test_beaker_name).on("pressmove", function(evt) { evt.target.x = evt.stageX-60; evt.target.y = evt.stageY-60; tub_current_position_x = evt.stageX; tub_current_position_y = evt.stageY; enable_disable_beaker(false) /** Disabling the mouseEnabled functionality of other beakers */ machine_container.getChildByName(current_test_beaker_name).mouseEnabled = true; }); /**Drop functionality of Beaker. */ machine_container.getChildByName(current_test_beaker_name).on("pressup", function(evt) { if (tub_current_position_x > hit_image_x && tub_current_position_y < hit_image_y && tub_current_position_x < hit_max_x && tub_current_position_y > hit_max_y) { /**Finding the Drop area of the Beaker. */ /** setting the beaker in the bottom of the machine */ machine_container.getChildByName(current_test_beaker_name).x = beaker_drop_x; machine_container.getChildByName(current_test_beaker_name).y = beaker_drop_y; enable_aspirate(scope)/** enabling the aspirate button */ scope.sample_disable=true; /** It disabling the sample drop-down */ scope.test_disable=true;/** It disabling the test drop-down */ scope.$apply(); if(aspirate_flag && sample_selected_flag){ /* if the fruit juice is selected */ scope.aspirate_disable=true; /** It disabling the aspirate button */ scope.start_test_disable=false; /** It enables the "start test" button */ scope.$apply(); } } else { revertBeakers() /** calling the revertBeakers function for replace the beakers in its original position */ } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startDrag(x, y) {}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function CdkDragDrop() {}", "function CdkDragDrop() {}", "function win_drag_start(ftWin){draggingShape = true;}", "drag_feedback(){\r\n this.dragging = true;\r\n }", "function drag(e) {\n draggedItem = e.target\n dragging = true\n}", "function drag(){\n console.log(\"Being dragged around\");\n}", "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "function DragHelperTemplate() {}", "function DragHelperTemplate() {}", "onMouseDrag(e) {}", "function drag(e) {\n draggedItem = e.target;\n dragging = true;\n}", "drag(ev) {\n // console.log('drag')\n }", "function drag(ev) {\n ev.dataTransfer.setData(\"text\", ev.target.id);\n ev.dataTransfer.setDragImage(ev.target, 25,25, 0);\n Array.from(document.getElementsByClassName(\"drop_target\")).forEach(o => {\n o.style.pointerEvents = \"auto\";\n });\n}", "function CdkDragMove() {}", "function CdkDragMove() {}", "function add_grabber(){\n $('#source-image').css('cursor', 'move');\n $('#source-image').draggable();\n }", "onDrag(mousePosition) {\n }", "function mouseDownEvent(eb){\r\n dragging = eb\r\n}", "mouseDrag(prev, pt) {}", "mouseDrag(prev, pt) {}", "function draggable() {\n\t$(\".bird\").draggable();\n}", "function editOnDragStart(){this._internalDrag=true;this.setMode('drag');}", "function CdkDragEnter() {}", "function CdkDragEnter() {}", "function mouseDragged(){\r\n inputForMDragging(mouseX, mouseY);\r\n\r\n\r\n}", "function dragStartFunction(e) {\r\n e.dataTransfer.setData(\"target\", e.target.id)\r\n\r\n\r\n}", "dragleave_feedback(){\r\n this.dragging = false;\r\n }", "function engage(e) {\n dragging = true;\n //2.6 don't know if it is mandatory add the function putPoint(e)\n putPoint(e);\n }", "drag(x, y) {\n this.doDrag(x, y);\n }", "function drag(ev) \n{\n ev.dataTransfer.setData(\"text\", ev.target.id);\n //$('#'+ev.target.id).draggable( {cursor: 'move'} );\n}", "function drag(event) {\n draggedItem = event.target;\n dragging = true;\n}", "function mouseDragged(){\r\n Matter.Body.setPosition(arrow.body,{x:mouseX, y:mouseY})\r\n }", "function wall_drag_start(ftWall){draggingShape = true;}", "function engage(e) {\n dragging = true;\n putPoint(e);\n}", "function dragFly() {\n $fly.draggable();\n $fly.on('mousedown',function() {\n buzzSFX.play();\n });\n}", "function setDragElements(obj) {\n\n var move = function (dx, dy) {\n\n var paperScaleX = this.paper.transform().localMatrix.a;\n var paperScaleY = this.paper.transform().localMatrix.d;\n\n this.attr({\n transform: this.data('origTransform') + (this.data('origTransform') ? \"T\" : \"t\") + [dx / paperScaleX, dy / paperScaleY]\n });\n\n //get current coordinates\n var x = this.transform().localMatrix.e;\n var y = this.transform().localMatrix.f;\n\n // check if new x or y is out of the box\n\n var o = this.select(\"#r\");\n //console.log(o);\n\n var width = o.attr(\"width\");\n var height = o.attr(\"height\");\n var maxX = this.paper.attr(\"width\");\n var maxY = this.paper.attr(\"height\");\n\n if (x < 0) x = 0;\n if (x >= (maxX - width)) x = (maxX - width);\n\n\n if (y < 0) y = 0;\n if (y >= (maxY - height)) y = (maxY - height);\n //console.log(\"x:\" + x + \" y:\" + y);\n //console.log(\"maxX:\" + maxX + \" maxY:\" + maxY);\n //console.log(\"height:\" + height + \" maxYwidth:\" + width);\n //console.log(\"SnapX:\"+xSnap+\" SnapY:\"+ ySnap);\n\n\n //console.log(\"x:\" + x + \" y:\" + y);\n this.transform(\"t\" + x + \",\" + y);\n\n // set dropzone\n var xSnap = Snap.snapTo(gridsize, x, 100000);\n var ySnap = Snap.snapTo(gridsize, y, 100000);\n //console.log(\"x:\" + x + \" y:\" + y);\n //console.log(\"dx:\" + dx + \" dy:\" + dy);\n //console.log(\"SnapX:\"+xSnap+\" SnapY:\"+ ySnap);\n\n var s = getSnap();\n var tmp = s.select(\".dropzone\");\n tmp.attr({\n stroke: \"#eee\",\n strokeWidth: 1,\n fill: \"#eee\",\n })\n $(tmp).show();\n tmp.transform(\"t\" + xSnap + \",\" + ySnap);\n\n //console.log(\"-----------------------------\");\n //console.log(this.transform().localMatrix);\n //console.log(tmp.transform().localMatrix);\n }\n\n var start = function () {\n console.log(\"start drag\");\n this.paper.undrag();\n this.data('origTransform', this.transform().local);\n\n getSnap().append(this);\n\n createTmpRec(this);\n\n }\n\n var stop = function (e) {\n\n var x = this.transform().localMatrix.e;\n var y = this.transform().localMatrix.f;\n\n\n var xSnap = Snap.snapTo(gridsize, x, 100000);\n var ySnap = Snap.snapTo(gridsize, y, 100000);\n\n this.attr({\n transform: \"martix(1,0,0,1,\" + xSnap + \",\" + ySnap + \")\"\n })\n\n //console.log(this.transform().localMatrix.e + 'x' + this.transform().localMatrix.f);\n //this.paper.drag();\n\n //remove tmp rectangle\n //var tmp = getSnap().select(\"#dropzone\");\n //tmp.remove();\n\n $(\".dropzone\").remove();\n\n detectNeighbors(this);\n }\n\n obj.drag(move, start, stop);\n\n}", "isDragAvailable() {\n return true;\n }", "function OnMouseDown(){\n\tbeingDragged = true;\n}", "function xl_DragMe(event) \n{\n\tvar target = xl_GetEventTarg(event); \n\txl_Drag(target, event); \n}", "_drop() {\n if (!this.element || !this.$()) { return; }\n\n let element = this.get('handle') ? this.$(this.get('handle')) : this.$();\n this._preventClick(element);\n\n this.set('isDragging', false);\n this.set('isDropping', true);\n\n this._tellGroup('update');\n\n this._waitForTransition()\n .then(run.bind(this, '_complete'));\n }", "function widgetDrag(e) {\n e.dataTransfer.setData(\"widgetID\", e.target.id);\n }", "_dragstart() {\n this.set('isTrackingBuses', false);\n }", "startDrag(e) {\n const selectedElement = e.target.parentElement,\n offset = this.getMousePosition(e, selectedElement);\n if ($(selectedElement).hasClass( \"sticker\" )) {\n offset.x -= parseFloat(selectedElement.getAttributeNS(null, \"x\")),\n offset.y -= parseFloat(selectedElement.getAttributeNS(null, \"y\"));\n this.setState({\n selectedElement:selectedElementom ,\n offset: offset\n })\n }\n }", "moveTool(e) {\n //find the cropper\n let cropper = this.state.cropper;\n //trigger the move tool\n cropper.setDragMode(\"move\");\n //reset active buttons\n this.clearActiveButtons();\n this.setActiveButton(\"moveTool\");\n }", "function mouseDragged() {\n flock.addBoid(new Boid(mouseX, mouseY));\n}", "function DragPreviewTemplate() {}", "function DragPreviewTemplate() {}", "onDragBegin(event,nodePath){\n var vm = this;\n\t\tevent.dataTransfer.setData(\"srcObjectNode\", nodePath);\n console.log(\"onDragBegin:\"+nodePath);\n event.stopPropagation(); \n $(\"#solvent_lastmile_drop_position_indicator\").css(\"display\",\"none\"); \n\n vm.setClientAppData(\"clipboardState\",{\"mode\":\"move\",\"component\":nodePath});\n\n\n $(\"#solvent_lastmile_drop_position_indicator\")\n .css({\"display\":\"block\"/*,\"min-width\":indicatorWidth*/})\n .position({\n my:\"center top\",\n at:\"center top\",\n of:window \n }) \n }", "function Beodrag(element, options, context = document) {\n \tvar myThis = this;\n \tthis.element = element;\n \tthis.context = context;\n \t\n \tthis.options = {\n \t\ttouchImmediately: false,\n \t\tpreventClick: false,\n \t\ttouchDelay: 300,\n \t\tenabled: true,\n \t\tarrange: false,\n \t\tpre: null,\n \t\tstart: null,\n \t\tmove: null,\n \t\tend: null,\n \t\tcancel: null\n \t};\n \tthis.options = Object.assign(this.options, options);\n \tif (!options.pre || typeof options.pre != \"function\") this.options.pre = null;\n \tif (!options.start || typeof options.start != \"function\") this.options.start = null;\n \tif (!options.move || typeof options.move != \"function\") this.options.move = null;\n \tif (!options.end || typeof options.end != \"function\") this.options.end = null;\n \tif (!options.cancel || typeof options.cancel != \"function\") this.options.cancel = null;\n \t\n \tvar elements = null;\n \tvar elementFound = false;\n \tvar dragEvent = null;\n\tvar dragging = 0;\n\tvar dragTimeout = null;\n\tvar clickHandler = null;\n\tvar touch = false;\n\tvar positions = {\n\t\telementX: 0, // Position of the element including offsets.\n\t\telementY: 0,\n\t\tpageX: 0,\n\t\tpageY: 0,\n\t\toffsetX: 0, // Calculated offset (element position - drag position + margin).\n\t\toffsetY: 0,\n\t\tdeltaX: 0,\n\t\tdeltaY: 0,\n\t\tstartX: 0,\n\t\tstartY: 0\n\t};\n\t\n \t\n \tthis.onDragStart = function(event) {\n \t\tif (this.options.enabled) {\n \t\t\tdragging = false;\n \t\t\telements = this.context.querySelectorAll(this.element);\n\t \t\telementFound = false;\n\t \t\tfor (element in elements) {\n\t\t \t\tif (elements[element] == event.target) {\n\t\t \t\t\telementFound = true;\n\t\t \t\t\tbreak;\n\t\t \t\t}\n\t\t \t}\n\t \t\tif (elementFound) {\n\t\t \t\tdragEvent = event;\n\t \t\t\tdragging = 0;\n\t\t\t\ttouch = (event.targetTouches) ? true : false;\n\t\t\t\tif (!touch) {\n\t\t\t\t\tpositions.pageX = dragEvent.pageX;\n\t\t\t\t\tpositions.pageY = dragEvent.pageY;\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} else {\n\t\t\t\t\tpositions.pageX = event.targetTouches[0].pageX;\n\t\t\t\t\tpositions.pageY = event.targetTouches[0].pageY;\n\t\t\t\t\tif (this.options.touchImmediately) event.preventDefault();\n\t\t\t\t}\n\t\t\t\tpositions.startX = positions.pageX;\n\t\t\t\tpositions.startY = positions.pageY;\n\t\t\t\tdomRect = event.target.getBoundingClientRect();\n\t\t\t\tcomputedStyle = window.getComputedStyle(event.target);\n\t\t\t\tpositions.offsetX = positions.pageX-domRect.x+parseFloat(computedStyle.marginLeft);\n\t\t\t\tpositions.offsetY = positions.pageY-domRect.y+parseFloat(computedStyle.marginTop);\n\t\t\t\tpositions.elementX = positions.pageX-positions.offsetX;\n\t\t\t\tpositions.elementY = positions.pageY-positions.offsetY;\n\t\t\t\tif (!this.options.touchImmediately) {\n\t\t\t\t\tdragTimeout = setTimeout(function() {\n\t\t\t\t\t\tdragTimeout = null;\n\t\t\t\t\t\tif (myThis.options.pre) myThis.options.pre(event, positions, dragEvent.target);\n\t\t\t\t\t\tdragging = 1;\n\t\t\t\t\t}, this.options.touchDelay);\n\t\t\t\t} else {\n\t\t\t\t\tif (this.options.pre) this.options.pre(event, positions, dragEvent.target);\n\t\t\t\t\tdragging = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t}\n \tthis.onDragMove = function(event) {\n \t\tif (dragEvent) {\n\t\t\tif (dragging < 2) {\n\t\t\t\tif (!touch) {\n\t\t\t\t\tclearTimeout(dragTimeout);\n\t\t\t\t\tdragTimeout = null;\n\t\t\t\t}\n\t\t\t\tif (!dragTimeout) {\n\t\t\t\t\tdragging = 2;\n\t\t\t\t\tif (this.options.start) this.options.start(event, positions, dragEvent.target);\n\t\t\t\t\tif (this.options.arrange) this.arrangeStart(event);\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} else {\n\t\t\t\t\tthis.onDragEnd(event, true);\n\t\t\t\t}\n\t\t\t} else if (dragging == 2) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (!touch) {\n\t\t\t\t\tx = event.pageX;\n\t\t\t\t\ty = event.pageY;\n\t\t\t\t} else {\n\t\t\t\t\tx = event.targetTouches[0].pageX;\n\t\t\t\t\ty = event.targetTouches[0].pageY;\n\t\t\t\t}\n\t\t\t\tif (x != positions.pageX || y != positions.pageY) {\n\t\t\t\t\tpositions.pageX = x;\n\t\t\t\t\tpositions.pageY = y;\n\t\t\t\t\tpositions.deltaX = x-positions.startX;\n\t\t\t\t\tpositions.deltaY = y-positions.startY;\n\t\t\t\t\tpositions.elementX = positions.pageX-positions.offsetX;\n\t\t\t\t\tpositions.elementY = positions.pageY-positions.offsetY;\n\t\t\t\t\tif (this.options.move) this.options.move(event, positions, dragEvent.target);\n\t\t\t\t\tif (this.options.arrange) this.arrangeMove(event);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t}\n \t\n \t\n \tthis.onDragEnd = function(event, fromDrag = false) {\n \t\tif (dragging == 2) {\n\t\t\t//dragging = false;\n\t\t\tif (this.options.arrange) {\n\t\t\t\tthis.arrangeEnd(event);\n\t\t\t} else if (this.options.end) {\n\t\t\t\tthis.options.end(event, positions, dragEvent.target);\n\t\t\t}\n\t\t\tdragEvent = null;\n\t\t\tevent.preventDefault();\n\t\t} else if (dragEvent) {\n\t\t\tif (this.options.cancel) this.options.cancel(event, positions, dragEvent.target);\n\t\t\tdragEvent = null;\n\t\t\tif (!fromDrag) event.preventDefault();\n\t\t\tclearTimeout(dragTimeout);\n\t\t\tdragTimeout = null;\n\t\t}\n \t}\n \t\n \tthis.onClick = function(event) {\n \t\tif (elementFound && (this.options.preventClick || dragging > 0)) {\n \t\t\tdragging = 0;\n \t\t\telementFound = false;\n \t\t\tevent.stopPropagation();\n \t\t}\n \t}\n \t\n \tthis.onContextMenu = function(event) {\n \t\tif (elementFound) {\n \t\t\tthis.onDragEnd(event, true);\n \t\t}\n \t}\n \t\n \tthis.context.addEventListener(\"mousedown\", this.onDragStart.bind(this), false);\n \tthis.context.addEventListener(\"mousemove\", this.onDragMove.bind(this), false);\n \tdocument.addEventListener(\"mouseup\", this.onDragEnd.bind(this), false);\n \t\n \tthis.context.addEventListener(\"touchstart\", this.onDragStart.bind(this), false);\n \tthis.context.addEventListener(\"touchmove\", this.onDragMove.bind(this), {passive: false, capture: false});\n \tthis.context.addEventListener(\"touchend\", this.onDragEnd.bind(this), false);\n \t\n \tthis.context.addEventListener(\"click\", this.onClick.bind(this), {passive: false, capture: true});\n \tthis.context.addEventListener(\"contextmenu\", this.onContextMenu.bind(this), {passive: false, capture: true});\n \t\n \t\n \tvar itemPositions = [];\n\tvar currentPosition = 0;\n\tvar newPosition = 0;\n\tvar itemHeight = 0;\n\t\n \tthis.arrangeStart = function(event) {\n\t\titemHeight = dragEvent.target.getBoundingClientRect().height;\n\t\titemPositions = [];\n\t\tfor (var i = 0; i < elements.length; i++) {\n\t\t\titemPositions.push(elements[i].getBoundingClientRect().top);\n\t\t\tif (elements[i] == dragEvent.target) currentPosition = i;\n\t\t}\n\t\tnewPosition = currentPosition;\n \t}\n \t\n \tthis.arrangeMove = function(event) {\n \t\tdragEvent.target.style.transform = \"translateY(\"+positions.deltaY+\"px)\";\n\t\tnewY = itemPositions[currentPosition]+positions.deltaY;\n\t\tfor (pos in itemPositions) {\n\t\t\tif (itemPositions[pos] < newY+itemHeight/2) newPos = parseFloat(pos);\n\t\t}\n\t\tif (newPos != newPosition) {\n\t\t\tfor (pos in itemPositions) {\n\t\t\t\tif (pos != currentPosition) {\n\t\t\t\t\tif (newPos > currentPosition) { // Moving down.\n\t\t\t\t\t\tif (newPos >= pos && pos > currentPosition) {\n\t\t\t\t\t\t\toldItemDeltaY = itemPositions[pos-1]-itemPositions[pos];\n\t\t\t\t\t\t\telements[pos].style.transform = \"translateY(\"+oldItemDeltaY+\"px)\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telements[pos].style.transform = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (newPos < currentPosition) { // Moving up.\n\t\t\t\t\t\tif (newPos <= pos && pos < currentPosition) {\n\t\t\t\t\t\t\toldItemDeltaY = itemPositions[parseInt(pos)+1]-itemPositions[pos];\n\t\t\t\t\t\t\telements[pos].style.transform = \"translateY(\"+oldItemDeltaY+\"px)\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\telements[pos].style.transform = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\telements[pos].style.transform = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewPosition = newPos;\n\t\t}\n \t}\n \t\n \tthis.arrangeEnd = function(event) {\n \t\tif (newPosition != currentPosition) {\n\t\t\tnewDeltaY = itemPositions[newPosition]-itemPositions[currentPosition];\n\t\t\tdragEvent.target.style.transform = \"translateY(\"+newDeltaY+\"px)\";\n\t\t\t// Run end\n\t\t\tif (this.options.end) this.options.end(event, positions, dragEvent.target, currentPosition, newPosition, elements);\n\t\t} else {\n\t\t\tdragEvent.target.style.transform = null;\n\t\t\tif (this.options.end) this.options.end(event, positions, dragEvent.target);\n\t\t}\n \t}\n }", "function DragRefInternal() {}", "function DragRefInternal() {}", "startDrag(event) {\n event.dataTransfer.setData(\"text\", event.target.id);\n }", "imagesDraggable() {\n this.input.on('drag', function (pointer, gameObject, dragX, dragY) {\n\n gameObject.x = dragX;\n gameObject.y = dragY;\n\n });\n\n }", "_onDragStart() {\n this._isDragged = true;\n }", "function makeDraggable() {\n\n moveable.draggable({\n revert: 'invalid',\n helper:\"clone\",\n containment:\"document\",\n });\n}", "startDragging_() {\n\t\tif (this.ariaDropEffect) {\n\t\t\tthis.targets.forEach(target =>\n\t\t\t\ttarget.setAttribute('aria-dropeffect', this.ariaDropEffect)\n\t\t\t);\n\t\t}\n\t\tsuper.startDragging_();\n\t}", "function onDragStart(e) {\n e.dataTransfer.setData(\"text/plain\", e.target.className);\n\n console.log(e);\n\n // FEATURE A TRABAJAR\n console.log(e.target);\n console.log(e.currentTarget);\n //e.currentTarget.style.position = \"absolute\";\n e.currentTarget.addEventListener(\"mousedown\", function(event){\n event.currentTarget.style.position = \"absolute\";\n event.currentTarget.style.left = event.clientX + \"px\";\n event.currentTarget.style.top = event.clientY + \"px\";}, true)\n \n\n e.currentTarget.style.backgroundColor = \"#DDD\";\n}", "function makeDraggable() {\n\t\t$('.dps-aw-item').draggable({\n\t\t\trevert: \"invalid\",\n\t\t\tappendTo: 'body',\n\t\t\tcontainment: 'window',\n\t\t\tscroll: false,\n\t\t\thelper: 'clone',\n\t\t\tstart: function(event, ui) { jQuery(this).hide(); },\n\t\t\tstop: function(event, ui) { jQuery(this).show(); }\n \t\t});\n \t\tconsole.log(\"test\");\n\t}", "function drag(e) {\n // If grab isn't empty, there's currently an object being dragged, do this\n if (grab !== 0) {\n // Let's find the element on the page whose data-drag=\"\" value matches the value of grab right now\n const element = document.querySelector('[data-drag=\"' + grab + '\"]');\n if (!element) {\n return;\n }\n\n // And to that element, let the new value of `top: ;` be equal to the old top position, plus the difference between the original top position and the current cursor position\n element.style.top =\n parseInt(oldTop) +\n parseInt((e.clientY || e.touches[0].clientY) - startY) +\n 'px';\n\n // And let the new value of `left: ;` be equal to the old left position, plus the difference between the original left position and the current cursor position\n element.style.left =\n parseInt(oldLeft) +\n parseInt((e.clientX || e.touches[0].clientX) - startX) +\n 'px';\n\n // That's all we do for dragging elements\n }\n}", "function Draggable(){this.on('mousedown',this._dragStart,this);this.on('mousemove',this._drag,this);this.on('mouseup',this._dragEnd,this);this.on('globalout',this._dragEnd,this); // this._dropTarget = null;\n // this._draggingTarget = null;\n // this._x = 0;\n // this._y = 0;\n }", "getDraggable() {\n return false;\n }", "function mouseDragged(){\n if(b){\n b.addPoint(mouseX, mouseY);\n }\n \n}", "function drop(event) {\n\tvar offset = event.dataTransfer.getData(\"application/x-moz-node\").split(',');\n\n\tvar mv = document.getElementsByClassName('moveable');\n\tmv[offset[2]].style.left = (event.clientX + parseInt(offset[0], 10)) + 'px';\n\tmv[offset[2]].style.top = (event.clientY + parseInt(offset[1], 10)) + 'px';\n\tevent.preventDefault();\n\treturn false;\n}", "function drag(e) {\n e.dataTransfer.setData('transfer', e.target.id);\n }", "function drag(event) {\n event.dataTransfer.setData(\"artikel_id\", event.srcElement.id);\n\n}", "onMouseDown(e) {\n // start dragging\n this.isMouseDown = true;\n\n // apply specific styles\n this.options.element.classList.add(\"dragged\");\n\n // get our touch/mouse start position\n var mousePosition = this.getMousePosition(e);\n // use our slider direction to determine if we need X or Y value\n this.startPosition = mousePosition[this.direction];\n\n // drag start hook\n this.onDragStarted(mousePosition);\n }", "function anadirEventoDulce(){\r\n $('img').draggable({\r\n containment: '.panel-tablero',\r\n\t\tdroppable: 'img',\r\n\t\trevert: true,\r\n\t\trevertDuration: 500,\r\n\t\tgrid: [100, 100],\r\n\t\tzIndex: 10,\r\n\t\tdrag: constrainCandyMovement\r\n });\r\n $('img').droppable({\r\n\t\tdrop: dejaDulce\r\n\t});\r\n activarEventoDulce();\r\n}", "function dragStart(e) {\n e.dataTransfer.setData('text/plain', e.target.id);\n this.classList.add('hold');\n setTimeout(() => this.classList.add('invisible'), 0);\n}", "attachEvents() {\n // Keep track pointer hold and dragging distance\n this.pointerDown = false;\n this.drag = {\n startX: 0,\n endX: 0,\n startY: 0,\n letItGo: null,\n preventClick: false,\n transformX: 0,\n transformY: 0\n };\n }", "function dragMachine(scope, rect, dummy_rect, machine, machine_x, machine_y, machine_new_x, machine_new_y) {\n\tgetChild(machine, side_view_container).on(\"mousedown\", function(evt) { /** Machine mousedown function */\n this.parent.addChild(this);\n this.offset = {\n x: this.x - evt.stageX,\n y: this.y - evt.stageY\n };\n brewsters_stage.update();\n });\n getChild(machine, side_view_container).on(\"pressmove\", function(evt) { /** Machine pressmove function */\n this.y = evt.stageY + this.offset.y;\n this.x = evt.stageX + this.offset.x;\n machine_current_x = evt.stageX;\n machine_current_y = evt.stageY;\n current_output_unit_rect_dummy.alpha = 1;\n\t\tdetector_rect_dummy.alpha = 1;\n\t\tmaterial_holder_rect_dummy.alpha = 1;\n\t\tpolariser_rect_dummy.alpha = 1;\n\t\temitter_rect_dummy.alpha = 1;\n\t\tbrewsters_stage.update();\n }); \n getChild(machine, side_view_container).on(\"pressup\", function(event) { /** Machine pressup function */\n var hit_obj = rect.globalToLocal(machine_current_x, machine_current_y);\n if ( rect.hitTest(hit_obj.x, hit_obj.y) ) { /** Check whether the machine hit with their corresponding rect */\n\t\t\tgetChild(machine, side_view_container).x = machine_new_x;\n \tgetChild(machine, side_view_container).y = machine_new_y;\n \tgetChild(machine, side_view_container).scaleX = getChild(machine, side_view_container).scaleY = 1;\n \tgetChild(machine, side_view_container).mouseEnabled = false;\n \tif ( machine == \"material_holder\" ) { /** Glass plate loading after drag and drop material holder */\n \t\tloadImages(queue.getResult(\"glass_plate\"), \"glass_plate\", 415, 438, 1, \"\", 0, side_view_container);\n \t\tgetChild(\"glass_plate\", side_view_container).scaleX = 0.04;\n \t}\n \tbrewsters_stage.removeChild(rect);\n \tbrewsters_stage.removeChild(dummy_rect);\n \tdummyRectAlphaSettings();\n \tmachine_drop_count += 1;\n \tif ( machine_drop_count == 5 ) { /** Check whether the all machines are placed */\n\t\t \tscope.control_disable = false; /** Enable all controls */\n\t\t \t/** After arranging all machines, measuring scale, dotted lines etc.. will appeared to the stage and \n\t\t \track, labels etc are disappeared from the stage */\n\t\t \tgetChild(\"dotted_lines\", brewsters_stage).alpha = getChild(\"arrow\", brewsters_stage).alpha = getChild(\"zoom_measures\", brewsters_stage).alpha = 1;\n\t\t\t\tgetChild(\"rack\", side_view_container).alpha = getChild(\"current_output_unit_lbl\", side_view_container).alpha = 0;\n\t\t\t\tgetChild(\"detector_lbl\", side_view_container).alpha = getChild(\"material_holder_lbl\", side_view_container).alpha = 0;\n\t\t\t\tgetChild(\"polariser_lbl\", side_view_container).alpha = getChild(\"emitter_lbl\", side_view_container).alpha = 0;\n\t\t\t\tgetChild(\"glass_plate\", side_view_container).alpha = 1;\n\t\t\t\tsetText(\"current_display\", 69, 521.7, \"0\", \"red\", 0.9, side_view_container);\n\t\t\t\tside_view_container.addChild(switch_on_rect); /** Switch on light circle */\n switch_on_rect.graphics.beginFill(\"red\").drawCircle(33, 516.5, 2);\n getChild(\"current_display\", side_view_container).alpha = 0;\n switch_on_rect.alpha = 0.01;\n calculateBrewstersAngle(scope);/** Brewsters angle and current calculated in this function */\n\t\t \tscope.$apply();\n\t\t \tbrewsters_stage.update();\n\t\t }\n } else {\n getChild(machine, side_view_container).x = machine_x;\n getChild(machine, side_view_container).y = machine_y;\n dummyRectAlphaSettings();\n }\n brewsters_stage.update();\n });\n\tbrewsters_stage.update();\n}", "function handleDragStart(){\n this.isMouseDown = true\n}", "function onDragStart(event) {\n //Store data to record movement\n this.data = event.data;\n this.alpha = 0.5;\n this.dragging = true;\n \n}", "function setEvent() {\r\n $('.MosContainer').draggable({revert : 'invalid', zIndex : '2700', refreshPositions: true, cursor: \"crosshair\"});\r\n $('.MosContainer').draggable({\r\n\tstart : function () {\r\n\t idDrag = $(this).data('id');\r\n\t $(this).css('z-index', '100');\r\n\t},\r\n\tend : function () {\r\n\t $(this).css('z-index', '1');\r\n\t},\r\n });\r\n\r\n $('.grill').droppable({\r\n\t'over' : function (event, ui) {\r\n\t var buffer = 'grill-can-drop';\r\n\t var x = $(this).data('x') - 1;\r\n\t var y = 0;\r\n\r\n\t if (!$(this).data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\tbuffer = 'grill-cant-drop';\r\n\t }\r\n\t for (id in $(this).data('parent').fence) {\r\n\t\tif ($(this).data('parent').fence[id].data('x') >= $(this).data('x') && $(this).data('parent').fence[id].data('x') < (ui.draggable.data('important') + $(this).data('x'))) {\r\n\t\t if ($(this).data('parent').fence[id].data('y') >= $(this).data('y') && $(this).data('parent').fence[id].data('y') < (ui.draggable.data('important') + $(this).data('y'))) {\r\n\t\t\t$(this).data('parent').fence[id].addClass(buffer);\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t},\r\n\t'out' : function () {\r\n\t $('.grill').removeClass('grill-can-drop');\r\n\t $('.grill').removeClass('grill-cant-drop');\r\n\t},\r\n\tdrop : function (event, ui) {\r\n\t if ($(this).data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\t//ui.draggable.data('parent').container.splice(ui.draggable.data('id'), 1);\r\n\t\tui.draggable.data('parent').removeContainer(ui.draggable.data('id'));\r\n\t\t//ui.draggable.css('top', $(this).css('top'));\r\n\t\t//ui.draggable.css('left', $(this).css('left'));\r\n\t\tui.draggable.data('x', $(this).data('x'));\r\n\t\tui.draggable.data('y', $(this).data('y'));\r\n\t\t$(this).data('parent').addContainer(ui.draggable.data('me'));\r\n\r\n\t } else {\r\n\t\t$('.Mosaique').trigger('mosaiqueResize');\r\n\t }\r\n\t $('.grill').removeClass('grill-can-drop');\r\n\t $('.grill').removeClass('grill-cant-drop');\r\n\t $('.Mosaique').trigger('mosaiqueResize');\r\n\t}\r\n });\r\n $('.MosContainer').droppable({\r\n\tdrop : function (event, ui) {\r\n\t if (ui.draggable.data('parent').checkPlace(ui.draggable.data('important'), $(this).data('x'), $(this).data('y'), ui.draggable.data('id'))) {\r\n\t\tvar x = $(this).data('x');\r\n\t\tvar y = $(this).data('y');\r\n\t\tvar id = parseInt($(this).data('id'));\r\n\t\tvar container = ui.draggable.data('parent').container[id];\r\n\r\n\t\tui.draggable.data('x', x);\r\n\t\tui.draggable.data('y', y);\r\n\r\n\t\tui.draggable.data('parent').removeContainer(id);\r\n\t\t/*if (ui.draggable.data('id') > $(this).data('id')) {\r\n\t\t//ui.draggable.data('parent').container[id] = ui.draggable.data('parent').container[ui.draggable.data('id')];\r\n\t\t//ui.draggable.data('parent').container[ui.draggable.data('id')] = container;\r\n\r\n\t\t//$(this).data('id', ui.draggable.data('id'));\r\n\t\t//ui.draggable.data('id', id);\r\n\t\t}*/\r\n\t\t$('.Mosaique').trigger('mosaiqueResize');\r\n\t }\r\n\t}\r\n });\r\n $('.videoClass, .streamClass').on({\r\n\tclick : function (event, ui) {\r\n\t var t = new One_tabs();\r\n\t var tchat = new Tchat(user, new Connect(), $(this).data(\"me\").tchat_id, $(this).data(\"me\").id);\r\n\r\n\t var i = tab.add_tabs(t);\r\n\t t.tab.add_content($(this).data('me').displayContent());\r\n\t t.tab.add_content(tchat.getHtml())\r\n\t t.onglet.icon = $(this).data(\"me\").name;\r\n\t tab.displayAll();\r\n\t tab.action['moins'].html.children('a').trigger('click');\r\n\t tchat.setPos(\"70%\", \"10%\");\r\n\t tchat.setSize(\"80%\", \"28%\");\r\n\t}\r\n });\r\n $('.folderClass').click(function () {\r\n\tgoInFolder($(this).data(\"me\").id);\r\n });\r\n}", "function mouseDragged(e) {\n\t\n\t// Define variables.\n\tvar parent = e.target.parentElement,\n\t\tparentID = parent ? parent.id : '';\t\n\n\t// Move control enabled.\n\tif (board.moving) {\t\t\n\t\tboard.move();\n\t}\n\t\n\t// Only draw/erase if the click/touch is not on the controls or swatches. \n\tif (parentID.toUpperCase() != 'CONTROLSBACKGROUND' && parentID.toUpperCase() != 'SWATCHES') {\n\t\n\t\t// Draw control enabled.\n\t\tif (board.drawing) {\n\t\t\tboard.draw(true);\n\t\t}\n\t\n\t\t// Erase control enabled.\n\t\tif (board.erasing) {\n\t\t\tboard.erase();\t\n\t\t}\n\t\t\n\t}\n\n\t// Prevent default functionality.\n\treturn false;\n\t\n}", "initDragAndDrop() {\n // treat body as drag and drop zone\n this.dndZone = document.getElementById('drag-and-drop');\n this.dndZone.addEventListener('dragover', this.onDragOver);\n this.dndZone.addEventListener(\"dragleave\", this.onDragLeave);\n this.dndZone.addEventListener('drop', this.onDragDrop);\n }", "function makeDraggable() {\n self.$getContainer().dragscrollable({\n dragSelector : \"#drawing-area, canvas.line-canvas\",\n acceptPropagatedEvent : false,\n delegateMode : true,\n preventDefault : true\n });\n }", "function drag(e) {\r\n //draggedItem = e.target; No need for a global variable here\r\n e.dataTransfer.setData(\"text\", e.target.id); // set data in drag and drop event to dragged element's id\r\n dragging = true;\r\n}", "dragMove(event) {\n\t\tif (!this.isDrag) return false;\n\t\tif (this.isDrag) {\n\t\t\t// make cursor change to grabbing\n\t\t\tthis.slider.classList.add('grabbing')\n\t\t\t// Get the mouse or finger X position\n\t\t\tlet clientX = this.getClientX(event);\n\t\t\tlet moved = this.reference - clientX;\n\t\t\tthis.reference = clientX;\n\t\t\tthis.direction = (moved > 0) ? 1 : (moved < 0) ? -1 : 0;\n\t\t\tthis.scroll(this.direction, this.scrollOffset + moved);\n\t\t}\n\n\t}", "function dragEditBox(e) {\n console.log(typeof e);\n console.log(\"I'm draggin!\");\n e.preventDefault();\n e.dataTransfer.setData(\"text\", e.target);\n}", "onDragStart(e, name){\n console.log('now dragging',name);\n e.dataTransfer.setData(\"name\", name);\n }", "onDragOver(e){\n e.preventDefault();\n }", "function widgetDragStart(event) {\n var data = JSON.stringify({\n type: 'widget_drag',\n data: event.target.id\n });\n event.dataTransfer.setData('data', data);\n event.dataTransfer.dropEffect = 'move';\n}", "function drag(ev)\n{\n ev.dataTransfer.setData(\"message\", ev.target.id);\n}", "drag(event) {\n event.dataTransfer.setData(\"divId\", event.target.id);\n console.log(\"----drag----:\");\n }", "function drag (event) {\r\n console.log(\"drag FN start\");\r\n console.log(event);\r\n draggedPic = event.target; // TODO draggedPic\r\n event.dataTransfer.setData(\"text\", event.target.id);\r\n event.dataTransfer.effectAllowed = \"move\";\r\n}", "function debugDraggable(scope) {}", "function file_drag_start(){\n\n\tdrag_flag();\n\n}", "function drag() {\n\t\t$(\"img, a\").on(\"dragstart\", function(event) { event.preventDefault(); });\n\t}", "drop(e) {\r\n let drobaple = this.dragObj.dropable;\r\n if (!this.dragObj.avatar) return;\r\n if (!drobaple) {\r\n this.dragObj.avatar.rollback();\r\n return;\r\n }\r\n let elem = this.dragObj.avatar;\r\n let container = drobaple.parentNode;\r\n let sibling;\r\n if (this.isDropAfter(e)) {\r\n sibling = drobaple.nextSibling;\r\n } else {\r\n sibling = drobaple;\r\n }\r\n container.insertBefore(elem, sibling);\r\n }", "function drag(e) {\n if (active) { //check whether the drag is active\n \n //tell the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be (MDN)\n e.preventDefault();\n \n //set the value of currentX and currentY to the result of the current pointer position with an adjustment from initialX and initialY\n if (e.type === \"touchmove\") {\n currentX = e.touches[0].clientX - initialX;\n currentY = e.touches[0].clientY - initialY;\n } else {\n currentX = e.clientX - initialX;\n currentY = e.clientY - initialY;\n }\n\n //set the new Offset\n xOffset = currentX;\n yOffset = currentY;\n\n //set the new position for our dragged element\n setTranslate(currentX, currentY, dragItem);\n }\n }", "function CdkDragRelease() {}", "function CdkDragRelease() {}", "function dragStart(event) {\n //console.log(event)\n event.dataTransfer.setData(\"choice\", event.target.id);\n event.dataTransfer.setData(\"letter\", event.target.innerHTML);\n}", "function dragstart_handler(e) {\r\n e.dataTransfer.setData(\"text/plain\", e.target.dataset.jsDraggable);\r\n}", "dragStart(e) {\n var dragImage = document.createElement('img');\n dragImage.width = 1;\n e.originalEvent.dataTransfer.setDragImage(dragImage, 0, 0);\n\n e.originalEvent.dataTransfer.effectsAllowed = 'none';\n e.originalEvent.dataTransfer.dropEffect = 'none';\n\n // Response the position of this component e.g.: {top: 5, left: 5}\n const pos = this.$().position();\n\n const clientX = parseInt(e.originalEvent.clientX);\n const clientY = parseInt(e.originalEvent.clientY);\n\n // Calculate distance between mouse pointer and\n // the corner position of this div component.\n const offsetX = clientX - pos.left;\n const offsetY = clientY - pos.top;\n\n this.set('offsetX', offsetX);\n this.set('offsetY', offsetY);\n }", "function dragtaskStart(ev) {\n ev.dataTransfer.setData(\"text/plain\", ev.target.id);\n}", "_onMouseUp () {\n Actions.changeDragging(false);\n }", "function drag(ev) {// credit to https://www.w3schools.com/HTML/html5_draganddrop.asp\n ev.dataTransfer.setData(\"text\", ev.target.id);\n}" ]
[ "0.72728145", "0.71896046", "0.71252334", "0.71252334", "0.7117768", "0.71021706", "0.7099971", "0.7083431", "0.70378935", "0.7032791", "0.7032791", "0.7032663", "0.7023351", "0.69985044", "0.6993123", "0.6983251", "0.6983251", "0.69374585", "0.6927577", "0.6911308", "0.69061327", "0.69061327", "0.68991464", "0.6882869", "0.68478584", "0.68478584", "0.6826384", "0.68210804", "0.6811455", "0.681106", "0.6805998", "0.67843676", "0.67747736", "0.6770525", "0.67521906", "0.67507166", "0.6744762", "0.67426616", "0.6739347", "0.67389685", "0.67162365", "0.6681596", "0.6680647", "0.66586024", "0.66331524", "0.6624194", "0.6621854", "0.6621611", "0.6621611", "0.6610552", "0.66065764", "0.6602647", "0.6602647", "0.66013056", "0.6581706", "0.65815", "0.65813404", "0.65799206", "0.65767044", "0.6564632", "0.6562824", "0.65500253", "0.65496165", "0.6547963", "0.65470916", "0.6537555", "0.6525784", "0.651363", "0.64978707", "0.6494008", "0.64939815", "0.6491827", "0.6478823", "0.6476282", "0.64632124", "0.6455838", "0.6453235", "0.6445188", "0.64409333", "0.64400494", "0.64380217", "0.64268214", "0.64230955", "0.642088", "0.64180857", "0.64171255", "0.64116526", "0.6406599", "0.64010894", "0.639913", "0.6398176", "0.6394955", "0.63880664", "0.63880664", "0.6385955", "0.63763875", "0.6374651", "0.63739634", "0.6369525", "0.63648874" ]
0.7129158
2
Change the test depends on the selection from the dropdown box
function test_ChangeOption(scope) { selected_Test = scope.first_test; current_test=selected_Test; scope.sample_disable=true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_dialog_dropdown_ui_values_in_the_dropdown_should_be_visible_in_edit_mode() {}", "function test_user_should_be_able_to_change_the_order_of_values_of_the_drop_down_list() {}", "fashionselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Fashion').then(option => {\n cy.wrap(option).contains('Fashion');\n option[0].click();\n \n })\n \n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "beautyselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Beauty').then(option => {\n cy.wrap(option).contains('Beauty');\n option[0].click();\n\n })\n \n }", "async selectDropDown(ObjectRepo) {\n //Verifying the drop down text\n await Utility.clickOn(ObjectRepo.Register.typeOfMerchant);\n //Accepting the option\n await Utility.clickOn(ObjectRepo.Register.optionOfMerchant);\n }", "sportsselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Sports').then(option => {\n cy.wrap(option).contains('Sports');\n option[0].click();\n \n })\n \n }", "animalpartIIselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Animals Part II').then(option => {\n cy.wrap(option).contains('Animals Part II');\n option[0].click(); \n })\n\n }", "function test_in_dynamic_dropdown_list_the_default_value_should_not_contain_all_the_value_of_the_list() {}", "function testOptions(){\n\tif (mvOptions.selectLongueur === \"\" || mvOptions.selectDifficulte === \"\") {\n\n\t\tmvOptions.messageError= \"\";\n\n\t\tif (mvOptions.selectLongueur === \"\") {\n\t\t\t\tmvOptions.messageError += \"Veuillez sélectionner la longueur que vous désirez pour l'exercice \\n\";\n\t\t}\n\t\tif (mvOptions.selectDifficulte === \"\") {\n\t\t\tmvOptions.messageError += \"Veuillez sélectionner la difficulté de l'exercice\";\n\t\t}\n\t}\n\telse {\n\t\tverificationDisponibiliteImage(mvOptions.selectLongueur);\n\t}\n}", "cookingselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Cooking').then(option => {\n cy.wrap(option).contains('Cooking');\n option[0].click();\n \n })\n \n }", "function selectionMade()\n{\n\t//Get value currently selected\n\tvar e = document.getElementById(\"selector\");\n\tvar value = e.options[e.selectedIndex].value;\n\n //Enter neccessary function\n\tif(value == \"income\"){ setup(); }\n if(value == \"marijuana\"){ marijuana(); }\n}", "computerprogselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Computer Programming').then(option => {\n cy.wrap(option).contains('Computer Programming');\n option[0].click();\n \n })\n \n }", "organiccultureselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Organic Culture').then(option => {\n cy.wrap(option).contains('Organic Culture');\n option[0].click();\n \n })\n \n }", "misceselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Miscellaneous').then(option => {\n cy.wrap(option).contains('Miscellaneous');\n option[0].click();\n \n })\n \n }", "televisionselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Television/Movies').then(option => {\n cy.wrap(option).contains('Television/Movies');\n option[0].click();\n \n })\n \n }", "musicselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Music').then(option => {\n cy.wrap(option).contains('Music');\n option[0].click();\n \n })\n \n }", "autoshowselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Auto Shows').then(option => {\n cy.wrap(option).contains('Auto Shows');\n option[0].click();\n\n })\n \n }", "function samplechangeOption(scope) {\n selected_sample =scope.select_sample;\n\tsample_number= parseInt(selected_sample)+5;\n\tfor (var i = 5; i < 15; i++) { \n\t\tvar _beaker_name = \"beaker_\" + i;\n\t\tbeaker_name_container = machine_container.getChildByName(_beaker_name);\n\t\tbeaker_name_container.visible=false;\n\t}\n\tmachine_container.getChildByName(\"beaker_\"+sample_number).visible=true; \n\tif(sample_number>=6){\n\t\tsample_selected_flag=true;\n\t\tenable_disable_beaker(false) \n\t\tscope.test_disable=true;\n\t}\n\telse{\n\t\tsample_selected_flag=false;\n\t\tenable_disable_beaker(true) \n\t\tscope.test_disable=false;\n\t}\n}", "function testjeu() {\n if (selectionmanu == choix) {\n alert (\"Vous avez fait le même choix que l'ordinateur\");\n } else {\n alert (\"Vous avez fait un choix différent de l'ordinateur\");\n }\n}", "newmovieselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('New Movie Trailers').then(option => {\n cy.wrap(option).contains('New Movie Trailers');\n option[0].click();\n \n })\n \n }", "function y_select_change(self) {\n $(self).parent().find(\".attr-options\").fadeOut();\n var type = $(self).find(\":selected\").attr('type');\n if(type == \"gene\"){\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeIn();\n var gene = $(self).find(\":selected\").val();\n } else {\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeOut();\n $(self).parent().find(\"#y-data-type-container\").fadeOut();\n }\n }", "entertainmentselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Entertainment').then(option =>{\n cy.wrap(option).contains('Entertainment');\n option[0].click();\n })\n}", "spanishselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Spanish').then(option =>{\n cy.wrap(option).contains('Spanish');\n option[0].click();\n })\n }", "function mySelectEvent() {\n\n var selected = this.selected();\n if (selected === '1') {\n hStep=1;\n ItterNum=1;\n }\n\n if (selected === '2') {\n hStep=0.1;\n ItterNum=10;\n }\n\n if (selected === '3') {\n hStep=0.01;\n ItterNum=100;\n }\n\n}", "celebritiesselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Celebrities').then(option => {\n cy.wrap(option).contains('Celebrities');\n option[0].click();\n\n })\n \n }", "mostviewedselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Most Viewed').then(option => {\n cy.wrap(option).contains('Most Viewed');\n option[0].click();\n \n })\n \n }", "animalvideosselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Animal Videos').then(option => {\n cy.wrap(option).contains('Animal Videos');\n option[0].click();\n })\n }", "function chooseUnit(unitId,ketuaUnit, namaUnit){\n \n $('#input-unit').val(namaUnit);\n $('#input-unit').attr(\"unit-id\", unitId);\n $('#input-unit').attr(\"ketua-unit\", ketuaUnit);\n $('#dropdown-selection-unit').hide();\n $('#btn-simpan').removeAttr('disabled'); \n}", "function selectOption() {\n let selection = document.querySelector('.pveSelect');\n let pveModal = document.querySelector('.pveModal');\n pveModal.style.cssText = 'display: none'; \n first.value = 'X';\n second.value = 'O';\n // determines which parts of code run\n if (selection.value == '2') {\n bestMove();\n GBModule.power('off');\n firstPlayer.winner('X');\n computer.power('off');\n AIGame.switch('on 2');\n playAgainPrompt.playAgain('on');\n } else if (selection.value == '1') {\n GBModule.power('off');\n firstPlayer.winner('X');\n computer.power('off');\n AIGame.switch('on 1');\n AIGame.random();\n playAgainPrompt.playAgain('on');\n\n }\n }", "function select(fc) {\r\n document.getElementById('dropdown').value = fc;\r\n change();\r\n}", "function checkSelect(o) {\n var se = o || $(\"se_unit\");\n var val = se.options[se.selectedIndex].value;\n if (val == \"bid\" || val == \"ask\") {\n $(\"se_type\").disabled = true;\n $(\"se_type2\").disabled = true;\n $(\"se_type3\").disabled = true;\n $(\"set1\").disabled = true;\n $(\"set2\").disabled = true;\n } else {\n $(\"se_type\").disabled = false;\n //check type2\n var type2 = $(\"se_type2\");\n typeSelect(type2, \"type2\");\n type2.disabled = false;\n //check type3\n var type3 = $(\"se_type3\");\n typeSelect(type3, \"type3\");\n type3.disabled = false;\n }\n}", "celebritiesnewselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Celebrity News').then(option => {\n cy.wrap(option).contains('Celebrity News');\n option[0].click();\n\n })\n \n }", "selectTheatre(){\n browser.click('#cmbComplejos')\n browser.click('#cmbComplejos > option:nth-child(2)');\n }", "function Calc(a,b,operator){\r\n\t\telement(by.model(\"first\")).sendKeys(a);\r\n\t\telement(by.model(\"second\")).sendKeys(b);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\telement.all(by.tagName(\"option\")).each(function(item){\r\n\t\t\titem.getAttribute(\"value\").then(function(values){\r\n\t\t\tif(values==operator){\r\n\t\t\titem.click();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t})\r\n\t\t})\r\n\t\t\r\n\t\telement(by.id(\"gobutton\")).click();\r\n\t}", "function clickOptiontoSelect(){\n\n}", "_checkSelectIsAble () {\n return true\n }", "selectCity(){\n browser.click('#cmbCiudades');\n browser.click(`#cmbCiudades > option:nth-child(107)`);\n\n //browser.pause(6000);\n /* \n let annoyingBanner = browser.isExisting('#takeover-close');\n\n if (annoyingBanner == true) {\n browser.click('#takeover-close')\n browser.waitUntil(annoyingBanner == false, 7000)\n browser.click('#cmbCiudades');\n browser.click(`#cmbCiudades > option:nth-child(107)`);\n }\n\n else {\n browser.click('#cmbCiudades');\n browser.click(`#cmbCiudades > option:nth-child(107)`); \n } */\n \n }", "function test_timepicker_should_show_date_when_chosen_once() {}", "function optionChanged(newSampleID) {\n showDemographicInfo(newSampleID); \n drawBarGraph(newSampleID);\n drawBubbleChart(newSampleID); \n\n console.log(\"Dropdown changed to:\", newSampleID);\n}", "function changeTree(dropdown){\n var index = dropdown.selectedIndex;\n var treeName = dropdown[index].text;\n var startPoint = dropdown[index].value;\n\n if (treeName != \"Select navigation tree\"){\n document.getElementById(\"test\").innerHTML = treeName + \" \" + startPoint;\n selectedTree=treeName;\n initialiseTree_kmn();\n }\n}", "function optionChanged(name){\r\n // Testing option change\r\n // console.log(name)\r\n buildCharts(name) \r\n demographicData(name)\r\n}", "function selectChange() {\n changeCouncil($(\"#selectCouncil option:selected\").val());\n}", "function test()\n {\n var selectBoxClassId = 'myselect';\n var sbox = nsmethods.create_select_box({\n\n //iarrays,\n listText : `\n Lithium hydroxide| \t LiOH\n Sodium hydroxide| \t NaOH\n Potassium hydroxide| KOH\n Rubidium hydroxide| RbOH\n Cesium hydroxide|\t CsOH\n Magnesium hydroxide| Mg(OH)2\n Calcium hydroxide| \t Ca(OH)2\n Strontium hydroxide| Sr(OH)2\n Barium hydroxide| \t Ba(OH)2\n Tetramethylammonium hydroxide| \tN(CH3)4OH\n Guanidine| \t HNC(NH2)2\n\n `,\n\n addValueToCaption : true,\n selectBoxClassId,\n sbStyle : `\n .${selectBoxClassId} {\n border-radius : 5px;\n }\n `,\n optionIsChanged_cb : ({\n selectedIndex,\n selectedCaption,\n selectedValue,\n }) => {\n ccc( selectedIndex, selectedCaption, selectedValue );\n },\n });\n document.body.appendChild( sbox.sbox$() ); \n }", "function optionChanged(teamValue){\n \n\n console.log(`Team input from menu : ${teamValue}`);\n drawChart(teamValue);\n\n}", "change() {\n\n const divs = this.parent.querySelectorAll('[class^=\"toggle-select-\"],[class*=\" toggle-select-\"]');\n const selectOption = this.select.options[this.select.selectedIndex];\n let value;\n\n if(this.options.field == 'group')\n {\n value = selectOption.parentNode.label ? selectOption.parentNode.label.toLowerCase() : null;\n } else {\n value = selectOption.value;\n }\n\n // Toggle each div\n divs.forEach(div => {\n const isVisible = div.classList.contains('toggle-select-'+value);\n const inputs = div.querySelectorAll('select,textarea,input:not([type=\"hidden\"],[type=\"checkbox\"],[type=\"radio\"])');\n\n // Toggle the visible div\n isVisible ? div.classList.remove('d-none') : div.classList.add('d-none');\n\n // Toggle the inputs\n if(inputs)\n {\n this.toggleForm(inputs,isVisible);\n }\n\n });\n\n // Run the custom callback\n this.options.onChanged(value);\n\n }", "function testChange () {\n if (rand_Q2.category === \"English\") {\n quotebox.style.color = \"blue\";\n } else if (rand_Q2.category === \"African\") {\n quotebox.style.color = \"red\";\n } else if (rand_Q2.category === \"Greek\") {\n quotebox.style.color = \"green\";\n };\n }", "function checkDept() {\n deptURL = '';\n if (dept === 'Engineering') {\n deptURL = \"eng\";\n $(\"#deptSelect > option\").each(function() {\n if (this.value === dept) {\n this.selected = true\n }\n });\n } else if (dept === 'Manufacturing') {\n deptURL = \"mfg\";\n $(\"#deptSelect > option\").each(function() {\n if (this.value === dept) {\n this.selected = true\n }\n });\n } else if (dept === 'Program Management') {\n deptURL = \"pm\";\n $(\"#deptSelect > option\").each(function() {\n if (this.value === dept) {\n this.selected = true\n }\n });\n };\n }", "function getChoice() {\n var opt = selection.options[selection.selectedIndex].value;\n if (opt == \"spyfall1\"){\n createElemImport1();\n }else if (opt == \"spyfall2\") {\n createElemImport2();\n }\n}", "function serachUnit(event){\n let indikator_id = $(`tr#${row_selected} td:nth-child(2)`).find('.form-control').val();\n let value = event.target.value;\n \n if(!value){\n $('#dropdown-selection-unit').hide();\n }else{\n let count = 0;\n $('#dropdown-selection-unit > li').filter(function(){\n if($(this).text().toLowerCase().indexOf(value) > -1){\n count++;\n }\n\n $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n })\n\n if (count == 0){\n $('#li-unit-tidak-ditemukan').show();\n $('#btn-simpan').attr('disabled', true);\n\n }else{\n $('#li-unit-tidak-ditemukan').hide();\n }\n \n $('#dropdown-selection-unit').show();\n }\n\n}", "function dropDown(event) {\n \tquery(event.target.name, event.target.value);\n }", "function applyTestSettingsChanges()\n{\n if (testSelector.testSelection === true && testSelector.testSwitched === false)\n {\n // This will be changed when it be defined what should do with test settings\n $(\"#testSwitched\").attr(\"test-value\", \"On\").html(\"On\");\n \n TogFormViewer.testFlag = true;\n }\n else if (testSelector.testSelection === false && testSelector.testSwitched === true)\n {\n // This will be changed when it be defined what should do with test settings\n $(\"#testSwitched\").attr(\"test-value\", \"Off\").html(\"Off\");\n \n TogFormViewer.testFlag = false;\n }\n \n testSelector.testSwitched = testSelector.testSelection;\n formioForm.triggerRedraw();\n TogFormViewer.calculate();\n}", "function ShowSelected1()\n{\n var MedidaSuavisante1 = document.getElementById(\"MedidaSuavisante\");\n medida = MedidaSuavisante1.options[MedidaSuavisante1.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n PrecioSuavisante1=3500;\n alert(\"que pasó\");\n }else if (medida == \"Dos litros\" ){\n PrecioSuavisante1=13500;\n }else if (medida== \"Galon\" ){\n PrecioSuavisante1=20500;\n }else if (medida == \"Garrafa\" ){\n PrecioSuavisante1=50000;\n }else if (medida == \"Medio litro\" ){\n PrecioSuavisante1=2500;\n }\n}", "function onChangeDirectSalesTeamSelect() {\n\n var $select = jQuery(this),\n $row = $select.closest('tr'),\n value = $select.val(),\n $ambassadorSelectWrapper = $row.find('.direct-sales-ambassador-select-wrapper');\n\n if (value == 'Ambassador') {\n $ambassadorSelectWrapper.show();\n }\n else {\n $ambassadorSelectWrapper.hide();\n }\n checkOnChanges();\n }", "function getSelectedOption(){\n\n}", "function optionCompareChangedOne(select) {\n //Giving select a variable name\n var sel = select\n\n // Importing data from portionsandweights\n d3.json(\"/portionsandweights\").then((importData) => {\n\n // Searching food names through json\n var portions = importData.data;\n\n //Empty Variable\n var filterSelect = []\n\n // Filter the search\n filterSelect = portions.filter(d => d.food_code == sel);\n\n // Food name of filtered data\n var nameOne = filterSelect[0].main_food_description;\n\n // selecting tag for displaying the name\n var selectFoodName = document.getElementById(\"nameOne\");\n\n // Clear html display name\n selectFoodName.innerHTML = \"\";\n\n // Create html tag showing food name\n selectFoodName.innerHTML = selectFoodName.innerHTML +\n '<h3>' + nameOne + '</h3>';\n\n // selecting tag for dropdown\n var select = document.getElementById(\"selCompareTwo\");\n\n //Clear dropdown\n select.innerHTML = \"\";\n\n // For loop for drop down. referencing id and seq_num of portion size\n for (var i = 0; i < filterSelect.length; i++) {\n select.innerHTML = select.innerHTML +\n '<option value=\"' + filterSelect[i].food_code + ',' + filterSelect[i].seq_num + '\">' + filterSelect[i].portion_description + '</option>';\n\n }\n\n // default selection\n var defaultPortionID = filterSelect[0].food_code\n var defaultPortionSeq_num = filterSelect[0].seq_num\n\n // Adding default selection into selection categfory\n optionCompareWeightChangedOne(defaultPortionID, defaultPortionSeq_num);\n // GAUGE ONE\n gaugeOne(defaultPortionID, defaultPortionSeq_num);\n\n });\n}", "function shirtDesignSelected () {\n\n // Gets the text of the selected option\n const selectedOption = $(\"#design :selected\").text();\n\n // Hides color select if theme is not chosen\n if( selectedOption === \"Select Theme\") {\n $(\"#color\").hide();\n $(\"label[for='color']\").text(\"Please select a theme:\");\n }\n\n // If theme is chosen, color drop down menu is shown and adjusted\n else {\n\n // Shows color options and updates color field\n $(\"#color\").show();\n $(\"label[for='color']\").text(\"Color:\");\n\n // Hides all non-matching elements and resets the current chosen value\n // Depending on the selected theme\n for (let colorOpt = 0; colorOpt < 6; colorOpt++) {\n\n if (colorOpt < 3 && selectedOption === \"Theme - JS Puns\") {\n\n $(\"#color\").val(\"cornflowerblue\");\n $(\"#color\").children().eq(colorOpt).show();\n\n } else if (colorOpt >= 3 && selectedOption != \"Theme - JS Puns\") {\n\n $(\"#color\").val(\"tomato\");\n $(\"#color\").children().eq(colorOpt).show();\n\n } else {\n $(\"#color\").children().eq(colorOpt).hide();\n }\n }\n }\n}", "function optionChanged(){\n init();\n}", "function dd_change(selected_option) {\n $('.selectpicker').selectpicker('render');\n val = selected_option.attr(\"table\").substr(2)\n if (zoo != val) {\n zoo = val;\n set_zoo(selected_option.attr(\"search\"));\n }\n else {\n //updateData(selected_option.attr(\"search\"));\n };\n }", "function optionChanged(newSelection) {\n console.log(newSelection);\n updateTable(newSelection);\n}", "function testSelection(test,variableName,selectColorVarName){\n buttonClick(\"#spotlightBtn\");\n casper.echo(\"---testSelection----\");\n casper.waitUntilVisible('div#spotlight', function () {\n casper.sendKeys('input#typeahead', variableName, {keepFocus: true});\n casper.sendKeys('input#typeahead', casper.page.event.key.Return, {keepFocus: true});\n casper.waitUntilVisible('button#buttonOne', function () {\n test.assertVisible('button#buttonOne', \"Select button correctly visible\");\n buttonClick(\"#buttonOne\");\n this.wait(500, function () {\n var selectColor = [1,0.8,0];\n casper.echo(\"---test3DMeshColor----\");\n test3DMeshColor(test,selectColor,selectColorVarName,0);\n });\n });\n });\n}", "function chkselect(race)\n{\n $value=$('#'+race).val();\n \n if($value==\"Choose Race\" || $value==\"\" )\n {\n setalert(race+'span',$raceerr);\n return false;\n }\n else{\n clearalert(race+'span');\n return true;\n }\n\n\n}", "function changeSavedOption() {\n var ccchoice = $('#demoCCDropdown1').val();\n\n if (ccchoice == '5') {\n $('.change-1-card-stage-1').hide();\n $('.change-1-card-stage-2').show();\n $(\"#demoCCDropdown2\").val(\"5\");\n }\n}", "function dropdownChange(motor, motorName) {\r\n var kawasako = ['Kawasako x56', 'Kawasako x57', 'Kawasako Black Sun', 'Kawasako Cross950', 'Kawasako Monster-21', 'Kawasako 21SF'];\r\n var vixian = ['Vixian XF262', 'Vixian CF300', 'Vixian Lumiere160', 'Vixian MT-1260', 'Vixian MT-V4', 'Vixian SP01'];\r\n\r\n switch (motor.value) {\r\n case 'Kawasako':\r\n motorName.options.length = 0;\r\n for (i = 0; i < kawasako.length; i++) {\r\n createOption(motorName, kawasako[i], kawasako[i]);\r\n }\r\n break;\r\n case 'Vixian':\r\n motorName.options.length = 0;\r\n for (i = 0; i < vixian.length; i++) {\r\n createOption(motorName, vixian[i], vixian[i]);\r\n }\r\n break;\r\n default:\r\n motorName.options.length = 0;\r\n break;\r\n }\r\n}", "function testSelect() {\n const url =\n \"https://opentdb.com/api.php?amount=\" +\n strQuestions +\n \"&category=\" +\n catValue[userCat] +\n \"&difficulty=\" +\n difValue[userDif] +\n \"&type=multiple\";\n\n $.ajax({\n url: url,\n method: \"GET\",\n }).then((res) => {\n quizRes = res.results;\n renderQuiz();\n });\n }", "function materialsubbase() {\n var tpbs = $(\"#materialsbs option:selected\").text();\n if (tpbs == $(\"#materialsbs option:first\").text()) {\n $(\"#subbasematerial\").text(\"Subbase\");\n } else {\n $(\"#subbasematerial\").text(\"Subbase \" + tpbs);\n };\n\n}", "function select(oTest) {\n\t\t\tvar bSelect = oTest !== oSelectedTest;\n\n\t\t\tif (oSelectedTest) {\n\t\t\t\toSelectedTest.element.classList.remove(\"selected\");\n\t\t\t\tif (oSelectedTest.frame) {\n\t\t\t\t\toSelectedTest.frame.style.position = \"fixed\";\n\t\t\t\t\toSelectedTest.frame.style.top = oSelectedTest.top + \"px\";\n\t\t\t\t}\n\t\t\t\toSelectedTest = null;\n\t\t\t}\n\t\t\tif (bSelect) {\n\t\t\t\toSelectedTest = oTest;\n\t\t\t\toTest.element.classList.add(\"selected\");\n\t\t\t\tif (oTest.frame) {\n\t\t\t\t\toTest.frame.style.position = null;\n\t\t\t\t\toTest.frame.style.top = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function select(oTest) {\n\t\t\tvar bSelect = oTest !== oSelectedTest;\n\n\t\t\tif (oSelectedTest) {\n\t\t\t\toSelectedTest.element.classList.remove(\"selected\");\n\t\t\t\tif (oSelectedTest.frame) {\n\t\t\t\t\toSelectedTest.frame.style.position = \"fixed\";\n\t\t\t\t\toSelectedTest.frame.style.top = oSelectedTest.top + \"px\";\n\t\t\t\t}\n\t\t\t\toSelectedTest = null;\n\t\t\t}\n\t\t\tif (bSelect) {\n\t\t\t\toSelectedTest = oTest;\n\t\t\t\toTest.element.classList.add(\"selected\");\n\t\t\t\tif (oTest.frame) {\n\t\t\t\t\toTest.frame.style.position = null;\n\t\t\t\t\toTest.frame.style.top = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function secondSelectorFiller() {\n if (firstSelect.value == \"Land Rover\") {\n optionMaker(roverModels, secondSelect);\n } else {\n optionMaker(toyotaModels, secondSelect);\n }\n }", "select(value) {\n\n \n let selectables = this.object_item(value).selectables;\n let selections = this.object_item(value).selections;\n\n\n\n if (selectables.length > 0) {\n\n selectables.addClass('OPTION-selected')\n .hide(1000);\n\n selections.addClass('OPTION-selected')\n .show(1000);\n\n this.object_item(value).options.prop('selected', true); // active selected original select\n\n // effacer class css SELECT-hover de cursur chaque changement\n this.$newSelect.find(this.elemsSelector).removeClass('SELECT-hover');\n\n\n\n\n if (this.options.keepOrder) { // order de position des item( asec or none)\n var selectionLiLast = this.$selectionUl.find('.OPTION-selected'); //les elements non hide =>show\n if ((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {\n selections.insertAfter(selectionLiLast.last());\n }\n }\n\n\n this.$originalSelect.trigger('change'); // start onchange de element original\n this.afterSelect(value);\n\n }\n }", "function selectFromDropDown(domObject, value, valueToSet) {\n try {\n switch (domObject) {\n case \"id\":\n var dropDownList = document.getElementById(value);\n setSelectedValue(dropDownList, valueToSet);\n console.log(\"status pass : value \" + valueToSet + \" is selected from drop down list\");\n break;\n case \"class\":\n var dropDownList = document.getElementsByClassName(value);\n setSelectedValue(dropDownList, valueToSet);\n console.log(\"status pass : value \" + valueToSet + \" is selected from drop down list\");\n break;\n case \"xpath\":\n var iterator = document.evaluate(value,\n document, null, XPathResult.ANY_TYPE, null);\n try {\n var dropDownList = iterator.iterateNext();\n } catch (e) {\n console.log('Error: Document tree modified during iteration ' + e);\n }\n setSelectedValue(dropDownList, valueToSet);\n console.log(\"status pass : value \" + valueToSet + \" is selected from drop down list\");\n break;\n case \"css\":\n var dropDownList = document.getElementById(value);\n setSelectedValue(dropDownList, valueToSet);\n console.log(\"status pass : value \" + valueToSet + \" is selected from drop down list\");\n break;\n case \"tag\":\n var dropDownList = document.getElementById(value);\n setSelectedValue(dropDownList, valueToSet);\n console.log(\"status pass : value \" + valueToSet + \" is selected from drop down list\");\n break;\n default:\n console.log(\"status fail : domObject type not supported\");\n }\n } catch (err) {\n console.log(\"status fail : \" + err);\n }\n\n function setSelectedValue(dropDownList, valueToSet) {\n for (var i = 0; i < dropDownList.options.length; i++) {\n if (dropDownList.options[i].text.trim() == valueToSet) {\n dropDownList.options[i].selected = true;\n break;\n }\n }\n }\n}", "function onchangeSelect() {\r\n\tvar hideSpec = document.getElementById('specialiteSel');\r\n\twhile (hideSpec.firstChild) {\r\n hideSpec.removeChild(hideSpec.firstChild);\r\n }\r\n\tvar codeEtablObj = document.getElementById('codeEtablissement');\r\n var specialiteObj = document.getElementById('specialite');\r\n var currentCode = codeEtablObj.value;\r\n if (currentCode == \"\") {\r\n specialiteObj.style.display = \"none\"; \r\n } else {\r\n var specialitelSelObj = document.getElementById('specialiteSel');\r\n \r\n var hospLen = tabHospitalisations.length; \r\n var selLen = specialitelSelObj.options.length;\r\n specialitelSelObj.options[0] = new Option (\"Choisissez specialite\");\r\n\t\tselLen ++;\r\n\t\tfor (var i=0; i < hospLen; i++) {\r\n var t = tabHospitalisations[i];\r\n\t\t\tvar e = tabEtablissements;\t\r\n\t\t\tif (currentCode == t.codeEtablissement && specialitelSelObj.options[selLen-1].value != t.specialite){\r\n\t\t\t\tspecialitelSelObj.options[selLen ++] = new Option(t.specialite);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t }\r\n specialiteObj.style.display = \"block\"; \r\n }\r\n}", "function optionChanged() {\n // Obtain selected sample from dropdown\n var selectedSample = Plotly.d3.select('select').property('value'); \n console.log('selectsamle_value : ' , selectedSample)\n // Call plot function with the new sample value\n fillOutTable(selectedSample);\n buildCharts(selectedSample);\n buildGauges(selectedSample);\n}", "function toggleSelect(item) {\n switch (item.value) {\n case 'Just Java':\n document.getElementById('dynLbl').innerHTML = \" Endless Cup $2.00\";\n break;\n case 'Cafe au Lait':\n document.getElementById('dynLbl').innerHTML = \" Single $2.00 Double $3.00\";\n break;\n case 'Iced Cappucino':\n document.getElementById('dynLbl').innerHTML = \" Single $4.75 Double $5.75\";\n break;\n case 'Mocha Latte':\n document.getElementById('dynLbl').innerHTML = \" Double $3.00\";\n break;\n case 'Lite Latte':\n document.getElementById('dynLbl').innerHTML = \" Single $2.00\";\n break;\n }\n}", "function selected(value) { \r\n extraQuestion=value;\r\n}", "function Changed()\n{\n \n\n if ($('#courseSelection option:selected').val() != 0) {\n var selected = $('#courseSelection option:selected').val();\n var decription = $('#courseSelection option:selected').text();\n\n alert('You Selected : ' + selected + '-' + ' ' + decription);\n }\n else\n alert('you must select a course');\n}", "function selectbox() {\n var sim = document.getElementById(\"simple\");\n alert(\"the user is from: \" + sim.options[sim.selectedIndex].value);\n}", "function ShowSelected5()\n{\n var MedidaJabonManos = document.getElementById(\"MedidaJabonManos\");\n medida = MedidaJabonManos.options[MedidaJabonManos.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n Precio=3500;\n alert(\"KDNDJ\");\n }else if (medida == \"Medio litro\" ){\n Precio=2500;\n }\n}", "function testSelect () {\r\n\r\nvar selectVal = document.getElementById('services').value;\r\nevent.preventDefault();\r\n\r\n\tif (selectVal === '- Select Service -') {\r\n\t\talert('must select');\r\n\t\t//document.getElementById('results').innerHTML = 'Please Select A Service';\r\n\t\tdocument.getElementById('services').focus();\r\n\t} else {\r\n\r\n\t}\r\n}", "mostwatchedselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Most Watched Videos').then(option => {\n cy.wrap(option).contains('Most Watched Videos');\n option[0].click();\n \n })\n \n }", "function getSelectedValue(e) {\n const value = $(this)\n .children(\"option:selected\")\n .val();\n\n if (e.target.id === \"season\") {\n season = value;\n } else {\n teamName = value.toLowerCase().replace(/\\s/g, \"-\");\n console.log(teamName);\n }\n\n getTeamStat(parseInt(season, 10), teamName);\n }", "function BtnConsulta() {\n\n var filtro;\n var ValidateSelect = $(\"#Select_Option\").val();\n var opcion;\n\n if (ValidateSelect == \"P\") {\n filtro = \"P\";\n transacionAjax_Paises(\"R_ead\", filtro);\n }\n else {\n filtro = \"C\";\n transacionAjax_Paises(\"R_ead\", filtro);\n }\n\n}", "function optionChanged(newsampleID)\n{\n console.log(\"Dropdown changed to:\", newsampleID);\n \n DrawBarGraph(newsampleID);\n DrawBubbleChart(newsampleID);\n ShowMetaData(newsampleID);\n}", "function setSelectedIndex(s, valsearch) {\r\n\r\n document.getElementById(\"currentAniType\").value = currentAniType;\r\n\r\n // Loop through all the items in drop down list\r\n for (i = 0; i< s.options.length; i++) { \r\n\r\n if (s.options[i].value == valsearch) {\r\n s.options[i].selected = true; // Item is found. Set its property and exit\r\n break;\r\n }\r\n }\r\n\r\n return;\r\n}", "function getUnitTestStatusFilter()\n{\n return document.getElementById('unit-test-status-selection').value;\n}", "onchange() {}", "function tipoatributom()\n{\n var selecvalue = tipo_atributo.options[tipo_atributo.selectedIndex].value;\n //var selectext = catalogo.options[catalogo.selectedIndex].text;\n if (selecvalue=='Especiales') {\n $(\"#boton_tipo_atributo\").show();\n $(\"#div_boton\").hide();\n\n \n }else{\n $(\"#boton_tipo_atributo\").hide();\n $(\"#div_boton\").hide();\n }\n \n}", "function which() {\n if ($unit.options[$unit.selectedIndex].value === \"kg\") {\n $kginput.style.display = \"block\";\n $lbsinput.style.display = \"none\";\n $output.style.visibility = \"hidden\"; // clearing output onchange\n } else {\n $lbsinput.style.display = \"block\";\n $kginput.style.display = \"none\";\n $output.style.visibility = \"hidden\";\n }\n}", "function select() {\n\t\tif (chosenCategory === randomWord[0]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation One\";\n\t\t} else if (chosenCategory === randomWord[1]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation Two\";\n\t\t}\n\t}", "function selectTests() {\n\tvar midTest;\n\tvar c2sTest;\n\tvar s2cTest;\n\tvar sfwTest;\n\tvar metaTest;\n\n\t// if ($('#C2S').is(':checked')) {\n\t// c2sTest = TESTTYPE_C2S;\n\t// clientState.requestedC2STest = true;\n\t// }\n\t// if ($('#MID').is(':checked')) {\n\t// midTest = TESTTYPE_MID;\n\t// clientState.requestedMIDTest = true;\n\t// }\n\t// if ($('#SFW').is(':checked')) {\n\t// sfwTest = TESTTYPE_SFW;\n\t// clientState.requestedSFWTest = true;\n\t// }\n\t// if ($('#S2C').is(':checked')) {\n\t// s2cTest = TESTTYPE_S2C;\n\t// clientState.requestedsS2CTest = true;\n\t// }\n\t// if ($('#META').is(':checked')) {\n\t// metaTest = TESTTYPE_META;\n\t// clientState.requestedMetaTest = true;\n\t// }\n\n\t//force start of c2s, s2c, and meta tests. Function could be changed to selectable tests in a later version.\n\tc2sTest = TESTTYPE_C2S;\n\tclientState.requestedC2STest = true;\n\ts2cTest = TESTTYPE_S2C;\n\tclientState.requestedsS2CTest = true;\n\tmetaTest = TESTTYPE_META;\n\tclientState.requestedMetaTest = true;\n\n\treturn midTest | c2sTest | s2cTest | sfwTest | TESTTYPE_STATUS | metaTest;\n}", "function ShowSelected9()\n{\n var MedidaJabonRey = document.getElementById(\"MedidaJabonRey\");\n medida = MedidaJabonRey.options[MedidaJabonRey.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n PrecioJabonRey=3500;\n\n }else if (medida == \"Medio litro\" ){\n PrecioJabonRey=2500;\n }\n}", "function selectchange(x,res,selectedval,targetdiv)\n {\n \n }", "function select(){\n\n\t\tcurrent = $filter.find('option:selected')[0].text.toLowerCase();\n\n\t\tmv.filter( current, '*' );\n\t}", "function testSelect2Callback (state) {\n\treturn state.text\n}", "selectProductOption(product, choice) {\n\n switch(product) {\n case 'Bow Ties':\n cy.get(bowTiesOptions)\n .find('option')\n .then($els => $els.get(choice).setAttribute('selected', \"selected\"))\n .parent()\n .trigger('change')\n break;\n case 'Dry Martini':\n cy.get(dryMartiniOptions)\n .find('option')\n .then($els => $els.get(choice).setAttribute('selected', \"selected\"))\n .parent()\n .trigger('change')\n break;\n case 'Fireworks':\n cy.get(fireworksOptions)\n .find('option')\n .then($els => $els.get(choice).setAttribute('selected', \"selected\"))\n .parent()\n .trigger('change')\n break;\n default:\n cy.log('not known')\n }\n return this;\n }", "function myColor() {\r\n let mySelect = document.getElementById(\"colorSelect\");\r\n let myValue = mySelect.selectedIndex;\r\n mySelect.options[myValue].value;\r\n\r\n if(wh_stepCount == 0 && bl_stepCount == 0){\r\n if (myValue == 0 && select_count == 0) {\r\n isBlack = true;\r\n select_count++;\r\n h2.innerHTML = \"You Have Black Stone\";\r\n }\r\n else if (myValue == 1 && select_count == 0) {\r\n isBlack = false;\r\n select_count++;\r\n h2.innerHTML = \"You Have White Stone\";\r\n }\r\n }\r\n else{\r\n alert(\"The Game Already Started!\")\r\n }\r\n}", "showEntropyOrGiniSelection() {\n return !this.state.renderTree ? (\n <div>\n <select\n value={this.state.isGini ? \"gini\" : \"entropy\"}\n onChange={e => this.setState({ isGini: e.target.value === \"gini\" })}\n >\n <option value=\"gini\">Gini</option>\n <option value=\"entropy\">Entropy</option>\n </select>\n </div>\n ) : null;\n }", "function EnableTShirtDesignsAndColorsInteraction_ExceedingExpectations() {\n const $designSelect = $(\"#design\");\n const $colorSelect = $(\"#color\");\n const $colorSelectLabel = $(\"label[for='color']\");\n\n // Add a placeholder option\n const $placeholderOption = $('<option>Please select a T-shirt theme</option>');\n $colorSelect.prepend($placeholderOption);\n\n function MakeColorsVisibleByDesign(design) {\n let options = $colorSelect.children();\n\n /* Toggle visibility and select the first entry when selecting\n an option that is visible. */\n if (design === \"Select Theme\") { \n $colorSelect.hide(); \n $colorSelectLabel.hide();\n }\n\n for (let i = 0; i < options.length; i++ ) {\n let $option = $(options[i]);\n\n $option.toggle($option.data(\"belongstoshirt\") === design);\n }\n\n if (design !== \"Select Theme\") { \n $colorSelect.show(); \n $colorSelectLabel.show();\n $colorSelect.val($colorSelect.find(\"option:visible\")[0].value);\n }\n }\n\n // Connect & initialize interaction\n $designSelect.on(\"change\", () => { MakeColorsVisibleByDesign($designSelect.val()); });\n MakeColorsVisibleByDesign($designSelect.val());\n }", "function SelectionChange() { }" ]
[ "0.67946875", "0.6755283", "0.6581949", "0.65648925", "0.65648925", "0.6526555", "0.6436549", "0.6434502", "0.6424533", "0.6420319", "0.6415478", "0.6392609", "0.63565344", "0.63557845", "0.635174", "0.63439506", "0.62650853", "0.6246674", "0.6242976", "0.6237628", "0.62326056", "0.6212851", "0.61710423", "0.61591643", "0.6144029", "0.6097629", "0.60825753", "0.6063046", "0.6061107", "0.60603034", "0.60518974", "0.6049291", "0.6040455", "0.6024593", "0.60136026", "0.5988179", "0.5960926", "0.5957811", "0.5917644", "0.5913579", "0.58999383", "0.5895355", "0.5880275", "0.58779025", "0.58692557", "0.5861913", "0.58542967", "0.5845034", "0.5837786", "0.58340955", "0.582457", "0.5823037", "0.58164245", "0.5816004", "0.58091414", "0.5791174", "0.57860625", "0.5781228", "0.5780495", "0.57804596", "0.5773323", "0.57673854", "0.57485795", "0.57380503", "0.57355887", "0.5732203", "0.5727491", "0.572327", "0.572327", "0.5721836", "0.5721108", "0.5721035", "0.57133704", "0.5709036", "0.5696228", "0.5685819", "0.5683219", "0.5679838", "0.5677969", "0.56616306", "0.56582206", "0.5656", "0.5646393", "0.5645947", "0.56406534", "0.5637059", "0.5635167", "0.5631903", "0.5630722", "0.5629682", "0.56295276", "0.56288683", "0.56240577", "0.56236374", "0.5623099", "0.56207734", "0.56185794", "0.56174165", "0.56149334", "0.56139064" ]
0.7133847
0
Change the juice sample on the selection from the dropdown box
function samplechangeOption(scope) { selected_sample =scope.select_sample; sample_number= parseInt(selected_sample)+5; for (var i = 5; i < 15; i++) { var _beaker_name = "beaker_" + i; beaker_name_container = machine_container.getChildByName(_beaker_name); beaker_name_container.visible=false; } machine_container.getChildByName("beaker_"+sample_number).visible=true; if(sample_number>=6){ sample_selected_flag=true; enable_disable_beaker(false) scope.test_disable=true; } else{ sample_selected_flag=false; enable_disable_beaker(true) scope.test_disable=false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optionChanged() {\n // Obtain selected sample from dropdown\n var selectedSample = Plotly.d3.select('select').property('value'); \n console.log('selectsamle_value : ' , selectedSample)\n // Call plot function with the new sample value\n fillOutTable(selectedSample);\n buildCharts(selectedSample);\n buildGauges(selectedSample);\n}", "function optionChanged(sample) {\n // Pull metadata and sample, then filter by dropdown selection\n d3.json(\"static/Data/samples.json\").then((data)=> {\n var metadata = data.metadata.filter(meta => meta.id.toString() === sample)[0];\n var samples = data.samples.filter(s => s.id.toString() === sample)[0];\n var wfreq=metadata.wfreq\n // Feed data into display functions\n barplot(samples);\n bubbleplot(samples);\n table(metadata);\n gauge(wfreq);\n });\n}", "function optionChanged(sample) {\n // The parameter being passed in this function is new sample id from dropdown menu\n\n // Update metadata with newly selected sample USE ON CHANGE\n buildMetadata(sample);\n // Update charts with newly selected sample\n buildCharts(sample);\n}", "function optionChanged(newSample) {\n\n // Display metadata Fucntion and Change\n metadata(newSample);\n\n // Display otu Function and Change \n otu(newSample);\n guage(newSample);\n}", "function optionChanged(newSampleID) {\n showDemographicInfo(newSampleID); \n drawBarGraph(newSampleID);\n drawBubbleChart(newSampleID); \n\n console.log(\"Dropdown changed to:\", newSampleID);\n}", "function optionChanged(newsampleID)\n{\n console.log(\"Dropdown changed to:\", newsampleID);\n \n DrawBarGraph(newsampleID);\n DrawBubbleChart(newsampleID);\n ShowMetaData(newsampleID);\n}", "function onchange_sample(){\n\tvar fn = \"onchange_sample \";\n\tvar szVal = selectGetSelVal(getElementById2(\"selectSample\"));\n\tjslog (JSLOG_JSU, fn + \"szVal=\" + szVal);\n\tfor (var i=1; i<=SAMPLE_MAX_NUM; i++){\n\t\tvar bShow = (szVal == SAMPLE_ALL || szVal == i+\"\");\n\t\tvar elTr = getElementById2(\"tr_sample_\" + i, false);\n\t\tif (elTr){\n\t\t\tjslog (JSLOG_JSU, fn + \"tr i=\" + i + \" bShow=\" + bShow);\n\t\t\telTr.style.display = (bShow) ? \"\" : \"none\";\n\t\t\telTr.style.visibility = bShow;\n\t\t}\n\t}\n}", "function chooseStimulus1() {makeChoice(selection=1)}", "function test_ChangeOption(scope) {\n selected_Test = scope.first_test;\n\tcurrent_test=selected_Test;\n\tscope.sample_disable=true;\n}", "function mySelectEvent() {\n\n var selected = this.selected();\n if (selected === '1') {\n hStep=1;\n ItterNum=1;\n }\n\n if (selected === '2') {\n hStep=0.1;\n ItterNum=10;\n }\n\n if (selected === '3') {\n hStep=0.01;\n ItterNum=100;\n }\n\n}", "function optionChanged(sample){\r\n \r\n buildplot(sample);\r\n \r\n \r\n }", "function optionChanged(sample_id){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Select the input value from the dropdown\n var sample_id = d3.select(\"#selDataset\").node().value;\n console.log(sample_id);\n\n // d3.select(\"#selDataset\").node().value = \"\";\n // Call the plot and demo functions with the new sample_id\n buildPlots(sample_id);\n buildDemo(sample_id);\n }", "function optionChanged(sample) {\n console.log(sample)\n getPlots(sample);\n getInfo(sample);\n}", "function optionChanged(newSample) {\n // Fetch new data each time a new sample is selected\n console.log(\"MOAR SCIENCE\")\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "function dropDown(sampleData){\n\tsampleData['names'].forEach(name=>{\n\t\tvar newItem = d3.select('#selDataset').append('option');\n\t\tnewItem.text(name);\n\t\tnewItem.property('value', name)\n\t});\n}", "function optionChanged (sample) {\ndemographic_panel(sample);\ncreate_charts(sample);\n}", "function selectvillain(selectedvillain) {\n if (selectedvillain == \"darthvader\") {\n actualvillain = darthvader;\n } else {\n if (selectedvillain == \"bobafett\") {\n actualvillain = bobafett;\n } else {\n if (selectedvillain == \"kyloren\") {\n actualvillain = kyloren\n }\n }\n }\n villainhpbarselect.setAttribute(\"aria-valuenow\", actualvillain.hp);\n villainhpbarselect.innerHTML = actualvillain.hp;\n}", "function ShowSelected3()\n{\n var MedidaAmbientador = document.getElementById(\"MedidaAmbientador\");\n medida = MedidaAmbientador.options[MedidaAmbientador.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n Precio=3500;\n \n }else if (medida == \"Dos litros\" ){\n Precio=13500;\n }else if (medida== \"Galon\" ){\n Precio=20500;\n }else if (medida == \"Garrafa\" ){\n Precio=50000;\n }else if (medida == \"Medio litro\" ){\n Precio=2500;\n }\n}", "function optionChanged(newSample) {\n var dropDownMenu = d3.select('#selDataset');\n var subject = dropDownMenu.property('value');\n createBarChart(subject);\n createBubbleChart(subject);\n createDemographics(subject);\n createGaugeChart(subject);\n}", "function select() {\n\t\tif (chosenCategory === randomWord[0]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation One\";\n\t\t} else if (chosenCategory === randomWord[1]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation Two\";\n\t\t}\n\t}", "function optionChanged(newSampleID)\n\n { \n //Log new selection\n console.log(`User selected ${newSampleID}`) ;\n\n //Run functions to display data\n FillMetaData(newSampleID) ;\n\n DrawBarGraph(newSampleID) ;\n\n DrawBubbleChart(newSampleID) ;\n\n }", "function optionChanged(newSampleId) {\n // console.log(`User selected ${newSampleId}`);\n\n DrawBargraph(newSampleId);\n DrawBubblechart(newSampleId);\n ShowMetadata(newSampleId);\n}", "function optionChanged(newSample){\n getData(newSample);\n getDemoData(newSample);\n\n}", "function optionChanged(id) {\n plot_samples(id);\n get_demographics(id);\n}", "function ShowSelected9()\n{\n var MedidaJabonRey = document.getElementById(\"MedidaJabonRey\");\n medida = MedidaJabonRey.options[MedidaJabonRey.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n PrecioJabonRey=3500;\n\n }else if (medida == \"Medio litro\" ){\n PrecioJabonRey=2500;\n }\n}", "function optionChanged (newsample){\n createchart(newsample) \n metadata(newsample)\n}", "function selectMeat(meat) {\n if($scope.model.selectedBurger.meat) {\n $scope.model.selectedBurger.meat.selected = false;\n }\n $scope.model.selectedBurger.meat = meat;\n $scope.model.selectedBurger.meat.selected = true;\n selectStep('cheese');\n }", "function optionChanged(newSample){\n //alert(newSample);\n chartBuilder(newSample);\n metadataBuilder(newSample);\n }", "function optionChanged(samplechoice) {\n\n buildCharts(samplechoice);\n meta(samplechoice);\n\n}", "function setInitalClimateVariable() {\n $('.climate-variables :selected').val('rh_wt');\n $(\"select\").material_select(); \n }", "function which() {\n if ($unit.options[$unit.selectedIndex].value === \"kg\") {\n $kginput.style.display = \"block\";\n $lbsinput.style.display = \"none\";\n $output.style.visibility = \"hidden\"; // clearing output onchange\n } else {\n $lbsinput.style.display = \"block\";\n $kginput.style.display = \"none\";\n $output.style.visibility = \"hidden\";\n }\n}", "function init() {\n var selector = d3.select(\"#selDataset\");\n d3.json(\"samples.json\").then((data) => {\n var Samp_ID = data.names;\n Samp_ID.forEach((sample) => {\n selector.append(\"option\").text(sample).property(\"value\");\n });\n\n var original = Samp_ID[0];\n charts(original);\n metadata(original);\n \n });\n}", "function optionChanged(changedSample){\n demographicInfo(changedSample);\n barChart(changedSample);\n bubbleChart(changedSample);\n}", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function Changed(newSample) {\n// Fetch new data each time a new sample is selected\nbuildPlot(newSample);\noptionChanged(newSample);\n}", "function optionChanged(newSample){\n buildCharts(newSample);\n MetaData(newSample);\n}", "function addKitSelector(rootDiv, voice) {\n var kitSel = document.createElement('select');\n kitSel.setAttribute('style', 'width: 100px; height: 22px; font-size: 12px');\n var i, j, N, M, e;\n for (i = 0, N = re.kits.length; i < N; ++i) {\n e = document.createElement('option');\n e.setAttribute('value', re.kits[i].name);\n e.innerText = re.kits[i].name;\n kitSel.insertAdjacentElement('beforeend', e);\n }\n rootDiv.insertAdjacentElement('beforeend', kitSel);\n\n kitSel.onchange = function (e) {\n voice.voice.kit = kitSel.value;\n voice.voice.drum = drumSel.value;\n };\n\n kitSel.value = voice.voice.kit;\n\n // The kits are all already loaded, so the loadSampleSet\n // will trigger immediately. \n //\n // TODO: Also, we're assuming here that the set of drum \n // names is the same for all the kits. This is only temporarily \n // true and the code will have to be generalized for arbitrary \n // kit collections.\n var drumSel = document.createElement('select');\n drumSel.setAttribute('style', 'width: 100px; height: 22px; font-size: 12px');\n SampleManager.loadSampleSet(re.kits[0].name, re.kits[0].url, {\n didFinishLoadingSampleSet: function (name, sset) {\n var drums = Object.keys(sset);\n var e, i, N;\n for (i = 0, N = drums.length; i < N; ++i) {\n e = document.createElement('option');\n e.setAttribute('value', drums[i]);\n e.innerText = drums[i];\n drumSel.insertAdjacentElement('beforeend', e);\n }\n\n rootDiv.insertAdjacentElement('beforeend', drumSel);\n\n drumSel.onchange = function (e) {\n voice.voice.drum = drumSel.value;\n };\n\n kitSel.value = voice.voice.kit;\n drumSel.value = voice.voice.drum;\n }\n });\n }", "function optionCompareWeightChangedOne(id, select) {\n\n // Nutrient fact initiated\n nutrient_fact_one(id, select);\n // Radar Graph initiated\n macroRadar();\n // Micro Radar Graph initiated\n microRadar();\n // GAUGE ONE\n gaugeOne(id, select)\n // Macro Grouped Bar Chart initiated\n macroGroupBar();\n // Micro Grouped Bar Chart initiated\n microGroupBar();\n}", "function dropDown() {\n // Use list of sample names to render the select options\n Plotly.d3.json(\"/names\", function (error, response) {\n if (error) return console.warn(error);\n\n let selection = document.getElementById(\"select-dataset\");\n for (let i = 0; i < response.length; i++) {\n let selectedOption = document.createElement(\"option\");\n selectedOption.text = response[i];\n selectedOption.value = response[i];\n selection.appendChild(selectedOption);\n }\n getData(response[0], createCharts);\n });\n}", "function optionChanged(id) {\n getSamplesData(id);\n getSamplesInfo(id);\n}", "function ShowSelected5()\n{\n var MedidaJabonManos = document.getElementById(\"MedidaJabonManos\");\n medida = MedidaJabonManos.options[MedidaJabonManos.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n Precio=3500;\n alert(\"KDNDJ\");\n }else if (medida == \"Medio litro\" ){\n Precio=2500;\n }\n}", "function dropDown() {\n // data route\n var url = \"/names\";\n\n var list = Plotly.d3.select(\"#sampleList\").append('select').attr(\"onchange\", \"getValue()\")\n\n Plotly.d3.json(url, function (error, namesList) {\n if (error) return console.warn(error)\n\n list.selectAll('option')\n .data(namesList)\n .enter()\n .append('option')\n .text(function (d) { return d; });\n });\n}", "function dropDown() {\n // data route\n var url = \"/names\";\n\n var list = Plotly.d3.select(\"#sampleList\").append('select').attr(\"onchange\", \"getValue()\")\n\n Plotly.d3.json(url, function (error, namesList) {\n if (error) return console.warn(error)\n\n list.selectAll('option')\n .data(namesList)\n .enter()\n .append('option')\n .text(function (d) { return d; });\n });\n}", "function filterSamples(i) {\n\n // return the id that is equal to the dropdown value option\n return i.id == dName\n }", "function optionChanged(sample) {\n createChart(sample);\n createMetaData(sample);\n // createGauge(sample)\n}", "function optionChanged(NextSample){\n ChartInfo(NextSample);\n AllData(NextSample);\n\n }", "function optionChanged(newsample) {\n buildPlots(newsample);\n buildMetadataInfo(newsample);\n}", "function chooseData(v) {\n\n console.log(v);\n\n\n // ******* TODO: PART I *******\n // Change the selected data when a user selects a different\n // menu item from the drop down.\n createBarChart(v);\n}", "function optionChanged(newSample){\n console.log(newSample);\n buildMetadata(newSample);\n //buildCharts(newSample);\n}", "function optionChanged(newSample) {\n getData(newSample, createCharts);\n}", "function chooseFruit() {\n $(\"#fruit1\").attr('src', 'images/' + fruits[Math.round(8*Math.random())] + '.png');\n }", "function selectHRU(){\n\t\tvar perc = $(\"#hru_percent\").val();\n\t\tvar perc_temp = 0;\n\t\t\n\t\tif(perc == \"\") return;\n\t\tif(parseFloat(perc) == 0) return;\n\n\t\t$(\"#hru_info_temp_select > option\").each(function() {\n\t\t\t$(this).attr('selected', false);\n\t\t\tif(parseFloat(perc_temp) < parseFloat(perc)) {\n\t\t\t\tperc_temp = parseFloat(perc_temp) + parseFloat($(this).attr('percent'));\n\t\t\t\t$(this).attr('selected', true);\n\t\t\t}\n\t\t});\n\t\t\n\t\t$(\"#hru_info_temp_select\").trigger(\"chosen:updated\");\n\t}", "function optionChanged(value){\n sampleMetaData(value);\n pieChart(value);\n bubbleChart(value);\n gaugechart(value);\n}", "function optionChanged(newsample){readFile(newsample)}", "function setSolution() {\n $('#solution').change(function () {\n choosen_solution = $('#solution').val();\n if(choosen_solution =='Coumarin343'){\n document.getElementById('scale_image').src = \"images/scale1.png\";\n document.getElementById('flask').style.filter = 'saturate(100%)';\n document.getElementById('beaker').style.filter= 'saturate(100%)';\n document.getElementById('cuvette').style.filter= 'saturate(100%)';\n document.getElementById('scale').style.visibility = 'visible';\n document.getElementById('slider').value=0;\n } \n else if(choosen_solution =='Coumarin6'){\n document.getElementById('scale_image').src = \"images/scale2.png\";\n document.getElementById('flask').style.filter = 'saturate(400%)';\n document.getElementById('beaker').style.filter= 'saturate(400%)';\n document.getElementById('cuvette').style.filter= 'saturate(400%)'; \n document.getElementById('scale').style.visibility = 'visible';\n document.getElementById('slider').value=0; \n }\n else if(choosen_solution == '1:1mixture') {\n document.getElementById('flask').style.filter = 'saturate(400%)';\n document.getElementById('beaker').style.filter= 'saturate(400%)';\n document.getElementById('cuvette').style.filter= 'saturate(400%)';\n document.getElementById('scale').style.visibility = 'hidden';\n document.getElementById('slider').value=0;\n } \n });\n}", "function ShowSelected1()\n{\n var MedidaSuavisante1 = document.getElementById(\"MedidaSuavisante\");\n medida = MedidaSuavisante1.options[MedidaSuavisante1.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n PrecioSuavisante1=3500;\n alert(\"que pasó\");\n }else if (medida == \"Dos litros\" ){\n PrecioSuavisante1=13500;\n }else if (medida== \"Galon\" ){\n PrecioSuavisante1=20500;\n }else if (medida == \"Garrafa\" ){\n PrecioSuavisante1=50000;\n }else if (medida == \"Medio litro\" ){\n PrecioSuavisante1=2500;\n }\n}", "function selectCheese(cheese) {\n if($scope.model.selectedBurger.cheese) {\n $scope.model.selectedBurger.cheese.selected = false;\n }\n if(cheese !== undefined) {\n $scope.model.selectedBurger.cheese = cheese;\n $scope.model.selectedBurger.cheese.selected = true;\n }\n\n selectStep('salads');\n }", "function ShowSelected7()\n{\n var MedidaJabonRopaColor = document.getElementById(\"MedidaJabonRopaColor\");\n medida = MedidaJabonRopaColor.options[MedidaJabonRopaColor.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n PrecioJabonRopaColor=3500;\n \n }else if (medida == \"Dos litros\" ){\n PrecioJabonRopaColor=13500;\n\n }else if (medida == \"Medio litro\" ){\n PrecioJabonRopaColor=2500;\n }\n}", "function optionChanged(newSample) { \n // Clear all charts & data\n clearAll();\n // Fetch new data each time a new sample is selected\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "function selectBun(bun) {\n\n if($scope.model.selectedBurger.bun) {\n $scope.model.selectedBurger.bun.selected = false;\n }\n\n $scope.model.selectedBurger.bun = bun;\n $scope.model.selectedBurger.bun.selected = true;\n\n selectStep('meat');\n }", "function factorconfia() {\n var factorc = $(\"#factorc option:selected\").val();\n $(\"#desvest\").val(factorc);\n}", "function selectedBunny() {\n\n $('.petImage').src = \"/assets/bunny.jpg\";\n pet_info = {\n\t\"name\" : \"Flop\",\n \"weight\" : 5,\n \"happiness\" : 9001\n }\n\n }", "function onchange() {\n selectValue = regionSelect.property('value')\n sentence = selectValue + ' has a total undergraduate population of ' + formatComma(popObject[selectValue]) + '. '\n sentence += 'My favorite country, The United States of America, has a total undergrad population of ' + formatComma(total) + '. '\n sentence += 'Math tells us that ' + selectValue + ' makes up ' + formatDecimal(popObject[selectValue] / total * 100) + '% of \\'Merica\\'s undergrad population'\n \n d3.select('#explanation1')\n .text(sentence)\n \n //select the region which the dropdown selects\n console.log(d3.select('#'+selectValue))\n console.log(selectValue)\n \n\n d3.select('.selectedRegion').classed('selectedRegion', false);\n d3.select('#'+(selectValue).replace(/\\s/g, \"\")).classed('selectedRegion', true);\n \n \n }", "function selectIns(o){\n selectedInstrument = selIns.selectedIndex;\n instrumentChanged = true;\n if(!metronome.isPlaying()) {\n changeInstrument();\n } \n}", "function updateMoodFace() {\n//Passing select value to h1\n moodFace.innerHTML = moodChoose.value;\n}", "function init () {\n var dropdownMenu = d3.select(\"#selDataset\");\n d3.json(\"samples.json\").then((data) => {\n var names = data.names;\n names.forEach(function(id) { //exercise 14.1\n dropdownMenu.append(\"option\").text(id).property(\"value\",id); \n });\n updatecharts(data.samples[0]);\n getDemoInfo(data.names[0]);\n });\n\n}", "function chooseUnit(unitId,ketuaUnit, namaUnit){\n \n $('#input-unit').val(namaUnit);\n $('#input-unit').attr(\"unit-id\", unitId);\n $('#input-unit').attr(\"ketua-unit\", ketuaUnit);\n $('#dropdown-selection-unit').hide();\n $('#btn-simpan').removeAttr('disabled'); \n}", "function mySelectEvent() {\n let val = sel.value();\n if (val == 'square') {\n bgCol = new p5.Oscillator('square');\n } else if (val == 'triangle') {\n bgCol = new p5.Oscillator('triangle');\n } else if (val == 'sine') {\n bgCol = new p5.Oscillator('sine');\n }\n }", "toggSel (c, i) {\r\n const O = this;\r\n let opt = null;\r\n if (typeof (i) === \"number\") {\r\n O.vRange(i);\r\n opt = O.E.find('option')[i];\r\n }\r\n else {\r\n opt = O.E.find(`option[value=\"${i}\"]`)[0] || 0;\r\n }\r\n if (!opt || opt.disabled)\r\n return;\r\n\r\n if (opt.selected !== c) {\r\n if ((settings.max && !opt.selected && O.selectedCount < settings.max) || opt.selected || (!settings.max && !opt.selected)) {\r\n opt.selected = c;\r\n if (!O.mob) $(opt).data('li').toggleClass('selected', c);\r\n\r\n O.callChange();\r\n O.setPstate();\r\n O.setText();\r\n O.selAllState();\r\n }\r\n }\r\n }", "function choosefruit() {\r\n\t$(\"#fruity\").attr('src', fruits[Math.round(11 * Math.random())] + '.png');\r\n}", "function setClassification() {\n var classification = document.getElementById('classification');\n var product = document.getElementById('product');\n var selected_product = product.value; \n var select_classification = all_classifications[selected_product];\n classification.value = select_classification;\n bz_fireEvent(classification, 'change');\n}", "handlePick() {\n const randomNum = Math.floor(Math.random() * this.state.options.length);\n const option = this.state.options[randomNum];\n alert(option);\n }", "function optionChanged(newSample) {\n buildMetadata(newSample);\n barChart(newSample);\n bubbleChart(newSample);\n \n}", "function setSpeakerType() {\n var speakerType = selectedHansardJSON().type;\n setSelectByValue(speakingTypesSelect, speakerType);\n}", "selectTheatre(){\n browser.click('#cmbComplejos')\n browser.click('#cmbComplejos > option:nth-child(2)');\n }", "function chooseData() {\n // ******* TODO: PART I *******\n // Changed the selected data when a user selects a different\n // menu item from the drop down.\n window.barChart.update();\n\n}", "function moistureSelect(analysis_params) {\n var myList=document.getElementById(\"myMoisture\");\n analysis_params.moisture = myList.options[myMoisture.selectedIndex].value;\n return analysis_params\n}", "function array_to_sample (result) {\n\tvar json = jQuery.parseJSON(result);\n\tvar sample = $('#sample');\n\n\tvar options = sample.prop('options');\t// store existing options in variable\n\t$('option', sample).remove();\t//remove existing options to replace\n\toptions[options.length] = new Option(\"-- Please type an active sample name --\", 0); \n\tif ($.isEmptyObject(json)){\n\t\talert (\"This project does not appear to have any samples with an 'active' status\");\n\t} else {\n\t\t$.each(json, function(key, val) {\n\t\t\toptions[options.length] = new Option (key, val);\t// loop through new values and add to Sample dropdown list\n\t\t});\n\t}\t\n\tsample.combobox({\n\t\t// The trigger response when a sample option is selected\n\t\tselected: function(event, ui) {\n\t\t\t//console.log(\"Selected function \" + $(\"#sample\").val());\n\t\t\t$('#study_id').val( $('#sample').val() );\t// values used are study ID keys associated with the sample\n\t\t\tvar sample_text = $('#sample option:selected').text();\n\t\t\tvar formatted = sample_text.replace(/\\s\\(ID:\\s+\\d+\\)/, '');\n\t\t\t$('#g_val').text(formatted);\t//autofills text area\n\t\t\t$(\"#genome_val\").val($('#g_val').text());\n\t\t\t//$(\"input[name='bsubmit']\").prop(\"disabled\", true);\t//Disable Submit until StudyStageID has been acquired\n\n\t\t\tif ( $('#study_id').val() <= 0 ) {\t// For times when the default \"please select a sample\" option is checked\n\t\t\t\treset_genome_ss();\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$.ajax ({\t//get_ss_id (since we now already have study ID)\n\t\t\t\t\turl: './get_study_stage.php',\n\t\t\t\t\tdata: { 'study_id' : $('#study_id').val() ,\n\t\t\t\t\t\t 'client' : $('#client').val() },\n\t\t\t\t\tcache: false,\n\t\t\t\t\tdataType: \"text\"\n\t\t\t\t}).done(function (ss_id) { \n\t\t\t\t\t$('#study_stage_id').val(ss_id);\n\t\t\t\t\t$('#ss_val').text(ss_id);\n\t\t\t\t\t$(\"#study_stage_val\").val($('#ss_val').text() );\t\t\n\t\t\t\t\tif ($('#study_stage_id').val() <= 0) {\n\t\t\t\t\t\t$('#ssDiv').show();\t//show checkbox if ID has not been found\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('#ssDiv').hide({\n\t\t\t\t\t\t\tcomplete: function () {\n\t\t\t\t\t\t\t\t$('#ss_create').prop('checked', false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} \n\t\t\t\t\t$(\"input[name='bsubmit']\").prop(\"disabled\", false);\n\t\t\t\t}).fail( function(http_r, opts, thrown) {\n\t\t\t\t\talert(\"status=\" + opts + \" \" + http_r.status + \", error=\" + thrown);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}", "function replace(button_id, value) {\n // replaces the value and text in the button to reflect the new choice\n document.getElementById(button_id).value = value;\n document.getElementById(button_id).innerHTML = value;\n\n // if flavor changes, changes large photo to represent the roll\n if (button_id == 'flavor-button') {\n document.getElementById('id_large_roll').src = \"images/\" + value.toLowerCase() + \"-roll.png\";\n }\n\n // if quantity changes, changes the title to represent the new number of rolls selected\n if (button_id == 'quantity-button') {\n if (value == '1') {\n document.getElementById('roll_title').innerHTML = \"PUMPKIN SPICE\";\n }\n else {\n document.getElementById('roll_title').innerHTML = \"PUMPKIN SPICE \" + value + \"-PACK\";\n }\n }\n\n\n // hides dropdown options\n var flavor = document.getElementById(\"flavors\");\n var quantities = document.getElementById(\"quantities\")\n if (flavor.classList.contains('show')) {\n flavor.classList.remove('show');\n }\n if (quantities.classList.contains('show')) {\n quantities.classList.remove('show');\n }\n}", "function optionChanged(newSampleID) {\n\n // Verify event handler\n // console.log(`User selected ID (${newSampleID}).`);\n\n // Call functions to draw bar graph plot, bubble chart plot, update demographic info panel, and gauge chart\n drawBarGraph(newSampleID);\n drawBubbleChart(newSampleID);\n updateDemographicInfo(newSampleID);\n drawGaugeChart(newSampleID);\n\n}", "function appSelection() {\n appLetter = letterOptions[Math.floor(Math.random() * letterOptions.length)];\n}", "function ShowSelected11()\n{\n var MedidaJabonLavadora = document.getElementById(\"MedidaJabonLavadora\");\n medida = MedidaJabonLavadora.options[MedidaJabonLavadora.selectedIndex].text;\n \n if (medida == \"Un litro\" ){\n \n PrecioJabonLavadora= 3500;\n \n }else if (medida == \"Dos litros\" ){\n PrecioJabonLavadora= 13500;\n\n }\n}", "function filterSamples(i) {\n\n // return the id that is equal to the dropdown value option\n return i.id == dName\n }", "function chooseCoal() {\n $('coal_span').addClassName('selected');\n $('oil_span').removeClassName('selected');\n $('gas_span').removeClassName('selected');\n $('nuclear_span').removeClassName('selected');\n $('hydro_span').removeClassName('selected');\n $('all_span').removeClassName('selected');\n // disable and unselect inappropriate units\n $('bbl').disable();\n $('bbl_span').setOpacity(0.3).removeClassName('selected');\n $('ft3').disable();\n $('ft3_span').setOpacity(0.3).removeClassName('selected');\n $('m3').disable();\n $('m3_span').setOpacity(0.3).removeClassName('selected');\n $('twh').disable();\n $('twh_span').setOpacity(0.3).removeClassName('selected');\n // keep current units if possible\n var units = $$('input:checked[type=\"radio\"][name=\"units\"]').pluck('value')[0]; \n if (units == 'joule') {\n $('mtoe').enable();\n $('mtoe_span').setOpacity(1.0).removeClassName('selected');\n $('joule').enable();\n $('joule').checked = true;\n $('joule_span').setOpacity(1.0).addClassName('selected');\n } else { // default to 'mtoe'\n $('mtoe').enable();\n $('mtoe').checked = true;\n $('mtoe_span').setOpacity(1.0).addClassName('selected');\n $('joule').enable();\n $('joule_span').setOpacity(1.0).removeClassName('selected');\n }\n\n requestImage();\n}", "function soundChoice() {\n\t\t\tvar sb;\n\t\t\tif (soundSelectorElem.selectedIndex <1) return; // we added a \"blank\" to the selector list.\n\t\t\tvar pathToLoad = \"jsaSound/\" + soundList[soundSelectorElem.selectedIndex-1].fileName;\n\t\t\tloadSoundFromPath(pathToLoad);\n\t\t}", "function init(){\n var dropDown = d3.select(\"#selDataset\");\n d3.json(\"data/samples.json\").then(data =>{\n var names = data.names;\n // console.log(names)\n names.forEach(sample => {\n dropDown.append(\"option\")\n .text(sample)\n .property(\"value\",sample);\n });\n var firstSample = names[0];\n console.log(firstSample);\n buildTable(firstSample);\n buildCharts(firstSample);\n });\n}", "function knobfunction(value1){\n\n $('#guage')\n .val(value1)\n .trigger('change');\n }", "function optionCompareChangedOne(select) {\n //Giving select a variable name\n var sel = select\n\n // Importing data from portionsandweights\n d3.json(\"/portionsandweights\").then((importData) => {\n\n // Searching food names through json\n var portions = importData.data;\n\n //Empty Variable\n var filterSelect = []\n\n // Filter the search\n filterSelect = portions.filter(d => d.food_code == sel);\n\n // Food name of filtered data\n var nameOne = filterSelect[0].main_food_description;\n\n // selecting tag for displaying the name\n var selectFoodName = document.getElementById(\"nameOne\");\n\n // Clear html display name\n selectFoodName.innerHTML = \"\";\n\n // Create html tag showing food name\n selectFoodName.innerHTML = selectFoodName.innerHTML +\n '<h3>' + nameOne + '</h3>';\n\n // selecting tag for dropdown\n var select = document.getElementById(\"selCompareTwo\");\n\n //Clear dropdown\n select.innerHTML = \"\";\n\n // For loop for drop down. referencing id and seq_num of portion size\n for (var i = 0; i < filterSelect.length; i++) {\n select.innerHTML = select.innerHTML +\n '<option value=\"' + filterSelect[i].food_code + ',' + filterSelect[i].seq_num + '\">' + filterSelect[i].portion_description + '</option>';\n\n }\n\n // default selection\n var defaultPortionID = filterSelect[0].food_code\n var defaultPortionSeq_num = filterSelect[0].seq_num\n\n // Adding default selection into selection categfory\n optionCompareWeightChangedOne(defaultPortionID, defaultPortionSeq_num);\n // GAUGE ONE\n gaugeOne(defaultPortionID, defaultPortionSeq_num);\n\n });\n}", "function materialsubbase() {\n var tpbs = $(\"#materialsbs option:selected\").text();\n if (tpbs == $(\"#materialsbs option:first\").text()) {\n $(\"#subbasematerial\").text(\"Subbase\");\n } else {\n $(\"#subbasematerial\").text(\"Subbase \" + tpbs);\n };\n\n}", "function audio_source_select(select) {\n var index = select.selectedIndex;\n var url = document.getElementById('audio_source_url');\n url.value = select.options[index].value;\n url.blur();\n audio_source_set(url.value);\n}", "function t_yieldCountry() {\n\n var t_information = document.getElementById(\"t_information\");\n var picker = document.getElementById(\"t_countrypicker\");\n t_information.innerHTML = \"Delegate of \"+picker.options[picker.selectedIndex].value;\n\n}", "function y_select_change(self) {\n $(self).parent().find(\".attr-options\").fadeOut();\n var type = $(self).find(\":selected\").attr('type');\n if(type == \"gene\"){\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeIn();\n var gene = $(self).find(\":selected\").val();\n } else {\n $(self).parent().find('.y-gene-attribute-select option:contains(\"select a specification\")').prop('selected', true);\n $(self).parent().find(\".y-gene-attribute-select\").fadeOut();\n $(self).parent().find(\"#y-data-type-container\").fadeOut();\n }\n }", "function initialize() {\n var dropdown = d3.select(\"#selDataset\"); \n d3.json(\"samples.json\").then((data) => {\n var sampleList = data.names; \n sampleList.forEach((sample) => {\n dropdown.append(\"option\").text(sample).property(\"value\", sample); \n \n });\n //capture sample metadata from the list\n var firstSample = sampleList[0];\n chartBuilder(firstSample); \n metadataBuilder(firstSample);\n \n }); \n }", "function optionChanged(newSample) {\n buildCharts(newSample);\n buildMetadata(newSample);\n}", "function chooseData() {\n\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\tvar select = document.getElementById(\"dataset\");\n\tupdateBarChart(select.options[select.selectedIndex].value);\n\t\n}", "function setTargetValue() {\n targetValue = Math.floor(Math.random() * 100) + 20;\n console.log(\"tv \" + targetValue);\n $(\"#target\").text(targetValue);\n alphaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"a \" + alphaValue);\n betaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"b \" + betaValue);\n gammaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"g \" + gammaValue);\n zappaValue = Math.floor(Math.random() * 11) + 1;\n console.log(\"z \" + zappaValue);\n}", "function speakInsult() {\n let selectInsult = insults[Math.floor(Math.random() * insults.length)];\n responsiveVoice.speak(selectInsult, 'Japanese Female');\n}", "function aiPick() {\r\n aiChoice = Math.floor(Math.random() * 3); \r\n\r\n switch (aiChoice) {\r\n case 0:\r\n aiPokemon = \"water\"\r\n aiIng.setAttribute(\"src\", \"src/pic/s.jpg\");\r\n area.appendChild(aiIng);\r\n break;\r\n case 1:\r\n aiPokemon = \"fire\"\r\n aiIng.setAttribute(\"src\", \"src/pic/c.jpg\");\r\n area.appendChild(aiIng);\r\n break;\r\n case 2:\r\n aiPokemon = \"grass\";\r\n aiIng.setAttribute(\"src\", \"src/pic/b.jpg\");\r\n area.appendChild(aiIng);\r\n break;\r\n default:\r\n Error = \"no pokemon has been chosen\";\r\n }\r\n }", "function optionCompareChangedTwo(select) {\n //Giving select a variable name\n var sel = select\n // Importing data from portionsandweights\n d3.json(\"/portionsandweights\").then((importData) => {\n\n // Searching food names through json\n var portions = importData.data;\n\n //Empty Variable\n var filterSelect = []\n\n // Filter the search\n filterSelect = portions.filter(d => d.food_code == sel);\n\n // Food name of filtered data\n var nameTwo = filterSelect[0].main_food_description;\n\n // selecting tag for displaying the name\n var selectFoodName = document.getElementById(\"nameTwo\");\n\n // Clear html display name\n selectFoodName.innerHTML = \"\";\n\n // Create html tag showing food name\n selectFoodName.innerHTML = selectFoodName.innerHTML +\n '<h3>' + nameTwo + '</h3>';\n\n // selecting tag\n var select = document.getElementById(\"selCompareFour\");\n\n //Clear dropdown\n select.innerHTML = \"\";\n\n // For loop for drop down. referencing id and seq_num of portion size\n for (var i = 0; i < filterSelect.length; i++) {\n select.innerHTML = select.innerHTML +\n '<option value=\"' + filterSelect[i].food_code + ',' + filterSelect[i].seq_num + '\">' + filterSelect[i].portion_description + '</option>';\n }\n // default selection\n var defaultPortionID = filterSelect[0].food_code\n var defaultPortionSeq_num = filterSelect[0].seq_num\n\n // Adding default selection into selection categfory\n optionCompareWeightChangedTwo(defaultPortionID, defaultPortionSeq_num);\n // GAUGE TWO\n gaugeTwo(defaultPortionID, defaultPortionSeq_num);\n\n });\n}" ]
[ "0.66189796", "0.6478805", "0.6455171", "0.6378742", "0.6339185", "0.62233233", "0.6163575", "0.61579686", "0.6103114", "0.6088636", "0.6085081", "0.60725796", "0.6068693", "0.6038692", "0.6037897", "0.60126996", "0.5999956", "0.5995459", "0.59934384", "0.5974364", "0.59738374", "0.59675986", "0.5962457", "0.596094", "0.5949927", "0.5928442", "0.5928177", "0.58982366", "0.58574694", "0.58161366", "0.58004755", "0.5795679", "0.5790652", "0.5778454", "0.5778454", "0.57766986", "0.5776262", "0.5769438", "0.5768064", "0.57610226", "0.57439905", "0.574131", "0.573449", "0.573449", "0.5731945", "0.5727918", "0.57062286", "0.56945544", "0.56940335", "0.5686823", "0.5668927", "0.56645197", "0.5664485", "0.5660413", "0.5654241", "0.56542206", "0.56541836", "0.56507987", "0.5640257", "0.56352323", "0.5633491", "0.5612467", "0.5610465", "0.55985975", "0.5598474", "0.5587551", "0.55874825", "0.5571393", "0.5570312", "0.5562205", "0.5554965", "0.555488", "0.5549658", "0.55467546", "0.5543363", "0.55429834", "0.5536902", "0.55314475", "0.552311", "0.55220157", "0.551841", "0.5513179", "0.5510953", "0.55066055", "0.5506605", "0.55042005", "0.54979223", "0.54914135", "0.5491353", "0.5489247", "0.54879564", "0.5474865", "0.547053", "0.5462384", "0.5455226", "0.5451517", "0.54504466", "0.54420173", "0.54359686", "0.5435566" ]
0.6771794
0
function for aspirate the sample
function aspirateSample(scope){ aspirate_flag=true; if(current_test==0){ machine_stage.getChildByName("test_1").text = beaker_values[current_test_beaker_number-1]+" ppm"; changeFlame(1); } else{ machine_stage.getChildByName("test_1").text = beaker_values[current_test_beaker_number-1]+" ppm"; changeFlame(0); if(current_test_beaker_number == 1){ changeFlame(1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Sample() {}", "Next() {\r\n return this.InternalSample();\r\n }", "readSample() {\n return 0;\n }", "function loopRecordedSample(name) {\n }", "function displayInitialSample(){\n\t\t//probably call it when starwars is clicked\n\t\tclearInfo();\n\t\t$spanInfo.html(\"<h4><b>Sample piece of data from each class on the API</b></h4>\");\n\t\t// $spanInfo.append(\"<h4 class='label label-info lb-md'>Starships, Vehicles, Species, Films, Planets, People</h4>\");\n\t\t$spanInfo.append(\"<table class='table tableHeaderHome label-default lb-sm'><th>Starships</th><th>Vehicles</th><th>Species</th><th>Films</th><th>Planets</th><th>People</th></table>\");\n\t\t$table.show();\n\t\t//print out the sample 1 per each.\n\t\tgenerateStarships(2);//no values on 1\n\t\tgenerateVehicles(4);//no values on first 3\n\t\tgenerateSpecies(1);\n\t\tgenerateFilms(1);\n\t\tgeneratePlanets(1);\n\t\tgeneratePeople(1);\t\t\t\t\t\t\n\t}", "function updateSample1() {\n playing = false;\n setUpdatingState();\n player.stop();\n setTimeout(() => {\n generateSample(z => {\n z1 = z;\n generateProgressions(setStoppedState);\n });\n }, 0);\n}", "function startSample(index, arNum) {\n\nvar source = context.createBufferSource()\nsource.buffer = userPad[index][arNum].activeVoice[0]\n\nsource.connect(bus[index].input)\nsource.start(0)\n\nsource.onended = function(){\n\tsource.stop()\n }\n\n}", "start_sample(val) {\n this._start_sample = val;\n return this;\n }", "function sample_size() {\n return 5000\n}", "get humanoidOversampling() {}", "initiateSampleRemoval() {\n for ( let i = 0; i < this.dataSamples.length; i++ ) {\n this.dataSamples.get( i ).initiateRemove();\n }\n }", "start() {\n this.stop();\n return this.sampleData();\n }", "function sample(first, last, output, n) {\r\n var e_1, _a;\r\n // GENERATE REMAINDERS\r\n var step = global_1.distance(first, last);\r\n var remainders = [];\r\n for (var i = 0; i < step; ++i)\r\n remainders.push(i);\r\n //----\r\n // CONSTRUCT INDEXES\r\n //----\r\n var advances = [];\r\n n = Math.min(n, step);\r\n // PICK SAMPLE INDEXES\r\n for (var i = 0; i < n; ++i) {\r\n var idx = randint(0, remainders.length - 1);\r\n advances.push(remainders.splice(idx, 1)[0]);\r\n }\r\n sorting_1.sort(factory_1.begin(advances), factory_1.end(advances));\r\n // CHANGE INDEXES TO ADVANCES\r\n for (var i = n - 1; i >= 1; --i)\r\n advances[i] -= advances[i - 1];\r\n try {\r\n //----\r\n // FILL SAMPLES\r\n //----\r\n for (var advances_1 = __values(advances), advances_1_1 = advances_1.next(); !advances_1_1.done; advances_1_1 = advances_1.next()) {\r\n var adv = advances_1_1.value;\r\n first = global_1.advance(first, adv);\r\n output.value = first.value;\r\n output = output.next();\r\n }\r\n }\r\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n finally {\r\n try {\r\n if (advances_1_1 && !advances_1_1.done && (_a = advances_1.return)) _a.call(advances_1);\r\n }\r\n finally { if (e_1) throw e_1.error; }\r\n }\r\n return output;\r\n}", "NextDouble() {\r\n return Sample();\r\n }", "calcTheoSample() {\r\n\r\n let that = this;\r\n\r\n // number of observations in sample\r\n let N = that.sampleData.length;\r\n\r\n // estimate mu parameter from sample data\r\n let mu = 0;\r\n for (let i = 0; i < N; i++) {\r\n mu += that.sampleData[i];\r\n }\r\n mu /= N;\r\n this.mu = mu;\r\n\r\n // estimate variance from sample data\r\n let v = 0;\r\n for (let i = 0; i < N; i++) {\r\n v += (that.sampleData[i] - mu)**2\r\n }\r\n v /= Math.max(N-1, 1);\r\n this.sigma = v**0.5\r\n\r\n // sample from normal distribtuion with estimated parameters\r\n let theo_sample = new Array(N).fill(0);\r\n for (let i = 0; i < N; i++) {\r\n theo_sample[i] = jStat.normal.sample(this.mu, this.sigma);\r\n }\r\n\r\n // return theoretical sample\r\n return theo_sample;\r\n }", "function sample() {\n return Math.sqrt(-2 * Math.log(Math.random())) * Math.cos(2 * Math.PI * Math.random());\n}", "function onchange_sample(){\n\tvar fn = \"onchange_sample \";\n\tvar szVal = selectGetSelVal(getElementById2(\"selectSample\"));\n\tjslog (JSLOG_JSU, fn + \"szVal=\" + szVal);\n\tfor (var i=1; i<=SAMPLE_MAX_NUM; i++){\n\t\tvar bShow = (szVal == SAMPLE_ALL || szVal == i+\"\");\n\t\tvar elTr = getElementById2(\"tr_sample_\" + i, false);\n\t\tif (elTr){\n\t\t\tjslog (JSLOG_JSU, fn + \"tr i=\" + i + \" bShow=\" + bShow);\n\t\t\telTr.style.display = (bShow) ? \"\" : \"none\";\n\t\t\telTr.style.visibility = bShow;\n\t\t}\n\t}\n}", "function doSample(event) {\n var now = Date.now();\n if (lastSampleTimestamp <= 0){\n lastSampleTimestamp = now;\n return; \n }\n var deltaSec = (now - lastSampleTimestamp)/1000;\n\n\n if (sampleRateSamples > 0){\n //Use the first several samples to calculate the device's sample rate\n if (rawSampleRate == null) {\n rawSampleRate = 1 / deltaSec;\n } else {\n rawSampleRate = (rawSampleRate + (1 / deltaSec))/2; //Hz \n }\n sampleRateSamples--;\n\n } else if (sampleRateSamples == 0){\n //We got all our device sample-rate related readings, \n //now calculate the sample-rate related parameters\n sampleIntervalMS = 1000 / rawSampleRate;\n\n var destSampleRate = 2*options.max_stride_freq;\n samplesToSkip = Math.floor(rawSampleRate / destSampleRate) - 1;\n sampleIntervalMS *= (samplesToSkip+1);\n actualSampleRate = 1000/sampleIntervalMS; //Hz\n amplitudeCheckSamples = Math.ceil(actualSampleRate); //look a second back\n\n //store first sample\n var datum = event.accelerationIncludingGravity[options.axis] || 0.5;\n shift(samples, datum);\n\n sampleRateSamples--;\n\n } else {\n //normal measurments\n if (samplesSkipped < samplesToSkip) {\n samplesSkipped++;\n return;\n }\n samplesSkipped = 0;\n\n var datum = event.accelerationIncludingGravity[options.axis] || 0.5;\n\n if (samples[samples.length-1] != 0){ //TODO\n //integrate to get a velocity sample\n var velocity = vSamples[vSamples.length-1] + (datum - samples[samples.length-1])*sampleIntervalMS/1000;\n shift(vSamples, velocity);\n }\n\n var smoothed = datum;//smooth(samples[samples.length-1], datum, options.smooth_alpha);\n shift(samples, smoothed);\n\n var freq = -1;\n switch (options.algorithm) {\n case 'fft':\n freq = getFreqFft(samples);\n break;\n case 'zero-cross':\n freq = getFreqCross(samples);\n break;\n case 'zero-cross-v':\n freq = getFreqCross(vSamples);\n break;\n }\n\n var spm = Math.round(freq*60);\n if (spm > lastSpm) {\n //rising (usually slower than falling)\n spm = Math.round(smooth(lastSpm, spm, options.smooth_alpha_rising));\n } else {\n //falling (it's possible to stop very quickly)\n spm = Math.round(smooth(lastSpm, spm, options.smooth_alpha_falling));\n }\n lastSpm = spm;\n }\n \n lastSampleTimestamp = now;\n }", "function idChange(newSample) { \n buildCharts(newSample); \n metaData(newSample);}", "Sample() {\r\n //Including this division at the end gives us significantly improved\r\n //random number distribution.\r\n return this.InternalSample() * (1.0 / this.MBIG);\r\n }", "fillWithTestData() {\n let sample = 0.0; // Range from -1 to 1.\n for (let i = 0; i < BUFFER_LENGTH; i++) {\n let delta = 2.0 * Math.random() - 1.0; // Range from 1.0 to -1.0\n // If the sample is already high, skew the delta so it goes lower.\n delta -= sample; // If sample is max, delta will only decrease.\n delta *= 0.09; // Only change a bit during each step.\n sample += delta;\n // Convert from -1 to 1 to 0 to 1\n this.dataBuffer[i] = (sample + 1.0) / 2.0;\n }\n }", "function copy_sample(id,to){\n\tthis[to].push(this['all_samples'][id]['_id']['$id']);\n\n\tthis.update_header('samples');\n}", "function playSample(sample){\n\tsample.play();\n}", "play(numsamples) {\n this.write(numsamples);\n }", "function firstSampleTrigger() {\n if (game.player.resources.beats.amount >= game.resources.samples.resourcesPer) {\n var context = {\n taskId: \"unlockResourceTask\",\n taskName: \"Create First Sample\",\n resource: \"samples\"\n }\n\n appendToOutputContainer(\"After creating a number of solid beats, you're ready to combine them into a short sample.\");\n addTask(context);\n addTrigger(firstSongTrigger);\n return true;\n }\n}", "function addExample() {\n\n samplesP.html('samples: '+sample++); //see amount of samples collected. \n\n let inputs = getInputs();\n // Get frequency\n let target = classifierLabel;\n // Add data\n brain.addData(inputs, [target]);\n\n}", "function generateSamples(data) {\n app.drawChartBlank();\n console.log(\"calling back in generateSamples\");\n //var sampleObj = genSampleData();\n var lastDay = -1;\n //console.log(JSON.stringify(sampleObj));\n var count = 0;\n for (var key in data) {\n if (!data.hasOwnProperty(key)) continue;\n var obj = data[key];\n //console.log(JSON.stringify(obj));\n count++;\n var d = new Date(0); // The 0 there is the key, which sets the date to the epoch\n d.setUTCSeconds(obj.epoch);\n // var newSample = {\n // \"epoch\": lastUtc, // unix timestamp\n // \"steps\": currentSteps,\n // \"hr\": getHR(maxHR),\n // \"hrDev\": getHRDev(maxHRDev),\n // \"batt\": currentBattVolts,\n // \"aux1\": getAux(),\n // \"aux2\": getAux(),\n // \"aux3\": getAux()\n // }\n dataArray.push([d, obj.hr, obj.hrDev, obj.steps, obj.aux1, obj.aux2, obj.aux3])\n\n //console.log(\"sample time: \" + obj.epoch + \" Steps: \" + obj.steps + \" hr: \" + obj.hr + \" hr dev: \" + obj.hrDev + \" batt: \" + (obj.batt * 0.0165).toFixed(3));\n //console.log(d.getDay());\n // if(d.getDay()!==lastDay){\n // lastDay = d.getDay();\n // console.log(\"New Day : \"+d.toString()+\" \"+ getWeekNumber(d));\n // }\n //console.log(count);\n //dataArray.push([d, obj.hr, obj.hrDev])\n }\n app.drawChart(dataArray);\n }", "function optionChanged (newsample){\n createchart(newsample) \n metadata(newsample)\n}", "function playRandomSample() {\r\n // 1) clear beatArray\r\n beatArray = [];\r\n // 2) fill beatArray with 5 radnom numbers\r\n for (var i_1 = 0; i_1 < 5; i_1++) {\r\n var randomNum = Math.floor(Math.random() * 9);\r\n // fill beatarray with random number\r\n beatArray.push(randomNum);\r\n }\r\n // 3) play beatsArray\r\n boolPlayStop = true;\r\n checkBeat();\r\n // 4) show stop button\r\n toggleClasses(playButton, stopButton);\r\n}", "function Sample() {\n\t// sample from the popData\n\tpopCost = d3.shuffle(popCost);\n\toneSample.length =sampSize;\n\n\tfor( ndx = 0; ndx < 16; ndx++){\n\t oneSample[ndx] = {\"x\": 30 + ndx * 50,\n\t\t\t \"y\": 10, \"txt\": ndx};\n\t}\n\n\tfor( ndx = 0; ndx < sampSize -0.1; ndx++ ){\n oneSample[ndx].txt = popCost[ndx] ;\n\t}\n\tif(sampSize < 16){\n for( k = 15; k >= sampSize; k-- ){\n\t\toneSample[k].txt = null ;\n\t }\n\t}\n\t//console.log(oneSample);\n\tSampleBox.transition()\n .style(\"stroke\",\"white\")\n .style(\"fill\",\"white\")\n .remove(); // remove the sample button frame\n\tStext.transition() // move the sample text to the bottom\n\t .attr(\"y\", height * 1.16 )\n\t .attr(\"duration\", 100);\n\n\tsFontSize = (sampSize < 15) ? \"30px\": \"20px\";\n\txStepSize = (sampSize > 8) ? 30: (sampSize > 4)? 50: 100;\n\n sampleText = Bootsvg.selectAll(\"text2\") // create the sample text objects\n \t.remove()\n .data(oneSample)\n .enter().append(\"text\")\n .attr(\"y\", function(d){ return d.y ;})\n .attr(\"x\", function(d){ return d.x ;} )\n .text( function(d) { return d.txt ;})\n .style(\"font-size\",\"2px\")\n\t .style(\"fill\",\"black\");\n sampleText.transition()\n\t\t\t// move sample to bottom\n .delay(function(d, i) { return (i+1) * sampTime; })\n .duration(sampTime)\n .attr(\"y\", height * 1.15)\n .attr(\"x\", function(d,i){ return 120 + i * xStepSize ;} )\n .style(\"font-size\", sFontSize);\n\n popText.transition().delay(sampTime * sampSize).remove(function(d) { d.remove;});\n Ptext.transition().delay(sampTime * sampSize).remove(function(d) { d.remove;});\n\n\n Bootsvg.append(\"text\") // create 1 Resample button\n .attr(\"x\", 4 )\n .attr(\"y\",height * 1.25)\n .attr(\"font-size\", 18 + \"px\")\n .style(\"fill-opacity\", 1.0E-6)\n .text(\"1 Resample\")\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n Rbox = Bootsvg.append(\"rect\") // and it's frame and activation\n .attr(\"class\", \"rect\")\n .attr(\"x\", 0)\n .attr(\"y\", height *1.25 - 20)\n .attr(\"width\", 112)\n .attr(\"height\",30)\n .attr(\"rx\", 4)\n .attr(\"ry\", 4)\n .style(\"stroke\", \"blue\" )\n .style(\"stroke-width\",2 )\n .style(\"fill\",\"lightblue\")\n .style(\"fill-opacity\", 1.0E-6)\n .on(\"click\", reSample1);\n// .transition(this)\n// .delay( sampTime * sampSize)\n// .duration(sampTime)\n// .style(\"fill-opacity\", 0.2)\n// .style(\"stroke\", \"blue\" )\n// .style(\"stroke-width\",2 );\n\n Bootsvg.append(\"text\") // create speed buttons\n .attr(\"x\", 126 )\n .attr(\"y\",height * 1.25 - 12)\n .attr(\"font-size\", \"9px\")\n .style(\"fill-opacity\", 1.0E-6)\n .text(\"Slower\")\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n Bootsvg.append(\"text\") // faster label\n .attr(\"x\", 127 )\n .attr(\"y\",height *1.25 +8)\n .attr(\"font-size\", \"9px\")\n .style(\"fill-opacity\", 1.0E-6)\n .text(\"Faster\")\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n SlowBox = Bootsvg.append(\"rect\") // slower button\n .attr(\"class\", \"rect\")\n .attr(\"x\", 122)\n .attr(\"y\", height * 1.25 - 22)\n .attr(\"width\", 40)\n .attr(\"height\",14)\n .attr(\"rx\", 4)\n .attr(\"ry\", 4)\n .style(\"stroke\", \"white\" )\n .style(\"stroke-width\",1 )\n .style(\"fill\",\"lightblue\")\n .style(\"fill-opacity\", 1.0E-6)\n .on(\"click\", function(){ resampTime = resampTime * 1.5;} )\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 0.1)\n .style(\"stroke\", \"blue\" )\n .style(\"stroke-width\", 1);\n\n FastBox = Bootsvg.append(\"rect\") // faster button\n .attr(\"class\", \"rect\")\n .attr(\"x\", 122)\n .attr(\"y\", height * 1.25 - 2 )\n .attr(\"width\", 40)\n .attr(\"height\",14)\n .attr(\"rx\", 4)\n .attr(\"ry\", 4)\n .style(\"stroke\", \"white\" )\n .style(\"stroke-width\",1 )\n .style(\"fill\",\"lightblue\")\n .style(\"fill-opacity\", 1.0E-6)\n .on(\"click\", function(){ resampTime = resampTime * .67;} )\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 0.1)\n .style(\"stroke\", \"blue\" )\n .style(\"stroke-width\",1 );\n\n Bootsvg.append(\"text\") // Many Resamples\n .attr(\"x\", 0 )\n .attr(\"y\", height * 1.38)\n .attr(\"font-size\", \"18px\")\n .text(\"Many Resamples: \")\n .style(\"fill-opacity\", 1.0E-6)\n .transition(this)\n .delay( sampSize * sampTime )\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n // TODO: should be able to build all resample buttons at once,\n // but not sure how to do it with text and rectangle.\n //\t\t Here's a data build as a start. Does display, but only the last box is active.\n\n var resampButtonData = [\n \t{x: 200, wd: 40, txt: \"100\", n: 100, clr: \"red\"},\n \t{x: 250, wd: 40, txt: \"500\", n: 500, clr: \"orange\"},\n \t{x: 300, wd: 48, txt: \"1000\", n: 1000, clr: \"green\"},\n \t{x: 360, wd: 48, txt: \"5000\", n: 5000, clr: \"blue\"},\n \t{x: 430, wd: 54, txt: \"10,000\", n: 10000, clr: \"purple\"}\n ]\n\n\n var manyTexts = Bootsvg.selectAll(\"text4\")\n .data(resampButtonData)\n .enter()\n .append(\"text\")\n .attr(\"x\", function(d){ return d.x;} )\n .attr(\"y\", height * 1.38)\n .attr(\"font-size\", \"16px\")\n .text(function(d){return d.txt;})\n .style(\"fill-opacity\", 1.0E-6)\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1)\n ;\n var manyBoxes = Bootsvg.selectAll(\"rect\")\n .data(resampButtonData)\n .enter()\n .append(\"rect\")\n .attr(\"x\", function(d){ return d.x -5 ;} )\n .attr(\"y\", height * 1.38 -20)\n .attr(\"width\", function(d){ return d.wd;} )\n .attr(\"height\",30)\n .style(\"fill\",function(d){return(d.clr);})\n .style(\"fill-opacity\", 1.0E-6)\n .on(\"click\", function(d){\n \t\t\t\treSampleMany(d.n);})\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 0.2)\n ;\n\n // Bootsvg.append(\"text\") // create Resample 100 button\n // .attr(\"x\", 200 )\n // .attr(\"y\", height * 1.44 )\n // .attr(\"font-size\", \"16px\")\n // .text(\" 100 \")\n // .style(\"fill-opacity\", 1.0E-6)\n // .transition(this)\n // .delay( sampTime * sampSize)\n // .duration(sampTime)\n // .style(\"fill-opacity\", 1);\n\n // var overlayC = Bootsvg.append(\"rect\") // 100 frame and activation\n // .attr(\"class\", \"rect\")\n // .attr(\"x\", 195)\n // .attr(\"y\", height * 1.38 -20)\n // .attr(\"width\", 40)\n // .attr(\"height\",30)\n // .style(\"fill\",\"red\")\n // .style(\"fill-opacity\", 1.0E-6)\n // .on(\"click\", function(){\n\t//\t\t\t\tBootCount = 100;\n\t//\t\t\t\treSampleMany(BootCount);})\n // .transition(this)\n // .delay( sampTime * sampSize)\n // .duration(sampTime)\n // .style(\"fill-opacity\", 0.2);\n\n Bootsvg.append(\"text\") // create Resample 500 button\n .attr(\"x\", 250 )\n .attr(\"y\", height * 1.38)\n .attr(\"font-size\", \"16px\")\n .text(\" 500 \")\n .style(\"fill-opacity\", 1.0E-6)\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n var overlayD = Bootsvg.append(\"rect\") // 500 frame and activation\n .attr(\"class\", \"rect\")\n .attr(\"x\", 245)\n .attr(\"y\", height * 1.38 -20)\n .attr(\"width\", 40)\n .attr(\"height\",30)\n .style(\"fill\",\"orange\")\n .style(\"fill-opacity\", 1.0E-6)\n .on(\"click\", function(){\n\t\t BootCount = 500;\n \t reSampleMany(BootCount);})\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 0.4);\n\n Bootsvg.append(\"text\") // create Resample 1000 button\n .attr(\"x\", 300 )\n .attr(\"y\", height * 1.38)\n .attr(\"font-size\", \"16px\" )\n .text(\" 1000 \")\n .style(\"fill-opacity\", 1.0E-6)\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n var overlayM = Bootsvg.append(\"rect\") // 1000 frame and activation\n .attr(\"class\", \"rect\")\n .attr(\"x\", 295 )\n .attr(\"y\", height * 1.38 -20)\n .attr(\"width\", 48)\n .attr(\"height\",30)\n .style(\"fill\",\"green\")\n .style(\"fill-opacity\", 1.0E-6)\n .on(\"click\", function(){\n\t BootCount = 1000;\n reSampleMany(BootCount);})\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 0.15);\n\n Bootsvg.append(\"text\") // create Resample 5000 button\n .attr(\"x\", 360 )\n .attr(\"y\", height * 1.38)\n .attr(\"font-size\", \"14px\")\n .text(\" 5000 \")\n .style(\"fill-opacity\", 1.0E-6)\n .transition(this)\n .delay( sampTime * sampSize)\n .duration(sampTime)\n .style(\"fill-opacity\", 1);\n\n // var overlayDX = Bootsvg.append(\"rect\") // 5000 frame and activation\n // .attr(\"class\", \"rect\")\n // .attr(\"x\", 355)\n // .attr(\"y\", height * 1.38 -20)\n // .attr(\"width\", 48)\n// .attr(\"height\",30)\n// .style(\"fill\",\"blue\")\n// .style(\"fill-opacity\", 1.0E-6)\n // .on(\"click\", function(){\n//\t \t\tBootCount = 5000;\n//\t \t\treSampleMany(BootCount);})\n// .transition(this)\n// .delay( sampTime * sampSize)\n// .duration(sampTime)\n// .style(\"fill-opacity\", 0.15);\n\n// Bootsvg.append(\"text\") // create Resample 10000 button\n// .attr(\"x\", 430 )\n// .attr(\"y\", height * 1.38)\n// .attr(\"font-size\", \"14px\")\n// .text(\" 10,000 \")\n// .style(\"fill-opacity\", 1.0E-6)\n// .transition(this)\n// .delay( sampTime * sampSize)\n// .duration(sampTime)\n// .style(\"fill-opacity\", 1);\n\n// var overlayMX = Bootsvg.append(\"rect\") // 10000 frame and activation\n// .attr(\"class\", \"rect\")\n// .attr(\"x\", 425)\n// .attr(\"y\", height * 1.38 -20)\n// .attr(\"width\", 54)\n// .attr(\"height\",30)\n// .style(\"fill\",\"purple\")\n// .style(\"fill-opacity\", 1.0E-6)\n// .on(\"click\", function(){\n//\t BootCount = 10000;\n// reSampleMany(BootCount);})\n// .transition(this)\n// .style(\"fill-opacity\", 0.1)\n// .delay( sampTime * sampSize)\n// .duration(sampTime)\n// .style(\"fill-opacity\", 0.2);\n }", "function loadTrainingTones(range){\n\tfor (var jj=0;jj<50;jj++){ // looping number of total presentations\t\t\n\t\t\t\ttones = sampleUniform(range,[1.2,1.2],2); \n\t\t\t\t\ttone1Training[jj] = tones[0];\n\t\t\t\t\ttone2Training[jj]= tones[1];\n\t}\n}", "set humanoidOversampling(value) {}", "sample(point) {\n // @TODO\n\n var isovalue = 0.0;\n isovalue = sampleIsoValue(point, this.balls);\n return isovalue;\n }", "drawExample() {\n let phenotype = this.generation[this.options.phenotypePerGeneration - 1]; // The best\n let canvas = document.querySelector(\".genetic-art .canvas_container .result\");\n let ctx = canvas.getContext('2d');\n ctx.putImageData(phenotype.generateWithRatio(1 / this.ratio), 0, 0)\n }", "function generateSamples() {\n for (let i = 0; i < NUM_STRIPS; i++) {\n const strip = new GlitchStrip({\n sampleImage: BASE_IMAGE_DATA,\n sampleArea: new Area(1, 0.01, BASE_IMAGE_DATA).init(),\n renderArea: new Area(0.65).init(),\n minSizeRatio: 0.04 * 1.5, //0.04\n maxSizeRatio: 0.017 * 1.5 //0.017\n }).init()\n sampleBlocks.push(strip)\n }\n\n for (let i = 0; i < NUM_HIGH_RES_FRAGMENTS; i++) {\n const fragment = new GlitchFragment({\n sampleImage: BASE_IMAGE_DATA,\n sampleArea: new Area(1, 0.1, BASE_IMAGE_DATA).init(),\n renderArea: new Area(0.65).init(),\n minSizeRatio: 0.09 * 1.5,\n maxSizeRatio: 0.16 * 1.5,\n minSampleRatio: 0.2,\n maxSampleRatio: 0.25\n }).init()\n sampleBlocks.push(fragment)\n }\n\n for (let i = 0; i < NUM_LOW_RES_FRAGMENTS; i++) {\n const fragment = new GlitchFragment({\n sampleImage: BASE_IMAGE_DATA,\n sampleArea: new Area(1, 0.4, BASE_IMAGE_DATA).init(),\n renderArea: new Area(0.65).init(),\n minSizeRatio: 0.04 * 1.5,\n maxSizeRatio: 0.07 * 1.5,\n minSampleRatio: 0.1,\n maxSampleRatio: 0.15\n }).init()\n sampleBlocks.push(fragment)\n }\n\n shuffle(sampleBlocks)\n}", "samples(tstates) {\n return Math.floor((0.5 + (this.cycle * tstates)));\n }", "function optionChanged(NextSample){\n ChartInfo(NextSample);\n AllData(NextSample);\n\n }", "function generateSampleData() {\r\n\r\n var itemContent = \"<p>活动内容</p>\";\r\n var itemDescription = \"Item Description\";\r\n var groupDescription = \"Group Description\";\r\n var startevent_groupDescription = \"将要举行的活动都显示在这里。可以选择右边具体的活动选项,查看活动的具体详情。期待您参与这些活动!\";\r\n var endEvent_groupDescription = \"您可能错过的活动都显示在这里。右边是您错过的活动列表,可以选择一项查看详情。多参加社交活动,有利于身体健康,期待您积极参加下一次活动。\";\r\n // These three strings encode placeholder images. You will want to set the\r\n // backgroundImage property in your real data to be URLs to images.\r\n var darkGray = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY3B0cPoPAANMAcOba1BlAAAAAElFTkSuQmCC\";\r\n var lightGray = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY7h4+cp/AAhpA3h+ANDKAAAAAElFTkSuQmCC\";\r\n var mediumGray = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXY5g8dcZ/AAY/AsAlWFQ+AAAAAElFTkSuQmCC\";\r\n\r\n // Each of these sample groups must have a unique key to be displayed\r\n // separately.\r\n\r\n\r\n // Each of these sample items should have a reference to a particular\r\n // group.\r\n var sampleItems = [\r\n //The event will start.\r\n { group: sampleGroups[0], title: \"圣诞节来临\", subtitle: \"2012-12-25\", description: itemDescription, content: itemContent, backgroundImage: '/images/single_event.png' },\r\n { group: sampleGroups[0], title: \"我们的元旦晚会\", subtitle: \"2013-01-01\", description: itemDescription, content: itemContent, backgroundImage: '/images/single_event.png' },\r\n { group: sampleGroups[0], title: \"春节\", subtitle: \"2013-01-01\", description: itemDescription, content: itemContent, backgroundImage: '/images/single_event.png' },\r\n { group: sampleGroups[0], title: \"我的生日晚会\", subtitle: \"2013-01-01\", description: itemDescription, content: itemContent, backgroundImage: '/images/single_event.png' },\r\n { group: sampleGroups[0], title: \"公司年会\", subtitle: \"2013-01-01\", description: itemDescription, content: itemContent, backgroundImage: '/images/single_event.png' },\r\n\r\n //The event have been end.\r\n { group: sampleGroups[1], title: \"感恩节\", subtitle: \"2013-02-01\", description: itemDescription, content: itemContent, backgroundImage: 'images/single_event_end.png' },\r\n { group: sampleGroups[1], title: \"中秋节\", subtitle: \"2013-03-01\", description: itemDescription, content: itemContent, backgroundImage: 'images/single_event_end.png' },\r\n { group: sampleGroups[1], title: \"这是一个测试\", subtitle: \"2013-01-01\", description: itemDescription, content: itemContent, backgroundImage: 'images/single_event_end.png' }\r\n ];\r\n\r\n\r\n\r\n }", "function updateSample2() {\n playing = false;\n setUpdatingState();\n player.stop();\n setTimeout(() => {\n generateSample(z => {\n z2 = z;\n generateProgressions(setStoppedState);\n });\n }, 0);\n}", "function selectPreviewPoints(samplePoints) {\n \n //Compress waveform to theme width and pick points at sample rate\n var previewWave = [];\n\n var sampleDelta = parseInt(samplePoints.length/theme.samplesPerFrame);\n \n console.log(\"Delta: \" + sampleDelta);\n\n for (var i=0; i < samplePoints.length; i++) {\n if (i%sampleDelta == 0) {\n console.log(i);\n console.log(samplePoints[i]);\n var point = [ samplePoints[i][0], samplePoints[i][1] ];\n previewWave.push(point);\n }\n }\n return previewWave;\n}", "function samplechangeOption(scope) {\n selected_sample =scope.select_sample;\n\tsample_number= parseInt(selected_sample)+5;\n\tfor (var i = 5; i < 15; i++) { \n\t\tvar _beaker_name = \"beaker_\" + i;\n\t\tbeaker_name_container = machine_container.getChildByName(_beaker_name);\n\t\tbeaker_name_container.visible=false;\n\t}\n\tmachine_container.getChildByName(\"beaker_\"+sample_number).visible=true; \n\tif(sample_number>=6){\n\t\tsample_selected_flag=true;\n\t\tenable_disable_beaker(false) \n\t\tscope.test_disable=true;\n\t}\n\telse{\n\t\tsample_selected_flag=false;\n\t\tenable_disable_beaker(true) \n\t\tscope.test_disable=false;\n\t}\n}", "function getRandomDescription () {\n return sampleDescriptions[Math.floor(Math.random()*sampleDescriptions.length)];\n}", "function incubateProteins(scope, selected_sample,x_pos) {\n\tshuffleArray(protein_array);\n\tif ( selected_sample == 1 ) {\n\t\tfindWeight(scope, marker_array,x_pos); /** Passing the samples arrays for finding the molecular weight */\n\t} else if ( selected_sample == 2 ) {\n\t\tfindWeight(scope, sample1_array,x_pos); /** Passing the samples arrays for finding the molecular weight */\n\t} else if ( selected_sample == 3 ) {\n\t\tfindWeight(scope, sample2_array,x_pos); /** Passing the samples arrays for finding the molecular weight */\n\t} else if ( selected_sample == 4 ) {\n\t\tfindWeight(scope, sample3_array,x_pos); /** Passing the samples arrays for finding the molecular weight */\n\t} else if ( selected_sample == 5 ) {\n\t\tfindWeight(scope, sample4_array,x_pos); /** Passing the samples arrays for finding the molecular weight */\n\t} else if ( selected_sample == 6 ) {\n\t\tfindWeight(scope, sample5_array,x_pos); /** Passing the samples arrays for finding the molecular weight */\n\t}\n}", "selectRand() {\n\t}", "function optionChanged(newSample){\n getData(newSample);\n getDemoData(newSample);\n\n}", "truncateSamples_(samples) {\r\n for (let i = 0, len = samples.length; i < len; i++) {\r\n if (samples[i] > 1) {\r\n samples[i] = 1;\r\n } else if (samples[i] < -1) {\r\n samples[i] = -1;\r\n }\r\n }\r\n }", "function updatePage() {\n\n sampleData = filterSamples(importedData);\n\n\n}", "function sample(samplingRate) {\n return Math.random() * 100 < samplingRate;\n}", "function addSample() {\n var sampleID = $(\"#bootbox-sample-id\").val();\n var subjectID = $(\"#bootbox-subject-id-samples\").val();\n addSampleIDtoDataBase(sampleID, subjectID);\n if (samplesTableData.length !== 0) {\n $(\"#div-import-primary-folder-sam\").hide();\n }\n if (samplesTableData.length === 2) {\n onboardingMetadata(\"sample\");\n }\n}", "function SeededRandom(){}", "function sample (population, count) {\n var arr = population.slice();\n var j, tmp, ln = arr.length;\n for (var i = ln - 1; i > (ln - count - 1); i--) {\n j = baseRandInt(i + 1);\n tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n return arr.slice(ln - count);\n }", "function createSampleConfig(data){\r\n\r\n if(data.n){\r\n // get the buffer by an id\r\n buffer = me.samples[data.n];\r\n //console.log(data.n, buffer);\r\n }\r\n\r\n\r\n if(buffer === undefined){\r\n if(sequencer.debug){\r\n console.log('no buffer found for ' + id + ' (' + me.name + ')');\r\n }\r\n sampleConfig = false;\r\n return;\r\n }\r\n\r\n sampleConfig = {\r\n noteNumber: noteNumber,\r\n buffer: buffer,\r\n autopan: me.autopan\r\n };\r\n\r\n // sample pack sustain\r\n if(config.sustain === true){\r\n sampleConfig.sustain = true;\r\n update = true;\r\n }\r\n\r\n // sustain\r\n if(data.s !== undefined){\r\n sampleConfig.sustain_start = data.s[0];\r\n sampleConfig.sustain_end = data.s[1];\r\n sampleConfig.sustain = true;\r\n update = true;\r\n }\r\n\r\n // global release\r\n if(config.release_duration !== undefined){\r\n sampleConfig.release_duration = config.release_duration;\r\n sampleConfig.release_envelope = config.release_envelope || me.releaseEnvelope;\r\n sampleConfig.release = true;\r\n update = true;\r\n }\r\n\r\n // release duration and envelope per sample overrules global release duration and envelope\r\n if(data.r !== undefined){\r\n if(typeString(data.r) === 'array'){\r\n sampleConfig.release_duration = data.r[0];\r\n sampleConfig.release_envelope = data.r[1] || me.releaseEnvelope;\r\n }else if(!isNaN(data.r)){\r\n sampleConfig.release_duration = data.r;\r\n sampleConfig.release_envelope = me.releaseEnvelope;\r\n }\r\n sampleConfig.release = true;\r\n update = true;\r\n //console.log(data.r, sampleConfig.release_duration, sampleConfig.release_envelope)\r\n }\r\n\r\n // panning\r\n if(data.p !== undefined){\r\n sampleConfig.panPosition = data.p;\r\n sampleConfig.panning = true;\r\n }\r\n //console.log(data.p, sampleConfig.panning);\r\n //console.log('ready', sampleConfig);\r\n }", "function newTarget() {\n randomBucketReq();\n displayTarget();\n speechBubble();\n}", "sample_perlin(x,y){\n var sample = this.perlin_generator.GetPerlinNoise(x/64 ,y/64)+\n 0.5*this.perlin_generator.GetPerlinNoise(x/8 ,y/8)\n 0.25*this.perlin_generator.GetPerlinNoise(x/4 ,y/4);\n return (Math.pow(sample+1,1.5)-1)*4;\n }", "function optionChanged(newsample){readFile(newsample)}", "function loadSamples(){\n\tconsole.log(\"load samples called \" + tag_no + \" load number \" + sampleLoadNumber);\n\tswitch(parseInt(tag_no)){\n\t\tcase 1001:\n\t\t\tchosenFrequencies = frequencies[0];\n\t\t\tdocument.getElementById(\"frequencies\").innerHTML = \"Frequencies: \" + chosenFrequencies;\n\t\t\tbreak;\n\t\tcase 1002:\n\t\t\tchosenFrequencies = frequencies[1];\n\t\t\tdocument.getElementById(\"frequencies\").innerHTML = \"Frequencies: \" + chosenFrequencies;\n\t\t\tbreak;\t\n\t\tcase 1003:\n\t\t\tchosenFrequencies = frequencies[2];\n\t\t\tdocument.getElementById(\"frequencies\").innerHTML = \"Frequencies: \" + chosenFrequencies;\n\t\t\tbreak;\n\t\tcase 1004:\n\t\t\tchosenFrequencies = frequencies[3];\n\t\t\tdocument.getElementById(\"frequencies\").innerHTML = \"Frequencies: \" + chosenFrequencies;\n\t\t\tbreak;\n\t\tcase 1005:\n\t\t\tchosenFrequencies = frequencies[4];\n\t\t\tdocument.getElementById(\"frequencies\").innerHTML = \"Frequencies: \" + chosenFrequencies;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"bad tag number \" + tag_no);\n\n\t}\n\t//All ones could use this test tone, however it is non-essential and left \n\t//till the end\n\tif(sampleLoadNumber==0){\n\t\tsetTimeout(loadTimer, loadTimeout);\n\t\t//testTone = loadSound('test.wav', progress)\n\t}\n\t\n}", "function G_sample_selector(v, converter)\n{\n var start_index;\n var end_index;\n var win_left;\n var win_right;\n\n this.select_samples = function(v_plane)\n {\n var w = v_plane.get_physical_window();\n if (win_left == undefined)\n {\n start_index = 0;\n while ((start_index < v.length - 1) && (converter(v[start_index]) < w.left))\n {\n start_index++\n }\n\n end_index = v.length - 1;\n while ((end_index > 0) && (converter(v[end_index]) > w.right))\n {\n end_index--\n }\n\n }\n else\n {\n if (win_left < w.left)\n {\n while ((start_index < v.length - 1) && (converter(v[start_index]) < w.left))\n {\n start_index++\n }\n }\n else\n {\n while ((start_index > 0) && (converter(v[start_index]) > w.left))\n {\n start_index--\n }\n }\n\n if (win_right > w.right)\n {\n while ((end_index > 0) && (converter(v[end_index]) > w.right))\n {\n end_index--\n }\n }\n else\n {\n while ((end_index < v.length - 1) && (converter(v[end_index]) < w.right))\n {\n end_index++\n }\n }\n }\n win_left = w.left;\n win_right = w.right;\n return v.slice(start_index, end_index + 1);\n }\n}", "function SamplerButton(x, y, w, h, filepath, idCheck) {\n\n this.x = x;\n this.y = y;\n this.width = w;\n this.height = h;\n this.on = false;\n this.sample = loadSound(filepath, loaded);\n this.idCheck = idCheck;\n\n this.display = function() {\n if(this.on) {\n fill(255,0,0);\n } else {\n fill(200);\n }\n stroke(0);\n rect(this.x, this.y, this.width, this.height);\n\n textAlign(CENTER);\n fill(0);\n noStroke();\n text(\"\" + this.idCheck + \"\", this.x + this.width/2, this.y + this.height/2);\n }\n\n this.play = function() {\n if(this.sample.isLoaded() && audioLoaded === true && this.on) {\n if(!this.sample.isPlaying()) {\n this.sample.loop();\n }\n }\n\n if(!this.on) {\n this.sample.stop();\n }\n }\n\n this.mouseOn = function() {\n if(mouseX > this.x && mouseX < this.x + this.width && mouseY > this.y && mouseY < this.y + this.height) {\n this.on = !this.on;\n }\n }\n\n\n this.killAll = function() {\n if(this.sample.isPlaying() && audioLoaded === true) {\n this.sample.stop();\n this.on = !this.on;\n }\n }\n\n\n //add effects to an individual sample: if the effectsName string matches those//\n //found in the switch statement below, the relevent effect is applied//\n this.addEffect = function(effectsName) {\n //MOUSE EFFECTS START//\n //volume//\n volMapX = map(mouseX, mouseControlWin.x, mouseControlWin.x + mouseControlWin.width, 0, 1);\n volMapY = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, 0, 1);\n\n //panning//\n panningX = map(mouseX, mouseControlWin.x, mouseControlWin.x + mouseControlWin.width, -1.0, 1.0);\n panningY = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, -1.0, 1.0);\n\n //rate//\n speedX = map(mouseX, mouseControlWin.x, mouseControlWin.x + mouseControlWin.width, 0, 2);\n speedX = constrain(speedX, 0.01, 4);\n speedY = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, 0, 2);\n speedY = constrain(speedY, 0.01, 4);\n\n //lowPass//\n lowPassFilterFreq = map(mouseX, mouseControlWin.x, mouseControlWin.x + mouseControlWin.width, 10, 22050);\n lowPassFilterRes = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, 15, 5);\n\n //highPass//\n highPassFilterFreq = map(mouseX, mouseControlWin.x, mouseControlWin.x + mouseControlWin.width, 10, 22050);\n highPassFilterRes = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, 15, 5);\n\n //delay//\n delayFreq = map(mouseX, mouseControlWin.x, mouseControlWin.x + mouseControlWin.width, 60, 15000);\n delayFreq = constrain(delayFreq, 60, 15000);\n delayRes = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, 3, 0.01);\n delayRes = constrain(delayRes, 0.01, 3);\n delTime = map(mouseY, mouseControlWin.y + mouseControlWin.height, mouseControlWin.y, .2, .01);\n delTime = constrain(delTime, .01, .2);\n //MOUSE EFFECTS END//\n\n switch(effectsName) {\n case \"VolumeX\":\n this.sample.setVolume(volMapX);\n break;\n\n case \"VolumeY\":\n this.sample.setVolume(volMapY);\n break;\n\n case \"PanX\":\n this.sample.pan(panningX);\n break;\n\n case \"PanY\":\n this.sample.pan(panningY);\n break;\n\n case \"SpeedX\":\n this.sample.rate(speedX);\n break;\n\n case \"SpeedY\":\n this.sample.rate(speedY);\n break;\n\n case \"LowPassXY\":\n connectToLowPassFilter(this.sample);\n lowPassFilter.set(lowPassFilterFreq, lowPassFilterRes);\n break;\n\n case \"HighPassXY\":\n connectToHighPassFilter(this.sample);\n highPassFilter.set(highPassFilterFreq, highPassFilterRes);\n break;\n\n case \"DelayXY\":\n connectToDelayFilter(this.sample); //only apply effect to single sample//\n delay.delayTime(delTime);\n break;\n\n default:\n console.log('waiting for effectsName');\n }\n\n }\n\n //effects are added the same way as above, but this time for effects that are//\n //controlled by the fist-detection library//\n this.addEffectWebcam = function(effectsName) {\n volMapXWebcam = map(globalFistPos[0], 50, 600, 0, 1);\n volMapYWebcam = map(globalFistPos[1], 400, 50, 0, 1);\n\n panningXWebcam = map(globalFistPos[0], 50, 600, -1.0, 1.0);\n panningYWebcam = map(globalFistPos[1], 400, 50, -1.0, 1.0);\n\n speedXWebcam = map(globalFistPos[0], 50, 600, 0, 2);\n speedXWebcam = constrain(speedXWebcam, 0.01, 4);\n speedYWebcam = map(globalFistPos[1], 400, 50, 0, 2);\n speedYWebcam = constrain(speedYWebcam, 0.01, 4);\n\n lowPassFilterFreqWebcam = map(globalFistPos[0], 50, 600, 10, 22050);\n lowPassFilterResWebcam = map(globalFistPos[1], 400, 50, 15, 5);\n\n highPassFilterFreqWebcam = map(globalFistPos[0], 50, 600, 10, 22050);\n highPassFilterResWebcam = map(globalFistPos[1], 400, 50, 15, 5);\n\n delayFreqWebcam = map(globalFistPos[0], 50, 600, 60, 15000);\n delayFreqWebcam = constrain(delayFreqWebcam, 60, 15000);\n delayResWebcam = map(globalFistPos[1], 400, 50, 3, 0.01);\n delayResWebcam = constrain(delayResWebcam, 0.01, 3);\n delTimeWebcam = map(globalFistPos[1], 400, 50, .2, .01);\n delTimeWebcam = constrain(delTimeWebcam, .01, .2);\n\n switch(effectsName) {\n case \"VolumeX\":\n this.sample.setVolume(volMapXWebcam);\n break;\n\n case \"VolumeY\":\n this.sample.setVolume(volMapYWebcam);\n break;\n\n case \"PanX\":\n this.sample.pan(panningXWebcam);\n break;\n\n case \"PanY\":\n this.sample.pan(panningYWebcam);\n break;\n\n case \"SpeedX\":\n this.sample.rate(speedXWebcam);\n break;\n case \"SpeedY\":\n this.sample.rate(speedYWebcam);\n break;\n\n case \"LowPassXY\":\n connectToLowPassFilter(this.sample);\n lowPassFilter.set(lowPassFilterFreqWebcam, lowPassFilterResWebcam);\n break;\n\n case \"HighPassXY\":\n connectToHighPassFilter(this.sample);\n highPassFilter.set(highPassFilterFreqWebcam, highPassFilterResWebcam);\n break;\n\n case \"DelayXY\":\n connectToDelayFilter(this.sample);\n delay.delayTime(delTimeWebcam);\n break;\n\n default:\n console.log('waiting for webcam effectsName');\n }\n\n }\n\n //Resets all sample effects to default//\n this.resetEffectsToDefault = function(effectsName) {\n this.sample.setVolume(1);\n this.sample.pan(0);\n this.sample.rate(1);\n //filter reset//\n this.sample.disconnect();\n this.sample.connect();\n }\n\n}", "function optionChanged(newSample){\n console.log(newSample);\n buildMetadata(newSample);\n //buildCharts(newSample);\n}", "function makeSamples(groove, color, data){\n\n\tvar oneSecond = 44100;\n\tvar loop = false;\n\tvar repeats = 4;\n\tvar repeated = 0;\n\tvar PI = Math.PI;\n\n\tvar maxSamples = (groove.duration * oneSecond ) / 1000 ;\t\n var instrumentType = \"sin\";\n var delay = false;\n if (color == 0) {\n\tdelay = true;\n } \n else if (color == 1) {\n } \n else if (color == 2) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 3) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 4) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 5) {\n\tinstrumentType = \"sqr\";\n } \n else if (color == 6) {\n\tinstrumentType = \"sqr\";\n\tdelay = true;\n } \n else if (color == 7) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 8) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 9) {\n\tinstrumentType = \"saw\";\n } \n else if (color == 10) {\n\tinstrumentType = \"saw\";\n } \n\n var freqs = data[0];\n var times = data[1];\n\tdebugfreqs = freqs;\n \tdebugtimes = times;\n\n var samples = [];\n ii = 0;\n var tcounter = 0;\n for (var j = 0; j < freqs.length - 1; j++) {\n\t\tif (j == 0 && times[0] > groove.startLine){\n\t\t\tvar freqDur = times[j] / groove.lineLength;\n\t \n\t\t\tfreqDur = freqDur * groove.duration;\n\t\t\tfreqDur = freqDur * 44100;\n\t\t\tfreqDur = Math.floor(freqDur / 1000);\n\t \n\t \tfor (var i = 0; i < freqDur; i++) {\n\t \t var t = i / oneSecond; \n\t \t samples[ii] = 0;\n\t \t ii++;\n\t\t }\n\t\t}\n var frequency = freqs[j];\n//\tif (freqs.length > j + 1 && freqs[j + 1] == 0){\n//\t\tfrequency = 0;\n//\t}\n\n var freqDur = times[j + 1] / groove.lineLength;\n \n freqDur = freqDur * groove.duration;\n freqDur = freqDur * 44100;\n freqDur = Math.floor(freqDur / 1000);\n\n// \tfor (var i = 0; i < freqDur; i++){\n\t\tvar i = 0;\n while (true){\n var t = i / oneSecond; // time from 0 to 1\n if (frequency == 0){\n samples[ii] = 0;\n }\n\t\t else if (instrumentType == \"sin\"){\n\t\t samples[ii] = Math.sin(frequency * 2 * PI * t); // wave equation (between -1,+1)\n\t\t }\n else if (instrumentType == \"sqr\") {\n\t\t\t if (Math.sin(frequency * 2 * PI * t) > 0){\n\t\t\t\t\tsamples[ii] = 1; } else { samples[ii] = -1;\n\t\t\t\t}\n\t\t }\n else if (instrumentType == \"saw\") {\n \tsamples[ii] = 1 - ((frequency*t)%1);\n\t\t }\n samples[ii] = samples[ii] * 0.25;\n\n\t\t\tif (i >= freqDur){\n\t\t\t\tif (instrumentType == \"sin\"){\n\t\t\t\t\tif (samples[ii] == 0 || (samples[ii -1] < samples[ii] && samples[ii] < 0.01 && samples[ii] > -0.01)){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\n\t\t\t}\n ii++;\n if (maxSamples > 0 && ii >= maxSamples){\n\t\t\t\tbreak;\n\t\t }\n\t\t i++;\n }\n if (maxSamples > 0 && ii >= maxSamples){\n\t\t\tbreak;\n\t }\n }\n if (maxSamples == 0){\n\t\tmaxSamples = ii;\n }\n else {\n\t\twhile (ii < maxSamples){\n\t \t\tsamples[ii] = 0;\n\t \tii++;\n\t\t}\n }\n//\tdocument.write(ii);\n//\tdocument.write(\"<br/>\");\n// var delayLine = new Array;\n// var pointer = 0;\n// var delayLength = oneSecond / 2;\n// for (var ijj = 0; ijj < groove.lineLength; ijj++){\n//\t\tdelayLine[ijj] = 0;\n// }\n for (var repeat = 1 ; repeat < repeats; repeat++){\n for (var jj = 0 ; jj < ii ; jj++){\n samples[jj + ii * repeat] = samples[jj];\n\t if (delay){\n//\t\tsamples[jj + ii * repeat] = samples[jj + ii * repeat] - 0.5*delayLine[pointer];\n//\t\tdelayLine[pointer] = samples[jj + ii * repeat];\n//\t\tpointer = (pointer+1)%lineLength;\n }\n\t }\n\t}\n return samples;\n}", "function trial()\n{}", "function optionChanged(sample){\r\n \r\n buildplot(sample);\r\n \r\n \r\n }", "function optionChanged(newsample) {\n buildPlots(newsample);\n buildMetadataInfo(newsample);\n}", "function sample(k, a, dist, params) {\n coroutine.sample(k, a, dist, params);\n}", "sample(){\n return this.cells[Math.floor(Math.random()*this.size)] ;\n }", "function TakeAPoint(data)\n {\n \n TakePointSound();\n var x = {\"X\": data.X, \"Y\":data.Y, \"Z\": data.Z, \"I\": data.I, \"J\": data.J, \"K\": data.K, \"ANGLES\": data.ANGLES, \"RawPositions\" : data.RawPositions}; \n elem = document.getElementById(\"pointsTakenId2\");\n\n switch(MeasureStep)\n \n {\n case 0:\n pts1.push(x);\n \n $(\"#pointsTakenId\").val(pts1.length)\n elem.value = pts1.length;\n if(pts1.length<=pointsNeededVal){\n $(\"#probPointsId\").html(pts1.length+\"/\"+pointsNeededVal);\n $(\"#CalculateResultId\").click(function(){\n finalStep();\n })\n }else{\n \n $(\"#CalculateResultId\").unbind(\"click\");\n\n\n }\n // special case for calibration and checkout.\n\n if(MaxPointsToTake != 0 && MaxPointsToTake == pts1.length){\n $(\".pointsContainer .btn-green\").css('background','#1db79b'); \n }\n\n break;\n case 1:\n pts2.push(x);\n elem.value = pts2.length;\n break;\n case 2:\n pts3.push(x);\n elem.value = pts3.length;\n break;\n case 3:\n pts4.push(x);\n elem.value = pts4.length;\n break;\n }\n \n \n \n }", "function new_scenario() {\n\t\tselect_functions(f_type_target,f_type_hypothesis);\n\t let target_function = f_target(true_weight),\n\t predicted_function = f_hypothesis(w_hat);\n\n\t let target = gen_function_data(target_function,NTARGET,XMIN,XMAX),\n\t noisefree_data = gen_function_data_random_x(target_function,nData,XMAX,XMIN),\n\t noise = gen_noise(nData),\n\t data = corrupt_data(noisefree_data, noise);\n\t weights = linspace(WMIN,WMAX,NWEIGHT),\n\t error_data = mse(weights,data),\n\t\t\tpointwise_error = square_error(data, predicted_function)\n\t hypothesis = [] ;\n\t if (w_hat !== '') {\n\t hypothesis = gen_function_data(predicted_function,NTARGET,XMIN,XMAX);\n\t\t\t}\n\t\t\t\n\t return {target:target, \n\t noisefree_data:noisefree_data,\n\t noise:noise,\n\t data:data, \n\t weights:weights, \n\t error_data:error_data,\n\t pointwise_error:pointwise_error,\n\t\t\t\thypothesis:hypothesis};\n\t}", "function optionChanged(newSample){\n //alert(newSample);\n chartBuilder(newSample);\n metadataBuilder(newSample);\n }", "function createSampleBtn(target, sample) {\n var btn,\n dset = ws.samples.get(sample);\n\n if (!dset) {\n return;\n }\n\n btn = sampleBtn = ws.dom.cr('div', 'ws-ok-button', dset.title);\n\n ws.dom.on(btn, 'click', function() {\n if (\n confirm(\n 'You are about to load the ' +\n dset.title +\n ' sample set. This will purge any existing data in the chart. Continue?'\n )\n ) {\n events.emit('LoadDataSet', dset);\n }\n });\n\n ws.dom.ap(target, btn);\n }", "function loadSampleFile() {\n /**\n * Callback function when file loaded\n * @param {string} file name\n * @param {AudioBuffer} file buffer\n */\n function addFileToCanvas(filename, buffer) {\n var newBuffer = [];\n for (var i = 0; i < buffer.numberOfChannels; i++) {\n newBuffer.push(buffer.getChannelData(i));\n }\n drawContext.add(new AudioCurve(newBuffer, filename, buffer.sampleRate));\n }\n var input = document.getElementById('sample_file');\n audioPlay.loadFile(input.files[0], addFileToCanvas);\n input.value = '';\n}", "function exampleFunctionToRun(){\n\n }", "function optionChanged(sample) {\n createChart(sample);\n createMetaData(sample);\n // createGauge(sample)\n}", "function loadTonesContext(range,drange,nTrials){\n\tfor (var jj=0;jj<nTrials;jj++){ // looping number of total presentations\n\t\t\ttones = sampleUniform(range,drange,1); \n\t\t\t\tcontext_tone[jj] = tones;\n\t}\n}", "resetSamples() {\n this._selectedSamples = [];\n this._activeSample = null;\n this.emitUpdate();\n }", "function activateTestMode() {\n var arr = newDataset.getDataset();\n var newArr = [];\n var amountToProcess = arr.length;\n for (let i = 0; i < arr.length; i++) {\n var a = new web3.utils.BN(\"10000000000000\");\n aa = [arr[i][0], a.toString()];\n newArr.push(aa);\n aa = [];\n }\n newDataset.resetData();\n newDataset.overrideData(newArr);\n console.log(JSON.stringify(newDataset.getDataset(), 2, 2));\n}", "function optionChanged(newSample) { \r\n buildMetadata(newSample);\r\n buildCharts(newSample);\r\n\r\n }", "function optionChanged(newSample) {\n\n // Display metadata Fucntion and Change\n metadata(newSample);\n\n // Display otu Function and Change \n otu(newSample);\n guage(newSample);\n}", "function randomSample(arrayofposts, size){\n\n}", "function generateSampleData() {\n \n console.log('Generating sample DB - remove before launch!');\n data = createSamplePrimitiveDB();\n\n console.log(data);\n\n}", "function optionChanged(sample) {\n console.log(sample)\n getPlots(sample);\n getInfo(sample);\n}", "function randomStimulusProc(block, trialNumber, isFirstTrial, isPractice) {\n let stimuli;\n let trialProp;\n let newRandom = Math.floor(Math.random() * 4); //choose a random position between 1-4\n stimuli = [{stimulus: [0, newRandom], data: {p_or_r: \"R\", block: block, first_response: 1, trial_number: trialNumber, sequence: usedSequenceString}}] //jsPsych.init modifies if necessary\n if (isFirstTrial == 1 && isPractice == 1) {\n stimuli[0].data.is_practice = 1;\n trialProp = firstTrialProperties;\n }\n else if (isPractice == 1) {\n stimuli[0].data.is_practice = 1;\n trialProp = randomTrialProperties\n } \n else if (isFirstTrial == 1){\n stimuli[0].data.is_practice = 0;\n trialProp = firstTrialProperties\n }\n else {\n stimuli[0].data.is_practice = 0;\n trialProp = randomTrialProperties\n }\n return {\n timeline: [trialProp],\n timeline_variables: stimuli\n }\n}", "sampleData(props = this.props) {\n const { dataset, func, sampler, samplerOptions, xExtent } = props;\n\n if (!dataset) {\n return undefined;\n }\n\n let options = Object.assign({}, samplerOptions);\n // use the x-extent as a default sample range\n if (!options.sampleRange) {\n options.sampleRange = xExtent;\n }\n\n return dataset.map(datum => ({\n datum: datum,\n samples: this.sampleDatum(options, datum, func, sampler)\n }));\n }", "multipleSamplesNoReplace(list, n) {\n\t\tconst samples = [];\n\t\twhile (samples.length < n && list.length) {\n\t\t\tsamples.push(this.sampleNoReplace(list));\n\t\t}\n\n\t\treturn samples;\n\t}", "function initSampleCmn(){\n\tvar fn = \"[about.js initSampleCmn()] \";\n\tjslog (JSLOG_JSU,fn + JSLOG_FUN_START);\n\n\tif (isInIframe()){\n\t\t// WE are in iframe (we are in SITE). Switch Current display selected\n\t\tgetElementById2('browserDisplay').className = 'browserDisplay';\n\t\tgetElementById2('siteDisplay').className = 'siteDisplaySel';\n\t}\n\ttry{\n\n\t\t//-----------------------------------------------------------\n\t\tvar szParOpt = urlGetParVal (URL_PAR_OPT);\n\t\tjslog (JSLOG_DEBUG,fn + \"URL PAR \" + URL_PAR_OPT + \"=\" + szParOpt);\n\t\tif (szParOpt != \"\"){\n\t\t\turl_par.opt = szParOpt;\n\t\t\tjslog (JSLOG_JSU,fn + \"show selectShowCol\");\n\t\t\telementShow (getElementById2(\"selectShowCol\"),true,\"inline\");\n\t\t\t// URL\n\t\t\tvar szLocation = window.n + \"\"; \n\t\t\tvar bJsLog = szLocation.indexOf (\"jslogSample\") > 0;\n\t\t\t// set preferred size to prepare YouTube Video \n\t\t\tif (bJsLog){\n\t\t\t window.moveTo(85, 34);\n\t\t\t window.resizeTo(1200, 800);\n\t\t\t}else{\n\t\t\t window.moveTo(85, 34);\n\t\t\t window.resizeTo(800+35, 620+170);\n\t\t\t}\n\t\t}\t\n\t// var URL_PAR_TEST=\"test\"; // 0= No TEST 1.. Number of Automatic Test to execute with Test Google Button \n\t// var URL_PAR_PERIOD=\"period\"; // Number of second sin randfom period default = 60\n\t\tvar iParTest = urlGetParVal (URL_PAR_TEST);\n\t\t// jslog (JSLOG_JSU,fn + \"URL: \" + URL_PAR_TEST + \"=\" + iParTest);\n\t\turl_par.bTest = (iParTest != undefined && iParTest != \"\");\n\t\t// jslog (JSLOG_JSU,fn + \"url_par.bTest=\" + url_par.bTest);\n\t\telementShow(getElementById2(\"test\",false), url_par.bTest);\n\t\tif (url_par.bTest){\n\t\t\turl_par.test = parseInt(iParTest);\n\t\t\t// Create test Div and add it di body\n\t\t\tjslog (JSLOG_INFO,fn + \"ADD divTest\");\n\t\t\tvar szDivTest = '<div id=\"test\">' + \n\t\t\t' <input type=\"button\" value=\"TEST Frame\" onclick=\"testStart(true);\" />&nbsp; &nbsp; &nbsp; <input type=\"button\" value=\"TEST Window\" onclick=\"testStart(false);\" /> <BR/>' + \n\t\t\t' Tmo(sec):<input with=\"50px\" id=\"testTmo\" readonly value=\"0\" />&nbsp; Test <input with=\"50px\" id=\"testDone\" readonly value=\"0\" />&nbsp;URL:<input with=\"50px\" id=\"testURL\" readonly width=\"100px\" />' + \n\t\t\t' <div id=\"divTestOut\">' + \n\t\t\t' </div>' + \n\t\t\t'</div>';\n\t\t\tvar divTest = document.createElement(\"div\");\n\t\t divTest.innerHTML = szDivTest;\n\t\t\tdocument.body.appendChild(divTest);\n\t\t\t\n\t\t}\n\t\tvar iParPeriod = urlGetParVal (URL_PAR_PERIOD);\n\t\tif (iParPeriod != undefined && iParPeriod != \"\"){\n\t\t\turl_par.period = parseInt(iParPeriod);\n\t\t\tjslog (JSLOG_DEBUG,fn + \"URL: \" + URL_PAR_PERIOD + \"=\" + iParPeriod );\n\t\t}\n\t\tvar iParPos = urlGetParVal (URL_PAR_POS);\n\t\tif (iParPos != undefined && iParPos != \"\"){\n\t\t\turl_par.pos = parseInt(iParPos);\n\t\t\tjslog (JSLOG_DEBUG,fn + \"URL: \" + URL_PAR_POS + \"=\" + iParPos );\n\t\t}\n\t\tvar szParType = urlGetParVal (URL_PAR_TYPE);\n\t\tif (szParType != undefined && szParType != \"\"){\n\t\t\turl_par.type = szParType;\n\t\t\tjslog (JSLOG_DEBUG,fn + \"URL: \" + URL_PAR_TYPE + \"=\" + szParType );\n\t\t}\n\t\tjslogObj (JSLOG_DEBUG,\"url_par\",url_par);\n\t\t// if Automatic TEST start it\n\t\ttestCheckAuto();\n\t}catch (e) {\n\t\tjslog (JSLOG_ERR,fn + \"Exception: \" + e.message);\n\t}\n\t\n\tjslog (JSLOG_JSU,fn + JSLOG_FUN_END);\n\t\n\t//\n}", "function showSampleData(elem) {\n console.log(elem.datasource.filename);\n var filename = elem.datasource.filename;\n var fileurl = \"https://cmpe295b-sjsu-bigdatasecurity.s3.amazonaws.com/\" + filename;\n parsePartialFile(fileurl);\n }", "function sampleFunction() {\n \t$scope.fullConversation[2].messages[0] = $scope.variables.name;\n \tgoNext();\n }", "function loadSample(fname, callback){\n\n loadedFname = fname;\n loadExample(fname, function (err, data){\n //if err, return\n if (err) {\n return};\n run();\n });\n }", "function updateTotalSamples() {\r\n\tvar totalSamplesSpan = document.getElementById('total-samples-span');\r\n\tif (totalSamplesSpan != null || totalSamplesSpan != undefined) {\r\n\t\ttotalSamplesSpan.innerText = countSamples();\r\n\t}\r\n}", "function newTest(){\n // Selecting a new random root and mode\n currentRoot = Math.floor(Math.random() * 11);\n currentMode = Math.floor(Math.random() * (currentIntervals.length-1));\n // Calculating current displayed scale (currentKeyScale) and intervals from the root and mode\n currentKeyScale = calculateScale(currentRoot, [...currentIntervals], currentMode); //[...array] used to send a copy of the array not the array itself\n // Setting up test state dom elemnts for new test\n rootSel.value = -1;\n modeSel.value = -1;\n relativeSel.value = -1;\n answerLab.innerHTML = \"\";\n nextBout.disabled = true;\n // Displaying the test scale\n drawKeyboard();\n colorScale(currentKeyScale);\n}", "function sampleNormal() {\n\n let fmt = {minimumFractionDigits: DPL};\n\n //Grab population parameters from 'sample.html'\n \n let mean = parseFloat(document.getElementById('normal_avg').value);\n let std = parseFloat(document.getElementById('normal_std').value);\n let n = parseInt(document.getElementById('normal_n').value);\n \n //console.log(mean, std, n);\n \n //Clear anything in 'mormres' and 'normstats' <div>s\n \n let result = document.getElementById('normal_results');\n result.innerHTML = '';\n \n let stats = document.getElementById('normal_stats');\n stats.innerHTML = '';\n \n // Generate a sample of n replicates from a population\n // with average = 'mean' and standard deviation = 'std'\n\n let x = 0, s = [], sumx = 0, sumx2 = 0;\n for ( let i = 0; i < n; i++ ) {\n x = jStat.normal.sample( mean, std );\n sumx += x;\n sumx2 += Math.pow(x,2);\n s.push(x); \n }\n \n let avg = ( sumx / n );\n let variance = ((sumx2 - Math.pow(sumx,2)/n)/(n-1));\n let sd = Math.sqrt(variance);\n \n let text = '<h3>Sampled values</h3>' +\n '<textarea cols=\"20\" rows=\"10\" id=\"norm_results\">';\n for ( let i = 0; i < n; i++ )\n text += s[i].toLocaleString( undefined, fmt ) + '\\n';\n text += '</textarea>';\n\n result.innerHTML = text;\n result.style.display = 'inline-block'; n\n \n text = '<h3>Sample statistics</h3>' +\n '<table><tr><td>x&#772; (average)</td><td>' +\n avg.toLocaleString( undefined, fmt ) + '</td></tr><tr>' +\n '<td><i>s</i> (stdev)</td><td>' +\n sd.toLocaleString( undefined, fmt ) + '</td></tr><tr>' +\n '<td><i>s</i>&sup2; (variance)</td><td>' +\n variance.toLocaleString( undefined, fmt ) + '</td></tr>';\n\n stats.innerHTML = text;\n stats.style.display = 'inline-block';\n \n }", "function writeSamplesInfo()\r\n{\r\n\tif (typeof g_samplesInstalled != \"undefined\" && g_samplesInstalled == true)\r\n\t{\r\n\t\twith (document)\r\n\t\t{\r\n\t\t\twrite(\"<br><hr width='80%'>\");\r\n\t\t\twrite(\"<h2><a name='Samples'>Samples installed</a></h2>\");\r\n\t\t\twrite(\"Some samples require the server platform to be installed in order to run the application in that server environment.\");\r\n\t\t\tif (true == g_samplesASP)\r\n\t\t\t\twrite(\"<li>ASP Samples\");\r\n\t\t\tif (true == g_samplesASPNET)\r\n\t\t\t\twrite(\"<li>ASP.NET Samples (Microsoft .NET server needs to be installed.)\");\r\n\t\t\tif (true == g_samplesColdFusion)\r\n\t\t\t\twrite(\"<li>ColdFusion Samples (ColdFusion server needs to be installed.)\");\r\n\t\t\tif (true == g_samplesHTML)\r\n\t\t\t\twrite(\"<li>HTML Samples\");\r\n\t\t\tif (true == g_samplesJSP)\r\n\t\t\t\twrite(\"<li>JSP Samples (JSP server needs to be installed.)\");\r\n\t\t\tif (true == g_samplesPHP)\r\n\t\t\t\twrite(\"<li>PHP Samples (PHP server needs to be installed.)\");\r\n\t\t\tif (true == g_samplesLasso)\r\n\t\t\t\twrite(\"<li>Lasso Samples (Lasso server needs to be installed.)\");\r\n\t\t\tif (true == g_samplesXML)\r\n\t\t\t\twrite(\"<li>XML Samples\");\r\n\t\t\tif (true == g_samplesDataDesign)\r\n\t\t\t\twrite(\"<li>Data Design Samples\");\r\n\t\t\tif (true == g_samplesWebImageFX)\r\n\t\t\t\twrite(\"<li>WebImageFX Samples\");\r\n\t\t\twriteln(\"<br>\");\r\n\t\t}\r\n\t}\r\n}", "get utterance()\n {\n return this.samples[this.sampleClassifier.classify(this.used)];\n }", "get_samples( s_cnt ){\n\t\t\tlet max \t= s_cnt-1,\n\t\t\t\tmax_inv\t= 1 / max,\n\t\t\t\tout \t= new Array( s_cnt ),\n\t\t\t\ti, t;\n\t\t\tfor( i=0; i <= max; i++ ){\n\t\t\t\tlet p = [0,0,0];\n\t\t\t\tt = i * max_inv;\n\t\t\t\tout[ i ] = this.at( t, p );\n\t\t\t}\n\t\t\treturn out;\n\t\t}", "function whenClicked2(){\n \t\tvar playSound = context.createBufferSource(); // Declare a New Sound\n\t\t\t\tplaySound.buffer = zero; // Attatch our Audio Data as it's Buffer\n\n\t\t\t\t// GAIN NODE\n\t\t\t\tgainNode = context.createGain(); // Create gain node\n\t\t\t\tvar gainval = document.getElementById('range1').value; //define the gainNode value (from the input slider)\n\t\t\t\tgainNode.gain.value = gainval; // Set gain node value\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t// FILTER NODE\n\t\t\t\tfilter = context.createBiquadFilter();\n\t\t\t\tvar filterval = document.getElementById('range2').value;\n\t\t\t\t// Create and specify parameters for the low-pass filter.\n\t\t\t\tfilter.type = 'lowpass'; // Low-pass filter. See BiquadFilterNode docs\n\t\t\t\tfilter.frequency.value = filterval; // Set cutoff to 440 HZ\n\t\t\t\t//filter.gain.value = 100;\n\t\t\t\t\n\t\t\t\t// DISTORTION NODE\n\t\t\t\tdistortion = context.createWaveShaper();\n\t\t\t\t//check to see if button is checked\n\t\t\t\tfunction distortionamount()\t{\n\t\t\t\t\tif (document.getElementById('distortvalue').checked) {\n\t\t\t\t\t\tdistortion.curve = makeDistortionCurve(10000);\n\t\t\t\t\t\t// alert(\"DISTORTION ACTIVATED\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdistortion.curve = makeDistortionCurve(0);\n\t\t\t\t\t\t// alert(\"DISTORTION NOT ACTIVATED\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdistortionamount();\n\t\t\t\t\n\t\t\t\t//connect it up\n\t\t\t\tplaySound.connect(gainNode); \n\t\t\t\tgainNode.connect(filter);\n\t\t\t\tfilter.connect(distortion);\n\t\t\t\tdistortion.connect(context.destination); //link to output\n\n\t\t\t\t// Playback the sound.\n\t\t\t\tvar playbackRateVal = document.getElementById('range3').value; // definte the playback rate from input 3\n\t\t\t\tplaySound.playbackRate.value = playbackRateVal;\n\t\t\t\tplaySound.start(0); // Play the Sound Immediately\n \t}", "function generateSamples(n, sort) {\n var data = [];\n for (var i = 0; i < n; i++) data.push($scope.distrFunctions.sample());\n if (sort) {\n data.sort(function (p1, p2) {\n return p1 < p2 ? -1 : (p1 > p2 ? 1 : 0);\n });\n }\n return data;\n }", "constructor() {\n this.amplitude = Math.random() * (10 - 2) + 2;\n this.checkSin = this.randomBool();\n this.choice = Math.round(Math.random() * (2 - 1)) + 1;\n this.direction1 = this.randomDirection();\n this.direction2 = this.randomDirection();\n // this.length = Math.ceil(Math.random() * 500);\n this.drawnLength = 0;\n this.length = Math.random() * 40;\n }", "function sample_population(population, fitnesses, selection_rate) {\n num_of_selected_chromosome = parseInt(selection_rate * population.length)\n mating_population = []\n // console.log(num_of_selected_chromosome + \" \" + population.length)\n for (var i = 0; i < num_of_selected_chromosome; i++) \n mating_population.push(roulette_wheel(population, fitnesses))\n\n return mating_population\n}", "function captureExamples() {\n console.log(\"staring capturing sprites...\")\n rInfo.hidden = false;\n rAlert.hidden = false;\n isCaptureExample = true;\n examplesNum = 0;\n exCtx.clearRect(0, 0, exCanvas.width, exCanvas.height);\n document.getElementById('updateModel').hidden = true;\n\n}", "mutation(rate) {\n function mutate(value) {\n if (Math.random() < rate) {\n return value + randomGaussian(0, 0.1);\n } else {\n return value;\n }\n }\n this.firstExtrinsicWeights.map(mutate);\n this.secondExtrinsicWeights.map(mutate);\n this.intrinsicWeights.map(mutate);\n }", "function Sample(name,chicken,available) {\n\tthis.name = name;\n\tthis.chicken = chicken;\n\tthis.booked = booked;\n\n\tthis.checkAvailability = function() {\n\t\treturn this.available - this.chicken; \n\t}\n}" ]
[ "0.640226", "0.63033336", "0.6285483", "0.6206293", "0.6042451", "0.59828913", "0.5927889", "0.5922859", "0.5878001", "0.58676636", "0.5837722", "0.5830816", "0.581275", "0.5781232", "0.5768793", "0.5758464", "0.5747044", "0.57237124", "0.5721485", "0.5719678", "0.5716194", "0.57059467", "0.5702057", "0.5694556", "0.5689933", "0.56834155", "0.5682411", "0.567226", "0.5663351", "0.5648064", "0.56146795", "0.5592228", "0.5591142", "0.5585822", "0.5584634", "0.5582745", "0.55726796", "0.55560154", "0.5508403", "0.5504416", "0.5484526", "0.5483943", "0.54735434", "0.547267", "0.5468981", "0.54643553", "0.5458794", "0.5435464", "0.5433144", "0.54239166", "0.54199916", "0.5418233", "0.54130566", "0.54104424", "0.5407274", "0.5399545", "0.5380377", "0.53760654", "0.5375262", "0.5354036", "0.5350793", "0.5348286", "0.5340708", "0.5339816", "0.5335538", "0.53346014", "0.5331517", "0.5331309", "0.5324009", "0.5320905", "0.53192866", "0.52884513", "0.52862024", "0.5276675", "0.5276007", "0.52743906", "0.52735674", "0.5270354", "0.5259527", "0.5256775", "0.5256584", "0.52565813", "0.5251373", "0.5239054", "0.52356505", "0.5225716", "0.52256155", "0.52241427", "0.522058", "0.5218541", "0.5206102", "0.51974684", "0.5195524", "0.51930505", "0.5189149", "0.518506", "0.5178433", "0.517629", "0.5171505", "0.5170628" ]
0.67916924
0
Function for changing the flames inside the machine
function changeFlame(flame){ if(flame==1){ machine_container.getChildByName("normal_flame").visible = true; machine_container.getChildByName("second_flame").visible = false; } else{ machine_container.getChildByName("normal_flame").visible = false; machine_container.getChildByName("second_flame").visible = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lightMode() {\n change(\n \"rgb(255 255 255 / 50%)\",\n \"rgb(0 0 0 / 50%)\",\n \"Light Mode\",\n \"fa-moon\",\n \"fa-sun\",\n \"img/undraw_proud_coder_light.svg\",\n \"img/undraw_feeling_proud_light.svg\",\n \"img/undraw_conceptual_idea_light.svg\"\n );\n \n}", "function flakesFalling()\r\n{\r\n\t/*\r\n\t\tMake sure the user has the functionality enabled.\r\n\t*/\r\n\t\r\n\tif(arFlakes.length < 1)\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tswitch(oUser.user_UseFlakes)\r\n\t{\r\n\t\tcase \"1\":\r\n\t\t\tarFlakeRange.low = 30000;\r\n\t\t\tarFlakeRange.high = 45000;\r\n\t\t\tbreak;\r\n\t\tcase \"2\":\r\n\t\t\tarFlakeRange.low = 6000;\r\n\t\t\tarFlakeRange.high = 12000;\r\n\t\t\tbreak;\r\n\t\tcase \"3\":\r\n\t\t\tarFlakeRange.low = 1000;\r\n\t\t\tarFlakeRange.high = 8000;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tHideFlakes();\r\n\t\t\treturn;\t\r\n\t}\r\n\r\n\tfor(i = 0; i < maxFlakes; i++)\r\n\t{\r\n\t\taFlake = arFlakes[i];\r\n\r\n\t\tif(!aFlake)\r\n\t\t{\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif(aFlake.visible == true)\r\n\t\t{\r\n\t\t\tif(aFlake.yp < 75)\r\n\t\t\t{\r\n\t\t\t\taFlake.yp += aFlake.sty;\r\n\t\t\t\taFlake.dx += aFlake.stx;\r\n\t\t\t\tdocument.getElementById(\"dot\" + aFlake.id).style.top = aFlake.yp + \"px\";\r\n\t\t\t\tdocument.getElementById(\"dot\" + aFlake.id).style.left= aFlake.xp + aFlake.am * Math.sin(aFlake.dx)+\"px\"; \r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t\tHide the flake for an arbitrary time after it has\r\n\t\t\t\t\tsat at the bottom of the page\r\n\t\t\t\t*/\r\n\t\t\t\taFlake.counter--;\r\n\t\t\t\tif(aFlake.counter == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tel = document.getElementById(\"dot\" + aFlake.id);\r\n\t\t\t\t\tel.style.visibility = \"hidden\";\r\n\t\t\t\t\taFlake.visible = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t\tWhat this code does is make it so sometimes the flakes\r\n\t\t\t\tare thicker and other times there's fewer of them.\r\n\t\t\t*/\r\n\t\t\tarFlakeRange.counter--;\r\n\t\t\tif(arFlakeRange.counter == 0)\r\n\t\t\t{\r\n\t\t\t\tarFlakeRange.counter = Math.round(Math.random() * (arFlakeRange.high - arFlakeRange.low)) + arFlakeRange.low;\r\n\t\t\t}\r\n\r\n\t\t\trandVal = Math.round(Math.random() * arFlakeRange.counter);\r\n\t\t\t\r\n\t\t\tif(randVal < 2)\r\n\t\t\t{\r\n\t\t\t\tarFlakeRange.counter = Math.round(Math.random() * (arFlakeRange.high - arFlakeRange.low)) + arFlakeRange.low;\t\t\t\t\r\n\t\t\t\tdoc_width = document.body.clientWidth;\r\n\t\t\t\taFlake.dx = 0;\t\t\t\t\t\t\t\t//\tset coordinate variables\r\n\t\t\t\taFlake.xp = Math.random()*(doc_width - 80); \t// set position variables\r\n\t\t\t\taFlake.yp = 0;\t\t\t\t\t\t\t\t//\tStart them all at the top of the page\r\n\t\t\t\taFlake.am = Math.random()*20; \t\t// set amplitude variables\r\n\t\t\t\taFlake.stx = 0.02 + Math.random()/10; \t\t// set step variables\r\n\t\t\t\taFlake.sty = 0.2 + Math.random(); \t\t// set step variables\r\n\t\t\t\taFlake.counter = Math.round(Math.random() * 900) + 150;\r\n\t\t\t\taFlake.visible = true;\r\n\t\r\n\t\t\t\tel = document.getElementById(\"dot\" + aFlake.id);\r\n\t\t\t\tel.style.top = aFlake.yp + \"px\";\r\n\t\t\t\tel.style.left = aFlake.xp + \"px\";\r\n\t\t\t\tel.style.visibility = \"visible\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearTimeout(snowTimer);\r\n\tsnowTimer = setTimeout(\"flakesFalling()\", 25);\r\n}", "function P_changePoo()\r\n{\r\n if(health>=30)\r\n {\r\n imgPooPoo = preload.getResult(\"smile\");\r\n }\r\n else\r\n {\r\n imgPooPoo = preload.getResult(\"cry\");\r\n }\r\n\r\n}", "function flamingSlime(event) {\t\t\t\t\t\t\t//Let's set the \"Slime\" on fire!\r\n\r\n //var entityHit = event.getEntityHit();\t\t\t\t//First, use the getEntityHit() method from projectileHitHook to figure out WHAT was hit...\r\n //var entityHit = event.getEntityType();\t\t\t\t//First, use the getEntityHit() method from projectileHitHook to figure out WHAT was hit...\r\n var entityHit = event.getEntity();\r\n //var projectile = event.getProjectile();\t\t\t\t//...then, use the getProjectile() method from projectileHitHook to figure out WHICH projectile was used...\r\n //var projectile = event.getLastDamageCause().getCause();\r\n var projectile = event.getDamager().getType();\r\n //var thrower = projectile.getThrower();\t\t\t\t//...and finally, use the getThrower() method from projectile to figure out WHO threw the projectile.\r\n echo(projectile);\r\n echo(entityHit); \r\n if (!(projectile == cmSnowBall)){\t\t\t//If the throwable IS NOT a snowball: \"there is nothing to see here, move along.\"\r\n return;\r\n }\r\n //echo('hello');\r\n if (entityHit instanceof cmSlime1){\t\t\t\t//Now, suppose the throwable was a snowball. Did it hit \"Slime\"?\t\t\r\n var slimeSize = entityHit.getSize();\t\t//If so, get the size of the \"Slime\" entity.\r\n var entityWhere = entityHit.getLocation();\t//Also, we get the location of the \"Slime\", to decide where the explosion sound will originate;\r\n entityHit.setFireTicks(100);\t\t\t\t//we then set the \"Slime\" on fire...\r\n // sounds.explode(entityWhere);\t\t\t\t//...and use the sounds plugin to provide the \"explode\" sound effect with origin at the \"Slime\"'s position.\r\n sounds.entityGenericExplode(entityWhere);\r\n function vanquishSlime(){\t\t\t\t\t//Not satisfied with simply setting \"Slime\" on fire, my 9 year-old advisor suggested vanquishing them.\r\n if (!(slimeSize == 'BIG')){\t\t\t\t//So... if the \"Slime\" is BIG, you will need to keep on hitting with snowballs until it breaks apart;\t\t\t\r\n //entityHit.destroy();\t\t\t\t//if the \"Slime\" size < BIG, then the \"Slime\" will be destroyed... \r\n entityHit.setHealth(0);\r\n destroyCount = destroyCount + 1;\t//The counter in then updated ***TO DO: build a decent counter using scoreboard!\r\n //echo(thrower, destroyCount);\t\t//and displays how many \"Slime\" entities were slayed.\r\n }\t\t\r\n }\t\t\r\n setTimeout(vanquishSlime, 2000);\t\t\t//Without a delay, you do not see the flaming \"Slime\"... so we get 2 seconds of fire.\r\n }\r\n}", "function LaunchFlames()\n{\n timer = 0.1f;\n}", "function flashAll(){\n\t\tredFlash();\n\t\tyellowFlash();\n\t\tblueFlash();\n\t\tgreenFlash();\n\t}", "function changePicture() {\n materialPic.diffuse = Textures.get(lPic[next]);\n next = (next+1)%nPic;\n}", "function fakeLight(){\n pntLight = false;\n}", "function changeIMG(v){\n\tif(v == '2')\n\t\tnomeImagem = \"../../terra.png\";\n\tif(v == '1')\t\n\t\tnomeImagem = \"../../terrain.png\";\n\tif(v == '3')\n\t\tnomeImagem = \"../../perlin_heightmap.png\";\n\tinitTexture();\n}", "function flash() {\n for (var i = 0; i < 81; i++) {\n let red = (Math.floor(Math.random() * 256)).toString();\n let green = (Math.floor(Math.random() * 256)).toString();\n let blue = (Math.floor(Math.random() * 256)).toString();\n body.children[i].style.backgroundColor = \"rgb(\" + red + \", \" + green + \", \" + blue + \")\"\n }\n}", "resetFlicker () {\r\n this.flicker_speed = 4\r\n this.flicker_delay = 1.5\r\n this.flicker_delta = 0\r\n this.flicker_phase = 0\r\n this.flicker_count = 0\r\n this.flicker_max = 25\r\n }", "function updateFlake(flake) {\n\n //Make the overall direction of the flakes drift over time\n let windDirection = Math.floor(sin(tick/200) * 5);\n flake.staticY -= windDirection;\n\n //Move the flake along and make it travel in a horizontal wave\n flake.x -= flake.speed;\n flake.y = flake.staticY + sin((flake.x + flake.waveOffset)/flake.waveFrequency) * flake.waveHeight;\n if (flake.x < 1) {\n flake.x = width;\n flake.staticY = rand(0, height);\n }\n}", "function changeColorScheme() {\n\n}", "function MakeshiftFlashAnimation() {\n if (me.state.isCurrent(me.state.FLASH_ANIMATION)) {\n me.state.change(me.state.PLAY);\n } else {\n me.state.change(me.state.FLASH_ANIMATION);\n }\n}", "function update_whack_life(life) {\n if (life === 2) {\n document.getElementById(\"life\").src = \"../static/imgs/2_lives.png\";\n } else if (life === 1) {\n document.getElementById(\"life\").src = \"../static/imgs/1_lives.png\";\n } else {\n document.getElementById(\"life\").src = \"../static/imgs/0_lives.png\";\n }\n}", "function realLight(){\n pntLight = true;\n}", "fade( o ) {\n\t\tfor( let i = 0; i < 10; i++ ) {\n\t\t\tif( o ) {\n\t\t\t\tgame.fopac = 1;\n\t\t\t}\n\t\t\tgame.setCB( () => {\n\t\t\t\tif( o ) {\n\t\t\t\t\tgame.fopac = Number( ( ( 9 - i ) / 9 ).toFixed( 1 ) );\n\t\t\t\t} else {\n\t\t\t\t\tgame.fopac = Number( ( i / 9 ).toFixed( 1 ) );\n\t\t\t\t}\n\t\t\t}, 8 );\n\t\t}\n\t}", "function plugF(machine){\n\tmachine.plug.x += 11.5;\n\tmachine.health += 5;\n\tif(machine.plug.x > game.width - 72){\n\t\tmachine.plug.x = game.width - 72;\n\t}\n\tsound1.play();\n}", "function changeMediumFn(scope) {\n\t/** Set all background image light alpha as 0 */\n\tfor ( var i=1; i<5; i++ ) {\n\t\tgetChild(\"side_view_bg\"+i, side_view_container).alpha = 0;\n\t}\n\tswitch(scope.medium){\n\t \t/** Selected medium is Air */\n\t\tcase \"1\": \n\t\t\tgetChild(\"side_view_bg1\", side_view_container).alpha = 1;\n\t\t\tbreak;\n\t\t/** Selected medium is Helium */\n\t\tcase \"1.000034\": \n\t\t\tgetChild(\"side_view_bg2\", side_view_container).alpha = 1;\n\t\t \tbreak;\n\t\t/** Selected medium is Hydrogen */ \n\t\tcase \"1.000138\": \n\t\t\tgetChild(\"side_view_bg3\", side_view_container).alpha = 1;\n\t\t \tbreak;\n\t\t/** Selected medium is Carbon Dioxide */\n\t\tcase \"1.000449\": \n\t\t\tgetChild(\"side_view_bg4\", side_view_container).alpha = 1;\n\t\t \tbreak;\t\n\t} \n\tcalculateBrewstersAngle(scope); /** Brewsters angle and current calculated in this function */\n\tbrewsters_stage.update();\n}", "function resetHearts() {\n let source = \"images/liveHeart.png\";\n for (let life of lives) {\n life.src = source;\n }\n}", "function popo(play, laze){\n \t laze.kill();\n \t timer.start();\n \t flashing = true;\n \t flash();\n \t //add red and blue sprites\n }", "function changeImageUmbrellaBack() {\n document.images['white-duck-umbrella'].src ='./assets/images/white-duck-umbrella.png'\n }", "function changeSword() {\n if (sword==0) {\n $('#swords').css({filter:'grayscale(0%)'});\n sword++;\n }\n else if (sword==1) {\n $('#swords').attr('src', 'images/item sprites/Green Sword.png');\n sword++;\n }\n else if (sword==2) {\n $('#swords').attr('src', 'images/item sprites/Red Sword.png');\n sword++;\n }\n else if(sword==3) {\n $('#swords').attr('src', 'images/item sprites/Blue Sword.png');\n sword++;\n }\n else if (sword==4) {\n $('#swords').attr('src', 'images/item sprites/Four Sword.png');\n sword++;\n }\n else {\n $('#swords').attr('src', \"images/item sprites/Smith's Sword.png\");\n $('#swords').css({filter:'grayscale(100%)'});\n sword=0;\n }\n}", "static turnOn(pix){\r\n\t\tpix.on = true;\r\n\t}", "makeColor( color ){\n if( color == White ){\n // console.log('white')\n // this.sprite.play(\"White\");\n this.fond.setTint( Black );\n this.sprite.setTint( White );\n this.sprite3.setTint( White );\n \n }\n else if( color == Black ){\n // console.log('black')\n // this.sprite.play(\"Black\");\n this.fond.setTint( White );\n this.sprite.setTint( Black );\n this.sprite3.setTint( White );\n \n }\n }", "function changeImageMonocleBack() {\n document.images['white-duck-monocle'].src ='./assets/images/white-duck-monocle.png'\n }", "function changeFlavor(color)\r\n{\r\n console.log(color);\r\n}", "function flashlight(){\n\tif(!blocks.length) return;\n\tif(flashlighton){\n\t\tgrab(\"prevb\").style.display = grab(\"nextb\").style.display = \"none\";\n\t\tdraw();\n\t\treturn;\n\t}\n\tsortsch(schedules[cursched]); draw();\n\tgrab(\"prevb\").style.display = grab(\"nextb\").style.display = \"initial\";\n\tfor (var i=0; i<blocks.length; i++) blocks[i].style.opacity = 0.1;\n\tcuropq=0;\n\tblocks[0].style.opacity = 0.9;\n\tflashlighton=1;\n}", "function switchFromFaint(newPoke) {\n document.getElementById('buttonsBattle').style['display'] = 'none';\n currentPlayerPokemon = newPoke;\n currentPlayerPokemonCry = new Audio(currentPlayerPokemon.cry);\n currentPlayerPokemonCry.play();\n playerPokemonImg.src = currentPlayerPokemon.plrSprite;\n playerPokemon.style['display'] = 'block';\n playerHpBar.style['display'] = 'block';\n rollText(\"battle_text\", `Go, ${currentPlayerPokemon.name}!`, 25);\n updateHealth(currentPlayerPokemon);\n setTimeout(function () { menu() }, 2000);\n}", "function twoLives() {\n getId('hearts1').src= \"images/heartfull.png\";\n getId('hearts2').src= \"images/heartfull.png\";\n getId('hearts3').src= \"images/heartempty.png\"; \n}", "function step() {\n TrafficLight.change();\n TrafficLight.draw(ctx);\n}", "function burning_crop_residues(){\n a_FAO_i='burning_crop_residues';\n initializing_change();\n change();\n}", "function changeImageGlassesBack() {\n document.images['white-duck-glasses'].src ='./assets/images/white-duck-glasses.png'\n }", "function changeColor()\n{\n if (this.style.backgroundColor === 'rgb(255, 255, 255)' || flag === 1)\n {\n this.style.backgroundColor = 'rgb(' + Math.floor(Math.random() * 256) + ','\n + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ')';\n }\n else if (flag === 0)\n {\n let lightness = parseInt(this.style.filter.match(/\\d+/));\n lightness != 0 ? this.style.filter = `brightness(${lightness - 10}%)` : false;\n }\n}", "function setHandMaterial(m) {\n\t\t\n\t\tpalms[0].material = m;\n\t\tpalms[1].material = m;\n\t\t\n\t\tfor (var i = 0, l = fingers.length; i < l; i++) { fingers[i].material = m; }\t\t\n\t}", "function livestock_manure(){\n a_FAO_i='livestock_manure';\n initializing_change();\n change();\n}", "flashTray(flash = true) {\n let _this=this;\n if (flash) {\n if (!timer) {\n timer = setInterval(() => {\n if((_this._trayIconCounter++) % 2){\n global.tray.setImage(_this.trayIcon);\n }else{\n global.tray.setImage(_this.emptyIcon);\n }\n // global.tray.setImage(this._trayIcons[(this._trayIconCounter++) % 2]);\n }, 400);\n }\n } else {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n global.tray.setImage(_this.trayIcon);\n }\n\n }", "function changePrimitive(v){\n\twireframe = !wireframe;\n\tinitTexture();\n}", "function turnBlackBgAndWhiteFo() {\n setInterval(changeBgAndFont, 0000);\n}", "function changeImageLoveBack() {\n document.images['white-duck-love'].src ='./assets/images/white-duck-love.png'\n }", "turnGhostsBlue() {}", "function changeColor(e){\n if (colorScheme == \"BLACK\"){\n e.target.style.backgroundColor = \"BLACK\";\n e.target.style.opacity = 1;\n } else if (colorScheme == \"RAINBOW\"){\n e.target.style.backgroundColor = \"#\" + Math.floor(Math.random() * 4096).toString(16);\n e.target.style.opacity = 1;\n } else if (colorScheme == \"DARKEN\"){\n let darken = Number(e.target.style.opacity);\n e.target.style.opacity = darken += 0.1;\n e.target.style.backgroundColor = '#000';\n }\n}", "function changeFace(typeChange) {\n if(document.getElementById(\"eye\").style.visibility == \"hidden\") {\n document.getElementById(\"bellaBack\").src = \"assets/images/bella.jpg\";\n document.getElementById(\"nose\").style.visibility = \"visible\"; document.getElementById(\"eye\").style.visibility = \"visible\";\n } else{\n document.getElementById(\"bellaBack\").src = \"assets/images/bella\" + typeChange + \".jpg\"; document.getElementById(\"nose\").style.visibility = \"hidden\"; document.getElementById(\"eye\").style.visibility = \"hidden\";\n }\n return;\n}", "execute() {\n this.light.changeBrightness(100);\n }", "function flakeSetup()\r\n{\r\n\tvar currentTime = new Date()\r\n\r\n\tmonth = currentTime.getMonth();\r\n\tday = currentTime.getDate();\r\n\t\r\n\tfallingImages = new Array();\t\r\n\t\r\n\t//January\r\n\tfallingImages[0] = new Object();\r\n\tfallingImages[0].image = \"snow.gif\";\r\n\tfallingImages[0].message = \"Enjoy the snow!\";\r\n\t\r\n\tfallingImages[0][1] = new Object();\r\n\tfallingImages[0][1].image = \"newyear.gif\";\r\n\tfallingImages[0][1].message = \"Happy New Year!!!\";\r\n\t\r\n\t//February\r\n\tfallingImages[1] = new Object();\r\n\tfallingImages[1].image = \"heart.gif\";\r\n\tfallingImages[1].message = \"Happy Valentine's Day!\";\r\n\t\r\n\tfallingImages[1][14] = new Object();\r\n\tfallingImages[1][14].image = \"heart.gif\";\r\n\tfallingImages[1][14].message = \"Happy Valentine's Day!\";\r\n\r\n\t//March\r\n\tfallingImages[2] = new Object();\r\n\tfallingImages[2].image = \"clover.gif\";\r\n\tfallingImages[2].message = \"Spring is here!\";\r\n\r\n\t//April\r\n\tfallingImages[3] = new Object();\r\n\tfallingImages[3].image = \"raindrop.gif\";\r\n\tfallingImages[3].message = \"April Showers!\";\r\n\r\n\t//May\r\n\tfallingImages[4] = new Object();\r\n\tfallingImages[4].image = \"flower.gif\";\r\n\tfallingImages[4].message = \"Enjoy May flowers!\";\r\n\r\n\tfallingImages[4][5] = new Object();\r\n\tfallingImages[4][5].image = \"spiderman.gif\";\r\n\tfallingImages[4][5].message = \"Spider-sense, tingling!\";\r\n\r\n\t//June\r\n\tfallingImages[5] = new Object();\r\n\tfallingImages[5].image = \"sun.gif\";\r\n\tfallingImages[5].message = \"Summer is here!\";\r\n\r\n\t//July\r\n\tfallingImages[6] = new Object();\r\n\tfallingImages[6].image = \"independence.gif\";\r\n\tfallingImages[6].message = \"Time for fireworks!\";\r\n\r\n\tfallingImages[6][3] = new Object();\r\n\tfallingImages[6][3].image = \"fireworks.gif\";\r\n\tfallingImages[6][3].message = \"Happy 4th of July!\";\r\n\r\n\tfallingImages[6][4] = new Object();\r\n\tfallingImages[6][4].image = \"fireworks.gif\";\r\n\tfallingImages[6][4].message = \"Happy 4th of July!\";\r\n\r\n\tfallingImages[6][5] = new Object();\r\n\tfallingImages[6][5].image = \"fireworks.gif\";\r\n\tfallingImages[6][5].message = \"Happy 4th of July!\";\r\n\r\n\t//August\r\n\tfallingImages[7] = new Object();\r\n\tfallingImages[7].image = \"kite.gif\";\r\n\tfallingImages[7].message = \"Enjoy the weather while it lasts!\";\r\n\r\n\t//September\r\n\tfallingImages[8] = new Object();\r\n\tfallingImages[8].image = \"leaf.gif\";\r\n\tfallingImages[8].message = \"Fall is here!\";\r\n\r\n\t//October \r\n\tfallingImages[9] = new Object();\r\n\tfallingImages[9].image = \"witch.gif\";\r\n\tfallingImages[9].message = \"Happy Halloween!\";\r\n\r\n\t//November\r\n\tfallingImages[10] = new Object();\r\n\tfallingImages[10].image = \"thanksgiving.gif\";\r\n\tfallingImages[10].message = \"It's Turkey time!\";\r\n\t\r\n\t//December\r\n\tfallingImages[11] = new Object();\r\n\tfallingImages[11].image = \"present.gif\";\r\n\tfallingImages[11].message = \"Happy Holidays!\";\r\n\r\n\tflake_image = \"\";\r\n\tflake_message = \"\";\r\n\t\r\n\tif(fallingImages[month])\r\n\t{\r\n\t\tif(fallingImages[month][day])\r\n\t\t{\r\n\t\t\tflake_image = \"../image/\" + fallingImages[month][day].image;\r\n\t\t\tflake_message = fallingImages[month][day].message;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tflake_image = \"../image/\" + fallingImages[month].image;\r\n\t\t\tflake_message = fallingImages[month].message;\r\n\t\t}\r\n\t}\r\n\r\n\tif(flake_image.length > 0)\r\n\t{\r\n\t\tCreateFlakes();\r\n\t\tflakesFalling();\r\n\t}\r\n\r\n\t\r\n\toSystemListener.add(\"Preferences\", flakesFalling);\r\n}", "function oneLife() {\n getId('hearts1').src= \"images/heartfull.png\";\n getId('hearts2').src= \"images/heartempty.png\";\n getId('hearts3').src= \"images/heartempty.png\";\n}", "function flashColor() {\n $(\"#bluepad\").addClass(\"light\");\n $(\"#redpad\").addClass(\"light\");\n $(\"#greenpad\").addClass(\"light\");\n $(\"#yellowpad\").addClass(\"light\");\n}", "function changeOne() {\n colors = ['#B29190', '#FFFFD3', '#FF8E8B', '#77A8CC', '#5E8EB2', '#FFD792'];\n init();\n}", "function changeImageMonocle() {\n document.images['white-duck-monocle'].src = './assets/images/white-duck-monocle2.png';\n return true;\n }", "function runEffect() {\n var effectArray = [\"blind\", \"clip\", \"drop\", \"explode\", \"fold\", \"puff\"];\n var effectNumber = Math.floor(Math.random() * 6) + 1;\n effectNumber--;\n effect = effectArray[effectNumber];\n $(\"#gamerules\").effect(effect, 750);\n $(\"#start\").effect(effect, 750);\n setTimeout(function() {\n mpopup.style.display = \"none\";\n }, 749);\n }", "function changeImageChill() {\n document.images['white-duck-chill'].src = './assets/images/white-duck-chill2.png';\n return true;\n }", "function changeImageChillBack() {\n document.images['white-duck-chill'].src ='./assets/images/white-duck-chill.png'\n }", "function showLives(){\n if(livesCounter == 3){\n image(heartLivesImg, 50, 65, 25,25);\n image(heartLivesImg, 80, 65, 25,25);\n image(heartLivesImg, 110, 65, 25,25);\n }\n else if (livesCounter == 2){\n image(heartLivesImg, 50, 65, 25,25);\n image(heartLivesImg, 80, 65, 25,25);\n }\n else if(livesCounter == 1){\n image(heartLivesImg, 50, 65, 25,25);\n }\n else if(livesCounter == 0) {\n image(transparentImg, 50, 65, 25,25);\n }\n}", "function victoryAnimation() {\n\tfor (let i = 0; i < 8; i++) {\n\t\tflashLetters(i);\n\t}\n}", "function fav(heart){\n\tif (heart.src.includes(\"heart_filled\"))\n\t\theart.src = \"/resources/pics/heart.png\";\n\telse\n\t\theart.src = \"/resources/pics/heart_filled.png\";\n}", "startFade(){\n this.last_update = Date.now();\n this.color = \"#f4d742\";\n this.fade_rate = .2; //fades 20% every 100 ms\n this.transparency = 1;\n }", "static turnOff(pix){\r\n\t\tpix.on = false;\r\n\t}", "function blackout(callback) {\n for (c=0; c < 256; c++) {\n var channel = {[c]: 0}; // make an object\n universe.update(channel); // set channel to 0\n }\n callback();\n}", "function flip()\n{\n\tmetronome_state = -metronome_state;\n\tmetronome_sound.play();\n}", "function changeImageUmbrella() {\n document.images['white-duck-umbrella'].src = './assets/images/white-duck-umbrella2.png';\n return true;\n }", "function blink(currentColour) {\n currentColour.fadeOut(100).fadeIn(100);\n}", "function changeFace(ddp, number) {\n switch(number) {\n case 1: \n // rotateMotorToFacePosition(1);\n setTimeout(function() { ddp.call('setFace', \"faces-01.jpg\", \"thomas\") }, 1000);\n break;\n case 2: \n // rotateMotorToFacePosition(2);\n setTimeout(function() { ddp.call('setFace', \"faces-02.jpg\", \"thomas\") }, 1000);\n break;\n case 3:\n default:\n // rotateMotorToFacePosition(3);\n setTimeout(function() { ddp.call('setFace', \"faces-03.jpg\", \"thomas\") }, 1000); \n }\n}", "function updatePallette(r, g, b, light, med, dark) {\n setPaletteColor(light, r * 2.0, g * 2.0, b * 1.8);\n setPaletteColor(med, r, g, b);\n setPaletteColor(dark, r * 0.7, g * 0.75, b * 0.8);\n\n for (var i in menu.sprites) {\n var sprite = menu.sprites[i];\n sprite.updateColorset();\n }\n }", "function changeImageLove() {\n document.images['white-duck-love'].src = './assets/images/white-duck-love2.png';\n return true;\n }", "function alterHues() {\n for (let i = 0; i < hues.length; i++) {\n hues[i] = (hues[i] + 1) % 360;\n }\n}", "function revertGhosts() {\n for (var x = 0; x <= 3; x++) {\n var temp = worldDict[x + 6];\n ghost[x].state = 0;\n document.getElementById(temp).style.backgroundImage = \"url('img/\" + temp + \".gif')\";\n }\n}", "function darkTheme() {\n\tdocument.getElementById(\"game\").style.background = \"url('images/skydark.jpg')\";\n\tdocument.getElementById(\"aliveDisplayContainer\").style.color = \"white\";\n\tdocument.getElementById(\"openButton\").style.color = \"white\";\n\tvar c = document.body.children;\n\tfor (var i = 0; i < c.length; i++) {\n\t\tc[i].style.cursor = \"url(https://scanuproductions.com/images/white-pointer.png) 5 5, crosshair\";\n\t}\n}", "function changeLight() {\n if (OrangeCounter > 0) {\n LIGHT = \"Orange\";\n OrangeCounter -= 1;\n }\n else if (random() < ChangeProb) {\n newLIGHT = ((LIGHT == \"Red\") ? \"Green\" : \"Red\");\n OrangeCounter = OrangeTime;\n } else if (OrangeCounter <= 0) {\n OrangeCounter = 0;\n LIGHT = newLIGHT;\n }\n}", "function setLightScheme() { /* exported setLightScheme */\n $(\"body\").removeClass(\"dark\").addClass(\"light\");\n $(\"#btnSettings\").attr(\"src\", AssetPaths.SETTINGS_LIGHT);\n}", "function clash() {\n $(\"#lightsaber1\").removeClass(\"off\");\n $(\"#lightsaber2\").removeClass(\"off\");\n $(\"#lightsaber2\").addClass(\"on\");\n anim();\n }", "function changeHeart() {\r\n var star = document.getElementById('heart');\r\n if (health === 4) {\r\n star.src = \"https://res.cloudinary.com/dytmcam8b/image/upload/v1561725918/virtual%20pet/l1.png\";\r\n }\r\n else if (health === 3) {\r\n star.src = \"https://res.cloudinary.com/dytmcam8b/image/upload/v1561725919/virtual%20pet/l2.png\";\r\n } else if (health === 2) {\r\n star.src = \"https://res.cloudinary.com/dytmcam8b/image/upload/v1561725919/virtual%20pet/l3.png\";\r\n } else if (health === 1) {\r\n star.src = \"https://res.cloudinary.com/dytmcam8b/image/upload/v1561725919/virtual%20pet/l4.png\";\r\n }\r\n }", "function adjustLightIntensity(i, value) {\n lightIntensity = value;\n spotlights[i-1].intensity = lightIntensity/100;\n updateIntensityLabel(i);\n render();\n}", "function updateFace() {\n let moment = Time.tick();\n\n // parses out the pc object slice by slice\n for (let slice of SLICES) {\n if (slice === \"tick\") {\n millis.textContent = Glypher.numbTo(moment.dsp[slice], glyphMode);\n continue;\n }\n updateDisplayTime(slice, moment);\n updatePercent(slice, moment);\n }\n}", "function change_map(map) {\n Sounds[Sounds.bgm].pause();\n actors = [];\n current_map = map;\n current_map();\n }", "function FLdown(){\n console.log(\"In face l arrow clicked\");\n face.destroy();\n faceindex--;\n if(faceindex<=0)\n {\n faceindex = 0;\n face = game.add.image(1015, 415, images.face[faceindex].name);\n face.scale.setTo(0.1);\n bf = bb.create(600, 55, images.face[faceindex].name);\n bf.scale.setTo(0.1);\n }\n else if (faceindex >= images.face.length)\n {\n faceindex = images.face.length -1;\n face = game.add.image(1015, 415, images.face[faceindex].name);\n face.scale.setTo(0.1);\n bf = bb.create(600, 55, images.face[faceindex].name);\n bf.scale.setTo(0.1);\n }\n else\n {\n face = game.add.image(1015, 415, images.face[faceindex].name);\n face.scale.setTo(0.05);\n bf = bb.create(600, 55, images.face[faceindex].name);\n bf.scale.setTo(0.11);\n }\n player.appearance.head.face = images.face[faceindex].name;\n\n}", "function litAll() {\n let newArr = [];\n for (let i = 0; i < dispSize; i++) {\n newArr.push(\"FF\");\n }\n mySwitcher(newArr);\n}", "function eCorrect(el){\r\n\tif (document.getElementById('ball5a').src.match(\"images/even/under10.png\") && document.getElementById('ball6a').src.match(\"images/even/under10.png\")){\r\n\tel.classList.add(\"opaque\");\r\n\t}\r\n\telse {\r\n\t\tvar audio = new Audio('sounds/glove.mp3');\r\n\t\taudio.play();\r\n\t}\r\n\tpartOnePass();\r\n}", "function animation_flag_with_saturation (direction){\n var index = '#filaIndice'+direction;\n $(index).html(\"<img src='js/css/cross.png' border='0' />\");\n $(index).effect(\"pulsate\",{times:3},500);\t\n}", "function crops_livestock(){\n a_FAO_i='crops_livestock';\n initializing_change();\n change();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n setFish1(); //Sets position of fish\n setFish2();\n\n diresong.loop(); //Background song\n\n dim = 15;\n push();\n ellipseMode(RADIUS); // Sets up positions of fireflies\n frameRate(100);\n for (var j = 0; j < maxFlies; j++)\n fireflies[j] = new firefly(random(0, windowWidth), random(0, windowHeight));\n pop();\n}", "function lightingSystem()\r\n{\r\n ambLight.intensity = timeLeft/totalTime;\r\n}", "function allOff() {\n for (var i = 0; i < LIGHTS.length; i = i + 1) {\n LIGHTS[i].classList.remove(\"on\");\n }\n}", "function fechaserver() {\n}", "function newGameVideo() {\n //light up the island for the first time\n}", "function resaltarFila(fila, color) \n{\n\tfila.bgColor=color;\n\tfila.style.cursor=\"hand\"; \n}", "async function fadeSpectrum(s,time);\r\n{\r\n let scale = s;\r\n // .mode('lab').colors(steps);\r\n\r\n for (var i = 0; i < scale.length; i++) {\r\n var col = scale[i];\r\n var xy = HueService.colorToHueHsv(col);\r\n changeLights(255, xy.hue, 255, true);\r\n await sleep(time);\r\n }\r\n}", "function updateShader(i) {\n var result = editors[i].getValue();\n var annotations = particlesClass.setShader(result, i);\n editors[i].getSession().setAnnotations(annotations);\n}", "function fadeUpDown() {\n\tserver=\"/arduino/light/9\";\n\tsendCommandtoServer(server); \n}", "function noLives() {\n getId('hearts1').src= \"images/heartempty.png\";\n getId('hearts2').src= \"images/heartempty.png\";\n getId('hearts3').src= \"images/heartempty.png\";\n}", "function changeRed(element){\r\n element.style.backgroundColor = \"red\";\r\n for(var i=0;i<9;i++)\r\n {\r\n \tdocument.getElementById(bomb[i]).style.backgroundColor = \"red\";\r\n \t//document.getElementById(bomb[i]).style.backgroundImage = \"url('https://superawesomevectors.com/wp-content/uploads/2018/06/flat-bomb-icon-800x566.jpg')\";\r\n\r\n }\r\n makeDisable();\r\n setTimeout(function(){ document.getElementById(\"congo-banner\").innerHTML = \"Game Over! Restart to play again\";\r\n document.getElementById(\"win\").classList.add('show'); }, 100);\r\n \r\n \r\n}", "function updateFouls(who) {\n\tvar fouls = AWAY_FOUL;\n\tif(who == HOME)\n\t\tfouls = HOME_FOUL;\n\n\tfouls = fouls % 10;\n\tonLED('#' + who + '_foul_count', SMALL_NUMBERS[fouls])\n}", "function enableAutoFlashing()\n{\n sendMidi(0xB0, 0, 0x28);\n}", "function switchLight(lightNumber) {\n allOff();\n var light = LIGHTS[lightNumber];\n light.classList.add(\"on\");\n\n if (lightNumber == 0)\n red();\n\n if (lightNumber == 2)\n ready();\n}", "function doChangeAmbientLight() {\r\n if (document.getElementById(\"light3\").checked) {\r\n scene.add(ambientLight);\r\n } else {\r\n scene.remove(ambientLight);\r\n }\r\n if (!animating) {\r\n render();\r\n }\r\n}", "set intensity(value) {}", "function FlashLEDs(t)\n{\n if (t == flashTime) return; // don't flash twice in the same second\n var flashNew = (flashNum + 1) % flashPin.length;\n var cmd = \"c.\"+flashPin[flashNum]+\" 1;c.\"+\n flashPin[flashNew]+\" 0\\n\";\n for (var i=0; i<2; ++i) {\n if (avrs[i]) avrs[i].SendCmd(cmd);\n }\n flashNum = flashNew;\n flashTime = t;\n}", "function fertilizers_nutrient(){\n a_FAO_i='fertilizers_nutrient';\n initializing_change();\n change();\n}", "function OnTypicalLights_Change( e )\r\n{\r\n Alloy.Globals.ShedModeInfrastructure[\"TYPICAL_LIGHTS\"] = e.id ;\r\n}", "function livestock_heads(){\n a_FAO_i='livestock_heads';\n initializing_change();\n change();\n}", "function toggleColors()\n{\n \n// var tweenValue = global.tweenManager.getGenericTweenValue( script.objectWithTweens, \"test\" );\n var tweenValue = global.tweenManager.getGenericTweenValue( script.objectWithTweens, \"generic_tween\" );\n var test = new vec3(tweenValue.x, tweenValue.y, tweenValue.z)\n if (script.lightSource != null) { \n script.lightSource.color = tweenValue; \n }\n \n if (tweenValue.x == nightColor.x || tweenValue.x == dayColor.x) {\n shouldSwitch = true\n } \n if (shouldSwitch) {\n if (isDay) {\n global.tweenManager.setStartValue(script.objectWithTweens, \"generic_tween\", nightColor)\n global.tweenManager.setEndValue(script.objectWithTweens, \"generic_tween\", dayColor)\n global.tweenManager.resetObject(script.objectWithTweens, \"generic_tween\")\n } else {\n global.tweenManager.setStartValue(script.objectWithTweens, \"generic_tween\", dayColor)\n global.tweenManager.setEndValue(script.objectWithTweens, \"generic_tween\", nightColor)\n global.tweenManager.resetObject(script.objectWithTweens, \"generic_tween\")\n }\n global.tweenManager.startTween( script.objectWithTweens, \"generic_tween\" );\n isDay = !isDay\n shouldSwitch = false\n } \n \n \n \n \n}" ]
[ "0.6119707", "0.589232", "0.5880041", "0.584753", "0.58289", "0.58140135", "0.5796855", "0.5793538", "0.5757344", "0.5730048", "0.5710642", "0.5705972", "0.5695456", "0.5693474", "0.5683954", "0.5680432", "0.56637627", "0.5646314", "0.56396985", "0.56367624", "0.56318754", "0.56302327", "0.5630168", "0.5627751", "0.5605482", "0.5603384", "0.5590672", "0.55689454", "0.5566058", "0.5565923", "0.55598605", "0.5550595", "0.55363226", "0.55236363", "0.5521882", "0.55115753", "0.5502787", "0.5493565", "0.54917115", "0.548856", "0.54849446", "0.5478174", "0.54780275", "0.5473315", "0.54678303", "0.54454255", "0.5444493", "0.54441804", "0.54428387", "0.54386467", "0.54351413", "0.5434979", "0.54328084", "0.5426358", "0.5426195", "0.5426064", "0.54149985", "0.5407471", "0.54044396", "0.5401393", "0.53931624", "0.53913873", "0.53894854", "0.53894085", "0.5385179", "0.5384521", "0.5384469", "0.53840137", "0.53812736", "0.53808933", "0.53785425", "0.53779507", "0.5377013", "0.5376577", "0.53694516", "0.5368946", "0.5365586", "0.5359458", "0.5356874", "0.5355363", "0.53471816", "0.53467405", "0.5342342", "0.53422683", "0.5340755", "0.5338654", "0.5334844", "0.5332311", "0.5331008", "0.53306514", "0.5329094", "0.5328931", "0.5326254", "0.5325449", "0.5325346", "0.5324295", "0.5322697", "0.53191894", "0.5313036", "0.53125036" ]
0.66716665
0
function for start the test
function start_test(scope){ if(current_test==0){ machine_stage.getChildByName("test_1").text = kplus_test_values[current_test_beaker_number-6] +" ppm"; changeFlame(1); } else{ machine_stage.getChildByName("test_1").text = naplus_test_values[current_test_beaker_number-6] +" ppm"; changeFlame(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run_test() { start_tests(); }", "function runStart()/* : void*/\n {\n this.setUp();\n }", "function start() {\n console.log('Starting!');\n test1();\n}", "function testRun()\r\n{\r\n}", "function run_test() {\n do_calendar_startup(run_next_test);\n}", "function run(){\n\n\tdescribe(\"XML Tester\", function(){\n\t\t\n\t\t//gameName = process.env.npm_config_gamename;\n\t\t//console.log(\"Testing \" + gameName);\n\t\t\n\t\t//findXML();\n\t\t//parseXML();\n\t\t//loadGame();\n\t\t//StartMultiGameTest();\n\t});\n}", "async attemptTestRunStart() {\n\n\t\t// Get concurrency first\n\t\t// And log it if its currently exceeded\n\t\tlet concurrency = await SpaceAndProjectApi.getProjectConcurrency( this.projectID );\n\n\t\t// Plan is not allowed to run test : Fail now - HARD !\n\t\tif( concurrency.total <= 0 ) {\n\t\t\tOutputHandler.fatalError(`No concurrency avaliable (total=0) - please update your settings / concurrency plan`, null, 16);\n\t\t\tprocess.exit(16)\n\t\t}\n\n\t\t// Safety net, due to the possibility of file renaming race condition: validate script path\n\t\t// also terminate quickly tests, with invalid filepaths\n\t\tawait this.validateScriptPath();\n\n\t\t// Skip, as concurrency is not sufficent (existing test runs)\n\t\tif( concurrency.avaliable <= 0 ) {\n\t\t\tOutputHandler.standard(`> Maximum test concurrency exceeded (${concurrency.running}/${concurrency.total}) ... `)\n\t\t\tif( this.startTimeoutLoggedFlag != true ) {\n\t\t\t\tOutputHandler.standard(`> Start Timeout : ${this.startTimeout} minutes - CLI will automatically retry till timeout`)\n\t\t\t\tthis.startTimeoutLoggedFlag = true;\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t// Attempt to start the project - and log the error\n\t\ttry {\n\t\t\t// The starting request param\n\t\t\tlet startRequestParams = { \n\t\t\t\tbrowser: this.browser,\n\t\t\t\twidth: this.width,\n\t\t\t\theight: this.height,\n\t\t\t\t// We ensure region is forwarded\n\t\t\t\tregion: this.region,\n\t\t\t\t// Rest is as per normal\n\t\t\t\tdataSetID: this.dataSetID,\n\t\t\t\tdata: this.dataObject,\n\t\t\t\tsecretData: this.secretObject,\n\t\t\t\tuserAgent: this.userAgent\n\t\t\t};\n\n\t\t\t// Start the test\n\t\t\tlet result = await SpaceAndProjectApi.startProjectTest( //\n\t\t\t\tthis.projectID, this.normalizedScriptPath, //\n\t\t\t\tstartRequestParams, this.testCodeDir_zipFile //\n\t\t\t); //\n\n\t\t\t// Lets get the testRunID if valid\n\t\t\tlet testRunIDs = result.testRunIDs;\n\t\t\tif( testRunIDs == null || testRunIDs.length <= 0 ) {\n\t\t\t\tthrow `Missing testRunID in response`;\n\t\t\t}\n\n\t\t\t// Get the test run ID\n\t\t\tlet testRunID = testRunIDs[0];\n\n\t\t\t// Reset and initialize the internal testID, and printed steps output status\n\t\t\tthis.testID = testRunID;\n\t\t\tthis.processedTestRunSteps = [];\n\t\t\tthis.jsonOutputObj = {\n\t\t\t\ttestID: this.testID,\n\t\t\t\tstatus: \"unknown\",\n\t\t\t\tsteps: this.processedTestRunSteps\n\t\t\t}\n\n\t\t\t// Return the testID\n\t\t\treturn testRunIDs[0];\n\t\t} catch(err) {\n\t\t\t// Get the error object where applicable\n\t\t\tlet errObj = err.ERROR || err.error || err;\n\t\t\t// Unwrap any error message / code\n\t\t\tlet errOut = errObj.message || errObj.code || errObj;\n\n\t\t\t// Get the error code, and check against the known fatal error list\n\t\t\tlet fatalErrorCodeList = [\n\t\t\t\t\"ERR_ACCOUNT_SUSPENDED\", \n\t\t\t\t\"SPACE_NOT_FOUND\", \"PROJECT_NOT_FOUND\", \"BILLING_ACCOUNT_NOT_FOUND\", \n\t\t\t\t\"PLAN_NOT_FOUND\", \"FEATURE_DISABLED\", \"SPACE_DISABLED\"\n\t\t\t]\n\t\t\tlet errCode = errObj.code || \"\";\n\t\t\tif( fatalErrorCodeList.indexOf(errCode) >= 0 ) {\n\t\t\t\tOutputHandler.fatalError(`${errOut}`, null, 16);\n\t\t\t\tprocess.exit(16);\n\t\t\t}\n\n\t\t\t// Output the error\n\t\t\tOutputHandler.standard(`> Error starting test - CLI will retry due to start error : ${errOut}`)\n\t\t\tif( !this.startTimeoutLoggedFlag ) {\n\t\t\t\tOutputHandler.standard(`> Start Timeout : ${this.startTimeout} minutes - CLI will automatically retry till timeout`)\n\t\t\t\tthis.startTimeoutLoggedFlag = true;\n\t\t\t}\n\t\t}\n\n\t\t// Returns nothing (no valid testID)\n\t\treturn null;\n\t}", "enterTest(ctx) {\n\t}", "testArtists() {\n this.artistTest.startAllTests();\n }", "function runTests() {\n\ttestBeepBoop();\n\ttestGetDigits();\n}", "started() {\r\n\r\n\t}", "start () {\n return testPF(this.m, this.p0, this.q, this.r)\n }", "async function startTests() {\n console.log(\"🎸 Built Source Code\");\n const time = new Date().getTime();\n const nodeTest = spawn(`${process.execPath}`, [`build/_tests/tests/test.js`]);\n\n nodeTest.stdout.on(\"data\", (data) => {\n console.log(`[TEST]: ${data}`);\n });\n\n nodeTest.stderr.on(\"data\", (data) => {\n console.error(`[TEST ERROR]: ${data}`);\n });\n\n nodeTest.on(\"close\", () => {\n console.log(`🎸 Test run finished in ${new Date().getTime() - time}ms`);\n if (!cliopts.watch) {\n process.exit();\n }\n });\n}", "function startAllTests(){ \n testGetObjectFromArrays();\n testNormalizeHeader();\n testFillInTemplateFromObject();\n testIsCellEmpty();\n testIsAlnum();\n testIsDigit();\n}", "enterAnd_test(ctx) {\n\t}", "function startLightTests(finish){\n\t(new cronJob(\"*/5 * * * *\", lightTests)).start();\n\tlightTests(finish);\n}", "firstRun() { }", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\t}", "function startTest() {\n $('#runOptions').modal('show');\n }", "function jasmineStarted() {\n _scenariooReporter.default.runStarted(options);\n }", "async runTests() {\n for (let file of this.testFiles) {\n console.log(chalk.gray(`--- ${file.shortName}`));\n const beforeEaches = [];\n\n global.render = render;//jsdom\n\n global.beforeEach = (fn) => {\n beforeEaches.push(fn)\n };\n global.it = async (desc, fn) => {\n // console.log(desc);\n beforeEaches.forEach(func => func());\n //to handle errors ocurred during our test we need to do try and catch to avoid the test to collapse\n try {\n await fn();\n console.log(chalk.green(`\\tOK - ${desc}`));\n } catch (err) {\n const message = err.message.replace(/\\n/g, '\\n\\t\\t');\n console.log(chalk.red(`\\tX - ${desc}`));\n console.log(chalk.red('\\t', message));// \\t is tab \n }\n\n };\n //to skip the typo in stopping test for running\n try {\n require(file.name);//when we require the file inside a func node will find it and execute the file here\n } catch (err) {\n console.log(chalk.red('X - Error Loading File'), file.name);\n console.log(chalk.red(err));\n }\n\n }\n }", "start() {\n this.do(\"start\")\n }", "function Start() {\n isml.renderTemplate(\"teststart\", {\n VERSION: Config.VERSION.shoppingCartExtension.version,\n BUILD: Config.VERSION.shoppingCartExtension.extensionID,\n ContinueURL: URLUtils.https('Test-HandleCC'),\n CurrentForms: session.forms,\n CONFIG: Config\n });\n}", "function test() {\n runTests0();\n runTests1(); \n return true;\n}", "start () {}", "function Test() {\n\tallReset();\n\tTest = new classTest();\n\tpost(\"start\", \"\\n\");\n\tdisplayAll(); \t\n\t}", "function Test() {\n\tallReset();\n\tTest = new classTest();\n\tpost(\"start\", \"\\n\");\n\tdisplayAll(); \t\n\t}", "started() { }", "function startTest(){\n currentState = 1;\n // Displaying needed dom elements\n setupDom.style.display = \"none\";\n testDom.style.display = \"flex\";\n if(rootCheck.checked){\n rootDiv.style.display = \"block\";\n }else{\n rootDiv.style.display = \"none\";\n }\n if(relativeCheck.checked){\n relativeDiv.style.display = \"block\";\n // Displaying the right question for the current relative root according to current slected scale\n if (scaleName != \"custom\"){\n relativeLab.innerHTML = \"Relative \" + scaleSel.options[scaleSel.selectedIndex].innerHTML.toLowerCase() + \" ?\";\n }else{\n relativeLab.innerHTML = \"Relative mode 0 ?\";\n }\n }else{\n relativeDiv.style.display = \"none\";\n }\n updateModeSel();\n newTest();\n}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "started () {}", "started() {\n\n }", "started() {\n\n }", "started() {\n\n }", "testAlbums() {\n this.albumTest.startAllTests();\n }", "function testMain() {\n var mode = 'test';\n main(mode);\n}", "runTestCasesAndFinish()\n {\n this.runTestCases();\n InspectorTest.completeTest();\n }", "function start(){\n\t\n}", "function run(){\n\n\tdescribe(\"UnderseaWorld2\", function(){\n\n\t\tfindXML();\n\t\tparseXML();\n\t\tloadGame();\n\t\tsingleSpin(); // Start by doing a single spin\n\t\tfullGame();\n\t\texpandingTiles();\n\t\tbonusGame();\n\t\tbonusTime();\n\t});\n}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "function beforeTest()\n{\n\tconsole.log(\"'beforeTest' executed\");\n}", "function start() {\n\n}", "beforeRun() {}", "before (callback) {\n\t\tthis.testBegins = Date.now();\n\t\tthis.init(callback);\n\t}", "start() {\n LogUtil.createLogDumpAsync(\n 'test', this.onLogDumpCreated.bind(this), true);\n }", "async S50_coreTestRunLoop() {\n\n\t\t// Get the initial start time / timeout time\n\t\t// Note this is resetted in event of system errors\n\t\tlet startTimeMS = Date.now();\n\t\tlet startTimeoutTimeMS = startTimeMS + this.startTimeout*this.startTimeout_ms;\n\n\t\t// save the start time\n\t\tthis._startTimeMS = startTimeMS;\n\n\t\t// The final test result status\n\t\tlet finalTestStatus = null;\n\n\t\t// The actual testID\n\t\tlet testID = null;\n\n\t\t// Max startRetries - this is acrossed ALL test starts\n\t\t// including system_error resets.\n\t\t//\n\t\t// This is approximately 2 hours \n\t\t// excluding any test run time\n\t\tlet maxTestStarts = 130;\n\n\t\t// Successful test start\n\t\tlet successfulTestStarts = 0;\n\n\t\t// Prepare testScript ZIP (if being used)\n\t\tif( this.testCodeDir ) {\n\t\t\tOutputHandler.standardGreen(`> Preparing test script files for upload ... `);\n\t\t\tawait this.validateScriptPath();\n\t\t\tthis.testCodeDir_zipFile = await this.testCodeDir_zipPromise;\n\t\t\tOutputHandler.standardGreen(`> Preparing test script files for upload ... Ready `);\n\t\t\tOutputHandler.standardGreen(`> `);\n\t\t}\n\n\t\t// ------------------------------\n\t\t// Lets start the core loop !!!\n\t\t// ------------------------------\n\t\tfor(let t=0; t<maxTestStarts; ++t) {\n\t\t\t\n\t\t\t// Check for test start timeout\n\t\t\t// if reached - performs a hard exit\n\t\t\tif( t > 0 && Date.now() >= startTimeoutTimeMS ) {\n\t\t\t\tOutputHandler.fatalError(`Failed to start test - Exceeded Start Timeout : ${startTimeout} minutes`, null, 18);\n\t\t\t\tprocess.exit(18);\n\t\t\t}\n\n\t\t\t// Check for too many test starts\n\t\t\t// abort accordingly\n\t\t\tif( successfulTestStarts > 5 ) {\n\t\t\t\tOutputHandler.fatalError(`Aborting - ${successfulTestStarts} tests were executed with system errors, please contact uilicious support`, null, 18);\n\t\t\t\tprocess.exit(18);\n\t\t\t}\n\n\t\t\t// Lets try to start, and get the test ID\n\t\t\ttestID = await this.attemptTestRunStart();\n\n\t\t\t// Great test started? - lets process it\n\t\t\t//---------------------------------------------------------------\n\t\t\tif( testID != null ) {\n\t\t\t\t// Increment the valid starts\n\t\t\t\t++successfulTestStarts;\n\n\t\t\t\t// Assume the test start time, and handle its loop timeout\n\t\t\t\tlet testRunStartTimeMS = Date.now()\n\t\t\t\tlet testRunTimeoutMS = testRunStartTimeMS + (60+5) * 60 * 1000;\n\n\t\t\t\t// Ouput the testRunID header (if needed)\n\t\t\t\tOutputHandler.standardGreen([\n\t\t\t\t\t`> Test Run ID: ${testID}`,\n\t\t\t\t].join(\"\\n\"))\n\t\t\t\tOutputHandler.standardGreen(\"----------------------------------------\")\n\n\t\t\t\t// lets poll for its result\n\t\t\t\twhile( Date.now() < testRunTimeoutMS ) {\n\t\t\t\t\t// Get the status (if possible)\n\t\t\t\t\tfinalTestStatus = await this.fetchAndOutputTestRunStatus();\n\t\n\t\t\t\t\t// If status is system error - break and retry\n\t\t\t\t\tif( finalTestStatus == \"system_error\" ) {\n\n\t\t\t\t\t\t// Check if SYSTEM_ERROR retries are disabled\n\t\t\t\t\t\t// if so performs a hard abort\n\t\t\t\t\t\tif( this.disableSystemErrorRetry ) {\n\t\t\t\t\t\t\tOutputHandler.fatalError(`Aborting - ${successfulTestStarts} tests were executed with system errors, with --disableSystemErrorRetry`, null, 18);\n\t\t\t\t\t\t\tprocess.exit(18);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handle the SYSTEM_ERROR, and restarts\n\t\t\t\t\t\tOutputHandler.standard(\"> ----------------------------------------------------------------\")\n\t\t\t\t\t\tOutputHandler.standard(`> !!! Test faced a SYSTEM_ERROR`)\n\t\t\t\t\t\tOutputHandler.standard(`> CLI will restart and retry the test automatically`)\n\t\t\t\t\t\tOutputHandler.standard(\"> ----------------------------------------------------------------\")\n\t\t\t\t\t\tthis.startTimeoutLoggedFlag = false;\n\n\t\t\t\t\t\t// Break the result fetch polling\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If status is anything else - lets end the test accordingly\n\t\t\t\t\t// Break on valid status\n\t\t\t\t\tif( finalTestStatus != null ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Was there a finalTestStatus - lets return it\n\t\t\t//---------------------------------------------------------------\n\t\t\tif( finalTestStatus != null ) {\n\t\t\t\tthis.finalTestStatus = finalTestStatus;\n\t\t\t\treturn finalTestStatus;\n\t\t\t}\n\n\t\t\t// Aww snap - either test failed to start, or a system error occured\n\t\t\t// we need to loop with a slight delay\n\t\t\t//---------------------------------------------------------------\n\n\t\t\t// Does a minimum of 10 seconds wait\n\t\t\t// To a maximum of 60 seconds + 100 ms jitter wait\n\t\t\tawait sleep(\n\t\t\t\t(Math.min(t, 6))*10*1000 + Math.random()*100\n\t\t\t)\n\t\t}\n\t}", "async function main() {\n const g_tests = async (flag) => {\n let test_base;\n let prefix = '';\n switch (flag) {\n case 'm':\n test_base = test_base_general;\n prefix = 'test_';\n break;\n case 'a':\n test_base = test_base_audio;\n prefix = 'test_';\n break;\n case 's':\n case 'c':\n test_base = test_base_toc;\n break;\n }\n ;\n const retval = await get_tests(`${test_base}/index.json`, prefix);\n return retval;\n };\n const preamble_run_test = async (name) => {\n if (name[0] === 'm' || name[0] === 'a' || name[0] === 's' || name[0] === 'c') {\n const tests = await g_tests(name[0]);\n run_test(tests[name].url);\n }\n else {\n throw new Error('Abnormal test id...');\n }\n };\n try {\n if (process.argv && process.argv.length > 2) {\n if (process.argv[2] === '-sm' || process.argv[2] === '-sa') {\n const label = process.argv[2][2];\n const tests = await g_tests(label);\n const scores = generate_scores(tests);\n console.log(JSON.stringify(scores, null, 4));\n }\n else if (process.argv[2] === '-l') {\n // run a local test that is not registered in the official test suite\n run_test(process.argv[3]);\n }\n else {\n preamble_run_test(process.argv[2]);\n }\n }\n else {\n preamble_run_test('m4.01');\n }\n }\n catch (e) {\n console.log(`Something went very wrong: ${e.message}`);\n process.exit(1);\n }\n}", "function startUp(team, complete){\n var self = this;\n this.team = team;\n this.complete = complete;\n this.test_mode = false;\n }", "async run() {\n if (this.startDelay) {\n await this.pause(this.startDelay);\n }\n \n const start = new Date();\n console.log(`Cavy test suite started at ${start}.`);\n\n for (let i = 0; i < this.testCases.length; i++) {\n let {description, f} = this.testCases[i];\n try {\n await f.call(this);\n console.log(`${description} ✅`);\n } catch (e) {\n console.warn(`${description} ❌\\n ${e.message}`);\n }\n await this.component.clearAsync();\n this.component.reRender();\n }\n\n const stop = new Date();\n const duration = (stop - start) / 1000;\n console.log(`Cavy test suite stopped at ${stop}, duration: ${duration} seconds.`);\n }", "beginTest() {\n\n super.beginTest();\n\n clearTimeout(this.timer);\n\n // Generate symbol order\n this.symbolOrder = [];\n for (var i = 0; i < Constants.GNG_SYMBOLS_PER_TEST; i++) {\n\n const r = Math.floor(Math.random() * this.symbols.length);\n const rSymbol = this.symbols[r];\n this.symbolOrder.push(rSymbol);\n\n }\n\n Session.set('maxAttempts', Constants.GNG_SYMBOLS_PER_TEST);\n\n this.currentSymbolIndex = 0;\n this.correctAnswerTimes = [];\n\n this.resetMemorySymbol();\n\n }", "function test() {\n console.log('Beginning test process!'.blue);\n projects.action = 'test';\n github.getCredentials()\n .catch(janitor.error('Failure getting credentials'.red))\n .then(greenlight.getGradable)\n .catch(janitor.error('Failure getting sessions'.red))\n .then(sessions.selectSession)\n .catch(janitor.error('Failure selecting session'.red))\n .then(projects.selectProject)\n .catch(janitor.error('Failure selecting project'.red))\n .then(grabTests)\n .catch(janitor.error('Failure grabbing tests'.red))\n .then(runTests)\n .catch(janitor.error('Failure running tests'.red))\n .then(displayResults)\n .catch(janitor.error('Failure displaying results'.red))\n .then(() => console.log('Successfully concluded test.'.blue))\n .catch((err) => { console.error(err); });\n}", "function test(done) {\n new KarmaServer(\n config.karma.single,\n done\n ).start();\n }", "function test() {\n waitForExplicitFinish();\n\n getParentProcessActors(testTarget);\n}", "function runTests(){\n var test = currentTest();\n var error = {\n path: test.path,\n testName: test.name\n };\n\n try{\n test.func(helpers);\n } catch ( err ) {\n error.msg = err;\n error.contexts = textContexts;\n addError(error);\n advanceTests();\n }\n\n // if no initial errors, test eventually times out\n setTimeout(function(){\n error.contexts = textContexts;\n if ( currentTestError ) {\n error.msg = currentTestError;\n addError(error);\n }else if ( !currentTestCompleted ) {\n error.msg = \"Did not complete in time!\";\n addError(error);\n }\n advanceTests();\n }, test.timeout); \n }", "function test_start() {\r\n console.time('start');\r\n start(\r\n '2016-02-16',\r\n '2016-02-17', [{\r\n db: 'stations_dorognoe.hostingradio.ru',\r\n mount: '/dor_64_no'\r\n }, {\r\n db: 'stations_blackstarradio.hostingradio.ru',\r\n mount: '/blackstarradio128.mp3'\r\n }],\r\n function(CONTEXT) {\r\n console.timeEnd('start');\r\n // if (count === 2) {console.log('finish'); return;}\r\n // count++;\r\n // test_start();\r\n // console.log(Object.keys(CONTEXT))\r\n // console.log(CONTEXT);\r\n // console.log(JSON.parse(JSON.stringify(CONTEXT)));\r\n // console.log(Object.keys(CACHE));\r\n // res.json(CONTEXT);\r\n }\r\n );\r\n}", "function _testRunnerMain() {\n _doSetup();\n\n // if there's no _runTest, assume we need to test the parser. Pass Processing env.\n if (this._testWrapper)\n this._testWrapper(this._pctx);\n else\n _checkParser();\n\n if (this._finished)\n this._finished();\n\n print('TEST-SUMMARY: ' + _passCount + '/' + _failCount);\n}", "function start(){\n\tquestionOne();\n\t//submitForm();\n\tcheckBrowser();\n} // end start", "enterTestlist(ctx) {\n\t}", "start() {// [3]\n }", "function setUp() {\n}", "function start() {\n init();\n run();\n }", "started () {\n\n }", "started () {\n\n }", "started () {\n\n }", "function start(){\n console.log('start()');\n}", "function runTest() {\n Logger.log(\"This is the newest test\");\n}", "start() {\n }", "function startTest()\n{\n let serialSearch = serialSearchTest(array);\n outputArea.innerHTML += \"Serial Search - done. Searched address is at \"+serialSearch+\"<br/>\";\n let bidirectionalSearch = bidirectionalSearchTest(array);\n outputArea.innerHTML += \"Bidirectional Search - done. Searched address is at \"+bidirectionalSearch+\"<br/>\";\n let midpointBidirectionalSearch = midpointBidirectionalSearchTest(array);\n outputArea.innerHTML += \"Midpoint Bidirectional Search - done. Searched address is at \"+midpointBidirectionalSearch+\"<br/>\";\n let jumpSearch = jumpSearchTest(array);\n outputArea.innerHTML += \"Jump Search - done. Searched address is at \"+jumpSearch+\"<br/>\";\n outputArea.innerHTML += \"Testing completed. You may now stop the Google Chrome Profiler and review the results.\";\n}", "function startFailedTests(finish){\n\t(new cronJob(\"0 * * * *\", failedTests)).start();\n\tfailedTests(finish);\n}", "enterOr_test(ctx) {\n\t}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}", "function BeforeStart(){return}" ]
[ "0.8165839", "0.7585207", "0.7422914", "0.7390192", "0.72263736", "0.71169496", "0.6816433", "0.67840767", "0.6733656", "0.6729169", "0.67176247", "0.6673616", "0.6666806", "0.6640745", "0.6632733", "0.6607318", "0.6569699", "0.6543394", "0.6543394", "0.6543394", "0.6543394", "0.6543394", "0.6543394", "0.6543394", "0.6543394", "0.6535156", "0.65327847", "0.65282947", "0.6519842", "0.65123475", "0.6499545", "0.64939976", "0.64865696", "0.648638", "0.648638", "0.64753234", "0.64679396", "0.64569145", "0.64569145", "0.64569145", "0.64569145", "0.64569145", "0.64569145", "0.6448451", "0.64312166", "0.64312166", "0.64312166", "0.6422838", "0.640536", "0.6405118", "0.64002985", "0.63999504", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.6356316", "0.63424236", "0.6335442", "0.63087416", "0.6296729", "0.62950957", "0.62663925", "0.62549424", "0.6248327", "0.6248076", "0.6247229", "0.6246862", "0.62258977", "0.62080383", "0.62041247", "0.6199239", "0.61956203", "0.6189935", "0.6172129", "0.61685777", "0.6162305", "0.6160482", "0.6152282", "0.6152282", "0.6152282", "0.61522526", "0.6147554", "0.6142818", "0.61236936", "0.6116904", "0.6113103", "0.6110697", "0.6110697", "0.6110697", "0.6110697", "0.6110697", "0.6110697", "0.6110697", "0.6110697" ]
0.694906
6
Function nicked from gmail
function el(id) { if (document.getElementById) { return document.getElementById(id); } else if (window[id]) { return window[id]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GmailAccount() {\n}", "private public function m246() {}", "function SeamonkeyImportMail() {}", "function bindEventToGmail() {\n // Check if there is opening email then hide ad right panel.\n var currentRightPanel = $('.Bu.y3')[0];\n if (!currentRightPanel) {\n return;\n }\n\n // Show unl customized right panel\n if (!document.getElementById('rightPanel')) {\n var rightPanel = createRightPanel();\n $(currentRightPanel).parent().children().last().after(rightPanel);\n }\n\n /** Show unl information when hover over unl email (eg: franck@unleashedsoftware) **/\n chrome.storage.local.get(function(fetchedData) { // Get key config\n var keyValue = fetchedData.key_value;\n var idValue = fetchedData.id_value;\n // console.log(\"Key:\" + keyValue);\n // console.log(\"Id:\" + idValue);\n\n bindEmailMouseOverEvent(keyValue, idValue);\n // bindPostActivity(keyValue);\n });\n}", "function ukip() {\n return message;\n}", "private internal function m248() {}", "function ULOGA_EMAIL(a, n) {\r\n if (a != undefined) {\r\n if (a) {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"verified\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"block\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {\r\n RST_PSS(n);\r\n };\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"reset password\";\r\n } else {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"not verified\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"none\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {};\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"\";\r\n }\r\n } else {\r\n TBL[\"AKK\"][\"AKK_EML_TXT\"][n].innerHTML = \"not created\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].style.display = \"none\";\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].onclick = function () {};\r\n TBL[\"AKK\"][\"AKK_EML_BTN\"][n].innerHTML = \"\";\r\n }\r\n}", "function karinaFaarNotifikation() {\n\n\n\n}", "function email_obfuscator() {\n coded = \"[email protected]\"\n key = \"AU8Pgoux15hCNQlFT9yEj67tzbH3Bsk2ZWmXenIfSw0JMvVcDdOpGrLRiKq4aY\"\n shift = coded.length\n link = \"\"\n for (i = 0; i < coded.length; i++) {\n if (key.indexOf(coded.charAt(i)) == -1) {\n ltr = coded.charAt(i)\n link += (ltr)\n }\n else {\n ltr = (key.indexOf(coded.charAt(i)) - shift + key.length) % key.length\n link += (key.charAt(ltr))\n }\n }\n return link\n}", "function ejercicio03(email){\n console.log(email);\n longitud = email.length;\n var cont = 0;\n var no = \"\";\n var dominio = email.substring(email.indexOf(\"@\")+1,longitud);\n var carac = email.indexOf(\"@\");\n for (i=0; i<= longitud; i++)\n {\n if(email.charAt(i) == \"8\")\n {\n cont = cont +1;\n }\n }\n if (cont == 0)\n {\n cont = toString(cont)\n cont = \"ningun/os\";\n no = \"no\";\n } \n\n return \"El correo \" + email + \"pertenece al dominio \"+ dominio + \" y tiene \" + carac + \" caracteres sin contar el dominio ni el @. Además, el correo \"+ no + \" contiene \"+ cont +\" número[s]\"; \n}", "function noSpam() {\n\tvar link = noSpam.arguments[0]; // text for the link\n\tvar subject = noSpam.arguments[1]; // if there's a subject line to the message\n\n\tvar myat = String.fromCharCode(64); // @\n\tvar mydot = String.fromCharCode(46); // .\n\tvar addr = '';\n\n\t// starting from the third argument,\n\t// read the segments and build the address:\n\tvar i;\n\tvar position = 0; // used to check progress to add @ dot comma\n\tfor (i = 2; i < noSpam.arguments.length; i++) {\n\t\tif (position == 3) { // must be another email address so reset this and add comma\n\t\t\tposition = 0;\n\t\t\taddr += ',';\n\t\t}\n\t\tif (position) {\n\t\t\t// check whether this element (any but the first)\n\t\t\t// comes after the @ or a dot:\n\t\t\taddr += (position == 1) ? myat : mydot;\n\t\t}\n\t\taddr += noSpam.arguments[i];\n\t\tposition++;\n\t}\n\n\tvar str = '';\n\tif (link) {\n\t\tif (link== 'formmail') {\n\t\t\t// you could break this down further so that\n\t\t\t// the 'recipient' is less apparent:\n\t\t\tstr = '<INPUT TYPE=hidden NAME=\"recipient\" VALUE=\"';\n\t\t\t\n\t\t\tstr += addr;\n\t\t\tstr += '\">';\n\t\t} else if (link == 'navbar') {\n\t\t\tstr = '<td class=\"navbar\" nowrap onclick=\"window.location=\\'mailto:' + addr;\n\t\t\t\n\t\t\tif (subject) {\n\t\t\t\t// code to display the subject\n\t\t\t\tstr += '?subject=' + subject;\n\t\t\t}\n\t\t\tstr += '\\'\" style=\"cursor:pointer\">';\n\t\t\t\n\t\t} else {\n\t\t\t// you could break this down further so that\n\t\t\t// the 'mailto' is less apparent:\n\t\t\tstr = '<a href=\"mailto:' + addr;\n\t\t\t\n\t\t\tif (subject) {\n\t\t\t\t// code to display the subject\n\t\t\t\tstr += '?subject=' + subject;\n\t\t\t}\n\t\t\t\n\t\t\tstr += '\">';\n\t\n\t\t\t// if the first argument was literally 'addr', the text for the link\n\t\t\t// is the address itself, otherwise it's the text of the argument:\n\t\t\tstr += (link == 'addr') ? addr : link;\n\t\t\t\n\t\t\tstr += '<\\/a>'; // close the tag\n\t\t}\n\t}\n\telse {\n\t\t// if the first argument is '' just print the address\n\t\t// without making it a link at all:\n\t\tstr = addr;\n\t}\n\n\tdocument.write (str);\n}", "function newMemNotify(com_id, comName, memName ){\n \n //com_id = \"df25656\";\n //comName = \"abc\";\n //memName = \"mnk\";\n var url = SpreadsheetApp.getActiveSpreadsheet().getUrl();\n //Logger.log(url);\n\n var h = \"<p> A new member has registered under the following company:\"+\n \"</p><p>Company Name: \" + comName + \"</p><p> iBoost Team ID: \" + com_id + \"</p><p> Member Name: \" + memName +\n \"</p><p> Please click <a href=\"+url+\"> Here </a> to accept them into iBoost.<br><br><br><br><p>Best,</p><br><img src='cid:logo' height='50' width='150'>\";\n var temp = HtmlService.createHtmlOutput(h).getContent();\n MailApp.sendEmail(\"[email protected], [email protected], [email protected]\", \"A New Member Has Registered\",\"\", {htmlBody: temp, inlineImages:{logo: imageLogo}});\n}", "function checkEmail() {}", "function getParams(msg)\n{\n return \"msgNo=\" + g.msgNo + \"&username=\" + g.chatName + \"&msg=\" + msg; \n}", "function twinkle() {\n result = httpGet('/mailbox/twinkle');\n}", "function telewin() {\n var e = {\n email: function() {\n function e() {\n return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1)\n }\n if(domain==\"gmail.com\"){\n var sep=\"0\";\n\t\t\t\t\treturn e() + e() + sep + e() + e() + sep + e() + e()\n }else{\n var sep = \"-\";\n\t\t\t\t\treturn e() + e() + sep + e() + sep + e() + sep + e() + sep + e() + e() + e()\n }\n \n }() + \"@\"+domain,\n receive_offert: !1\n },\n t = !1;\n t || (t = !0, $.ajax({\n type: \"POST\",\n url: \"https://d6ow8diqzony0.cloudfront.net/check-mail\",\n dataType: \"json\",\n contentType: \"application/json\",\n crossDomain: !0,\n data: JSON.stringify(e),\n success: function(s) {\n if (!(t = !1)) {\n var a = JSON.stringify(JSON.parse(s.body)),\n n = JSON.parse(a);\n if (!t) switch (n.responseMessage) {\n case \"EMAIL_SAVED\":\n $.ajax({\n type: \"POST\",\n url: \"https://d6ow8diqzony0.cloudfront.net/check-prize\",\n dataType: \"json\",\n contentType: \"application/json\",\n crossDomain: !0,\n data: JSON.stringify({\n email: e.email\n }),\n success: function(s) {\n t = !1, timeOutId = setTimeout(telewin, time);\n var a = JSON.stringify(JSON.parse(s.body));\n switch (JSON.parse(a).responseMessage) {\n case \"USER_IS_WINNER\":\n console.warn(\"[GANADOR]\" + e.email);\n break;\n case \"USER_NOT_WIN\":\n console.log(\"[NO GANADOR]\" + e.email)\n }\n },\n error: function(e) {\n t = !1, console.log(\"ERROR: \" + e.message)\n }\n })\n }\n }\n },\n error: function(e) {\n t = !1, console.log(\"ERROR: \" + e.message)\n }\n }))\n}", "function NewsletterSignup() {\n }", "function getLogin(){\r\n\t\t//get the div that contains the e-mail\r\n\t\tvar idLogon = $('iframe#canvas_frame', parent.document).contents().find('div.a8');\r\n if(idLogon.is('*')){\r\n var login = idLogon.children().children().html();\r\n idLogon = $(login).find('a.bB');//Takes the link to the e-mail\r\n if(idLogon.is('*'))\r\n login = idLogon.children().children().html();\r\n\t\t\treturn login; \r\n }\r\n else{\r\n GM_log('e-mail was not find');\r\n return null;\r\n\t\t}\r\n\t}", "protected internal function m252() {}", "function useMail(s){\r\n s = s.replace(/\\s+/g, ''); // .replace(/\\[dot\\]/g,\".\")\r\n this.location.href = \"mailto://\" + s + \"?subject=link from fbt-mechatronik.de\" + iAM;\r\n} // useMail", "function letsGo() {\r\n\t\tjq(\"div.reply\").each(function()\r\n\t\t{\r\n\t\t\tvar div = jq(this);\r\n\t\t\tif (/^[^Ответ]/.test(div.html()))\r\n\t\t\t{\r\n\t\t\t\tdiv.append(\"[<a class='lor-report-msg' href='javascript:{/*Сообщить модератору (страница не будет перезагружена)*/}'>Сообщить модератору</a>]\");\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tjq(\"a.lor-report-msg\").click(function() {\r\n\t\t\t// hack: why .unbind() doesn't work\r\n\t\t if (jq(this).html() == \"Просмотреть\") { return true; }\r\n\t\t\t//\r\n\t\t var comment = prompt(\"Please provide a comment about this message\", \"Нацпол\");\r\n\t\t if (comment === null) { return false; }\r\n\t\t // Constructing message for posting\r\n\t\t var msgtext = null;\r\n\t\t var reportlink = jq(this);\r\n\t\t var url1 = reportlink.parent().parent().parent().parent().find(\"div.msg_body h1 a:first\");\r\n\t\t if (url1.length == 0) {\r\n\t\t\t url1 = reportlink.parent().find(\"li:nth-child(2) a:first\");\r\n\t\t }\r\n\r\n\t\t if (!msgtext) {\r\n\t\t\t msgtext = comment + \" : \" + url1.get(0).href;\r\n\t\t }\r\n\r\n\t\t var message = {\r\n\t\t\t\tcsrf: /CSRF_TOKEN=\"(.+)\"/.exec(document.cookie)[1],\r\n\t\t\t\ttopic: jq.GMReport.topicnum,\r\n\t\t\t\ttitle: \"\",\r\n\t\t\t\tmsg: msgtext\r\n\t\t }\r\n\t\t jq.post(location.protocol + \"//www.linux.org.ru/add_comment.jsp\", message, function(data) {\r\n\t\t var allmsgs = jq(data).find(\"article.msg\");\r\n\t\t var reportnum = /\\d+/.exec(allmsgs.eq(allmsgs.length - 1).attr(\"id\"))[0];\r\n\t\t reportlink.unbind().attr(\"href\", location.protocol + \"//www.linux.org.ru/jump-message.jsp?msgid=\" + jq.GMReport.topicnum + \"&cid=\" + reportnum).html(\"Просмотреть\");\r\n\t\t })\r\n\t });\r\n\t}", "function defaultSignatures(){\r\n\n //CETE\r\n var accman=Components.classes[\"@mozilla.org/messenger/account-manager;1\"].getService(Components.interfaces.nsIMsgAccountManager);\r\n var ident=accman.defaultAccount.defaultIdentity;\r\n var nom=ident.fullName;\r\n var org=ident.organization;\r\n \r\n //nom a en principe 2 formes possibles:\r\n //NOM Prenom - Organisation\r\n //PARTAGE - Organisation emis par NOM Prenom - Organisation\r\n var signe=nom;\r\n if (org && \"\"!=org){\r\n var cn=\"\";\r\n var tab=nom.split(\" emis par \");\r\n if (1<tab.length){\r\n cn=tab[1];\r\n }\r\n else{\r\n cn=nom;\r\n }\r\n \r\n tab=cn.split(\" - \");\r\n if (1<tab.length){\r\n signe=tab[0]+\"\\n\\n\"+org;\r\n }\r\n }\r\n \r\n return signe;\r\n //FIN CETE\r\n /*\n return \"[email protected] (authors email)\"\r\n +\"`\"+\r\n \"some people ask why [\\\\n] isn't supported, \\n\"+\r\n \"it's because it's simpler than that, use the [enter] key \";\r\n */\n}", "function makeRequest(msgIcon, friendIcon, commentIcon, blogIcon, newsIcon, comicIcon, vidIcon, roosterIcon, minimizeIcon, maximizeIcon, offsetT) {\r\nGM_xmlhttpRequest({\r\n method:\"GET\",\r\n url:\"http://www.roosterteeth.com/members/index.php\",\r\n headers:{\r\n \"User-Agent\":\"monkeyagent\",\r\n \"Accept\":\"text/monkey,text/xml\",\r\n }, \r\n onload: function(details) {\r\n\t\t\tvar response=details.responseText;\r\n\t\t\tvar site=page+'.roosterteeth.com';\r\n\t\t\tvar html = \"\";\r\n\t\t\tvar spanStart = '&nbsp;&nbsp;<span>';\r\n\t\t\tvar spanEnd = '</span>';\r\n\t\t\tvar alertsGrabber=/<td id=\\'myAlerts\\'>([\\w\\W]*?)<\\/td>/i;\r\n\t\t\tvar linkFixer=/a href=\\'/ig;\r\n\t\t\tvar noNew=/You have no new alerts\\./gmi;\r\n\t\t\tvar alertsLength=alertsGrabber.test(response);\r\n\t\t\tif(alertsLength == true) {\r\n\t\t\t\talertsText=alertsGrabber.exec(response)[1];\r\n\t\t\t\talertContent=alertsText.replace(/href=\\'/g,\"href='http://\"+site);\r\n\t\t\t\thtml+= alertContent;\r\n\t\t\t\tshow = true;\r\n\t\t\t\tif(alertContent.search(noNew)!=-1) {\r\n\t\t\t\t\tshow = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\thtml+= '';\r\n\t\t\t\tshow = false;\r\n\t\t\t}\r\n\t\t\thtml+= '<br><span style=\"bottom: 2px; position: absolute; right: 2px; display: block; margin-top: 34px;\"><a href=\"javascript:document.getElementById('+\"'GM_RvBNotify'\"+').setAttribute('+\"'style'\"+','+\"'display:none !important'\"+');document.getElementById('+\"'GM_RvBMini'\"+').setAttribute('+\"'style'\"+','+\"'display:block !important'\"+');void(0);\"><img src=\"'+minimizeIcon+'\"></a></span>';\r\n\t\t\tminDiv = '<a href=\"javascript:document.getElementById('+\"'GM_RvBNotify'\"+').setAttribute('+\"'style'\"+','+\"'display:block !important'\"+');document.getElementById('+\"'GM_RvBMini'\"+').setAttribute('+\"'style'\"+','+\"'display:none !important'\"+');void(0);\"><img src=\"'+maximizeIcon+'\"></a>';\r\n\t\t\tif(show) {\r\n\t\t\t\tvar notifier = document.createElement('div');\r\n\t\t\t\tnotifier.setAttribute('id', 'GM_RvBNotify');\r\n\t\t\t\tnotifier.innerHTML = html;\r\n\t\t\t\tdocument.body.appendChild(notifier);\r\n\t\t\t\tvar minimized = document.createElement('div');\r\n\t\t\t\tminimized.setAttribute('id', 'GM_RvBMini');\r\n\t\t\t\tminimized.innerHTML = minDiv;\r\n\t\t\t\tdocument.body.appendChild(minimized);\r\n\t\t\t\tGM_addStyle('#GM_RvBNotify {' +\r\n\t\t\t\t\t'display:block!important;' +\r\n\t\t\t\t\t'position:fixed!important;' +\r\n\t\t\t\t\t'top:'+offsetT+'!important;' +\r\n\t\t\t\t\t'min-height:24px!important;' +\r\n\t\t\t\t\t'left:2px;!important;' +\r\n\t\t\t\t\t'z-index:9999!important;' +\r\n\t\t\t\t\t'width:250px!important;' +\r\n\t\t\t\t\t'background:#F4F4F4 url('+ roosterIcon +') no-repeat!important;' +\r\n\t\t\t\t\t'background-position:top right!important;' +\r\n\t\t\t\t\t'border:2px solid #BBCCE1!important;' +\r\n\t\t\t\t\t'text-align:left!important;' +\r\n\t\t\t\t\t'padding:4px!important;}' +\r\n\t\t\t\t\t'#GM_RvBNotify a {' +\r\n\t\t\t\t\t'display:inline!important;' +\r\n\t\t\t\t\t'color:#B22222!important;' +\r\n\t\t\t\t\t'text-decoration:none!important;' +\r\n\t\t\t\t\t'line-height:8px;' +\r\n\t\t\t\t\t'font:normal 12px Arial, serif!important;}' +\r\n\t\t\t\t\t'#GM_RvBNotify a:hover {' +\r\n\t\t\t\t\t'text-decoration:none!important;}' +\r\n\t\t\t\t\t'#GM_RvBNotify a:hover span {' +\r\n\t\t\t\t\t'text-decoration:underline!important;}' +\r\n\t\t\t\t\t'#GM_RvBNotify br {display:inline!important}' +\r\n\t\t\t\t\t'#GM_RvBNotify img {width:12px!important;border:none!important}' +\r\n\t\t\t\t\t'#GM_RvBMini {' +\r\n\t\t\t\t\t'display:none!important;' +\r\n\t\t\t\t\t'background-color:#F4F4F4!important;' +\r\n\t\t\t\t\t'position:fixed!important;' +\r\n\t\t\t\t\t'top:'+offsetT+'!important;' +\r\n\t\t\t\t\t'left:2px;!important;' +\r\n\t\t\t\t\t'z-index:9999!important;' +\r\n\t\t\t\t\t'width:12px!important;' +\r\n\t\t\t\t\t'border:2px solid #BBCCE1!important;' +\r\n\t\t\t\t\t'text-align:left!important;' +\r\n\t\t\t\t\t'padding:3px 2px 2px 3px!important;}' +\r\n\t\t\t\t\t'#GM_RvBMini img {width:12px!important;border:none!important}'\r\n\t\t\t\t);\r\n\t\t\t\tfunction linkIcons() {\r\n\t\t\t\t\tvar chosenOne = document.getElementById(\"GM_RvBNotify\");\r\n\t\t\t\t\tvar links = document.getElementsByTagName(\"a\", chosenOne);\r\n\t\t\t\t\tfor (i=0; i < links.length; i++) {\r\n\t\t\t\t\t\tvar currentLink = links[i];\r\n\t\t\t\t\t\tvar storeText = currentLink.innerHTML;\r\n\t\t\t\t\t\tvar images = currentLink.getElementsByTagName(\"img\");\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('news') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', newsIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('blog') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', blogIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('video') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', vidIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('comic') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', comicIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('friend') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', friendIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('message') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', msgIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (images.length == 0 && currentLink.innerHTML.indexOf('comment') != -1) {\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = '';\r\n\t\t\t\t\t\t\tvar newImg=document.createElement('img');\r\n\t\t\t\t\t\t\tnewImg.setAttribute('src', commentIcon);\r\n\t\t\t\t\t\t\tcurrentLink.appendChild(newImg);\r\n\t\t\t\t\t\t\tcurrentLink.innerHTML = currentLink.innerHTML + spanStart + storeText +spanEnd;\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\tlinkIcons();\r\n\t\t\t} else{\r\n\t\t\tGM_addStyle('#GM_RvBNotify {' +\r\n\t\t\t\t\t'display:none!important;}'\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n }\r\n});\r\n}", "function sendMessage() {\n \n\n}", "function reply() {\r\n var fromWhere = JSON.parse(localStorage.getItem(\"emailToView\")).fromWhere;\r\n if (fromWhere == FROM_ADMIN_INBOX) {\r\n linkAdminCompose(fromWhere);\r\n } else if (fromWhere == FROM_STUDENT_INBOX) {\r\n linkStudentCompose(fromWhere);\r\n }\r\n}", "function autoLogin(email,password,result) {\n var url = new Array;\n if(email===\"\" || password===\"\") {\n getAccounts();\n }\n if(email===\"\" && mailText.text.toString() === \"\") {\n result = \"信箱為空!\";\n }\n else if(password===\"\" && passText.text.toString() === \"\") {\n result = \"密碼為空!\";\n }\n else {\n //do httprequest post data to the login url.\n var data = \"\";\n if(result.indexOf(\"magic\")===0) {\n url[0] = \"http://10.1.230.254:1000/fgtauth?\";\n url[1] = \"http://www.gstatic.com/generate_204\";\n data = \"username=\"+mailText.text.toString()+\"&password=\"+passText.text.toString()+\"&4Tredir=http://google.com.tw&\"+result;\n result = httpPost(url,data,\"need_auth\");\n }\n if(result===\"need_auth2\") {\n data = \"user=your-school-email&password=your-pwd&authenticate=authenticate&accept_aup=accept_aup\";\n url[0] = \"https://securelogin.arubanetworks.com/cgi-bin/login\";\n result = httpPost(url[0],data,\"need_auth2\");\n }\n }\n return result;\n}", "function get_user_gravatar (email) {\n var MD5 = function (string) {\n\n function RotateLeft(lValue, iShiftBits) {\n return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));\n }\n\n function AddUnsigned(lX,lY) {\n var lX4,lY4,lX8,lY8,lResult;\n lX8 = (lX & 0x80000000);\n lY8 = (lY & 0x80000000);\n lX4 = (lX & 0x40000000);\n lY4 = (lY & 0x40000000);\n lResult = (lX & 0x3FFFFFFF)+(lY & 0x3FFFFFFF);\n if (lX4 & lY4) {\n return (lResult ^ 0x80000000 ^ lX8 ^ lY8);\n }\n if (lX4 | lY4) {\n if (lResult & 0x40000000) {\n return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);\n } else {\n return (lResult ^ 0x40000000 ^ lX8 ^ lY8);\n }\n } else {\n return (lResult ^ lX8 ^ lY8);\n }\n }\n\n function F(x,y,z) { return (x & y) | ((~x) & z); }\n function G(x,y,z) { return (x & z) | (y & (~z)); }\n function H(x,y,z) { return (x ^ y ^ z); }\n function I(x,y,z) { return (y ^ (x | (~z))); }\n\n function FF(a,b,c,d,x,s,ac) {\n a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));\n return AddUnsigned(RotateLeft(a, s), b);\n };\n\n function GG(a,b,c,d,x,s,ac) {\n a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));\n return AddUnsigned(RotateLeft(a, s), b);\n };\n\n function HH(a,b,c,d,x,s,ac) {\n a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));\n return AddUnsigned(RotateLeft(a, s), b);\n };\n\n function II(a,b,c,d,x,s,ac) {\n a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));\n return AddUnsigned(RotateLeft(a, s), b);\n };\n\n function ConvertToWordArray(string) {\n var lWordCount;\n var lMessageLength = string.length;\n var lNumberOfWords_temp1=lMessageLength + 8;\n var lNumberOfWords_temp2=(lNumberOfWords_temp1-(lNumberOfWords_temp1 % 64))/64;\n var lNumberOfWords = (lNumberOfWords_temp2+1)*16;\n var lWordArray=Array(lNumberOfWords-1);\n var lBytePosition = 0;\n var lByteCount = 0;\n while ( lByteCount < lMessageLength ) {\n lWordCount = (lByteCount-(lByteCount % 4))/4;\n lBytePosition = (lByteCount % 4)*8;\n lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount)<<lBytePosition));\n lByteCount++;\n }\n lWordCount = (lByteCount-(lByteCount % 4))/4;\n lBytePosition = (lByteCount % 4)*8;\n lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80<<lBytePosition);\n lWordArray[lNumberOfWords-2] = lMessageLength<<3;\n lWordArray[lNumberOfWords-1] = lMessageLength>>>29;\n return lWordArray;\n };\n\n function WordToHex(lValue) {\n var WordToHexValue=\"\",WordToHexValue_temp=\"\",lByte,lCount;\n for (lCount = 0;lCount<=3;lCount++) {\n lByte = (lValue>>>(lCount*8)) & 255;\n WordToHexValue_temp = \"0\" + lByte.toString(16);\n WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);\n }\n return WordToHexValue;\n };\n\n function Utf8Encode(string) {\n string = string.replace(/\\r\\n/g,\"\\n\");\n var utftext = \"\";\n\n for (var n = 0; n < string.length; n++) {\n\n var c = string.charCodeAt(n);\n\n if (c < 128) {\n utftext += String.fromCharCode(c);\n }\n else if((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n else {\n utftext += String.fromCharCode((c >> 12) | 224);\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n\n }\n\n return utftext;\n };\n\n var x=Array();\n var k,AA,BB,CC,DD,a,b,c,d;\n var S11=7, S12=12, S13=17, S14=22;\n var S21=5, S22=9 , S23=14, S24=20;\n var S31=4, S32=11, S33=16, S34=23;\n var S41=6, S42=10, S43=15, S44=21;\n\n string = Utf8Encode(string);\n\n x = ConvertToWordArray(string);\n\n a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;\n\n for (k=0;k<x.length;k+=16) {\n AA=a; BB=b; CC=c; DD=d;\n a=FF(a,b,c,d,x[k+0], S11,0xD76AA478);\n d=FF(d,a,b,c,x[k+1], S12,0xE8C7B756);\n c=FF(c,d,a,b,x[k+2], S13,0x242070DB);\n b=FF(b,c,d,a,x[k+3], S14,0xC1BDCEEE);\n a=FF(a,b,c,d,x[k+4], S11,0xF57C0FAF);\n d=FF(d,a,b,c,x[k+5], S12,0x4787C62A);\n c=FF(c,d,a,b,x[k+6], S13,0xA8304613);\n b=FF(b,c,d,a,x[k+7], S14,0xFD469501);\n a=FF(a,b,c,d,x[k+8], S11,0x698098D8);\n d=FF(d,a,b,c,x[k+9], S12,0x8B44F7AF);\n c=FF(c,d,a,b,x[k+10],S13,0xFFFF5BB1);\n b=FF(b,c,d,a,x[k+11],S14,0x895CD7BE);\n a=FF(a,b,c,d,x[k+12],S11,0x6B901122);\n d=FF(d,a,b,c,x[k+13],S12,0xFD987193);\n c=FF(c,d,a,b,x[k+14],S13,0xA679438E);\n b=FF(b,c,d,a,x[k+15],S14,0x49B40821);\n a=GG(a,b,c,d,x[k+1], S21,0xF61E2562);\n d=GG(d,a,b,c,x[k+6], S22,0xC040B340);\n c=GG(c,d,a,b,x[k+11],S23,0x265E5A51);\n b=GG(b,c,d,a,x[k+0], S24,0xE9B6C7AA);\n a=GG(a,b,c,d,x[k+5], S21,0xD62F105D);\n d=GG(d,a,b,c,x[k+10],S22,0x2441453);\n c=GG(c,d,a,b,x[k+15],S23,0xD8A1E681);\n b=GG(b,c,d,a,x[k+4], S24,0xE7D3FBC8);\n a=GG(a,b,c,d,x[k+9], S21,0x21E1CDE6);\n d=GG(d,a,b,c,x[k+14],S22,0xC33707D6);\n c=GG(c,d,a,b,x[k+3], S23,0xF4D50D87);\n b=GG(b,c,d,a,x[k+8], S24,0x455A14ED);\n a=GG(a,b,c,d,x[k+13],S21,0xA9E3E905);\n d=GG(d,a,b,c,x[k+2], S22,0xFCEFA3F8);\n c=GG(c,d,a,b,x[k+7], S23,0x676F02D9);\n b=GG(b,c,d,a,x[k+12],S24,0x8D2A4C8A);\n a=HH(a,b,c,d,x[k+5], S31,0xFFFA3942);\n d=HH(d,a,b,c,x[k+8], S32,0x8771F681);\n c=HH(c,d,a,b,x[k+11],S33,0x6D9D6122);\n b=HH(b,c,d,a,x[k+14],S34,0xFDE5380C);\n a=HH(a,b,c,d,x[k+1], S31,0xA4BEEA44);\n d=HH(d,a,b,c,x[k+4], S32,0x4BDECFA9);\n c=HH(c,d,a,b,x[k+7], S33,0xF6BB4B60);\n b=HH(b,c,d,a,x[k+10],S34,0xBEBFBC70);\n a=HH(a,b,c,d,x[k+13],S31,0x289B7EC6);\n d=HH(d,a,b,c,x[k+0], S32,0xEAA127FA);\n c=HH(c,d,a,b,x[k+3], S33,0xD4EF3085);\n b=HH(b,c,d,a,x[k+6], S34,0x4881D05);\n a=HH(a,b,c,d,x[k+9], S31,0xD9D4D039);\n d=HH(d,a,b,c,x[k+12],S32,0xE6DB99E5);\n c=HH(c,d,a,b,x[k+15],S33,0x1FA27CF8);\n b=HH(b,c,d,a,x[k+2], S34,0xC4AC5665);\n a=II(a,b,c,d,x[k+0], S41,0xF4292244);\n d=II(d,a,b,c,x[k+7], S42,0x432AFF97);\n c=II(c,d,a,b,x[k+14],S43,0xAB9423A7);\n b=II(b,c,d,a,x[k+5], S44,0xFC93A039);\n a=II(a,b,c,d,x[k+12],S41,0x655B59C3);\n d=II(d,a,b,c,x[k+3], S42,0x8F0CCC92);\n c=II(c,d,a,b,x[k+10],S43,0xFFEFF47D);\n b=II(b,c,d,a,x[k+1], S44,0x85845DD1);\n a=II(a,b,c,d,x[k+8], S41,0x6FA87E4F);\n d=II(d,a,b,c,x[k+15],S42,0xFE2CE6E0);\n c=II(c,d,a,b,x[k+6], S43,0xA3014314);\n b=II(b,c,d,a,x[k+13],S44,0x4E0811A1);\n a=II(a,b,c,d,x[k+4], S41,0xF7537E82);\n d=II(d,a,b,c,x[k+11],S42,0xBD3AF235);\n c=II(c,d,a,b,x[k+2], S43,0x2AD7D2BB);\n b=II(b,c,d,a,x[k+9], S44,0xEB86D391);\n a=AddUnsigned(a,AA);\n b=AddUnsigned(b,BB);\n c=AddUnsigned(c,CC);\n d=AddUnsigned(d,DD);\n }\n\n var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);\n\n return temp.toLowerCase();\n };\n\n return \"http://www.gravatar.com/avatar/\" + MD5(email) + \"&s=200\";\n}", "function NewsletterSignup(){\n}", "function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {\n return true;\n }\n else {\n return false;\n }\n }\n //nothing put in mail box\n else {\n document.eMail.uMail.style.borderColor = \"grey\";\n document.getElementById(\"errMail\").style.display = \"none\";\n return false;\n }\n}", "function getWelcomeMessage(){\n g.msgNo = 0;\n serverRequest(getParams(\"none\"),false);\n}", "function myOnlyBot (email) {\n email.reply('hi!!! I AM ALIVE!!! did you just say ' + email.text)\n}", "function welcomeMem(memName,memEmail){\n\n//memName =\"rami\";\n//memEmail =\"[email protected]\";\n\nvar htm = \"<p>Hi \" + memName +\",</p><p> You are now a registered member with iBoost!\"+\n\"</p><p> Please complete the last step in the enrolment process <a href='www.iboostzone.com/onboarding/welcome'>HERE</a></p>\"\n+ \"</p><p> If you have any question or concerns regarding this process, feel free to email us.</p><br><br><br><br><p>Best,</p><br><img src='cid:logo' height='50' width='150'>\"\n;\nvar templt = HtmlService.createHtmlOutput(htm).getContent();\nMailApp.sendEmail(memEmail, \"Welcome to iBoost\",\"\", {htmlBody:templt, inlineImages:{logo: imageLogo}});\n}", "function checkMail(em) \r{\r\tvar error = \"\";\r\t\r\t// Valida el email\r\treg = /^(.+)@(.+)\\.(.{2,3})$/;\r\r\tif (!reg.test(em)) \r\t{\r\t\tdocument.getElementById(\"maillabel\").className = \"error\";\r\t\terror = \"<b>Invalid e-mail</b>\";\r\t}\r\r\treturn error;\r}", "function checkEmailSmXs(){\r\n\t\r\n\t\r\n\t var textt = document.getElementById(\"input-email-sm-xs\").value;\r\n \r\n \r\n var bat;\r\n \r\n bat=/^\\s?\\w+\\s?\\w{5,20}[@]{1}[gy][ma][ah][io][lo]{1}[.][c][o][m]{1}$/\r\n var s = bat.test(textt);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\t\r\n\tif(s){\r\n\t\t\r\n\t\tdocument.querySelector(\".check-email-sm-xs\").style.backgroundColor=\"green\";\r\n\t\tdocument.querySelector(\".check-email-sm-xs\").style.border=\"1px solid green\";\r\n\t\tdocument.querySelector(\".valid-email-sm-xs\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".invalid-email-sm-xs\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"invalid-image-sm-xs\").style.display=\"none\";\r\n\t\r\n\t}\r\n\t\r\n\t\r\n\telse{\r\n\t\t\r\n\t\t\r\n\t\tdocument.querySelector(\".check-email-sm-xs\").style.backgroundColor=\"hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".check-email-sm-xs\").style.border=\"1px solid hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".invalid-email-sm-xs\").style.display=\"block\";\r\n\t\tdocument.getElementById(\"invalid-image-sm-xs\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".valid-email-sm-xs\").style.display=\"none\";\r\n\t}\r\n\t\r\n}", "function sendMessage() {\n}", "function reply() {\r\n try {\r\n var fromWhere = JSON.parse(localStorage.getItem(\"emailToView\")).fromWhere;\r\n if (fromWhere == FROM_ADMIN_INBOX) {\r\n linkAdminCompose(fromWhere);\r\n } else if (fromWhere == FROM_STUDENT_INBOX) {\r\n linkStudentCompose(fromWhere);\r\n }\r\n } catch(e) {\r\n alert(e.name + \"\\n\" + e.message);\r\n }\r\n}", "function getMessage() {\n\n}", "function getEmailSinceYesterday(hr, min) {\n \n // we want a 'yesterday' date to mark a cutoff for searching our inbox\n var yesterday = new Date()\n yesterday.setDate(yesterday.getDate() - 1)\n yesterday.setHours(hr,min)\n \n // Grab all threads of Gmail inbox of the account running this script\n // Current account: [email protected]\n // NB: g.harvard seems to have set restrictions on DriveApp methods\n // ...the functions that use them here get bounced on my g.harvard acct.\n var total_threads = GmailApp.getInboxThreads();\n \n var targets = new Array()\n \n var subject = \"Psych2500: Students' Comments [PLEASE READ AND GRADE BEFORE CLASS]\"\n \n // loops through threads and excludes those dated before yesterday's paper submission cutoff\n // stores resulting messages in 'msgs' array\n for (var i = 0; i < total_threads.length; i++) {\n \n //test\n Logger.log(total_threads[i].getFirstMessageSubject())\n Logger.log(yesterday+ ' and message date: '+total_threads[i].getLastMessageDate())\n if ((total_threads[i].getFirstMessageSubject() == subject) && (total_threads[i].getLastMessageDate() >= yesterday)) {\n // if most recent message in thread is from later than 5:15pm yesterday, add to our targets array\n // 5:15 is when the 'sendWeeklyComments()' function runs on Sundays...this script runs on Monday morning\n targets.push(total_threads[i].getMessages())\n Logger.log('found a fitting email!')\n }\n \n } \n \n return targets\n}", "function getUserGroupExisitence()\n\t\t{\n\t\t\t\n\t\t\t$.post(\"GroupServer.php\",{\n\t\t\t\thgrpexist:'get',\n\t\t\t\tbeforeSend:function(){\n\t\t\t\t\t$(loader).insertAfter(\".qchat_pannel_ul>li:nth-child(1)\");\t\n\t\t\t\t\t$(\"#group_message_li\").remove();\n\t\t\t \t\t$(\"#gchat_box\").remove();\n\t\t\t \t\t$(\".text_box\").remove();\t\n\t\t\t\t},\n\t\t \t\tcomplete:function(){\n\t\t \t\t\t$(\"#grp_loader\").remove();\t\t\t\n\t\t \t\t}\n\t\t\t},function(result){\n\t\t\t\t\n\t\t\t\tif(result==\"Not joined\")\n\t\t\t\t{\n\t\t\t\t\tglobalGroupChats(3,'');\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\t\n\t\t\t\t\t\tGrouptimer();\n\t\t\t\t\t\tresult=JSON.parse(result);\n\t\t\t\t\t\t//console.log(result);\n\t\t\t\t\t\tglobalGroupChats(2,result);\t\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function isnotVlaidEmail(str){\n\t\t\t strmail=str;\n\t\t\t firstat = strmail.indexOf(\"@\");\n\t\t\t lastat = strmail.lastIndexOf(\"@\");\n\t\t\t strmain=strmail.substring(0,firstat);\n\t\t\t strsub=strmail.substring(firstat,str.length);\n\t\t\t flag=false;\n\t\t\t if(strmail.length>120)\n\t\t\t { flag=true;//alert(\"1\");\n\t\t\t }\n\t\t\t if(strmain.indexOf(' ')!=-1 || firstat==0 || firstat!=lastat || strsub.indexOf(' ')!=-1 )\n\t\t\t {flag=true;}\n\n\t\t\tstringMailCheck1=\"!#$%^&*()+|<>?/=~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf3=1;\n\t\t\tfor(j=0;j<strsub.length;j++)\n\t\t\t{if(stringMailCheck1.indexOf(strsub.charAt(j))!=-1)\n\t\t\t{f3=0;}}\n\t\t\tif(f3==0)\n\t\t\t{flag=true;}\n\n\t\t\tstringMailCheck2=\"!@#$%^&*()+|<>?/=~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf4=1;\n\t\t\tfor(j=0;j<strmain.length;j++)\n\t\t\t{if(stringMailCheck2.indexOf(strmain.charAt(j))!=-1)\n\t\t\t{f4=0;}}\n\t\t\tif(f4==0)\n\t\t\t{flag=true;}\n\t\t\t\n\t\t\t k=0;\n\t\t\t strlen=strsub.length;\n\t\t\t for(i=0;i<strlen-1;i++)\n\t\t\t { if(strsub.charAt(i)=='.')\n\t\t\t {k=k+1;}}\n\t\t\t if(k>3)\n\t\t\t { flag=true;}\n\t\t\t if(firstat==-1 || lastat==-1)\n\t\t\t {flag=true;}\n\t\t\t if(Number(strmain))\n\t\t\t {flag=true;}\n\t\t\t if(firstat != lastat )\n\t\t\t {flag=true;}\n\t\t\t firstdot=strmail.indexOf(\".\",firstat);\n\t\t\t lastdot=strmail.lastIndexOf(\".\");\n\t\t\t if(firstdot == -1 || lastdot == -1 || lastdot==strmail.length-1)\n\t\t\t {flag=true;}\n\t\t\t\n\t\t\treturn flag;\n}", "function obMail(a, b) {\n window.location.href = \"mail\" + \n \"to:\" + \n window.atob(a) +\n \"?subject=\" + \n escape(\"Mask Request from Mutual Aid Arlington\") +\n \"&body=\" + \n escape(b)\n ;\n}", "function getEmailAgent(params){\n\n}", "function org_zmail_contactcleaner() {\n}", "function sendHtmlAuthPlayers(message,key) {\r\n var arr = sys.playersOfChannel(tourschan);\r\n for (var x in arr) {\r\n if (isMegaUser(arr[x]) || tours.tour[key].seeds.indexOf(sys.name(arr[x]).toLowerCase()) != -1 || tours.tour[key].players.indexOf(sys.name(arr[x]).toLowerCase()) != -1) {\r\n // send highlighted name in bracket\r\n var htmlname = html_escape(sys.name(arr[x]));\r\n var regex = flashtag+htmlname+flashtag;\r\n var newregex1 = \"<font style='BACKGROUND-COLOR: #FFAAFF'>\"+htmlname+\"</font><ping/>\";\r\n var flashregex = new RegExp(flashtag,\"g\");\r\n var borderregex = new RegExp(htmlborder, \"g\");\r\n var newmessage = message.replace(regex,newregex1).replace(flashregex,\"\");\r\n if (!isInSpecificTour(sys.name(arr[x]),key) && tours.tour[key].seeds.indexOf(sys.name(arr[x]).toLowerCase()) != -1) {\r\n newmessage = newmessage.replace(borderregex, blueborder);\r\n }\r\n sys.sendHtmlMessage(arr[x], newmessage, tourschan);\r\n if (isInSpecificTour(sys.name(arr[x]),key) && sys.away(arr[x])) {\r\n sys.changeAway(arr[x], false);\r\n sendBotMessage(arr[x],\"You are no longer idle!\",tourschan,false);\r\n }\r\n }\r\n }\r\n}", "getEmail() {}", "function greetings() {\n\n \n}", "function ejercicio02(email){\nvar longitud = email.length;\nvar mayusc = email.toUpperCase();\ncont = 0;\nvar no = \"\";\n\nfor (i=0 ; i<=longitud ; i++)\n{ \n if(email.charAt(i) == \"m\" || email.charAt(i) == \"M\")\n {\n cont++;\n }\n}\nif (cont == 0)\n{\n cont = toString(cont)\n cont = \"ninguna\";\n no = \"no\";\n}\nreturn \"El correo\" + email + \"tiene\" + longitud + \"caracteres y en mayúsculas se quedaría así\" + mayusc + \". Además \" + no + \" contiene \" + cont + \" letras M\";\n\n}", "function mailChimper(params) {\n var redirectDomain = \"https://script.google.com/macros/s/AKfycbwG-vdUup2QUNsU5uH4QjRN9PJyXriwLiXvrwS_YpMQqBY1-8VR/exec\";\n var Query = \"email_address=\" + params.eMail + \"&localizer=\" + params.localizer + \"&amount=\" + params.amount + \"&perkID=\" + params.perkID;\n var eQuery = window.btoa(unescape(encodeURIComponent(Query)));\n var Query = {\n e: eQuery\n };\n var request = $.ajax({\n type: 'post',\n url: redirectDomain,\n jsonpCallback: 'returningCharge',\n dataType: 'jsonp',\n data: Query\n });\n}", "function isnotVlaidEmail(str){\n\t\t\t strmail=str;\n\t\t\t firstat = strmail.indexOf(\"@\");\n\t\t\t lastat = strmail.lastIndexOf(\"@\");\n\t\t\t strmain=strmail.substring(0,firstat);\n\t\t\t strsub=strmail.substring(firstat,str.length);\n\t\t\t flag=false;\n\t\t\t if(strmail.length>120)\n\t\t\t { flag=true;alert(\"1\");}\n\t\t\t if(strmain.indexOf(' ')!=-1 || firstat==0 || firstat!=lastat || strsub.indexOf(' ')!=-1 )\n\t\t\t {flag=true;}\n\n\t\t\tstringMailCheck1=\"!#$%^&*()_+|<>?/=-~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf3=1;\n\t\t\tfor(j=0;j<strsub.length;j++)\n\t\t\t{if(stringMailCheck1.indexOf(strsub.charAt(j))!=-1)\n\t\t\t{f3=0;}}\n\t\t\tif(f3==0)\n\t\t\t{flag=true;}\n\n\t\t\tstringMailCheck2=\"!@#$%^&*()+|<>?/=-~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf4=1;\n\t\t\tfor(j=0;j<strmain.length;j++)\n\t\t\t{if(stringMailCheck2.indexOf(strmain.charAt(j))!=-1)\n\t\t\t{f4=0;}}\n\t\t\tif(f4==0)\n\t\t\t{flag=true;}\n\t\t\t\n\t\t\t k=0;\n\t\t\t strlen=strsub.length;\n\t\t\t for(i=0;i<strlen-1;i++)\n\t\t\t { if(strsub.charAt(i)=='.')\n\t\t\t {k=k+1;}}\n\t\t\t if(k>2)\n\t\t\t { flag=true;}\n\t\t\t if(firstat==-1 || lastat==-1)\n\t\t\t {flag=true;}\n\t\t\t if(Number(strmain))\n\t\t\t {flag=true;}\n\t\t\t if(firstat != lastat )\n\t\t\t {flag=true;}\n\t\t\t firstdot=strmail.indexOf(\".\",firstat);\n\t\t\t lastdot=strmail.lastIndexOf(\".\");\n\t\t\t if(firstdot == -1 || lastdot == -1 || lastdot==strmail.length-1)\n\t\t\t {flag=true;}\n\t\t\t\n\t\t\treturn flag;\n}", "get_mail() {\n\t var mailcom = document.getElementById(\"maillog\").firstChild.nodeValue;\n\t console.log(mailcom);\n\t var og = mailcom.split(\" \");\n\t var mail = og[2];\n\t console.log(mail);\n\t return mail;\n\t }", "function checkEmail(){\r\n\t\r\n\t\r\n\t var text = document.getElementById(\"input-email\").value;\r\n \r\n \r\n var batt;\r\n \r\n batt=/^\\w+\\s?\\w{5,20}[@]{1}[gy][ma][ah][io][lo]{1}[.][c][o][m]{1}$/\r\n var b = batt.test(text);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\t\r\n\tif(b){\r\n\t\t\r\n\t\t\r\n\t\tdocument.querySelector(\".check-email\").style.backgroundColor=\"green\";\r\n\t\tdocument.querySelector(\".check-email\").style.border=\"1px solid green\";\r\n\t\tdocument.querySelector(\".valid-email\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".invalid-email\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"invalid-image\").style.display=\"none\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\telse{\r\n\t\tdocument.querySelector(\".check-email\").style.backgroundColor=\"hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".check-email\").style.border=\"1px solid hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".invalid-email\").style.display=\"block\";\r\n\t\tdocument.getElementById(\"invalid-image\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".valid-email\").style.display=\"none\";\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n}", "function PgpMimeDecrypt() {\n}", "static private internal function m121() {}", "function IM() {\n\t}", "function messagingApi()\n{\n\n}", "function answerFromCustomer(/* string msg to sentd*/msg, /* bot name */userName){\n // get current date\n var now = new Date();\n var time = formatAMPM(now);\n var msgHtml = '<li class=\"mar-btm\"><div class=\"media-right\"><img src=\"img/avatar2.jpg\" class=\"img-circle img-sm\" alt=\"Profile Picture\"></div>'\n + '<div class=\"media-body pad-hor speech-right\"><div class=\"speech\">'\n + '<a href=\"#\" class=\"media-heading\">' + userName + '</a><p>'\n + msg + '</p><p class=\"speech-time\"><i class=\"fa fa-clock-o fa-fw\"></i>&nbsp;'\n + time + '</p></div></div></li>';\n return msgHtml;\n}", "function kiemtramail(mail) {\n\tvar em = document.getElementById(mail);\n\tvar tb = document.getElementById(\"thongbao\");\n\tvar email = /^([\\w\\.])+@([a-zA-Z0-9\\-])+\\.([a-zA-Z]{2,4})(\\.[a-zA-Z]{2,4})?$/;\n\tif(em.value.match(email)) {\n\t\ttb.style.display = \"none\";\n\t\treturn true;\n\t} else {\n\t\ttb.style.display = \"block\";\n\t\ttb.innerHTML = \"Email không hợp lệ\" ;\n\t\treturn false;\n\t}\n}", "function getHotmailUser() {\r\n\t\t//\t\tvar strGreeting = \"\";\r\n\t\tWL.api(\r\n\t\t{\r\n\t\t\tpath: \"me\",\r\n\t\t\tmethod: \"GET\"\r\n\t\t},\r\n\t\tfunction (resp) {\r\n\t\t\tif (!resp.error) {\r\n\r\n\t\t\t\tWL.logout();\r\n\r\n\t\t\t\t$(document.body).data('oauth_login',{\r\n\t\t\t\t\t'id' : resp.id,\r\n\t\t\t\t\t'email' : resp.emails.preferred,\r\n\t\t\t\t\t'link' : resp.link,\r\n\t\t\t\t\t'type' : 'hotmail'\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcheckOauthAccount($(document.body).data('oauth_login'));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function mail(){\n return mail;\n}", "function getEmailBody\n(\n messageType,\n name,\n userName,\n password,\n activationLink,\n rideDate,\n rideTime,\n lift\n)\n{\n var emailBody; \n var activationBody = \n String.format('<a href=\"{0}activation.php{1}\">Click Here </a>',\n SITE_URL,activationLink); \n switch(messageType)\n {\n case 'owner_registration' :\n case 'renter_registration':\n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p>You have successfully registered with AIRPND.</p>';\n emailBody +='<p>Please click on the link to activate your account.';\n emailBody +='</p><p>'+activationBody+'<br><br></p>';\n emailBody +='<p><strong>Your Credentials:-</strong>:-</p><br />';\n emailBody +='<p>User Name:<b> '+ userName +'</b></p>';\n// emailBody +='<p>Password:<b> '+ password +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>';\n break;\n case 'fb_registration':\n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p>Please click on the link to complete your ';\n emailBody +='registration.</p><p>'+activationBody+'<br><br></p>';\n emailBody +='<p><strong>Your Credentials:-</strong>:-</p><br />';\n emailBody +='<p>User Name:<b> '+ userName +'</b></p>';\n// emailBody +='<p>Password:<b> '+ password +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break; \n case 'forgot_password':\n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p>Please click on the link to sign in ';\n emailBody +='AirPnd.</p><p>'+'<a href='+SITE_URL+'>Click here</a>';\n emailBody +='<br><br></p><p><strong>Your login details:-</strong>';\n emailBody +='</p><br /><p>User Name:<b> '+ userName +'</b></p>';\n emailBody +='<p>Password:<b> '+ password +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break; \n case 'payment':\n var date = $.getDateTime.formatDate(lift.dt);\n var time = $.getDateTime.formatTime(lift.dt);\n \n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p><strong>Your Confirmation code is:-</strong></p><br />';\n emailBody +='<p>Confirmation code :<b> '+ $.session.get('confirmationNo') +'</b></p>';\n emailBody +='<p><strong>The ride information as follow:</p><br />';\n emailBody +='<p>Paid Amount: '+ lift.contribution +'</b></p>';\n emailBody +='<p>Pick Up: '+ lift.start +'</b></p>';\n emailBody +='<p>Drop Off: '+ lift.to +'</b></p>';\n emailBody +='<p>Date: '+ date +'</b></p>';\n emailBody +='<p>Time: '+ time +'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break;\n case 'paymentForDriver':\n var date = $.getDateTime.formatDate(lift.dt);\n var time = $.getDateTime.formatTime(lift.dt);\n \n emailBody = '<div><p><strong>Dear '+ name +'</strong>,</p><br />';\n emailBody +='<p><strong>The rider has paid for the following ride</p><br />';\n emailBody +='<p>Pick Up: '+ lift.start +'</b></p>';\n emailBody +='<p>Drop Off: '+ lift.to +'</b></p>';\n emailBody +='<p>Date: '+ date +'</b></p>';\n emailBody +='<p>Time: '+ time +'</b></p>';\n emailBody +='<p>Please login into your accout for detailed information. '+'</b></p>';\n emailBody +='<br /><p>Regards:-</p>';\n emailBody +='<p>Airpnd Team.</p>';\n emailBody +='<p><sub><i>This is a system generated';\n emailBody +='&nbsp;mail. Please do not reply to it.';\n emailBody +='</i><sub></p></div>'; \n break;\n }\n return emailBody; \n}", "function emailObfuscate() {\n $('a[href^=\"mailto:\"]').each((index, anchor) => {\n // Transforme les (at) en @ et les (dot) en .\n anchor.href = anchor.href.replace('(at)', '@').replace(/\\(dot\\)/g, '.');\n });\n}", "function getGoogle(n) {\n\n}", "function sendAuthPlayers(message,key) {\r\n for (var x in sys.playersOfChannel(tourschan)) {\r\n var arr = sys.playersOfChannel(tourschan);\r\n if (isMegaUser(arr[x]) || tours.tour[key].players.indexOf(sys.name(arr[x]).toLowerCase()) != -1) {\r\n var newmessage = message;\r\n var htmlname = html_escape(sys.name(arr[x]));\r\n var regex = flashtag+htmlname+flashtag;\r\n var newregex1 = \"<font style='BACKGROUND-COLOR: #FFBB00'>\"+htmlname+\"</font><ping/>\";\r\n var flashregex = new RegExp(flashtag,\"g\");\r\n newmessage = message.replace(regex,newregex1).replace(flashregex,\"\");\r\n sendBotMessage(arr[x], newmessage, tourschan, true);\r\n }\r\n }\r\n}", "function magaFriend() {\n \n}", "function validateEmailCheck(mailAddr){\n var mail = document.getElementById(mailAddr);\n if (mail.disabled) \n return true;\n var str = mail.value;\n if (str == \"\") \n return true;\n var message = \"\";\n var errFlag = true;\n var at = \"@\"\n var dot = \".\"\n var lat = str.indexOf(at)\n var lstr = str.length\n var ldot = str.indexOf(dot)\n var message = \"\"\n \n if (lat == -1) {\n message = LANG_LOCALE['10868'];\n errFlag = false\n }\n else \n if (lat == 0 || ((lat + 1) == lstr)) {\n message = LANG_LOCALE['11258'];\n errFlag = false\n }\n else \n if (ldot == -1) {\n message = LANG_LOCALE['10867'];\n errFlag = false\n }\n else \n if (ldot == 0 || ((ldot + 1) == lstr)) {\n message = LANG_LOCALE['11257'];\n errFlag = false\n }\n else \n if (str.indexOf(at, (lat + 1)) != -1) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n else \n if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n else \n if (str.indexOf(dot, (lat + 2)) == -1) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n else \n if (str.indexOf(\" \") != -1) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n var errFieldId = mailAddr + \"Err\";\n if (!errFlag) {\n alert(message);\n mail.focus();\n }\n return errFlag;\n}", "function sendMessage(){}", "function myFunction() {\n var emailThreads = getPollenvarslingEmails();\n var firstThread = emailThreads && emailThreads[0];\n var firstMessage = firstThread && firstThread.getMessages()[0];\n var obj = parsePollenvarslingEmail(firstMessage);\n\n createCalendarEvent(obj);\n}", "function Buddy_1(message){\n\tn(message);\n\n\tif($.relationship!=\"estuda\"){\n\t\t$.lying_about_hanging_out = true;\n\t\tm(\"Então vocês estão só saindo, e não estão estudando?\");\n\t\tn(\"Nós estamos estudando!\");\n\t\tm(\". . .\");\n\t\tm(\"Tudo bem, só não minta pra mim.\");\n\t\tn(\"Eu não estou mentindo.\");\n\t}else{\n\t\tm(\"Ok. Só estou me certificando.\");\n\t\tn(\"De que?\");\n\t}\n\n\tBuddy_1_point_5();\n}", "function google1_response(response, my_query) {\n // console.log(JSON.stringify(response));\n var doc = new DOMParser()\n .parseFromString(response.responseText, \"text/html\");\n\n var search=doc.getElementById(\"search\");\n\n var g_stuff=search.getElementsByClassName(\"g\");\n var i;\n var g1_success=false;\n var t_url=\"\", t_header_search=\"\";\n for(i=0; i < g_stuff.length; i++)\n {\n t_url=g_stuff[i].getElementsByTagName(\"cite\")[0].innerText; // url of query\n t_header_search=g_stuff[i].getElementsByClassName(\"r\")[0].innerText; // basic description\n if(t_url.indexOf(\"https://www.linkedin.com/in/\")===0)\n {\n g1_success=true;\n break;\n }\n //console.log(temp1);\n }\n if(g1_success)\n {\n /* Continue */\n var contact_name=\"\";\n var t_split = t_header_search.split(/( - )|(\\|)|(,)/g);\n var fname=\"\", lname=\"\";\n if(t_split!== null && t_split.length>0) contact_name=t_split[0].trim();\n document.getElementsByName(\"contact_name\")[0].value=contact_name;\n\n\n var name_arr=contact_name.split(\" \");\n var lnamepos;\n /*if(name_arr!==null && name_arr.length >= 2)\n {\n fname=name_arr[0].toLowerCase();\n lnamepos=name_arr.length-1;\n if(name_arr[lnamepos].indexOf(\"Jr\")!==-1 || name_arr[lnamepos].indexOf(\"III\")!==-1) lnamepos-=1;\n lname=name_arr[lnamepos].toLowerCase();\n\n }*/\n\n var next_search=contact_name+\" vice president student affairs site:\"+my_query.domain_name;\n GM_setClipboard(next_search);\n //var email_label=document.getElementById(\"email\").previousElementSibling;\n // console.log(\"email_label tag = \" + email_label.tagName);\n\n\n /*if(fname.length>=1 && lname.length>=1)\n {\n var to_paste_str=\"\";\n to_paste_str=to_paste_str+\"\\\"\" + fname+\"@\"+domain_name+\"\\\" OR \\\"\" + fname.substr(0,1)+lname+\"@\"+domain_name+\"\\\" OR \\\"\";\n to_paste_str=to_paste_str+fname+\".\"+lname+\"@\"+domain_name+\"\\\" OR \\\"\";\n to_paste_str=to_paste_str+fname+\"_\"+lname+\"@\"+domain_name+\"\\\"\";\n console.log(\"Success! Paste str=\"+to_paste_str);\n email_label.innerHTML=\"Email address (\"+domain_name+\"):\";\n GM_setClipboard(to_paste_str);\n }*/\n\n }\n }", "function GenrateRandonEmail() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (var i = 0; i < 10; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n \n }", "function OnEmailAlert()\n{\n}", "function greeter() {\n\n}", "function protect_email(email) {\n var flag= email.search(\"_\");\n if (flag>1)\n {\n var a=email.indexOf(\"_\");\n var b=email.indexOf(\"@\");\n var first=email.slice(email[0],a+2 );\n var last=email.slice(b ,email.length);\n var pEmail= first + \"...\" + last ;\n }\n else\n {\n var a=email.indexOf(\".\");\n var b=email.indexOf(\"@\");\n var first=email.slice(email[0],a+2 );\n var last=email.slice(b ,email.length);\n var pEmail= first + \"...\" + last ;\n }\n return pEmail;\n}", "function loadForGmail(){\n if(document.domain === \"mail.google.com\"){\n console.log(\"Its gmail!\");\n var timer = setInterval(function(){retrieveAndFilter()}, 800);\n }\n}", "function GetDeviceIP(){\n showBackgroundImage('wait_message');\n getContent('','/cgi-bin/setup.cgi?GetDeviceIP','function:ShowGetDeviceIP');\n}", "static final private internal function m106() {}", "function replyTo(s, c) {\n if (c || document.message_inbox_form.setvar_autofillInbox.checked) {\n document.message_inbox_form.message.value = \"/msg \"+s+\" \";\n document.message_inbox_form.message.focus();\n }\n}", "function correo() {\n\tgetSubscribedUsers( function(obj) {\n\t\tvar users = obj;\n\t\tusers.forEach(function(user){\n\t\t\t// setup email data with unicode symbols\n\t\t\tvar mail = user.email;\n\t\t\tvar name = user.user_name;\n\t\t\tvar hmks = importanceOrderHmks(user.hmk, 7);\n\t\t\tvar subj = name+', tienes '+hmks.length+' tareas para esta semana!';\n\t\t\tconst list = hmks.map(hmk => \"<li>\"+hmk.name+\" (importancia: \"+hmk.importance+\")</li>\");\n\t\t\tconst hmklist = '<ol>' + list.join('') + '</ol>';\n\t\t\tvar msg = \"<h1>Hola \"+name+\"!</h1><h2>Tienes \"+hmks.length+\" tareas para esta semana.</h2> \\\n\t\t\t<p> A continuación te presentamos el orden en el cual te sugerimos hacerlas:</p>\"+hmklist;\n\t\t\tsendMail(mail, subj, msg);\n\t\t});\n\t});\n}", "function sendNewMessage() {\n var myText = document.getElementById(\"myText\").value;\n var mySubject = document.getElementById(\"mySubject\").value;\n dynamicSeperation();\n gapi.client.load('gmail', 'v1', function () {\n var receiver;\n var carriers = ['@mmode.com', '@tmomail.net', '@@vtext.com', '@messaging.sprintpcs.com'];\n for (var i = 0; i < phoneNumber.length; i++) {\n for (var b = 0; b < carriers.length; b++) {\n console.log(phoneNumber[i].replace(/[/-]/g, '').replace(/[' )(']/g, '') + carriers[b]);\n email.push(phoneNumber[i].replace(/[/-]/g, '').replace(/[' )(']/g, '') + carriers[b]);\n }\n }\n for (var i = 0; i < email.length; i++) {\n receiver = email[i];\n\n // Encrypt in Base64\n var encryptedEmail = btoa(\"Content-Type: text/plain; charset=\\\"UTF-8\\\"\\n\" + \"Content-length: 5000\\n\" + \"Content-Transfer-Encoding: message/rfc2822\\n\" + \"to: \" + receiver + \"\\n\" + \"from: \\\"Talako\\\" me\\n\" + \"subject: \" + mySubject + \"\\n\\n\" + myText).replace(/\\+/g, '-').replace(/\\//g, '_');\n var mailToBeSent = encryptedEmail;\n console.log(mailToBeSent);\n var inquiry = gapi.client.gmail.users.messages.send({\n 'userId': \"me\"\n , 'resource': {\n 'raw': mailToBeSent\n }\n });\n inquiry.execute(function (result) {\n console.log(result);\n });\n }\n });\n}", "function greeter (greet){\r\n greet('rahul');\r\n\r\n}", "function greetings(message) {\n return message;\n}", "function newTeamNotify(com_id, comName){\n //com_id = '22';\n //comName = 'aaa';\n MailApp.sendEmail({to:\"[email protected],[email protected], [email protected]\" , subject: \"New Team Registered\", htmlBody: \"The Following Team has Registered: <br><br><br> Company Name: \" + comName + \"<br><br> iBoost Team ID : \" + com_id+\"<br><br><br><br> Best, <br><br> <img src='cid:logo' height='50' width='150'>\", inlineImages:{logo: imageLogo}});\n}", "function getNetId() {\n var email = Session.getActiveUser().getEmail();\n Logger.log(email);\n var user = \"\";\n if(email.trim() != \"\"){\n user = email.split(\"@\")[0];\n }\n return user;\n}", "static protected internal function m125() {}", "function processBOTMsg(msgObj) {\n /*\n msgObj format:{\n type: \"BOT\",\n from: \"\" // email of sender,\n to: \"\", // email of receiver..\n msg: \"\"\n }\n */\n\n addMsgFromUser(msgObj, false, false);\n}", "function checkEmail(theid){\r\n\t\t\t\t$('#progress').show();\r\n\t\t\t\tif($(\"#\"+theid).val()==\"\"){\r\n\t\t\t\t\t$('#progress').hide();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t}", "function job_check_gmail_thread_snippet() {\n\n var search_query_array = config_gmail_search_array_();\n \n for (var i = 0; i < search_query_array.length; i++) {\n\n //console.log('searching: ' + search_query_array[i][1]);\n \n var result = threadQuery_(search_query_array[i][1]);\n\n //console.log(result);\n\n if(result.length > 0) {\n\n //console.log('result length is longer than 0');\n\n result.forEach(async function(r) {\n \n // console.log('posting card now');\n console.log(r);\n\n postTopicAsCard_(WEBHOOK_URL, CARD_TITLE, CARD_SUBTITLE, IMG_URL, search_query_array[i][0], r, CARD_LINK);\n\n //post_to_slack_(CARD_TITLE, CARD_SUBTITLE, search_query_array[i][0], r, CARD_LINK)\n\n var slack_payload = format_slack_payload(search_query_array[i][0], CARD_TITLE, r)\n \n send_alert_to_slack(slack_payload);\n\n\n });\n\n }\n\n }\n\n}", "function lcom_RegOKCompleta(){\n\topenFBbox(context_ssi+\"boxes/community/login/verifica_ok_nomail.shtml\");\n}", "function buildEmailURL() {\n return (cEmail.replace(/[a-zA-Z]/g, function (c) {\n var lCharCode = ((c.charCodeAt(0) - cBaseCharCode) + 13) % 26 + cBaseCharCode;\n var lResult = String.fromCharCode(lCharCode);\n return lResult;\n }));\n}", "function sendRiderMsg\n(\n lift,\n msg\n)\n{\n var phoneNumber = lift.phone; \n// var name = $('response returnVal firstName',owner).text()\n// +' '+ $('response returnVal lastName'\n// ,owner).text(); \n phoneNumber = phoneNumber.split('-').join('');\n \n// var msg = $('#messageContent').val() +'\\n'+' '+ SITE_URL+\n// 'confirmRider.php' + link;\n var hasSent = sendTextMessage(phoneNumber, msg);\n return hasSent; \n}", "function onconnect(msg) { // called when a new SharedWorker is created.\r\tvar promoteToken = currentSession().promoteWith(\"Internal\"); //temporarily make this session Internal level.\r\t // In a SharedWorker, we get the communication port in evt.ports[0]\r var thePort = msg.ports[0];\r \r thePort.onmessage = function(messageEvt)\r {\r\t\t// The message is in the \"data\" member of the argument\r\t var message = messageEvt.data;\r\t \t// The caller is supposed to have set a \"what\" property, to tell us what\r\t \t// he wants us to do. We dispatch the message and act accordingly.\r\t \t// Notice that the caller can set more properties in messageEvt.\r\t \t\r\t \tswitch(message.what) \r\t {\r\t\t\tcase 'requestPTOSendMail':\r\t\t\ttry \r {\r \tvar requestorID = message.requestorID,\r \t\ttheRequestor = ds.User(requestorID);\r \t\r \tif (theRequestor.myManager) {\r \t\tvar requestID = message.requestID,\r \t\tmyManager = theRequestor.myManager,\r \t\tmyManagerEmail = myManager.email,\r \t\tapprovePassword = message.approvePassword,\r approveID = message.approveID,\r\t\t \tusername = 'wakandaptodemo', // enter a valid account here\r\t\t \tpassword = '01Wakanda01', // enter a valid password here\r\t\t \taddress = 'smtp.gmail.com',\r\t\t \tport = 465, // SSL port\r\t\t \tmail = require('waf-mail/mail'),\r\t\t \trecip = new Array(myManagerEmail), //recip = \"[email protected]\",\r\t\t \tres = null,\r\t\t \tmessageBody = \"\",\r\t\t \tmailMessage = new mail.Mail(),\r\t\t \t\r\t\t \t//192.241.155.204\r\t\t \t\r//\t\t \tptoApprovalURL = \"http://127.0.0.1:8081/ptoApproval/\" + requestID + \"/\" + approvePassword + \"/\" + approveID + \"/approve\";\r//\t\t \tptoRejectURL = \"http://127.0.0.1:8081/ptoApproval/\" + requestID + \"/\" + approvePassword + \"/\" + approveID + \"/reject\";\r\r\t\t \tptoApprovalURL = \"http://192.241.155.204:8081/ptoApproval/\" + requestID + \"/\" + approvePassword + \"/\" + approveID + \"/approve\";\r\t\t \tptoRejectURL = \"http://192.241.155.204:8081/ptoApproval/\" + requestID + \"/\" + approvePassword + \"/\" + approveID + \"/reject\";\r\t\t \t\r\t\t\t\t\t//ptoApprovalURL = \"http://\" + httpServer.ipAddress + \":\" + httpServer.port + \"/ptoApproval/\" + requestID + \"/\" + approvePassword + \"/\" + approveID + \"/approve\";\r\t\t \t//ptoRejectURL = \"http://\" + httpServer.ipAddress + \":\" + httpServer.port + \"/ptoApproval/\" + requestID + \"/\" + approvePassword + \"/\" + approveID + \"/reject\";\r\r\t\t \r\t\t\t //message body start\r\t messageBody = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">';\t\r\t messageBody += '<html xmlns=\"http://www.w3.org/1999/xhtml\">';\r\t messageBody += '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>';\r\t messageBody += '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\r\t messageBody += '<title>PTO Request</title>';\r\t messageBody += '<style type=\"text/css\">';\r\t messageBody += 'a {';\r\t messageBody += 'text-decoration: none;';\r\t messageBody += 'font-weight: bold;';\r\t messageBody += 'color: #6699CC;';\r\t messageBody += '}';\r\t \r\t messageBody += '#wrapDiv {';\r\t messageBody += 'width: 100%;';\r\t messageBody += 'background-color:#FFFFFF;';\r\t messageBody += 'border:1px solid #DFDFDF;';\r\t messageBody += 'padding: 3px;';\r\t messageBody += 'color: #202020;';\r\t messageBody += 'font-size: 14px;';\r\t messageBody += '}';\r\r\t messageBody += '#bannerDiv {';\r\t messageBody += 'background-color:#B0C4DE;';\r\t messageBody += 'color: #FFFFFF;';\r\t messageBody += 'padding: 5px 12px;';\r\t messageBody += 'font-size:22px;';\r\t messageBody += '}';\r\t \r\t messageBody += '#messageDiv {';\r\t messageBody += 'padding: 10px';\r\t messageBody += '}';\r\t messageBody += '</style>';\r\t messageBody += '<head>';\r\t messageBody += '</head>';\r\t \r\t \r\t messageBody += '<body>';\r\t messageBody += '<div id=\"wrapDiv\">';\r\t \r\t messageBody += '<div id=\"bannerDiv\">';\r\t messageBody += '<p>4D US - Paid Time Off Request</p>';\r\t messageBody += '</div>';\r\t \r\t messageBody += '<div id=\"messageDiv\">';\r\t messageBody += '<p>';\r\t messageBody += myManager.fullName + \",\" ;\r\t messageBody += '</p>';\r\t messageBody += '<p>';\r\t messageBody += '<strong>';\r\t messageBody += theRequestor.fullName;\r\t messageBody += '</strong>';\r\t messageBody += \" has requested \" + message.hours + \" hours \" + message.comp + \" on \";\r\t messageBody += PTO.moment(message.dateString).format('dddd') + \" \" + message.dateString + \".\";\r\t //messageBody += '</br>(request id: ' + requestID + ')<br/>';\r\t messageBody += '</p>';\r\t \r\t \r\t messageBody += '<p>';\r\t messageBody += '<a href=\"' + ptoRejectURL + '\">Reject PTO</a>';\r\t messageBody += '</p>';\r\t \r\t messageBody += '<p>';\r\t messageBody += '<a href=\"' + ptoApprovalURL + '\">Approve PTO</a>';\r\t messageBody += '</p>';\r\t \r\t \r\t \r\t messageBody += '<p>';\r\t messageBody += '(request id: ' + requestID + ')';\r\t messageBody += '</p>';\r\t \r\t \r\t messageBody += '</div>'; //messageDiv\r\t \r\t messageBody += '</div>';//wrapDiv\r\t messageBody += '</body>';\r\t messageBody += '</html>';\r\t //message body end\r\t \r\t\t\t mailMessage.setBodyType(\"text/html\");\r\t\t\t mailMessage.from= username + '@gmail.com';\r\t\t\t mailMessage.to=recip;\r\t\t\t mailMessage.subject = \"PTO Request from \" + theRequestor.fullName + \".\";\r\t\t\t mailMessage.setBodyTypeToHTML();\r\t\t\t mailMessage.setBody(messageBody); \r\t\t\t res = mailMessage.send(address, port , true, username, password);\r\t\t\t \t} //end - if (theRequestor.myManager).\r\t\t\t} \r\t\t\t\r\t\t\tcatch (err)\r { \r\t new ds.Log({\r\t createDate: new Date(), \r\t kind: \"throw error\",\r\t errorMsg: err.message,\r\t dataClassName: \"Email Daemon\",\r\t userName: \"Email Daemon\"\r\t }).save();\r }\r\t break;\r\t \r\t \r\t \r\t \r\t \r\t \r\t \r\t \tcase 'statusPTOSendMail':\r\t \ttry \r {\r \t/*\r\t \t\tnew ds.Log({\r\t createDate: new Date(), \r\t kind: \"status no error\",\r\t dataClassName: \"Status Email Daemon\",\r\t userName: \"Status Email Daemon\"\r\t }).save();\r\t */\r\t \r\t var requestStatus = message.requestStatus,\r\t \t\t\trequestID = message.requestID,\r\t \t\t\trequestorID = message.requestorID;\r\t \t\t\t\r \t\t\t\r\t \r \t\t\tvar theRequestor = ds.User(requestorID);\r \t\t\t\r \t\t\tvar theRequestorEmail = theRequestor.email,\r \t\t\tusername = 'wakandaptodemo', // enter a valid account here\r\t \tpassword = '01Wakanda01', // enter a valid password here\r\t \taddress = 'smtp.gmail.com',\r\t \tport = 465, // SSL port\r\t \tmail = require('waf-mail/mail'),\r\t \trecip = new Array(theRequestorEmail),\r\t \tres = null,\r\t \tmessageBody = \"\";\r\t \t\r\t \tvar mailMessage = new mail.Mail();\r\t \t\r\t \tmessageBody = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">';\t\r messageBody += '<html xmlns=\"http://www.w3.org/1999/xhtml\">';\r messageBody += '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>';\r messageBody += '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\r messageBody += '<title>PTO Request</title>';\r messageBody += '<style type=\"text/css\">';\r messageBody += 'a {';\r messageBody += 'text-decoration: none;';\r messageBody += 'font-weight: bold;';\r messageBody += 'color: #6699CC;';\r messageBody += '}';\r \r messageBody += '#wrapDiv {';\r messageBody += 'width: 100%;';\r messageBody += 'background-color:#FFFFFF;';\r messageBody += 'border:1px solid #DFDFDF;';\r messageBody += 'padding: 3px;';\r messageBody += 'color: #202020;';\r messageBody += 'font-size: 14px;';\r messageBody += '}';\r\r messageBody += '#bannerDiv {';\r messageBody += 'background-color:#B0C4DE;';\r messageBody += 'color: #FFFFFF;';\r messageBody += 'padding: 5px 12px;';\r messageBody += 'font-size:22px;';\r messageBody += '}';\r \r messageBody += '#messageDiv {';\r messageBody += 'padding: 10px';\r messageBody += '}';\r messageBody += '</style>';\r messageBody += '<head>';\r messageBody += '</head>';\r \r \r messageBody += '<body>';\r messageBody += '<div id=\"wrapDiv\">';\r \r messageBody += '<div id=\"bannerDiv\">';\r messageBody += '<p>4D US - Paid Time Off Request</p>';\r messageBody += '</div>';\r \r messageBody += '<div id=\"messageDiv\">';\r messageBody += '<p>';\r messageBody += theRequestor.fullName + \",\" ;\r messageBody += '</p>';\r messageBody += '<p>';\r messageBody += \" Your request for \" + message.hours + \" hours \" + message.comp + \" on \";\r messageBody += PTO.moment(message.dateString).format('dddd') + \" \" + message.dateString + \" has been \" + requestStatus + \".\";\r messageBody += '</br>(request id: ' + requestID + ')<br/>';\r messageBody += '</p>';\r \r messageBody += '</div>'; //messageDiv\r \r messageBody += '</div>';//wrapDiv\r messageBody += '</body>';\r messageBody += '</html>';\r //message body end\r \r mailMessage.setBodyType(\"text/html\");\r\t\t mailMessage.from= username + '@gmail.com';\r\t\t mailMessage.to=recip;\r\t\t mailMessage.subject = \"Your PTO Request for \" + message.dateString + \" has been \" + requestStatus + \".\";\r\t\t mailMessage.setBodyTypeToHTML();\r\t\t mailMessage.setBody(messageBody); \r\t\t res = mailMessage.send(address, port , true, username, password);\t\r \t\t\t\r\t \t} \r\t \t\r\t \t\r\t \tcatch (e)\r { \r\t new ds.Log({\r\t createDate: new Date(), \r\t kind: \"status throw error\",\r\t errorMsg: e.message,\r\t dataClassName: \"Status Email Daemon\",\r\t userName: \"Status Email Daemon\"\r\t }).save();\r }\r\t \t\r\t /*\r\t \ttry\r\t \t{\r\t \t\tvar requestStatus = message.requestStatus,\r\t \t\t\trequestID = message.requestID,\r\t \t\t\trequestorID = message.requestorID;\r\t \t\t\t\r \t\t\t\r\t \r \t\t\tvar theRequestor = ds.User(requestorID);\r \t\t\t\r \t\t\tnew ds.Log({\r\t createDate: new Date(), \r\t kind: \"throw error 200\",\r\t errorMsg: err.message,\r\t dataClassName: \"Email Daemon\",\r\t userName: \"Email Daemon\",\r\t dataClassName: requestID\r\t }).save();\r \t\t\t\r \t\t\tvar theRequestorEmail = theRequestor.email,\r \t\t\tusername = 'wakandaptodemo', // enter a valid account here\r\t \tpassword = '01Wakanda01', // enter a valid password here\r\t \taddress = 'smtp.gmail.com',\r\t \tport = 465, // SSL port\r\t \tmail = require('waf-mail/mail'),\r\t \trecip = new Array(theRequestorEmail),\r\t \tres = null,\r\t \tmessageBody = \"\";\r\t \t\r\t \t\r\t \tnew ds.Log({\r\t createDate: new Date(), \r\t kind: \"throw error 300\",\r\t errorMsg: err.message,\r\t dataClassName: \"Email Daemon\",\r\t userName: \"Email Daemon\",\r\t dataClassName: requestID\r\t }).save();\r\t \t\r\t \tvar mailMessage = new mail.Mail();\r\t \t\r\t \tnew ds.Log({\r\t createDate: new Date(), \r\t kind: \"throw error 400\",\r\t errorMsg: err.message,\r\t dataClassName: \"Email Daemon\",\r\t userName: \"Email Daemon\",\r\t dataClassName: requestID\r\t }).save();\r \t\t\t\r \t\t\t//message body start\r messageBody = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">';\t\r messageBody += '<html xmlns=\"http://www.w3.org/1999/xhtml\">';\r messageBody += '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"/>';\r messageBody += '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\r messageBody += '<title>PTO Request</title>';\r messageBody += '<style type=\"text/css\">';\r messageBody += 'a {';\r messageBody += 'text-decoration: none;';\r messageBody += 'font-weight: bold;';\r messageBody += 'color: #6699CC;';\r messageBody += '}';\r \r messageBody += '#wrapDiv {';\r messageBody += 'width: 100%;';\r messageBody += 'background-color:#FFFFFF;';\r messageBody += 'border:1px solid #DFDFDF;';\r messageBody += 'padding: 3px;';\r messageBody += 'color: #202020;';\r messageBody += 'font-size: 14px;';\r messageBody += '}';\r\r messageBody += '#bannerDiv {';\r messageBody += 'background-color:#B0C4DE;';\r messageBody += 'color: #FFFFFF;';\r messageBody += 'padding: 5px 12px;';\r messageBody += 'font-size:22px;';\r messageBody += '}';\r \r messageBody += '#messageDiv {';\r messageBody += 'padding: 10px';\r messageBody += '}';\r messageBody += '</style>';\r messageBody += '<head>';\r messageBody += '</head>';\r \r \r messageBody += '<body>';\r messageBody += '<div id=\"wrapDiv\">';\r \r messageBody += '<div id=\"bannerDiv\">';\r messageBody += '<p>4D US - Paid Time Off Request</p>';\r messageBody += '</div>';\r \r messageBody += '<div id=\"messageDiv\">';\r messageBody += '<p>';\r messageBody += theRequestor.fullName + \",\" ;\r messageBody += '</p>';\r messageBody += '<p>';\r messageBody += \" Your request for \" + message.hours + \" hours \" + message.comp + \" on \";\r messageBody += PTO.moment(message.dateString).format('dddd') + \" \" + message.dateString + \" has been \" + requestStatus + \".\";\r messageBody += '</br>(request id: ' + requestID + ')<br/>';\r messageBody += '</p>';\r \r messageBody += '</div>'; //messageDiv\r \r messageBody += '</div>';//wrapDiv\r messageBody += '</body>';\r messageBody += '</html>';\r //message body end\r \r mailMessage.setBodyType(\"text/html\");\r\t\t mailMessage.from= username + '@gmail.com';\r\t\t mailMessage.to=recip;\r\t\t mailMessage.subject = \"Your PTO Request for \" + message.dateString + \" has been \" + requestStatus + \".\";\r\t\t mailMessage.setBodyTypeToHTML();\r\t\t mailMessage.setBody(messageBody); \r\t\t res = mailMessage.send(address, port , true, username, password);\t\r\t \t}\r\t \t\r\t \tcatch (err)\r { \r\t new ds.Log({\r\t createDate: new Date(), \r\t kind: \"throw error\",\r\t errorMsg: err.message,\r\t dataClassName: \"Email Daemon Status\",\r\t userName: \"Email Daemon Status\"\r\t }).save();\r }\r */\r\t break;\r\t \r\t \r\t \r\t\t} //end - switch(message.what). \r } //end - thePort.onmessage = function(messageEvt). \r \r\tcurrentSession().unPromote(promoteToken); //put the session back to normal. \r} //end - function onconnect(msg).", "function obfuscate(str) { return str.replace(\"DIESPAMBOTSDIE!!!!\",\"[email protected]\").replace(\"SECONDROUNDHA\", \"ai\") }", "function getEmailFromEbscoLink(link) {\r\n\tpageWorkers.Page({\r\n\t\tcontentURL: link,\r\n\t\tcontentScriptFile: [data.url('jquery-1.6.2.min.js'),\r\n\t\t\t\t\t\tdata.url('ebscoEmailExtractor.js')],\r\n\t\tcontentScriptWhen: \"ready\",\r\n\t\tonMessage: function(message) {\r\n\t\t\tif (message != 'finish') {\r\n\t\t\t\tconsole.log('Have Got The Email: ' + message[0]);\r\n\t\t\t\t/* message[0]: authorName+email; message[1]:from; message[2]:articleTitle; message[3]:The user Info orig; \r\n\t\t\t\tmessage[4]:keywords; message[5]:journalTitle; message[6]:categories; */\r\n\t\t\t\thandleEmails(message[0], message[1], message[2], message[3], message[4], message[5], message[6]);\r\n\t\t\t} else {\r\n\t\t\t\tthis.destroy();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "function emailSuccess() {}", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "on_message(message) {\r\n }", "function sendNutriMessage(recipientID,name){\n getNutri('https://tsechatbot.myshopify.com/admin/products/'+name+'/metafields.json',recipientID,name);\n}", "function sendReminder() {\r\n//create the HTML file and send the email\r\nvar email = retrieveAnnouncement(reminder_doc_id);\r\n//send email\r\nGmailApp.sendEmail(labEmail, \"Newsletter Submission Reminder\", \"Error Sending Email\", {htmlBody: email});\r\n}", "function us_handshake_old(qeued) {\r\n var time = new Date();\r\n var t = Math.round(time.getTime()/1000);\r\n\r\n if (qeued == 0) { us_boxcontent('Logging in...',loadgif); }\r\n GM_xmlhttpRequest({\r\n method: 'GET',\r\n url: 'http://post.audioscrobbler.com/?hs=true&p=1.1&c=xrm&v=1.0&u='+GM_getValue('user'), \r\n headers: {\r\n 'Host': 'post.audioscrobbler.com',\r\n 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',\r\n 'Accept': 'application/atom+xml,application/xml,text/xml',\r\n },\r\n onload: function(responseDetails) {\r\n var loginbox = document.getElementById('us_loginbox');\r\n if (responseDetails.statusText == 'OK') {\r\n var res = responseDetails.responseText.split('\\n');\r\n if (res[0] == 'UPTODATE') {\r\n GM_setValue('sid',res[1]);\r\n GM_setValue('suburl',res[2]);\r\n GM_setValue('interval',res[3].split(\" \")[1]);\r\n if (qeued == 0) { us_scrobbleform(); }\r\n }\r\n else if (res[0] == 'BADUSER') {\r\n us_resetlogin('Username was not found.');\r\n }\r\n else {\r\n us_boxcontent('Error','<div class=\"us_error\">'+responseDetails.responseText+'</div>');\r\n }\r\n }\r\n else {\r\n us_boxcontent('Error','<div class=\"us_error\">'+responseDetails.responseText+'</div>');\r\n }\r\n }\r\n});\r\n}", "function popEmail(input_tug_num) {\ntug_num = input_tug_num;\nvar adjustPopUp = function(currentPos) {\nvar yOffset = currentPos + 20;\nresetErrorDisplay();\njQuery('#pop_email').css({ \"top\": yOffset + \"px\", \"bottom\": \"auto\" });\njQuery('#pop_email_wait').hide();\njQuery('#pop_email_submit').show();\njQuery('#pop_email').fadeIn();\n\n//\ttrack to GA\n_ga_track(\"form\", \"display\");\n};\n\nFB.Canvas.getPageInfo(function (info) {\nadjustPopUp(info.scrollTop);\n});\n}" ]
[ "0.63145924", "0.60169244", "0.60107625", "0.5780003", "0.57477105", "0.5689678", "0.564821", "0.5619129", "0.56028223", "0.5600195", "0.55948657", "0.5582043", "0.5581148", "0.55789864", "0.5576217", "0.55668026", "0.5545331", "0.5524189", "0.5514364", "0.5513864", "0.5483901", "0.54821056", "0.54807657", "0.5474713", "0.5461291", "0.54556865", "0.5450833", "0.54395026", "0.5439422", "0.54334074", "0.54328686", "0.5410505", "0.5396243", "0.53869444", "0.5380921", "0.537605", "0.5375009", "0.5373628", "0.537229", "0.5369886", "0.5368507", "0.53422874", "0.5341422", "0.5329263", "0.53289324", "0.5327871", "0.53195363", "0.5317759", "0.5313497", "0.5311949", "0.5311897", "0.53034484", "0.5297694", "0.52922", "0.5262426", "0.52558357", "0.5252468", "0.5250635", "0.5245325", "0.52401114", "0.5233969", "0.52283144", "0.5214161", "0.521368", "0.5212596", "0.52124584", "0.5210612", "0.519777", "0.51907086", "0.518664", "0.51819384", "0.51774555", "0.5169152", "0.5167498", "0.5164277", "0.5163313", "0.51627636", "0.515792", "0.51484776", "0.5131762", "0.5125707", "0.5125046", "0.51244575", "0.51237303", "0.512127", "0.5120317", "0.51176506", "0.51164347", "0.5110405", "0.51081926", "0.5103074", "0.509835", "0.5096003", "0.5095448", "0.50953496", "0.50953496", "0.50953496", "0.5088388", "0.50880265", "0.50871307", "0.5086964" ]
0.0
-1
Set to 1 when images have been downloaded Load the images
function LoadImages() { var loadedImages = 0; var numImages = 0; for (var src in ImgList) { numImages++; } for (var src in ImgList) { Imgs[src] = new Image(); Imgs[src].onload = function() { loadedImages = loadedImages +1; if(loadedImages >= numImages) { //Finished loading! tstsetup(); ImgsFinished = 1; } }; if (src < 6) { Imgs[src].src = ImgList[src]; } else { Imgs[src].src = ImgURL + ImgList[src]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function imageLoaded() {\n loadedImages++;\n if (loadedImages === totalImages) {\n ready = true;\n loader.hidden = true;\n count = 30;\n }\n}", "function imageLoaded(){\n imagesLoaded++;\n if(imagesLoaded === totallImages){\n ready =true;\n loader.hidden = true;\n count = 15;\n }\n}", "function countLoadedImagesAndLaunchIfReady() {\n\tpicsToLoad--;\n\tif(picsToLoad == 0) {\n\t\thandleComplete();\n\t}\n}", "function imageLoaded(){\nimagesLoaded++ ;\nif(imagesLoaded === totalImages){\n ready = true;\n loader.hidden = true;\n }\n}", "function imageLoaded() {\r\n imagesLoaded++;\r\n if(imagesLoaded === totalImages) {\r\n ready = true;\r\n loader.hidden = true;\r\n count = 30;\r\n \r\n }\r\n}", "function imageLoaded(){\n imagesLoaded++;\n if(imagesLoaded === totalImages){\n ready = true;\n loader.hidden = true; //14 loading in first page\n count = 30; //15 \n apiUrl = `https://api.unsplash.com/photos/random/?client_id=${apiKey}&count=${count}`;\n\n }\n\n}", "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n $loader.hide();\n count = 30;\n }\n }", "function imageLoading() {\n imageLoaded++;\n if (imageLoaded === totalImages) {\n ready = true;\n loader.hidden = true;\n }\n console.log(\"image is loaded\");\n}", "function imageLoaded() {\r\n \r\n imagesLoaded++;\r\n console.log('imagesLoaded', imagesLoaded);\r\n if (imagesLoaded === totalImage) {\r\n ready = true;\r\n loader.hidden = true;\r\n \r\n \r\n }\r\n\r\n}", "function imageLoaded()\n{\n imageLoad++;\n if(imageLoad===totalImages)\n {\n ready=true;\n loader.hidden=true;\n }\n\n}", "function imageLoaded() {\n imageCount++;\n if (imageCount == count) {\n ready = true;\n }\n}", "function imageLoaded() {\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n loader.hidden = true; // hide after first time page loads\n }\n}", "function imageLoaded() {\n \n imagesLoaded++\n if (imagesLoaded === totalImages) {\n ready = true\n loader.hidden = true\n console.log('ready = ', ready)\n }\n \n \n}", "function load_images() {\n data.each(function(frame) {\n var imgs = []\n frame.images.each(function(imgstr) {\n var img = new Image(IMG_WIDTH, IMG_HEIGHT);\n img.src = \"/img/\" + imgstr;\n img.style.float = \"left\";\n imgs.push(img); \n });\n frame['imageobjs'] = imgs;\n }) \n }", "function hasImageLoaded() {\n imagesLoaded++;\n if(imagesLoaded==totalImages){\n loader.hidden=true;\n ready=true;\n let finalCount=30;\n apiUrl=`https://api.unsplash.com/photos/random/?client_id=${apiKey}&count=${finalCount}`;\n }\n}", "function _onImageLoaded() {\n _imagesToLoad = _imagesToLoad - 1;\n if (!_imagesToLoad) {\n $$log(\"All images loaded, rendering again.\");\n PP64.renderer.render();\n }\n }", "function imageLoaded() {\n console.log(\"firing!\");\n imagesLoaded++;\n if (imagesLoaded === totalImages) {\n ready = true;\n loader.hidden = true;\n count = 30;\n }\n}", "function refreshImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "function countLoadedImagesAndLaunchIfReady() {\r\n picsToLoad--;\r\n if (picsToLoad === 0) {\r\n imageLoadingDoneSoStartGame();\r\n }\r\n}", "function fetchImages() {\n $.getJSON(\"/images.php\", function(data) {\n preloadImages(data);\n }); \n }", "function imageLoaded() {\n\timageYetToLoad--;\n}", "function countLoadedImagesAndLaunchIfReady(){\n picsToLoad--;\n //console.log(picsToLoad);\n \n if(picsToLoad == 0){\n imageLoadingDoneStartGame();\n }\n}", "function imageLoadPost(){\n\n loadedImages++;\n progressP.innerHTML = Math.round(100*(loadedImages/arrLength)) + \"%\";\n if (loadedImages == arrLength){\n onFinish();\n postAction(newImages);\n }\n }", "function countLoadedImagesAndLaunchIfReady() {\n picsToLoad--;\n //console.log(picsToLoad);\n if(picsToLoad == 0) {\n imageLoadingDoneSoStartGame();\n }\n}", "function countLoadedImagesAndLaunchIfReady() {\n picsToLoad--;\n // console.log(picsToLoad);\n if (picsToLoad == 0) {\n imageLoadingDoneSoStartGame();\n } // wait for images to finish loading\n} // end of function", "function loadImages(){\n prev_btnj.addClass('loading')\n next_btnj.addClass('loading')\n fs.readdir(dirname, (err, files) => {\n if (!err){\n images = files.filter(isImage)\n curIndex = images.indexOf(basename)\n prev_btnj.removeClass('loading')\n next_btnj.removeClass('loading')\n setBtn()\n }\n })\n}", "function loadImages() {\n\t\t const button = document.querySelector('#loadImages');\n\t\t const container = document.querySelector('#image-container');\n\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\t\t images.forEach((image) => {\n\t\t requestFor(image, container).then(imageData => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\t\t });\n\t\t });\n\t\t}", "function imageLoaded(){\n\t\t//For every image loaded numLoaded increases by one\n\t\tnumLoaded++;\n\t\t//When numLoaded equals numImages then proceed to the next function\n\t\tif (numLoaded == numImgaes){\n\t\t\ttitleScreen();\n\t\t}\n\t}", "function imageLoaded(){\n\t\t//For every image loaded numLoaded increases by one\n\t\tnumLoaded++;\n\t\t//When numLoaded equals numImages then proceed to the next function\n\t\tif (numLoaded == numImgaes){\n\t\t\ttitleScreen();\n\t\t}\n\t}", "function getLoadedImages() {\r\n return images;\r\n }", "beginLazyLoading(){\n\t\tconst imageTag = document.getElementById(this._elementID);\n\t\tconst highResImage = this._highResImageURL\n\n\t\timageTag.src = highResImage;\n\t\t\n\t\timageTag.addEventListener('load', function() {\n\t\t\timageTag.className = imageTag.className + ' is-loaded';\n\t\t});\n\t}", "loadImages() {\n let loadCount = 0;\n let loadTotal = this.images.length;\n\n if (WP.shuffle) {\n this.images = this.shuffle(this.images);\n }\n\n const imageLoaded = (() => {\n loadCount++;\n\n if (loadCount >= loadTotal) {\n // All images loaded!\n this.setupCanvases();\n this.bindShake();\n this.loadingComplete();\n }\n }).bind(this);\n\n for (let image of this.images) {\n // Create img elements for each image\n // and save it on the object\n const size = this.getBestImageSize(image.src);\n image.img = document.createElement('img'); // image is global\n image.img.addEventListener('load', imageLoaded, false);\n image.img.src = image.src[size][0];\n }\n }", "function start_loadImages()\n {\n methods.loadImages(\n function() {\n methods.getDataURI();\n run_app();\n },\n imagesRack.imgList\n );\n }", "function preLoadImages( callback){\n var imagesLoaded=0;\n for(var i=0;i<gameConfig.sources.length;i++){\n var image = new Image();\n image.src= gameConfig.sources[i].url;\n images[gameConfig.sources[i].name]= image;\n image.onload=function(){ \n imagesLoaded+=1;\n if(imagesLoaded===gameConfig.sources.length){\n model.setPreLoadedImages(images);\n callback();\n }\n }\n } \n }", "async preloadImages(data) {\n const urls = data.map(imageData => {\n const uri = this.returnImageUrl(imageData);\n return CacheManager.get(uri).getPath();\n });\n this.setState({imagesLoaded: true});\n }", "function count_images() {\r\n if (++num_loaded_images == imageSum) {\r\n\t\t show_speed();\r\n\t\t $('#load').remove();\r\n animate();\r\n } else {\r\n\t\t $('#load').css({\r\n\t\t\t\tbackgroundImage: 'url(./assets/images/stars.gif)',\r\n\t\t\t\tbackgroundPosition: 'top left',\r\n\t\t\t\tbackgroundRepeat: 'repeat'\r\n\t\t });\r\n $('.label #playlabel').html('Loading: ');\r\n\t\t $('.label #playstatus').html(num_loaded_images+\" of \"+imageSum);\r\n }\r\n }", "function loadAllImages() {\n var images = document.querySelectorAll('img[data-src]');\n\n for (var i = 0; i < images.length; i++) {\n ImageLoader.load(images[i]);\n }\n }", "function imageLoaded() {\n console.log(\"READY:\", ready);\n imagesLoaded++; //increment let var set above\n if (imagesLoaded === totalImages) {\n ready = true; // true when photoArray length reached.\n loader.hidden = true;\n console.log(\"READY: \", ready);\n }\n}", "function checkLoaded() {\n imageCount = 0;\n if (done) {\n checkOption();\n for (var i = 0; i < images.length; i++) {\n images[i].onload = function () {\n imageCount++;\n if (imageCount == images.length && done) {\n drawPhotos();\n }\n };\n }\n }\n }", "function LoadSuccess() {\n // Image: set properties\n that.Properties($i);\n // Image: all image loaded\n SetupAfterAllLoaded();\n }", "function simpleLoad(config){\n for (var i = 1; i < config.imgTotal + 1; i++){\n $('<img>').attr({\n id: \"image\" + i,\n src: config.imgDir + i + config.imgFormat,\n title: \"Image\" + i\n }).appendTo(\"#\" + config.imgContainer);\n }\n }", "function imageLoaded(){\n counter--; \n if( counter === 0 ) {\n el.show();\n el.vars.start();//Calls \"start\" callback function\n methods.coverImages();\n methods.slideTimer();\n methods.animate(); \n }\n }", "loadImg() {\n let loadedCount = 0\n function onLoad() {\n loadedCount++\n if (loadedCount >= this.imgPaths.length) {\n this.flowStart()\n }\n }\n this.baseImages = this.imgPaths.map(path => {\n const image = new Image()\n image.onload = onLoad.bind(this)\n image.src = path\n return image\n })\n }", "function loadImages() {\r\n\t\tremoveUnseenImages();\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar range = getPixelRange();\r\n\t\tfor(var i=range.start.x; i<range.end.x && i<sets.resolutions[sets.zoom-1].width; i+=addi(i)) {\r\n\t\t\tfor(var j=range.start.y; j<range.end.y && j<sets.resolutions[sets.zoom-1].height; j+=256) {\r\n\t\t\t\tvar col = getColumn(i);\r\n\t\t\t\tif(!isLoaded(col,i,j)) { // Prevent already loaded images from being reloaded\r\n\t\t\t\t\tvar imgurl = sets.image_name.replace(/%Z/, sets.zoom );\r\n\t\t\t\t\timgurl = imgurl.replace(/%L/, sets.level);\r\n\t\t\t\t\timgurl = imgurl.replace(/%C/, col);\r\n\t\t\t\t\timgurl = imgurl.replace(/%X/, (i-firstInColumnLocation(col-1)));\r\n\t\t\t\t\timgurl = imgurl.replace(/%Y/, j);\r\n\t\t\t\t\timgurl = sets.image_dir + imgurl;\r\n\t\t\t\t\t$['mapsettings'].loaded[sets.zoom+\"-\"+col+\"-\"+i+\"-\"+j] = true;\r\n\t\t\t\t\tvar style = \"top: \" + j + \"px; left: \" + i + \"px;\"\r\n\t\t\t\t\tvar theClass = \"file\" + sets.zoom + \"-\" + col +\"-\" + i + \"-\" + j;\r\n\t\t\t\t\t$(\"<img/>\").attr(\"style\", style).attr('class',theClass).appendTo(\"#images\").hide();\r\n\t\t\t\t\t$(\"img.\" + theClass).load(function(e){ $(this).show(); }); // Only show the image once it is fully loaded\r\n\t\t\t\t\t$(\"img.\" + theClass).attr(\"src\", imgurl);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function lazyLoad(){\n\tvar $images = $('.lazy_load');\n\n\t$images.each(function(){\n\t\tvar $img = $(this),\n\t\t\tsrc = $img.attr('data-img');\n\t\t$img.attr('src',src);\n\t});\n}", "function loadImages(imagesToLoad) {\n\timagesToLoad.forEach(lazyImage => {\n\t\tthis.fireLazyEvent(lazyImage.image);\n\t\tlazyImage.resolved = true;\n\t});\n}", "function imageLoaded() {\n loadedCount++;\n\n if (loadedCount >= startImageCount) {\n\tawaitRound(\"HTML5 BOXING!\", true);\n }\n}", "function findImagesToLoad() {\n\tsetLazyImagePositions.call(this);\n\tconst imagesToLoad = getImagesInView(this.images);\n\tloadImages.call(this, imagesToLoad);\n}", "function loadImageUrls() {\n fetch(\"https://api.imgflip.com/get_memes\")\n .then((result) => result.json())\n .then(({ data: { memes: loadedMemes } = {} }) => {\n memes = loadedMemes;\n showImage(0);\n });\n }", "function imageLoad() {\n var $imagesToAnimate = $('img');\n if ($imagesToAnimate.length) {\n $imagesToAnimate.each(function () {\n $(this).on('load', function () {\n $(this).addClass('animate-images');\n });\n });\n }\n}", "function preloadImages() {\n\tidList.forEach(function(id) {\n\t\tlet $newImage = $('#image-preloader').clone();\n\t\t$newImage.attr('src', `${ART_URL}${id}.png`);\n\t\t$('#image-preloader-container').append();\n\t});\n}", "onImageLoaded() {\n this.imgLoaded = true;\n }", "function imageLoadedCallback() {\n if (++imagesAmount >= imagesForPreload.length) {\n imagesLoaded = true;\n if (styleLoaded) {\n spotgamesEventManager.dispatchEvent(spotgames.event_type.AD_INIT, thisgame.constructor.name);\n }\n\n }\n }", "function preloadImages() {\n for (var i = 0; i < numberOfGifsToPreload; i++) {\n popThenAddImage(fileNamesArray);\n }\n }", "function fetch( i, img, retry ) {\n // IE problem, can't preload more than 15\n if( img.attachEvent /* msie */ && data.next && data.next % settings.gap == 0 && !retry ){\n window.setTimeout(\n function() {\n fetch( i, img, true );\n }, 10\n );\n return false;\n }\n if( data.next == data.total ) {\n return false;\n }\n img.index = data.next; // save it, we'll need it.\n img.src = sources[data.next++];\n if( settings.onRequest ) {\n data.index = img.index;\n data.element = img;\n data.image = img.src;\n data.original = original[data.next-1];\n settings.onRequest( data );\n }\n }", "function preloader() {\n\tif (document.images) {\n\t\tvar img1 = new Image();\n\t\tvar img2 = new Image();\n\t\tvar img3 = new Image();\n\t\tvar img4 = new Image();\n\n\t\timg1.src = \"./imgs/sunny.jpg\";\n\t\timg2.src = \"./imgs/sunset.jpg\";\n\t\timg3.src = \"./imgs/stars.jpg\";\n\t\timg4.src = \"./imgs/downtown.jpg\";\n\t}\n}", "loadImages() {\n if (this._queue.length > 0) {\n let img = new Image();\n let src = this._queue.pop();\n\n let name = src.slice(src.lastIndexOf('/') + 1);\n img.src = src;\n img.onload = (function() {\n this.loadImages();\n }).bind(this);\n this.images[name] = img;\n } else {\n this._callback();\n }\n }", "function loadImage() {\n\t\t\tthis.loading = 'eager';\n\t\t\tif( this.src )\n\t\t\t\tthis.src = this.src;\n\t\t\tif( this.srcset )\n\t\t\t\tthis.srcset = this.srcset;\n\t\t}", "function imageLoader(numImages, completion) {\n\tvar count = 0;\n\n\treturn function() {\n\t\tif (numImages == ++count)\n\t\t\tcompletion();\n\t};\n}", "function initDownload() {\n downloadStartTime = new Date().getTime();\n downloadImg(0);\n }", "function allLoaded() {\n for (var i = 0; i != images.length; ++i) {\n if (!images[i].loaded) return false;\n }\n return true;\n }", "function preload(){\n images.forEach(function(elem) {\n im = new Image();\n im.src = elem;\n });\n}", "loadImages(): void {\n let self = this;\n let items = this.getState().items;\n for (let i = 0; i < items.length; i++) {\n let item: ItemType = items[i];\n // Copy item config\n let config: ImageViewerConfigType = {...item.viewerConfig};\n if (_.isEmpty(config)) {\n config = makeImageViewerConfig();\n }\n let url = item.url;\n let image = new Image();\n image.crossOrigin = 'Anonymous';\n self.images.push(image);\n image.onload = function() {\n config.imageHeight = this.height;\n config.imageWidth = this.width;\n self.store.dispatch({type: types.LOAD_ITEM, index: item.index,\n config: config});\n };\n image.onerror = function() {\n alert(sprintf('Image %s was not found.', url));\n };\n image.src = url;\n }\n }", "function _loadVisibleImages() {\n // do not load anything if currently in forced scrolling\n if (scrolling) return;\n _computeFirstAndLastVisible();\n var $canvas = $(\"#canvas\");\n var maxWidth = $canvas.width()-16;\n // iterate over images visible in viewport\n var uuid = firstVisibleUUID;\n while (uuid) {\n var fingerprint = fpCache.getFingerprint(uuid);\n var $item = fpCache.getDOMElement(uuid);\n // Check if item is still visible\n var viewTop = $(\"#canvas\").scrollTop();\n var viewBottom = viewTop + $(\"#canvas\").height();\n var canvasTop = $(\"#canvas\").position().top;\n var offsetTop = viewTop - canvasTop;\n var top = $item.position().top + offsetTop;\n var bottom = top + $item.height();\n var visible = (bottom >= viewTop && top <= viewBottom);\n if (visible) {\n // Update 'src' attribute to reload\n var $img = $('img', $item);\n var size = computeThumbsize(maxWidth, uuid);\n $img.css(size);\n var $play = $('.canvas-image-item-play', $item);\n $play.css(size);\n\n if (fingerprint.image && fingerprint.image.dominantColor && fingerprint.image.dominantColor.length>0)\n $img.css('backgroundColor', fingerprint.image.dominantColor);\n var src = $img.attr('src');\n if (!src) {\n $img.attr(\"src\", \"/photos/thumb/\" + flavor + \"/\" + fingerprint.uuid);\n }\n }\n if (uuid === lastVisibleUUID) break;\n uuid = fpCache.getNextUUID(uuid);\n } \n}", "function handler( e ){\n data.element = this;\n data.found = e.type == 'load';\n data.image = this.src;\n data.index = this.index;\n var orig = data.original = sources[this.index];\n data[data.found?'loaded':'failed']++;\n data.done++;\n\n if( settings.onComplete ) {\n settings.onComplete( data );\n }\n if( data.done < data.total ) {\n fetch( 0, this );\n } else {\n if( imgs && imgs.unbind ) {\n imgs.unbind('load').unbind('error').unbind('abort');\n }\n imgs = null;\n finish();\n }\n }", "function beginLoadingImage(imgVar, fileName) {\r\n imgVar.onload = countLoadedImagesAndLaunchIfReady;\r\n imgVar.src = 'images/' + fileName;\r\n}", "function lazyLoad() {\n lazyImages.forEach(image => {\n if (image.offsetTop < window.scrollY + 150) {\n image.style.backgroundImage =\n `url(${image.getAttribute('data-src')})`;\n image.classList.add('loaded')\n }\n })\n}", "function loadImages(data) {\n $('.gif-wrapper').empty();\n var temp = JSON.parse(data);\n for (var i = 0; i < temp.length; i += 1) {\n $('.gif-wrapper').append('<img src=\"' + temp[i].url + '\">');\n }\n }", "loadImage() {\n this.imagesLoaded++;\n if (this.imagesLoaded >= this.slides.length) {\n this.playSlideshow();\n }\n }", "function preloadImages(images) {\n imagesAmount = images.length;\n for (var i = 0; i < images.length; i++) {\n var img = new Image();\n img.addEventListener('load', imageLoadedCallback, false);\n img.src = basePath + 'images/' + images[i];\n }\n }", "function loadImages(images, callback) {\n if (!images[0].complete) {\n if (!images[0].imageReloadTries) {\n images[0].imageReloadTries = 0;\n setTimeout(function(){\n images[0].imageReloadTries += 1;\n loadImages(images, callback);\n },\n 50);\n } else if (images[0].imageReloadTries < IMG_RELOAD_RETRY_MAX) {\n setTimeout(function() {\n images[0].imageReloadTries += 1;\n loadImages(images, callback);\n },\n 250);\n } else {\n // failed so ignore\n widgets.log(\"failed to load \" + images[0].src + \" retries=\" + images[0].imageReloadTries);\n images.shift();\n if (images.length == 0) {\n callback();\n } else {\n loadImages(images, callback);\n }\n }\n } else {\n // remove the first item\n images.shift();\n if (images.length == 0) {\n callback();\n } else {\n loadImages(images, callback);\n }\n }\n }", "function imgLazyLoad() {\n\t$('.lazy-load').unveil();\n}", "function pre(allLoadedCallback) {\n \n var allImg = [],\n imgLoaded = 0,\n uncached = function (src) {\n if (!src || src=='') return false;\n var img = new Image();\n img.src = src;\n return !img.complete;\n },\n imgLoad = function(self, img) {\n imgLoaded++;\n\n self.naturalimgwd = img.width;\n self.naturalimghg = img.height;\n\n if (imgLoaded >= allImg.length) {\n \n f.$el.removeClass('loading');\n f.o.cbStarted();\n \n allLoadedCallback.call(f);\n \n return false;\n }\n }\n \n // gets all frame images\n $.each(f.o.config, function() {\n if (f.o.src || this.src) {\n //allImg.push((f.o.src)? f.o : this)\n allImg.push((this.src)? this : f.o)\n if (typeof(this.src) != 'undefined' && this.src !== '') \n \tthis.hasOwnImage = true;\n else\n \tthis.hasOwnImage = false;\n }\n });\n\n f.$el.addClass('loading');\n $.each(allImg, function() {\n var img = new Image(),\n self = this;\n if(uncached(this.src)) {\n img.onload = function() {\n imgLoad(self, img)\n }\n img.src = this.src || f.o.src;\n } else {\n img.src = this.src || f.o.src;\n imgLoad(self, img)\n }\n });\n if(!allImg.length){\n imgLoad(f.o, '')\n }\n }", "loadImage() {\n this.imagesLoaded++;\n if (this.imagesLoaded >= this.slides.length) { this.playSlideshow() }\n }", "function loadImages(sources, callback) {    \n\t\tfor(var src in sources) {         \t// get num of sources\n        numImages++;\n        }\n    for(var src in sources) {\n        images[src] = new Image();\n\t\t\timages[src].onload = function() {\n\t\t\t\tif(++loadedImages >= numImages) {\n\t\t\t\tcallback(images);\n\t\t\t\t}\n\t\t\t};\n        images[src].src = sources[src];\n        }\n    }", "async function loadData() {\n if (initialRender.current) {\n initialRender.current = false;\n\n }\n else {\n\n let tempArray = []\n\n for (let i = 0; i < imageKeys.length; i++) {\n\n if (!imageKeys[i].Key.endsWith('/')) {\n let url = \"https://manhuapointin.s3.amazonaws.com/\" + imageKeys[i].Key\n tempArray.push(url)\n }\n }\n setImageUrl(tempArray)\n }\n }", "function imgLoading() { \n var done = true;\n for(var i=0;i<cacheArray.length;i++) {\n if(cacheArray[i][0].complete && !cacheArray[i][1]) {\n layers[i].ctx.drawImage(cacheArray[i][0],0,0);\n cacheArray[i][1] = true;\n } else if(cacheArray[i][1]==false) {\n done = false;\n }\n }\n if(done) {\n cacheArray = [];\n } else {\n requestAnimationFrame(imgLoading);\n }\n}", "function imageLoaded() {\n // Increments the value of the \"loadedImages\" variable\n loadedImages++;\n // Updates the preloader percentage text\n $(\"#spinner span\").text(Math.floor(loadedImages / totalFrames * 100) + \"%\");\n // Checks if the currently loaded image is the last one in the sequence...\n if (loadedImages == totalFrames) {\n // ...if so, it makes the first image in the sequence to be visible by removing the \"previous-image\" class and applying the \"current-image\" on it\n frames[0].removeClass(\"previous-image\").addClass(\"current-image\");\n /*\n Displays the image slider by using the jQuery \"fadeOut\" animation and its complete event handler.\n When the preloader is completely faded, it stops the preloader rendering and calls the \"showThreesixty\" function to display the images.\n */\n $(\"#spinner\").fadeOut(\"slow\", function(){\n spinner.hide();\n showThreesixty();\n });\n } else {\n // ...if not, Loads the next image in the sequence\n loadImage();\n }\n }", "function loadImages() {\n $('img[data-src]').each(function () {\n var src = $(this).data('src');\n var style = $(this).data('style');\n $(this).attr('src', src);\n $(this).attr('style', style);\n });\n}", "function loadNextImage() {\n loadImageIndex(++currentImageIndex);\n //drawMarkers(canvas);\n}", "imageLoadEnded() {\n this.stateMap.images_still_loading -= 1;\n if(this.stateMap.images_still_loading < 0) {\n console.log(\"There are a negative number of images loading.\");\n }\n if(this.stateMap.images_still_loading == 0) {\n console.log(\"shell: images done loading\");\n spa.imagelistmodel.deployConfig();\n }\n }", "function loadImage() {\n\n // image file not loaded yet? => load image file\n if ( !resource ) jQuery( '<img src=\"' + url + '\">' );\n\n // immediate perform success callback\n success();\n\n }", "preload(i){\n if(i===this.imgUrl.length){\n return;\n }\n if(this.prelaodImg.length === 2){\n document.dispatchEvent(new CustomEvent('load-complete',{}));\n }\n const tImg = document.createElement('img');\n tImg.src = this.imgUrl[i];\n //when load is done, load next\n tImg.addEventListener('load',(event)=>{this.preload(++i);\n console.log('loaded '+tImg.src);\n })\n this.prelaodImg.push(tImg);\n }", "function preload() {\r\n\r\n var img = images[loadedCount];\r\n if (typeof(img) === \"undefined\") {\r\n img = images[loadedCount] = new Image();\r\n }\r\n if (loadedCount * percentIncrement < total_width + 10) {\r\n img.onload = function () {\r\n if (debug === 1) {\r\n console.log('imgLoaded is not done');\r\n }\r\n if (loadedCount + 1 < totalImages) {\r\n img.src = this.src;\r\n }\r\n\r\n if (loadedCount * percentIncrement < total_width + 0.1) {\r\n draw(loadedCount * percentIncrement);\r\n }\r\n\r\n };\r\n if (loadedCount < totalImages) {\r\n var source = imgPath + imgList[loadedCount];\r\n source = source.replace(/([^:]\\/)\\/+/g, \"$1\");\r\n img.src = source;\r\n images[loadedCount] = img;\r\n }\r\n }\r\n }", "_handleImageLoad() {\n if (!this.attachmentViewer || !this.attachmentViewer.attachment) {\n return;\n }\n const refs = this._getRefs();\n const image = refs[`image_${this.attachmentViewer.attachment.id}`];\n if (\n this.attachmentViewer.attachment.fileType === 'image' &&\n (!image || !image.complete)\n ) {\n this.attachmentViewer.update({ isImageLoading: true });\n }\n }", "function preloader() {\r\n const imagesPaths = [\r\n \"./img/SolarEnergy.jpg\",\r\n \"./img/HydroEnergy.jpg\",\r\n \"./img/BiogasEnergy.jpg\"\r\n ];\r\n const images = [];\r\n for (let i = 0; i < imagesPaths.length; i++) {\r\n images[i] = new Image();\r\n images[i].src = imagesPaths[i];\r\n }\r\n\r\n // Images ready to be used:\r\n console.log(`Preloaded images:\\n\\t${images[0].src}\\n\\t${images[1].src}\\n\\t${images[2].src}`);\r\n}", "function allImagesLoaded(preloader){\n document.querySelector(\"body\").classList.remove(\"load\")\n preloader.classList.add(\"isLoaded\")\n}", "function lazy_img_load(){\r\n Array.prototype.forEach.call( $('img[data-src]'), function(img) {\r\n img.setAttribute('src', img.getAttribute('data-src'));\r\n img.onload = function() {\r\n setTimeout(function() {\r\n img.removeAttribute('data-src');\r\n $('.preloader').css(\"background-image\" , \"none\");\r\n $('.clickToResize').css(\"display\" , \"block\")\r\n \r\n }, 750)\r\n }\r\n })\r\n}", "function fitImageOnLoad(selector) {\n//\t$(\".stuffypic\").one('load', () ->\n//\t\tfitImage this\n//\t).each () ->\n//\t\tif this.complete \n//\t\t\t$(this).load();\n $(selector).each(function() {\n fitImage(this);\n });\n}", "function getAllImages() {\n printLog('Requiring all images the user solved from the server.');\n IMAGES = [];\n // IMAGES_ON_CLIENT = 0;\n send(json_get_all_images_message());\n}", "function lgb_imageLoader() {\n\n lgb_images = lgb_images - 1;\n}", "function preload(){\n for (let i = 0; i<totalImages; i++)\n {\n img[i] = loadImage(\"load/img\" + (i+1) + \".jpg\");\n }\n}", "async TryGetImages(fetchParams) {\n if (!this.state.loadingMore) {\n this.setState({ loadingMore: true }, () => { this.GetImages(fetchParams) })\n }\n }", "function loadPrevImg() {\n\t\tif (!isLoading && currentImageOrder > 0 && multi) {\n\t\t\tshowedImage = images[--currentImageOrder];\n\t\t\tloadNext = first = false;\n\t\t\tloadImg();\n\t\t}\n\t}", "function McDeferredLoadImages() {\n var items = {};\n\n this.addImage = function (idx, hash, src, href) {\n if (!items.hasOwnProperty(idx)) {\n items[idx] = [hash, src, href];\n }\n };\n\n this.load = function (cb) {\n var count = Object.keys(items).length;\n var currentIdx = 0;\n\n Object.keys(items).forEach(function (idx) {\n var hash = items[idx][0];\n var imgSrc = items[idx][1];\n var lnkHref = items[idx][2];\n\n var _link = document.getElementById('link_' + hash + idx);\n var _img = document.getElementById('img_' + hash + idx);\n\n if (_img && _img.src && _link && _link.href){\n _img.src = imgSrc;\n _link.href = lnkHref;\n\n console.log('loadAll: ' + imgSrc);\n\n _img.onload = function () {\n currentIdx ++;\n delete items[idx];\n\n if (currentIdx === count && cb){\n cb();\n }\n };\n\n _img.onerror =_img.onabort = function (err) {\n console.warn(err);\n }\n }\n });\n };\n}", "function loadImagesSeq() {\n\t\t const button = document.querySelector('#loadImagesSeq');\n\t\t const container = document.querySelector('#image-container');\n\t\t const promises = [];\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\n\t\t images.forEach((image) => {\n\t\t promises.push(requestInSeq(image, container));\n\t\t });\n\t\t console.log(promises);\n\t\t // when all promises are resolved then this promise is resolved.\n\t\t Promise.all(promises).then((imageDataObjs) => {\n\t\t console.log(imageDataObjs);\n\t\t imageDataObjs.forEach((imageData) => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\n\t\t });\n\t\t });\n\n\n\t\t}", "function renderImages() {\n $('.landing-page').addClass('hidden');\n $('.img-round').removeClass('hidden');\n updateSrcs();\n currentOffset+=100;\n }", "function preload(){\r\n img=loadImage('https://upload.wikimedia.org/wikipedia/commons/8/81/Dalai_Lama_%2814566605561%29.jpg')\r\n\r\n img1=loadImage('https://upload.wikimedia.org/wikipedia/commons/0/02/Nelson_Mandela_1994.jpg')\r\n\r\n img2=loadImage('https://upload.wikimedia.org/wikipedia/commons/0/00/Bill_Clinton_1999_Presidential_Medal_of_Freedom_%281%29.jpg')\r\n\r\nimg3=loadImage('https://live.staticflickr.com/65535/49245065008_a7082b2a41_b.jpg')\r\n}", "function addURLLoading()\n{\n\tnumLoading++;\n\tvar throbber = document.getElementById('throbber');\n\tif (throbber && throbber.src.indexOf('.png' != -1))\n\t{\n\t\tthrobber.src = \"images/throbber_anim.gif\";\t\t\t\n\t}\n}", "fetchData() {\n this.service.getAllImages(function (data) {\n for (let i = 0; i < data.length; i++) {\n this.sideDrawer.addElements(data[i].images);\n this.map.drawMarker(data[i].images);\n }\n }.bind(this), function (error) {\n // handle error\n }.bind(this));\n }" ]
[ "0.78154147", "0.76731503", "0.7651768", "0.76379204", "0.7622793", "0.7595641", "0.7566192", "0.7477516", "0.7469799", "0.7428003", "0.73923427", "0.73823583", "0.7355395", "0.73309684", "0.731137", "0.7300096", "0.72339004", "0.7187371", "0.71635747", "0.71390754", "0.71042585", "0.70427454", "0.7039679", "0.7039303", "0.69933647", "0.69798005", "0.69645566", "0.6945819", "0.6945819", "0.69350505", "0.69134855", "0.6909959", "0.69067043", "0.6903765", "0.690114", "0.6899495", "0.6897807", "0.6888899", "0.68858683", "0.6865737", "0.6861976", "0.6856906", "0.6812175", "0.67912006", "0.6773586", "0.6772902", "0.67648804", "0.67557925", "0.6745438", "0.67245275", "0.6720641", "0.6705765", "0.67021066", "0.6691464", "0.66876763", "0.66852045", "0.66775465", "0.6670143", "0.665335", "0.66481864", "0.66182184", "0.66174597", "0.6615683", "0.6612752", "0.6606493", "0.6602273", "0.659573", "0.6592218", "0.6578405", "0.6575093", "0.65604264", "0.654656", "0.65357506", "0.6524062", "0.6518337", "0.65042424", "0.65036386", "0.6502129", "0.6500253", "0.649974", "0.64960027", "0.64863443", "0.64828867", "0.64788854", "0.6474672", "0.6462377", "0.64617425", "0.64537007", "0.64519155", "0.64499176", "0.64488447", "0.64400935", "0.64352316", "0.642981", "0.64256436", "0.6420417", "0.64131826", "0.6410194", "0.6407395", "0.64067185" ]
0.6895601
37
Rename this later you mug
function LolWut() { //Change fill and outline colours simpleText.setFill((getRandomColour())); simpleText.setStroke((getRandomColour())); //stage.draw(); //Redraw text simpleText.draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rename () {\n }", "getName(newName) {\n this.name = newName;\n }", "function changeName(newName){\n\tthis.currentName = newName;\n}", "rename(newName) {\n this.name = newName;\n return this;\n }", "setName(name) { }", "set name(newName) {\n\t this.setName(newName);\n\t }", "changeName(newName) {\n this.cgram.changeAnchorName(this.name, newName);\n }", "__init25() {this.forceRenames = new Map()}", "set name(newName) {\n this.setName(newName);\n }", "changeName(newName) {\n this.cgram.changeBlobName(this.name, newName);\n }", "set name(newName) {\n if (newName) {\n this._name = newName;\n }\n }", "set name(newName) {\n this.setName(newName);\n }", "function trackRename(){\n oldRename = Notebook.__proto__.rename\n Notebook.__proto__.rename = function(){\n new_name = arguments[0]\n\n // POST request to rename files\n // rename folder\n // rename db\n // rename ipynb\n\n return oldRename.apply(this, arguments)\n }\n }", "set name(x) { this._name = x; }", "function _generateCurrentName() {\n NameWebAPIUtils.getNewCurrentName();\n}", "function newname(config,oldname,newname) {\n if(config[oldname] != undefined) config[newname] = config[oldname]\n delete config[oldname]\n }", "correctName() {\n\t\tthis.name = this.stringCorrector.getMon(this.name);\n\t}", "function changeNameInHeader() {\n $headerName.html('Todo list for ' + $TaskName.val());\n }", "function setName(n) {\n\tname = n;\n}", "function rename(thing) {\n return (\n thing.type === \"class\" ||\n thing.type === \"id\" ||\n (current.name && current.name.search(identifiers.keyframes) > -1)\n );\n }", "set setName(name){\n _name=name;\n }", "_setSelfName () {\n var globalName = `_${this._props.nameBase}s`;\n // track amount of tweens globally\n t[globalName] = ( t[globalName] == null ) ? 1 : ++t[globalName];\n // and set generic tween's name || Tween # ||\n this._props.name = `${this._props.nameBase} ${t[globalName]}`;\n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "setName( name ) {\n this.name = name;\n }", "function changeName(obj) {\r\n obj.name = 'coder';\r\n}", "setName(name) {\n this._name = name;\n }", "function name() {}", "function changeName(obj) {\n obj.name = 'coder'\n}", "function renameIdentifier(path) {\n // console.log(path.type, path.node.name)\n // console.log(path)\n if (!firstDef && path.scope.bindings[name]) {\n firstDef = path.scope.bindings[name]\n }\n if (path.node.name === name && getDef(path.node.name, path.scope) === firstDef) {\n path.node.name = newName\n }\n }", "set type(name) {\n console.warn(\"prototype.type = 'ModelName' is deprecated, use static __name__ instead\");\n this.constructor.__name__ = name;\n }", "adjustNameForPic(name) {\n return name.toLowerCase().replace(/ /g,\"_\"); \n }", "function instanceRenameReset() {\n if ($(instancePage.nameContainer).data('original-name')) {\n $(instancePage.renameInput).val($(instancePage.nameContainer).data('original-name').trim());\n $(instancePage.nameContainerText).text($(instancePage.nameContainer).data('original-name').trim());\n }\n $(instancePage.hiddenIsRenamePending).val(false);\n resetUnsavedChanges();\n }", "function fixStateName(state){\n if(state.parent){\n state.name = state.parent.name + '.' + state.name;\n }\n }", "isChangingName() {\n return this._isChangingName\n }", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj) {\n obj.name = \"coder\";\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "function changeName(obj) {\n obj.name = 'coder';\n}", "setName(name) {\n this.name = name;\n }", "function changeName(name1) {\n let newName = \"\";\n for (let i = 0; i < hacker1.length; i++) {\n newName = newName + hacker1[i];\n }\n return newName.toUpperCase().split(\"\").join(\" \");\n}", "function updateRenameForms() {\n\tdocument.renameFileForm.renamedFile = selectedFile;\n\tdocument.renameFileForm.originalFile = selectedFile;\n}", "function unSetInstanceRenameMode() {\n $(instancePage.renameContainer).hide('slide', { direction: \"left\" });\n $(instancePage.nameContainer).show('slide', { direction: \"left\" });\n\n // TODO: Uncommenting the code below breaks renaming. Write a regression test for this?\n // if ($(instancePage.nameContainer).data('original-name')) {\n // $(instancePage.renameInput).val($(instancePage.nameContainer).data('original-name').trim());\n // }\n }", "onRenamed(newName){\n\n this._renameRelay(newName).then(() => {\n this._log('successfully saved the new name via gRPC call')\n }).catch((err) => {\n this._log('error saving new name: '+err.message)\n }); // this._renameRelay\n\n }", "function getNewName() {\n var ext, docName, newName, saveInFile, docName;\n docName = sourceDoc.name;\n ext = '.png'; // new extension for file\n newName = \"\";\n\n for (var i = 0; docName[i] != \".\"; i++) {\n newName += docName[i];\n }\n newName += ext; // full name of the file\n\n // Create a file object to save the png\n saveInFile = new File(sourceFolder + '/' + newName);\n\n\n return saveInFile;\n}", "get name() {\n \treturn 'Stephanie';\n }", "function rename(obj) {\r\n\t\tvar newName = prompt(\"Rename \" + obj.part.data.item + \" to...\");\r\n\t\tobj.part.data.item = newName; \r\n\t }", "renameTable(tableName, to) {\n this.pushQuery(`rename table ${this.formatter.wrap(tableName)} to ${this.formatter.wrap(to)}`);\n }", "set name(newName) {\n if (newName.length >= 5) {\n this._name = newName;\n } else {\n throw new Error('Name should be at least 5 characters');\n }\n }", "static className(name) {\n return name.replace(/\\w[^-\\s]*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1)).replace(/[-\\s]/g, \"\");\n }", "addName() {\n if (this.newName === '')\n return;\n this.names.push(this.newName);\n this.newName = \"\";\n }", "setName(newName) {\r\n const nameNodes = this.getNameNodes();\r\n const openIssueText = `Please open an issue if you really need this and I'll up the priority.`;\r\n if (nameNodes.length > 1)\r\n throw new errors.NotImplementedError(`Not implemented to set a namespace name that uses dot notation. ${openIssueText}`);\r\n if (newName.indexOf(\".\") >= 0)\r\n throw new errors.NotImplementedError(`Not implemented to set a namespace name to a name containing a period. ${openIssueText}`);\r\n if (newName !== \"global\")\r\n addNamespaceKeywordIfNecessary(this);\r\n nameNodes[0].replaceWithText(newName);\r\n return this;\r\n }", "setName(name) {\r\n const nameNode = this.getNameNode();\r\n if (nameNode.getText() === name)\r\n return this;\r\n nameNode.replaceWithText(name);\r\n return this;\r\n }", "function changeName(obj) {\n\tobj.name = 'diffEllie';\n}", "function JSCompiler_renameProperty(a) {\n return a;\n }", "function name(name) {\n return name;\n }", "function newName() {\n friends[2] = \"Ackemo\";\n friends[3] = false;\n}", "['@_longname']() {\n super['@_longname']();\n if (this._value.longname) return;\n this._value.longname = this._value.name;\n }", "get name() {\n \treturn 'Rybu';\n }", "constructor () {\n this._name = 'u1';\n }", "function renameTag(orig, modified) {\n db.run(\"UPDATE tagnames SET name=(?) WHERE name LIKE (?)\", modified, orig, function (err) {\n if (err) {\n console.log(err);\n return;\n }\n console.log(\"UPDATE: \"+this.changes);\n });\n}", "changeName( id, newName ) {\n this.bands = this.bands.map( band => {\n\n if ( band.id === id ) {\n band.name = newName;\n }\n\n return band;\n\n })\n }", "function changeName(obj){\n obj.name = 'coder'\n}", "get name() {return this._name;}", "_$name() {\n super._$name();\n this._value.name = this._node.key.name;\n }", "onRename(modelCopy, nameNew, nameOld) {\n\n // Reconstruct the matchers\n var matchers = {};\n for (var name in modelCopy.matchers) {\n if (name === nameOld)\n matchers[nameNew] = modelCopy.matchers[name];\n else\n matchers[name] = modelCopy.matchers[name];\n }\n modelCopy.matchers = matchers;\n\n // Rename references from index field names to the old matcher name\n for (var i in modelCopy.indices) {\n var index = modelCopy.indices[i];\n for (var f in index.fields) {\n var field = index.fields[f];\n if (field.matcher === nameOld)\n modelCopy.indices[i].fields[f].matcher = nameNew;\n }\n }\n\n return modelCopy;\n }", "function getName() { return name; }", "rename ({ commit }, id, name) {\n // TODO: axios call\n commit('rename', id, name)\n }", "switchName(name) {\n const nameChanges = {\n id: 'Project ID',\n cost: 'Project Cost',\n savings: 'Project Savings',\n location: 'Location',\n funding_agency: 'Funding Agency',\n funding_agencies: 'funding_agency',\n locations: 'location',\n subsystems: 'subsystem',\n };\n return nameChanges[name];\n }", "function changeName(obj){\r\n obj.name = 'coder';\r\n}", "changeName(newName) {\n this.setState(\n {name: newName}\n );\n }", "handleRenameHistory(newName, oldName) {\n this.setState((prevState, props) => {\n prevState.currentHistoryName = newName;\n prevState.history[newName] = prevState.history[oldName];\n prevState.history[newName].name = newName;\n delete prevState.history[oldName];\n\n this.saveInHistory(prevState);\n\n return prevState;\n });\n }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "get name() { return this._name; }", "setName(namePicked) {\n this.name = namePicked; //refer to the object itself using 'this'\n }", "function shortName(name, tTable) {\n var back;\n if (back = tTable[name]) {\n\treturn back;\n }\n return name;\n}", "nameChanged(previous, next) {\n if (this.proxy instanceof HTMLElement) {\n this.proxy.name = this.name;\n }\n }", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "get name() {\n\t\treturn this.__name;\n\t}", "updateName() {\n App.elements.name.html(App.state.name);\n }", "function rename(obj) {\n if (!obj) obj = myDiagram.selection.first();\n if (!obj) return;\n myDiagram.startTransaction(\"rename\");\n var newName = prompt(\"Rename \" + obj.part.data.item + \" to:\", obj.part.data.item);\n myDiagram.model.setDataProperty(obj.part.data, \"item\", newName);\n myDiagram.commitTransaction(\"rename\");\n}", "function myName(name) {\n console.log(\"Old JS -> this is my name: \", name);\n}", "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }", "static set BoneName(value) {}", "updateName(state, name) {\r\n state.name = name;\r\n }", "renameTable(from, to) {\n this.pushQuery(\n `alter table ${this.qualifiedTableName(\n from\n )} rename to ${this.formatter.wrap(to)}`\n );\n }", "function fixStateName(state){\n if(state.parent){\n state.name = (angular.isObject(state.parent) ? state.parent.name : state.parent) + '.' + state.name;\n }\n }", "set setRaza(newName){\n this.raza = newName;\n }" ]
[ "0.7268357", "0.6747382", "0.6700619", "0.65855426", "0.64010906", "0.63651925", "0.6355663", "0.63196933", "0.63040966", "0.6279242", "0.6273887", "0.6270998", "0.6261195", "0.61612344", "0.61239976", "0.60722333", "0.60643995", "0.60387176", "0.59874266", "0.5928104", "0.5901088", "0.5897867", "0.5880071", "0.5877166", "0.5870742", "0.5867717", "0.58604413", "0.58369964", "0.58169913", "0.58114946", "0.58090144", "0.5808365", "0.5803344", "0.57911134", "0.5782199", "0.5782199", "0.5769445", "0.5769445", "0.5769445", "0.5762914", "0.5761115", "0.57455105", "0.5701077", "0.56948566", "0.5694489", "0.56879705", "0.56877", "0.56851196", "0.5683128", "0.5663484", "0.56609035", "0.56458926", "0.5645665", "0.5642335", "0.5640507", "0.56399626", "0.5628987", "0.5628697", "0.5622155", "0.5613936", "0.55995643", "0.5597432", "0.5585642", "0.5575592", "0.55708194", "0.5568489", "0.55677235", "0.55657774", "0.55656", "0.55649585", "0.5564046", "0.5556539", "0.5555986", "0.5555986", "0.5555986", "0.5555986", "0.5555986", "0.5555986", "0.5555986", "0.5555986", "0.5549968", "0.5543141", "0.5542548", "0.55330473", "0.55330473", "0.55330473", "0.55330473", "0.55330473", "0.55330473", "0.55330473", "0.5529596", "0.55218726", "0.55215335", "0.55188215", "0.55188215", "0.55188215", "0.55182296", "0.5517201", "0.5515051", "0.5513324", "0.55123115" ]
0.0
-1
Generate colours, modified from something found on S.O.
function makeid() { var text = ""; var possible = "ABCDEF0123456789"; for(var i=0;i<6;i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorGen($usr) {\n var hexArray = GM_getValue(\"hexArrayStore\", \"\") || [];\n var tempArray = [];\n\n // Convert string to hex\n var hexStr = $usr.text();\n var result = \"\";\n for (var i=0; i<hexStr.length; i++) {\n result += hexStr.charCodeAt(i).toString(16);\n }\n\n var hexName = result.split(\"\");//Splitting each character up with \"\"s and converting to hex\n\n var adder = 1;\n $.each(hexName, function(ind,num){\n num = (parseInt(num) + 1);\n if (num !== 0 && !isNaN(num)){//math\n adder = adder * num;\n }\n });\n adder = adder.toString().replace(\".\", \"\").split(\"0\").join(\"\");\n let start = adder.length-10;\n let end = adder.length-4;\n var firstThree = adder.toString().substring(start, end);//moremath\n var amt = 60;\n\n //Will loop twice, once for light and once for dark, then escapes to Robin colors\n for (i=0;i<2;i++){\n var r = firstThree.slice(0,2);\n var g = firstThree.slice(2,4);\n var b = firstThree.slice(4,6);\n if (rowAlternator) amt+=10; // TODO: Might want to rethink this\n var randR = (Math.seededRandom(r*100,120,175));\n var randG = (Math.seededRandom(g*100,120,175));\n var randB = (Math.seededRandom(b*100,120,175));\n // This is the randomizer, not much to know about this. Buncha math\n var suppress = (Math.seededRandom(firstThree*r*10,0,6));\n var modAmt =2 ;\n switch(suppress) {\n case 0:\n randR/=modAmt;\n break;\n case 1:\n randG/=modAmt;\n break;\n case 2:\n randB/=modAmt;\n break;\n case 4:\n randR/=modAmt;\n randG/=modAmt;\n break;\n case 5:\n randR/=modAmt;\n randB/=modAmt;\n break;\n case 6:\n randG/=modAmt;\n randB/=modAmt;\n break;\n default:\n break;\n }\n var hexR = (parseInt(randR) + parseInt(amt)).toString(16);\n var hexG = (parseInt(randG) + parseInt(amt)).toString(16);\n var hexB = (parseInt(randB) + parseInt(amt)).toString(16);\n amt=-40;\n tempArray.push(hexR + hexG + hexB); //pushing the 6 character string to a temporary array, one for light, one for dark\n }\n\n //Robin Colors\n var colors = [\"e50000\", \"db8e00\", \"ccc100\", \"02be01\", \"0083c7\", \"820080\"];\n var e = $usr.text().toLowerCase(),\n t = e.replace(/[^a-z0-9]/g, \"\"),\n n = parseInt(t, 36) % 6;\n\n //Cascading array used to add color schemes to master hex array on a 1:1 user:colorset basis\n //AKA, arrays within an array (multidimensional array)\n tempArray.push(colors[n]);\n hexArray.push(tempArray);\n //console.log(hexArray);\n GM_setValue(\"hexArrayStore\", hexArray); //Store array in scriptmonkey settings for later access\n }", "function generateColor(red, green, blue)\n{\n paintColor[0] = red;\n paintColor[1] = green;\n paintColor[2] = blue;\n}", "createColors(color, num) {\n //receive hex color from parent, return array of colors for gradient\n //num is # of generated color in return array\n let a = []\n let red = parseInt( color.substring(1, 3), 16)\n let green = parseInt(color.substring(3, 5), 16)\n let blue = parseInt(color.substring(5,7), 16)\n \n let k = 0.8 \n //from lighter colder to darker warmer\n // console.log(red, green, blue)\n for (i=0;i<num;i++) {\n let new_red = (Math.floor(red*k)).toString(16)\n let new_green = (Math.floor(green*k)).toString(16)\n let new_blue = (Math.floor(blue*k)).toString(16)\n let new_color = '#'+new_red+new_green+new_blue\n k += 0.1\n a.push(new_color)\n }\n return a\n\n }", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function generateRainbowColours() {\n var size = 16;\n rainbow = new Array(size);\n for (var i = 0; i < size; i++) {\n var red = sin_to_hex(i, 0 * Math.PI * 2 / 3); // 0 deg\n var blue = sin_to_hex(i, 1 * Math.PI * 2 / 3); // 120 deg\n var green = sin_to_hex(i, 2 * Math.PI * 2 / 3); // 240 deg\n rainbow[i] = \"#\" + red + green + blue;\n }\n function sin_to_hex(i, phase) {\n var sin = Math.sin(Math.PI / size * 2 * i + phase);\n var int = Math.floor(sin * 127) + 128;\n var hex = int.toString(16);\n return hex.length === 1 ? \"0\" + hex : hex;\n }\n }", "function generate_color(i){\n\t/* Colors should have well defined ordering.\n\t * First N colors are hardcoded, then colors are random\n\t * (must seed random number generator with deterministic value\n\t * before getting colors).\n\t */\n\treturn ( i < COLORS.length ) ? COLORS[i] : parseInt(0xffffff * Math.random());\n}", "function getNewColor() { \r\n\r\n symbols = \"012345679ABCDEF\";\r\n color = \"#\";\r\n\r\n //Generate random color using hex id\r\n for (let i = 0; i < 6; i++){\r\n color = color + symbols[Math.floor(Math.random() * 16)];\r\n }\r\n return color\r\n}", "function getColour() {\n var buildBlock = \"0123456789abcdef\"\n var hexCode = \"#\"\n\n for (i = 0; i < 6; i++) {\n\n randomNumber = Math.floor(Math.random() * 16)\n randomeBuildBlock = buildBlock[randomNumber]\n hexCode = hexCode + randomeBuildBlock \n\n }\n return hexCode\n}", "function colour() {\n //let c = Math.random();\n //console.log(c);\n //c = c.toString(16)\n //console.log(c)\n return '#' + Math.random().toString(16).substring(2,8); //substring (2,8) \n}", "function create_colour() {\r\n return \"#\" + colour_val[getRandom(0, 15)]\r\n + colour_val[getRandom(0, 15)]\r\n + colour_val[getRandom(0, 15)]\r\n + colour_val[getRandom(0, 15)]\r\n + colour_val[getRandom(0, 15)]\r\n + colour_val[getRandom(0, 15)];\r\n}", "function generateCreamPalette(){\n flag = 'false';\n var vRed = generateCream(generateRed()); //red\n var vOrange = generateCream(generateOrange()); //orange\n var vYellow = generateCream(generateYellow()); //yellow\n var vYellowGreen = generateCream(generateYellowGreen()); //yellowGreen\n var vGreen = generateCream(generateGreen()); //green\n var vGreenCyan = generateCream(generateGreenCyan()); //greenCyan\n var vCyan = generateCream(generateCyan()); //cyan\n var vCyanBlue = generateCream(generateCyanBlue()); //cyanBlue\n var vBlue = generateCream(generateBlue()); //blue\n var vBlueMagenta = generateCream(generateBlueMagenta()); //blueMagenta\n var vMagenta = generateCream(generateMagenta()); //magenta\n var vMagentaRed = generateCream(generateMagentaRed()); //magentaRed\n \n debug('Red=' + vRed + ' | Orange=' + vOrange + ' | Yellow=' + vYellow + ' | yellowGreen' + vYellowGreen \n + ' | Green=' + vGreen + ' | GreenCyan=' + vGreenCyan + ' | Cyan=' + vCyan + ' | CyanBlue=' + vCyanBlue \n + ' | Blue=' + vBlue + ' | BlueMagenta=' + vBlueMagenta + ' | Magenta=' + vMagenta \n + ' | MagentaRed=' + vMagentaRed); \n return [vRed, vOrange, vYellow, vYellowGreen, vGreen, vGreenCyan, vCyan, vCyanBlue, vBlue, vBlueMagenta, vMagenta, vMagentaRed];\n}", "function genColor() {\n var ret = []; // via http://stackoverflow.com/a/15804183\n\n if (next_color < 16777215) {\n ret.push(next_color & 0xff); // R\n\n ret.push((next_color & 0xff00) >> 8); // G\n\n ret.push((next_color & 0xff0000) >> 16); // B\n\n next_color += 10; // This is exaggerated for this example and would ordinarily be 1.\n } //if\n\n\n return 'rgb(' + ret.join(',') + ')';\n } //function genColor", "function genColor() {\n var ret = []; // via http://stackoverflow.com/a/15804183\n\n if (next_color < 16777215) {\n ret.push(next_color & 0xff); // R\n\n ret.push((next_color & 0xff00) >> 8); // G\n\n ret.push((next_color & 0xff0000) >> 16); // B\n\n next_color += 10; // This is exaggerated for this example and would ordinarily be 1.\n } //if\n\n\n return 'rgb(' + ret.join(',') + ')';\n } //function genColor", "function colorConverter (string) {\n \n// todo: study the Object.freeze \n const colorCodes = Object.freeze({\n \"blue\":\"rgb(40, 116, 237)\",\n \"brown\":\"rgb(255, 102, 102)\",\n \"brownish-red\":\"rgb(196, 136, 124)\",\n \"coral\":\"rgb(255, 102, 102)\",\n \"cream\":\"rgb(240, 237, 218)\",\n \"creamyWhite\":\"rgb(255, 253, 230)\",\n \"darkBlue\":\"rgb(0, 0, 153)\",\n \"darkPink\":\"rgb(255, 102, 153)\",\n \"darkPurple\":\"rgb(103, 0, 103)\",\n \"deepGreen\":\"rgb(0, 102, 0)\",\n \"deepPink\":\"rgb(212, 30, 90)\",\n \"emeraldGreen\":\"rgb(38, 115, 38)\",\n \"gold\":\"rgb(217, 195, 33)\",//stopped here, finish adding colors\n \"green\":\"rgb(50, 133, 59)\",\n \"greenish-white\":\"rgb(217, 242, 217)\",\n \"greenish-yellow\":\"rgb(230, 255, 179)\",\n \"indigoBlue\":\"rgb(74, 51, 222)\",\n \"lavender\":\"rgb(150, 153, 255)\",\n \"lightBlue\":\"rgb(179, 218, 255)\",\n \"lightGreen\":\"rgb(204, 255, 204)\",\n \"lightPink\":\"rgb(255, 204, 225)\",\n \"lilac\":\"rgb(230, 204, 255)\",\n \"magenta\":\"rgb(255, 0, 255)\",\n \"peach\":\"rgb(253, 217, 181)\",\n \"pink\":\"rgb(255, 102, 153)\",\n \"pinkish-lavender\":\"rgb(242, 211, 227)\",\n// \"purple and yellow\":\"rgba(0,100,0,0.75)\",//todo: need code instead of dark green\n \"purpleRed\":\"rgb(192, 0, 64)\",\n \"purplish-pink\":\"rgb(192, 96, 166)\",\n \"rose\":\"rgb(255, 153, 204)\",\n \"violet\":\"rgb(230, 130, 255)\",\n \"whiteAndPurple\":\"rgb(240, 240, 240)\",//todo: need code instead of dark green\n \"yellowish-green\":\"rgb(198, 210, 98)\", \n \"yellowCenter\":\"rgb(200, 200, 0)\"\n });\n \n //remove i_ (used to make inconspicuous) that might be in a name\n \n\t//if an rgb code is sent, return the color name\n if (string.slice(0,3) === \"rgb\") {\n for(let key in colorCodes) {\n if(colorCodes[key] === string) {\n return key;\n }\n }\n }\n //if a color name that needs to be converted is sent, return rgb\n else if (string in (colorCodes)) {\n return colorCodes[string];\n }\n //otherwise return a color name in camel case when needed\n //this is used when the color isn't listed in colorCodes, but\n //its name is valid as is or if converted to camel case notation\n else {\n return camelCase(string);\n }\n \n}", "function colorGeneration () {\n\tvar rgb = []; \n\tfor (var i=0; i<3;i++){\n\t\trgb[i] = Math.floor(Math.random() * 256); // gera numeros aleatorios entre 0 e 255\n\t}\n\treturn rgb; \n}", "function get_color(i, v, n) {\n var color_list = [\n d3.rgb(0, 0, 0), //black\n d3.rgb(230, 159, 0), // orange\n d3.rgb(86, 180, 233), // sky blue\n d3.rgb(0, 158, 115), // bluish green\n d3.rgb(240, 228, 66), // yellow\n d3.rgb(0, 114, 178), // blue\n d3.rgb(213, 94, 0), // vermilion\n d3.rgb(204, 121, 167) // reddish purple\n ];\n if (v === (false || null)) {\n return '#eeeeee';\n }\n var c = color_list[(i + 8) % 8],\n m = 3,\n r = (255 - (255 - c.r) / m - c.r) * (n - v) / n + c.r,\n g = (255 - (255 - c.g) / m - c.g) * (n - v) / n + c.g,\n b = (255 - (255 - c.b) / m - c.b) * (n - v) / n + c.b\n ;\n return d3.rgb(r, g, b);\n }", "generateColors(itemCount) {\r\n let colors = [];\r\n let number = Math.round(360 / itemCount);\r\n //this loop splits the colour spectrum evenly and gives each\r\n //div a colour so that when in order, they resemble the colour spectrum\r\n for (let i = 0; i < itemCount; i++) {\r\n let color = chroma(\"#ff0000\");\r\n colors.push(color.set(\"hsl.h\", i * number));\r\n }\r\n return colors;\r\n }", "function printColors() {\n\treturn \"<div class=\\\"column\\\">\" + mutateColor(hex, 255, 0, 0, 0, 1, true) + mutateColor(hex, 0, 255, 0, 0, 1, true) + mutateColor(hex, 0, 0, 255, 0, 1, true) + mutateColor(hex, 255, 255, 0, 0, 1, true) + mutateColor(hex, 0, 255, 255, 0, 1, true) + mutateColor(hex, 255, 0, 255, 0, 1, true) + mutateColor(hex, 255, 255, 255, 0, 1, true) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 128, -32, 0, 0, 1, false) + mutateColor(hex, 0, 128, -32, 0, 1, false) + mutateColor(hex, -32, 0, 128, 0, 1, false) + mutateColor(hex, 128, 128, 0, 0, 1, false) + mutateColor(hex, 0, 128, 128, 0, 1, false) + mutateColor(hex, 128, 0, 128, 0, 1, false) + mutateColor(hex, 128, 128, 128, 0, 1, false) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 32, 0, 0, 0, 7, false) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 0, 32, 0, 0, 7, false) + \"</div>\" +\n\t\t\t\"<div class=\\\"column\\\">\" + mutateColor(hex, 0, 0, 32, 0, 7, false) + \"</div>\";\n}", "function addColors() {\n\tvar temp = \"rgb(\" + generateRGB() + \", \" + generateRGB() + \", \" + generateRGB() + \")\";\n\treturn temp;\n}", "function randomColors() {\r\n return '#' + Math.floor(Math.random() * 16777215).toString(16);\r\n}", "function composeColor() {\n return [rand256(), rand256(), rand256()];\n}", "function clrs(i, j) {\n clr_list = [\n [0, 0, 0],\n [255, 255, 255],\n [204, 82, 82],\n [204, 163, 82],\n [163, 204, 82],\n [82, 204, 82],\n [82, 204, 163],\n [82, 163, 204],\n [82, 82, 204],\n [163, 82, 204],\n [204, 82, 163],\n [204, 82, 82]\n ];\n var tmp = clr_list[i];\n var foo = d3.rgb(tmp[0], tmp[1], tmp[2])\n return d3.rgb(tmp[0], tmp[1], tmp[2]).darker(2.5).brighter(j * 5);\n}", "function color (i){\n\tif (i===0){\n\t\treturn \"rgb(1, 95, 102)\";\n\t} else if (i===1) {\n\t\treturn \"rgb(45, 241, 255)\";\n\t} else if (i===2) {\n\t\treturn \"rgb(34, 86, 150)\";\n\t} else if (i===3) {\n\t\treturn \"rgb(0, 132, 88)\";\n\t} else if (i===4) {\n\t\treturn \"rgb(56, 255, 188)\";\n\t} else if (i===5) {\n\t\treturn \"rgb(77, 168, 137)\";\n\t} else {\n\t\treturn \"rgb(1, 95, 102)\";\n\t}\n}", "function randomColors() {\n return '#' + Math.floor(Math.random() * 16777215).toString(16);\n}", "function getColorGenerator() {\n var hsv = [90, 90, 90];\n var seed = 0;\n return function () {\n hsv[0] = (hsv[0]+60) % 360;\n\n seed++;\n\n if (seed % 6 === 0) {\n hsv[0] = (hsv[0]+30) % 360;\n hsv[1] = (hsv[1]+30) % 100;\n hsv[2] = (hsv[2]+20) % 100;\n }\n\n if (hsv[1] < 45) hsv[1] = 45;\n if (hsv[2] < 50) hsv[2] = 50;\n\n var rgb = colorconverter.hsv(hsv[0], hsv[1], hsv[2]).rgb();\n return 'rgb('+rgb[0]+','+rgb[1]+','+rgb[2]+')';\n };\n}", "createColorsArray() {\n const _hexadecimals = '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f';\n const hexadecimals = _hexadecimals.split(',');\n const colorsArray = [];\n\n // mesaure time needed to create an array\n const startTime = performance.now();\n\n while (colorsArray.length < this.pairs) {\n let hexColor = '';\n\n for (let j = 0; j < 6; j++) {\n const randomIndex = Math.floor(Math.random() * hexadecimals.length);\n hexColor += hexadecimals[randomIndex];\n }\n\n hexColor = `#${hexColor}`;\n\n // if that color does not exist yet, push it to the array\n // else iterate again\n if (colorsArray.indexOf(hexColor) === -1)\n colorsArray.push(hexColor);\n }\n\n const endTime = performance.now();\n const creationTime = endTime - startTime;\n\n // double array to make every color have a pair\n const pairedColorsArray = colorsArray.concat(colorsArray);\n\n // function returns object maybe for future purposes\n return {\n pairedColors: pairedColorsArray,\n colors: colorsArray,\n time: creationTime,\n };\n }", "function generatePastelPalette(){\n var vRed = generatePastel(generateRed()); //red\n var vOrange = generatePastel(generateOrange()); //orange\n var vYellow = generatePastel(generateYellow()); //yellow\n var vYellowGreen = generatePastel(generateYellowGreen()); //yellowGreen\n var vGreen = generatePastel(generateGreen()); //green\n var vGreenCyan = generatePastel(generateGreenCyan()); //greenCyan\n var vCyan = generatePastel(generateCyan()); //cyan\n var vCyanBlue = generatePastel(generateCyanBlue()); //cyanBlue\n var vBlue = generatePastel(generateBlue()); //blue\n var vBlueMagenta = generatePastel(generateBlueMagenta()); //blueMagenta\n var vMagenta = generatePastel(generateMagenta()); //magenta\n var vMagentaRed = generatePastel(generateMagentaRed()); //magentaRed\n \n debug('Red=' + vRed + ' | Orange=' + vOrange + ' | Yellow=' + vYellow + ' | yellowGreen' + vYellowGreen \n + ' | Green=' + vGreen + ' | GreenCyan=' + vGreenCyan + ' | Cyan=' + vCyan + ' | CyanBlue=' + vCyanBlue \n + ' | Blue=' + vBlue + ' | BlueMagenta=' + vBlueMagenta + ' | Magenta=' + vMagenta \n + ' | MagentaRed=' + vMagentaRed); \n return [vRed, vOrange, vYellow, vYellowGreen, vGreen, vGreenCyan, vCyan, vCyanBlue, vBlue, vBlueMagenta, vMagenta, vMagentaRed];\n}", "function getColour(){\n return 'rgb(' + _.random(0, 255) + ',' + _.random(0, 255) + ',' + _.random(0, 255) + ')';\n }", "function getColour(){\n return 'rgb(' + _.random(0, 255) + ',' + _.random(0, 255) + ',' + _.random(0, 255) + ')';\n }", "function pColor(piece){ return piece.charCodeAt(0) }", "function generateColor(){\r\n const color=\"rgb(\"+genColorVal()+\", \"+genColorVal()+\", \"+genColorVal()+\")\";\r\n return color;\r\n }", "function randomColorGen(){\n // return `#${Math.floor(Math.random()*16777215).toString(16)}`;\n return \"#\" + Math.random().toString(16).slice(2, 8)\n}", "function _createColorVariations() {\n var colors = { waveColor: [], progressColor: [] };\n for (var c in colors) {\n var tmp = WP.UTILS.hex2rgb(this._params[c]);\n colors[c].push(tmp);\n tmp = WP.UTILS.rgb2hsv(tmp);\n colors[c].push(WP.UTILS.hsv2rgb({ h: tmp.h, s: tmp.s, v: tmp.v*1.4 }));\n }\n colors.dc = {\n r: (colors.waveColor[0].r - colors.progressColor[0].r),\n g: (colors.waveColor[0].g - colors.progressColor[0].g),\n b: (colors.waveColor[0].b - colors.progressColor[0].b)\n };\n return colors;\n }", "function getRandomColor(){\n var letters = '0123456789ABCDEF'.split('');//splitting a string into an array\n //var letters is an array and '0123456789ABCDEF' is a string\n var color = '#';//colors in html start with a #\n for (var i = 0;i<6;i++)\n {\n color += letters[Math.floor(Math.random()*16)];//concatinate the array to color which already has a '#' at the start\n }\n return color;\n}", "function makeColors() {\n colors.push([\"rgb(205,230,245)\",\"rgb(141,167,190)\"])\n colors.push([\"rgb(24,169,153)\",\"rgb(72,67,73)\"])\n colors.push([\"rgb(24,169,153)\",\"rgb(242,244,243)\"])\n colors.push([\"rgb(237,242,244)\",\"rgb(43,45,66)\"])\n colors.push([\"rgb(192,248,209)\",\"rgb(189,207,181)\"])\n colors.push([\"rgb(141,177,171)\",\"rgb(88,119,146)\"])\n colors.push([\"rgb(80,81,104)\",\"rgb(179,192,164)\"])\n colors.push([\"rgb(34,34,34)\",\"rgb(99,159,171)\"])\n}", "function createColor()\n\t{\n\t\tvar expColor = '#'+(Math.random()*0xFFFFFF<<0).toString(16);\n\t\t//alert(expColor);\n\t\treturn expColor;\n\n\n\t}", "function generateBrightPalette(){\n var vRed = generateBright(generateRed()); //red\n var vOrange = generateBright(generateOrange()); //orange\n var vYellow = generateBright(generateYellow()); //yellow\n var vYellowGreen = generateBright(generateYellowGreen()); //yellowGreen\n var vGreen = generateBright(generateGreen()); //green\n var vGreenCyan = generateBright(generateGreenCyan()); //greenCyan\n var vCyan = generateBright(generateCyan()); //cyan\n var vCyanBlue = generateBright(generateCyanBlue()); //cyanBlue\n var vBlue = generateBright(generateBlue()); //blue\n var vBlueMagenta = generateBright(generateBlueMagenta()); //blueMagenta\n var vMagenta = generateBright(generateMagenta()); //magenta\n var vMagentaRed = generateBright(generateMagentaRed()); //magentaRed\n \n debug('Red=' + vRed + ' | Orange=' + vOrange + ' | Yellow=' + vYellow + ' | yellowGreen' + vYellowGreen \n + ' | Green=' + vGreen + ' | GreenCyan=' + vGreenCyan + ' | Cyan=' + vCyan + ' | CyanBlue=' + vCyanBlue \n + ' | Blue=' + vBlue + ' | BlueMagenta=' + vBlueMagenta + ' | Magenta=' + vMagenta \n + ' | MagentaRed=' + vMagentaRed); \n return [vRed, vOrange, vYellow, vYellowGreen, vGreen, vGreenCyan, vCyan, vCyanBlue, vBlue, vBlueMagenta, vMagenta, vMagentaRed];\n}", "function makeRandoColor(){\r\n var rc = 'rgb(' + (Math.floor((256-229)*Math.random()) + 230) + ',' + \r\n (Math.floor((256-190)*Math.random()) + 220) + ',' + \r\n (Math.floor((256-190)*Math.random()) + 200) + ')';\r\n return rc;\r\n}", "function generateColor () {\n // GENERATE RANDOM RGB VALUES\n generateRandomColorValues();\n\n // USE THESE COLORS TO UPDATE APP\n setColors();\n\n // ADD NEW COLOR TO THE ARRAY\n updateColorArray();\n}", "function generateJewelPalette(){\n flag = 'false';\n var vRed = generateJewel(generateRed()); //red\n var vOrange = generateJewel(generateOrange()); //orange\n var vYellow = generateJewel(generateYellow()); //yellow\n var vYellowGreen = generateJewel(generateYellowGreen()); //yellowGreen\n var vGreen = generateJewel(generateGreen()); //green\n var vGreenCyan = generateJewel(generateGreenCyan()); //greenCyan\n var vCyan = generateJewel(generateCyan()); //cyan\n var vCyanBlue = generateJewel(generateCyanBlue()); //cyanBlue\n var vBlue = generateJewel(generateBlue()); //blue\n var vBlueMagenta = generateJewel(generateBlueMagenta()); //blueMagenta\n var vMagenta = generateJewel(generateMagenta()); //magenta\n var vMagentaRed = generateJewel(generateMagentaRed()); //magentaRed\n \n debug('Red=' + vRed + ' | Orange=' + vOrange + ' | Yellow=' + vYellow + ' | yellowGreen' + vYellowGreen \n + ' | Green=' + vGreen + ' | GreenCyan=' + vGreenCyan + ' | Cyan=' + vCyan + ' | CyanBlue=' + vCyanBlue \n + ' | Blue=' + vBlue + ' | BlueMagenta=' + vBlueMagenta + ' | Magenta=' + vMagenta \n + ' | MagentaRed=' + vMagentaRed); \n return [vRed, vOrange, vYellow, vYellowGreen, vGreen, vGreenCyan, vCyan, vCyanBlue, vBlue, vBlueMagenta, vMagenta, vMagentaRed];\n}", "function generateDeepPalette(){\n flag = 'false';\n var vRed = generateDeep(generateRed()); //red\n var vOrange = generateDeep(generateOrange()); //orange\n var vYellow = generateDeep(generateYellow()); //yellow\n var vYellowGreen = generateDeep(generateYellowGreen()); //yellowGreen\n var vGreen = generateDeep(generateGreen()); //green\n var vGreenCyan = generateDeep(generateGreenCyan()); //greenCyan\n var vCyan = generateDeep(generateCyan()); //cyan\n var vCyanBlue = generateDeep(generateCyanBlue()); //cyanBlue\n var vBlue = generateDeep(generateBlue()); //blue\n var vBlueMagenta = generateDeep(generateBlueMagenta()); //blueMagenta\n var vMagenta = generateDeep(generateMagenta()); //magenta\n var vMagentaRed = generateDeep(generateMagentaRed()); //magentaRed\n \n debug('Red=' + vRed + ' | Orange=' + vOrange + ' | Yellow=' + vYellow + ' | yellowGreen' + vYellowGreen \n + ' | Green=' + vGreen + ' | GreenCyan=' + vGreenCyan + ' | Cyan=' + vCyan + ' | CyanBlue=' + vCyanBlue \n + ' | Blue=' + vBlue + ' | BlueMagenta=' + vBlueMagenta + ' | Magenta=' + vMagenta \n + ' | MagentaRed=' + vMagentaRed); \n return [vRed, vOrange, vYellow, vYellowGreen, vGreen, vGreenCyan, vCyan, vCyanBlue, vBlue, vBlueMagenta, vMagenta, vMagentaRed];\n}", "function generateColor() {\n\tvar array = [];\n\tfor (var i = 0; i < 3; i++) {\n\t\tvar number = Math.floor(Math.random() * 256);\n\t\tarray.push(number);\n\t} \n\tvar newRgb = \"rgb(\" + array[0] + \",\" + array[1] + \",\" + array[2] + \")\";\n\treturn newRgb;\n}", "function generateColor(r, g, b)\n{\n\treturn \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n}", "function colorGenerator(num) {\n\treturn (num % 2 === 0) ? \"yellow\" : \"blue\";\n}", "function buildPalette() {\n let r = 255,\n g = 0,\n b = 0;\n \n for (g = 0; g <= 255; g++) {\n addToPalette(r, g, b);\n }\n g--;\n \n for (r = 254; r >= 0; r--) {\n addToPalette(r, g, b);\n }\n r++;\n \n for (b = 1; b <= 255; b++) {\n addToPalette(r, g, b);\n }\n b--;\n \n for (g = 254; g >= 0; g--) {\n addToPalette(r, g, b);\n }\n g++;\n \n for (r = 1; r <= 255; r++) {\n addToPalette(r, g, b);\n }\n r--;\n \n for (b = 254; b > 0; b--) {\n addToPalette(r, g, b);\n }\n b++;\n \n function addToPalette(r, g, b) {\n palette.push({\n r,\n g,\n b,\n color: `rgb(${r},${g},${b})`\n });\n }\n \n console.log(palette);\n }", "function genColor(seed) {\n const CHART_COLOURS = [\n 'rgba(255,0,0,0.66)',\n 'rgba(255,128,0,0.66)',\n 'rgba(255,255,0,0.62)',\n 'rgba(128,255,0,0.6)',\n 'rgba(0,255,255,0.47)',\n 'rgba(0,64,255,0.5)',\n 'rgba(191,0,255,0.53)'];\n if (seed < CHART_COLOURS.length) {\n return CHART_COLOURS[seed];\n } else {\n return '#000000';\n }\n}", "function gencolor() {\n len = _COLOR.length;\n rand = Math.floor(Math.random()*len); \n return _COLOR[rand];\n }", "function colorGenerator() {\n var redColor = Math.floor(Math.random() * 256) + 1;\n var greenColor = Math.floor(Math.random() * 256) + 1;\n var blueColor = Math.floor(Math.random() * 256) + 1;\n var rgb = redColor + ', ' + greenColor + ', ' + blueColor;\n document.body.style.backgroundColor = 'rgb(' + [redColor, greenColor, blueColor].join(',') + ')';\n}", "function ColorList() {}", "function getColor() {\n var i = 0;\n while (takenColor[i]) {\n i++;\n }\n takenColor[i] = true;\n return color[i];\n}", "function colourNameToHex(colour)\n {\n var colours = {\"aliceblue\":\"#f0f8ff\",\"antiquewhite\":\"#faebd7\",\"aqua\":\"#00ffff\",\"aquamarine\":\"#7fffd4\",\"azure\":\"#f0ffff\",\n \"beige\":\"#f5f5dc\",\"bisque\":\"#ffe4c4\",\"black\":\"#000000\",\"blanchedalmond\":\"#ffebcd\",\"blue\":\"#0000ff\",\"blueviolet\":\"#8a2be2\",\"brown\":\"#a52a2a\",\"burlywood\":\"#deb887\",\n \"cadetblue\":\"#5f9ea0\",\"chartreuse\":\"#7fff00\",\"chocolate\":\"#d2691e\",\"coral\":\"#ff7f50\",\"cornflowerblue\":\"#6495ed\",\"cornsilk\":\"#fff8dc\",\"crimson\":\"#dc143c\",\"cyan\":\"#00ffff\",\n \"darkblue\":\"#00008b\",\"darkcyan\":\"#008b8b\",\"darkgoldenrod\":\"#b8860b\",\"darkgray\":\"#a9a9a9\",\"darkgreen\":\"#006400\",\"darkkhaki\":\"#bdb76b\",\"darkmagenta\":\"#8b008b\",\"darkolivegreen\":\"#556b2f\",\n \"darkorange\":\"#ff8c00\",\"darkorchid\":\"#9932cc\",\"darkred\":\"#8b0000\",\"darksalmon\":\"#e9967a\",\"darkseagreen\":\"#8fbc8f\",\"darkslateblue\":\"#483d8b\",\"darkslategray\":\"#2f4f4f\",\"darkturquoise\":\"#00ced1\",\n \"darkviolet\":\"#9400d3\",\"deeppink\":\"#ff1493\",\"deepskyblue\":\"#00bfff\",\"dimgray\":\"#696969\",\"dodgerblue\":\"#1e90ff\",\n \"firebrick\":\"#b22222\",\"floralwhite\":\"#fffaf0\",\"forestgreen\":\"#228b22\",\"fuchsia\":\"#ff00ff\",\n \"gainsboro\":\"#dcdcdc\",\"ghostwhite\":\"#f8f8ff\",\"gold\":\"#ffd700\",\"goldenrod\":\"#daa520\",\"gray\":\"#808080\",\"green\":\"#008000\",\"greenyellow\":\"#adff2f\",\n \"honeydew\":\"#f0fff0\",\"hotpink\":\"#ff69b4\",\n \"indianred \":\"#cd5c5c\",\"indigo\":\"#4b0082\",\"ivory\":\"#fffff0\",\"khaki\":\"#f0e68c\",\n \"lavender\":\"#e6e6fa\",\"lavenderblush\":\"#fff0f5\",\"lawngreen\":\"#7cfc00\",\"lemonchiffon\":\"#fffacd\",\"lightblue\":\"#add8e6\",\"lightcoral\":\"#f08080\",\"lightcyan\":\"#e0ffff\",\"lightgoldenrodyellow\":\"#fafad2\",\n \"lightgrey\":\"#d3d3d3\",\"lightgreen\":\"#90ee90\",\"lightpink\":\"#ffb6c1\",\"lightsalmon\":\"#ffa07a\",\"lightseagreen\":\"#20b2aa\",\"lightskyblue\":\"#87cefa\",\"lightslategray\":\"#778899\",\"lightsteelblue\":\"#b0c4de\",\n \"lightyellow\":\"#ffffe0\",\"lime\":\"#00ff00\",\"limegreen\":\"#32cd32\",\"linen\":\"#faf0e6\",\n \"magenta\":\"#ff00ff\",\"maroon\":\"#800000\",\"mediumaquamarine\":\"#66cdaa\",\"mediumblue\":\"#0000cd\",\"mediumorchid\":\"#ba55d3\",\"mediumpurple\":\"#9370d8\",\"mediumseagreen\":\"#3cb371\",\"mediumslateblue\":\"#7b68ee\",\n \"mediumspringgreen\":\"#00fa9a\",\"mediumturquoise\":\"#48d1cc\",\"mediumvioletred\":\"#c71585\",\"midnightblue\":\"#191970\",\"mintcream\":\"#f5fffa\",\"mistyrose\":\"#ffe4e1\",\"moccasin\":\"#ffe4b5\",\n \"navajowhite\":\"#ffdead\",\"navy\":\"#000080\",\n \"oldlace\":\"#fdf5e6\",\"olive\":\"#808000\",\"olivedrab\":\"#6b8e23\",\"orange\":\"#ffa500\",\"orangered\":\"#ff4500\",\"orchid\":\"#da70d6\",\n \"palegoldenrod\":\"#eee8aa\",\"palegreen\":\"#98fb98\",\"paleturquoise\":\"#afeeee\",\"palevioletred\":\"#d87093\",\"papayawhip\":\"#ffefd5\",\"peachpuff\":\"#ffdab9\",\"peru\":\"#cd853f\",\"pink\":\"#ffc0cb\",\"plum\":\"#dda0dd\",\"powderblue\":\"#b0e0e6\",\"purple\":\"#800080\",\n \"rebeccapurple\":\"#663399\",\"red\":\"#ff0000\",\"rosybrown\":\"#bc8f8f\",\"royalblue\":\"#4169e1\",\n \"saddlebrown\":\"#8b4513\",\"salmon\":\"#fa8072\",\"sandybrown\":\"#f4a460\",\"seagreen\":\"#2e8b57\",\"seashell\":\"#fff5ee\",\"sienna\":\"#a0522d\",\"silver\":\"#c0c0c0\",\"skyblue\":\"#87ceeb\",\"slateblue\":\"#6a5acd\",\"slategray\":\"#708090\",\"snow\":\"#fffafa\",\"springgreen\":\"#00ff7f\",\"steelblue\":\"#4682b4\",\n \"tan\":\"#d2b48c\",\"teal\":\"#008080\",\"thistle\":\"#d8bfd8\",\"tomato\":\"#ff6347\",\"turquoise\":\"#40e0d0\",\n \"violet\":\"#ee82ee\",\n \"wheat\":\"#f5deb3\",\"white\":\"#ffffff\",\"whitesmoke\":\"#f5f5f5\",\n \"yellow\":\"#ffff00\",\"yellowgreen\":\"#9acd32\"};\n\n if (typeof colours[colour.toLowerCase()] != 'undefined')\n return colours[colour.toLowerCase()];\n\n return false;\n }", "getColor(i) {\n switch(i) {\n case 1:\n return 'blue';\n case 2:\n return 'red';\n case 3:\n return 'yellow';\n default:\n return 'grey';\n }\n }", "function get_random_color()\r\n {\r\n \r\n var letters = '0123456789ABCDEF'.split('');\r\n var color = '#';\r\n for (var i = 0; i < 6; i++ ) \r\n {\r\n color += letters[Math.round(Math.random() * 15)];\r\n }\r\n return color;\r\n}", "function color(i) {\n\tlet ret = \"white\";\n\tswitch (i) {\n\t\tcase 0:\n\t\t\tret = \"bisque\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tret = \"lightgreen\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tret = \"lightsalmon\";\n\t\t\tbreak;\n\t\tdefault:\n\t}\n\treturn ret;\n}", "function paintColor(d, i){\n if (i < n){\n tog(color, i / ( n + 2) );\n } else {\n var k = Math.floor(i/n);\n var num = ( 2 * k + 1);\n var dem = Math.pow(2, Math.ceil( Math.log(k + 1) / Math.LN2 ));\n var added = ( num / dem ) % 1;\n tog(color, (i % n + added) / ( n + 2) );\n }\n vec3.scale( color, color, 100);\n \n return [\n \"color:rgb( \", \n Math.round(color[0]), \"%,\", \n Math.round(color[1]), \"%,\",\n Math.round(color[2]), \"% )\"\n ].join(\"\");\n }", "function color(n) {\r\n // rgb\r\n return `hsl(${n * quickcol * 360},100%,50%)`;\r\n // default\r\n return `hsl(${n * quickcol * 360},${20+n*quickcol*50}%,${n * quickcol * 100}%)`;\r\n // gray-scaled\r\n return `hsl(0, 0%, ${100 - n * quickcol * 100}%)`;\r\n}", "makeGradient() {\n let low = 0;\n let high = (255*255*255);\n let step = Math.floor(high/(this.props.data.length));\n let colors = [];\n \n // Create gradients\n for (var key in this.props.data) {\n low += step;\n colors.push(\n ('#' + low.toString(16))\n );\n }\n\n // Shuffle and return\n return colors.sort(\n (a, b) => {\n return (Math.random()-Math.random());\n });\n }", "function getColors(len){\r\n\tfor(var i=0 ; i<len ; i++ )\r\n\t{\r\n\t\tcolorArr[i]=generateColor();\r\n\t}\r\n}", "function getRandomColor() {\r\n var letters = \"0123456789ABCDEF\";\r\n var color = \"#\";\r\n\r\n for (var i = 0; i < 6; i++) {\r\n color += letters[Math.floor(Math.random() * 16)];\r\n }\r\n return color;\r\n} // end getRandomColor()", "function getColors(datalen) {\n const colorList =\n ['rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)',\n 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)',\n 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)',\n 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)',\n 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)',\n 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)',\n 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)',\n 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)',\n 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)',\n 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)',\n 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)',\n 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)', 'rgb(255,0,255)',\n 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)', 'rgb(128,0,128)',\n 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)', 'rgb(0,255,255)',\n 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)', 'rgb(0,128,0)',\n 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)', 'rgb(0,255,0)', 'rgb(0,0,255)', 'rgb(255,255,0)',\n 'rgb(0,255,255)', 'rgb(255,0,255)', 'rgb(192,192,192)', 'rgb(128,128,128)', 'rgb(128,0,0)', 'rgb(128,128,0)',\n 'rgb(0,128,0)', 'rgb(128,0,128)', 'rgb(0,128,128)', 'rgb(0,0,128)'\n ];\n return colorList.slice(0, datalen);\n}", "function generateColours(num) {\n let array = [];\n\n for (i = 0; i < num; i++) {\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n\n array.push(`rgb(${r}, ${g}, ${b})`);\n }\n\n return array;\n}", "function getColor(){\n //var colors = [ \"rgba(237, 106, 90, 1)\", \"rgba(247, 244, 205, 1)\", \"rgba(155, 193, 188, 1)\", \"rgba(92, 164, 169, 1)\", \"rgba(230, 235, 224, 1)\"];\n var colors = cscheme;\n\n //generates random n to select a color from the array above\n //if new color (colors[n]) is equal to last color selected, it loops again to not repeat colors\n do{\n n = Math.floor(Math.random() * colors.length);\n }while( colors[n] === color );\n\n return colors[n];\n }", "function color() {\n var colors = ['red', 'indigo', 'blue', 'green', 'darkgreen', 'maroon',\n 'brown', 'tomato', 'darkblue', 'violet', 'orange', 'pink'\n ];\n return colors[Math.floor(Math.random() * 8)];\n}", "function getRandomColour() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (let i = 0; i < 6; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n return color;\n}", "function rcol() {\n colors = ['#f5f2e6','#040204','#306dc9','#D1AE45','#b53012'];\n index = int(random(0,colors.length));\n print(index);\n return color(colors[index]);\n}", "function colorRGB(){\n var coolor = \"(\"+generarNumero(255)+\",\" + generarNumero(255) + \",\" + generarNumero(255) +\")\";\n return \"rgb\" + coolor;\n }", "function getRandomColor() // function to choose random color of shape\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar letters= '1234567890ABCDEF'.split(''); //spiliting the digits and alphabets randomly to make different color combinations\n\t\t\t\t\t\t\t\t\t\tvar color= '#';\n\t\t\t\t\t\t\t\t\t\t\tfor(i=0; i<6 ; i++)\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\t\tcolor += letters[Math.floor(Math.random() * 16 )]; //setting to a round off digit rather than a decimal one\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\treturn color;\n\t\t\t\t\t\t\t\t\t}", "function llenarColores(){\n\n\t\tvar colores = [];\n\t\tfor(i=0;i<numColores;i++)\n\t\t\t{\n\t\t\t\tcolores[i] = colorRandom();\n\t\t\t}\n\t\treturn colores;\n}", "function rainbowColorText(str){\r\n\tvar phase = 0, center = 128, width = 127, frequency = Math.PI*2/str.length, totalString = '';\r\n\tvar div = document.createElement('div');\r\n\tvar escape = document.createElement('textarea');\r\n\tdiv.innerHTML = str;\r\n\tif(div.firstChild !== null && div.firstChild !== undefined){\r\n\t\tvar decoded = div.firstChild.nodeValue;\r\n\t}else{\r\n\t\tvar decoded = '';\r\n\t}\r\n\tfor(var i=0; i<decoded.length; ++i){\r\n\t\tred = parseInt(Math.sin(frequency*i+2+phase) * width + center);\r\n\t\tgreen = parseInt(Math.sin(frequency*i+0+phase) * width + center);\r\n\t\tblue = parseInt(Math.sin(frequency*i+4+phase) * width + center);\r\n\t\tescape.innerHTML = decoded.substr(i,1);\r\n\t\ttotalString += '<span style=\"color:' + RGB2Color(red,green,blue) + '\">' + escape.innerHTML + '</span>';\r\n\t}\r\n\treturn totalString;\r\n}", "function generateRandomColour(){\n\n var colour=[];\n\n for(var i=0;i<3;i++){\n colour.push(Math.floor(Math.random() * 255));\n }\n\n\n return `rgb(${colour[0]},${colour[1]},${colour[2]},0.8)`;\n\n\n}", "function rand_color(n){\n\tdiff = Math.floor(Math.random() * n);\n\n\tif (diff_prev == diff){\n\t\tdiff = Math.floor(Math.random() * n);\n\t}\n\tdiff_prev == diff;\n\tvar r = Math.floor(Math.random() * 256);\n\tvar g = Math.floor(Math.random() * 256);\n\tvar b = Math.floor(Math.random() * 256);\n\tvar rd=r, gd=g, bd=b;\n\tvar rand = Math.floor(Math.random() * 3);\n\t\n\tif(cnt == 40) h = 10;\n\t\n\tswitch(rand){\n\t\tcase 0 : ((r-h) < 0) ? rd = (r+h) : rd = (r-h);\n\t\t\t\t((g-h) < 0) ? gd = (g+h) : gd = (g-h);\n\t\t\t\tbreak;\n\t\tcase 1 : ((r-h) < 0) ? rd = (r+h) : rd = (r-h);\n\t\t\t\t((b-h) < 0) ? bd = (b+h) : bd = (b-h);\n\t\t\t\tbreak;\n\t\tcase 2 : ((g-h) < 0) ? gd = (g+h) : gd = (g-h);\n\t\t\t\t((b-h) < 0) ? bd = (b+h) : bd = (b-h);\n\t\t\t\tbreak;\n\t}\n\tgener_color = \"rgb(\"+r+\", \"+g+\", \"+b+\")\";\n\ttrans_color = \"rgb(\"+rd+\", \"+gd+\", \"+bd+\")\";\n\t//span_gen_color.textContent = gener_color;\n\t//span_trs_color.textContent = trans_color;\n\t//span_diff_pos.textContent = diff+1;\t\n}", "function colourCode(c)\n{\n\thtmlTag = /(&lt;([\\s\\S]*?)&gt;)/gi;\n\ttableTag = /(&lt;(table|tbody|th|tr|td|\\/table|\\/tbody|\\/th|\\/tr|\\/td)([\\s\\S]*?)&gt;)/gi;\n\tcommentTag = /(&lt;!--([\\s\\S]*?)&gt;)/gi;\n\timageTag = /(&lt;img([\\s\\S]*?)&gt;)/gi;\n\tobjectTag = /(&lt;(object|\\/object)([\\s\\S]*?)&gt;)/gi;\n\tlinkTag = /(&lt;(a|\\/a)([\\s\\S]*?)&gt;)/gi;\n\tscriptTag = /(&lt;(script|\\/script)([\\s\\S]*?)&gt;)/gi;\n\theadlinkTag = /(&lt;link([^&]*?)(borders.css)([^&]*?)&gt;<br\\/>)/gi;\n\tc = c.replace(headlinkTag,\"\");\n\theadlinkTag2 = /(&lt;link([^&]*?)(borders.css)([^&]*?)&gt;)/gi;\n\tc = c.replace(headlinkTag2,\"\");\n\n\tb2 = \"</font>\";\n\tb1 = \"<font color=#000080>\";\n\tc = c.replace(headlinkTag,\"\");\n\tc = c.replace(htmlTag,b1+\"$1\"+b2);\n\tc = c.replace(tableTag,\"<font color=#008080>$1\"+b2);\n\tc = c.replace(commentTag,\"<font color=#808080>$1\"+b2);\n\tc = c.replace(imageTag,\"<font color=#800080>$1\"+b2);\n\tc = c.replace(objectTag,\"<font color=#840000>$1\"+b2);\n\tc = c.replace(linkTag,\"<font color=#008000>$1\"+b2);\n\tc = c.replace(scriptTag,\"<font color=#800000>$1\"+b2);\n\treturn c;\n}", "function generateColor() {\n const ranges = [\n [150, 256],\n [0, 190],\n [0, 30]\n ];\n var g = function() {\n var range = ranges.splice(Math.floor(Math.random() * ranges.length), 1)[0];\n return Math.floor(Math.random() * (range[1] - range[0])) + range[0];\n }\n return \"rgb(\" + g() + \",\" + g() + \",\" + g() + \")\";\n }", "function generateColor(){\r\n\tvar i,j,k;\r\n\t i=Math.floor(Math.random()*255 + 1);\r\n\t j=Math.floor(Math.random()*255 + 1);\r\n\t k=Math.floor(Math.random()*255 + 1);\r\n\r\n\t \r\n\t return \"rgb(\" + i + \", \" + j +\", \" + k + \")\" ;\r\n}", "function uvColor (index) {\n if (index > 0 && index < 3 ) {\n green (index)\n }\n else if (index > 3 && index < 5 ) {\n yellow (index)\n }\n else if (index > 3 && index < 5 ) {\n yellow (index)\n }\n else if (index > 5 && index < 8 ) {\n orange (index)\n }\n else if (index > 8 && index < 11 ) {\n red (index)\n }\n else if (index > 11) {\n violet (index)\n }\n $(`#uvIndex2`).html(`\n <span> ${ index }</span>\n `) \n }", "function jumbleTitleColors() {\n $(\"#title h1\").children().removeClass();\n var id;\n for (var i=1; i <= 10; i++) {\n id = \"#char\" + i.toString();\n $(id).addClass(returnRandomColorClass());\n }\n }", "function randomColorGenerator() {\n\t\t\t\t\t\t\treturn '#'\n\t\t\t\t\t\t\t\t\t+ (Math.random().toString(16) + '0000000')\n\t\t\t\t\t\t\t\t\t\t\t.slice(2, 8);\n\t\t\t\t\t\t}", "function getColourSchemes() {\n \n \n // addColourList();\n palettes = [\"#ffffe5\", \"#f7fcb9\", \"#d9f0a3\", \"#addd8e\", \"#78c679\", \"#41ab5d\", \"#238443\", \"#006837\", \"#004529\", \"#ffffd9\", \"#edf8b1\", \"#c7e9b4\", \"#7fcdbb\", \"#41b6c4\", \"#1d91c0\", \"#225ea8\", \"#253494\", \"#081d58\", \"#f7fcf0\", \"#e0f3db\", \"#ccebc5\", \"#a8ddb5\", \"#7bccc4\", \"#4eb3d3\", \"#2b8cbe\", \"#0868ac\", \"#084081\", \"#f7fcfd\", \"#e5f5f9\", \"#ccece6\", \"#99d8c9\", \"#66c2a4\", \"#41ae76\", \"#238b45\", \"#006d2c\", \"#00441b\", \"#fff7fb\", \"#ece2f0\", \"#d0d1e6\", \"#a6bddb\", \"#67a9cf\", \"#3690c0\", \"#02818a\", \"#016c59\", \"#014636\", \"#fff7fb\", \"#ece7f2\", \"#d0d1e6\", \"#a6bddb\", \"#74a9cf\", \"#3690c0\", \"#0570b0\", \"#045a8d\", \"#023858\", \"#f7fcfd\", \"#e0ecf4\", \"#bfd3e6\", \"#9ebcda\", \"#8c96c6\", \"#8c6bb1\", \"#88419d\", \"#810f7c\", \"#4d004b\", \"#fff7f3\", \"#fde0dd\", \"#fcc5c0\", \"#fa9fb5\", \"#f768a1\", \"#dd3497\", \"#ae017e\", \"#7a0177\", \"#49006a\", \"#f7f4f9\", \"#e7e1ef\", \"#d4b9da\", \"#c994c7\", \"#df65b0\", \"#e7298a\", \"#ce1256\", \"#980043\", \"#67001f\", \"#fff7ec\", \"#fee8c8\", \"#fdd49e\", \"#fdbb84\", \"#fc8d59\", \"#ef6548\", \"#d7301f\", \"#b30000\", \"#7f0000\", \"#ffffcc\", \"#ffeda0\", \"#fed976\", \"#feb24c\", \"#fd8d3c\", \"#fc4e2a\", \"#e31a1c\", \"#bd0026\", \"#800026\", \"#ffffe5\", \"#fff7bc\", \"#fee391\", \"#fec44f\", \"#fe9929\", \"#ec7014\", \"#cc4c02\", \"#993404\", \"#662506\", \"#fcfbfd\", \"#efedf5\", \"#dadaeb\", \"#bcbddc\", \"#9e9ac8\", \"#807dba\", \"#6a51a3\", \"#54278f\", \"#3f007d\", \"#f7fbff\", \"#deebf7\", \"#c6dbef\", \"#9ecae1\", \"#6baed6\", \"#4292c6\", \"#2171b5\", \"#08519c\", \"#08306b\", \"#f7fcf5\", \"#e5f5e0\", \"#c7e9c0\", \"#a1d99b\", \"#74c476\", \"#41ab5d\", \"#238b45\", \"#006d2c\", \"#00441b\", \"#fff5eb\", \"#fee6ce\", \"#fdd0a2\", \"#fdae6b\", \"#fd8d3c\", \"#f16913\", \"#d94801\", \"#a63603\", \"#7f2704\", \"#fff5f0\", \"#fee0d2\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#ef3b2c\", \"#cb181d\", \"#a50f15\", \"#67000d\", \"#ffffff\", \"#f0f0f0\", \"#d9d9d9\", \"#bdbdbd\", \"#969696\", \"#737373\", \"#525252\", \"#252525\", \"#000000\", \"#7f3b08\", \"#b35806\", \"#e08214\", \"#fdb863\", \"#fee0b6\", \"#f7f7f7\", \"#d8daeb\", \"#b2abd2\", \"#8073ac\", \"#542788\", \"#2d004b\", \"#543005\", \"#8c510a\", \"#bf812d\", \"#dfc27d\", \"#f6e8c3\", \"#f5f5f5\", \"#c7eae5\", \"#80cdc1\", \"#35978f\", \"#01665e\", \"#003c30\", \"#40004b\", \"#762a83\", \"#9970ab\", \"#c2a5cf\", \"#e7d4e8\", \"#f7f7f7\", \"#d9f0d3\", \"#a6dba0\", \"#5aae61\", \"#1b7837\", \"#00441b\", \"#8e0152\", \"#c51b7d\", \"#de77ae\", \"#f1b6da\", \"#fde0ef\", \"#f7f7f7\", \"#e6f5d0\", \"#b8e186\", \"#7fbc41\", \"#4d9221\", \"#276419\", \"#67001f\", \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#f7f7f7\", \"#d1e5f0\", \"#92c5de\", \"#4393c3\", \"#2166ac\", \"#053061\", \"#67001f\", \"#b2182b\", \"#d6604d\", \"#f4a582\", \"#fddbc7\", \"#ffffff\", \"#e0e0e0\", \"#bababa\", \"#878787\", \"#4d4d4d\", \"#1a1a1a\", \"#a50026\", \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee090\", \"#ffffbf\", \"#e0f3f8\", \"#abd9e9\", \"#74add1\", \"#4575b4\", \"#313695\", \"#9e0142\", \"#d53e4f\", \"#f46d43\", \"#fdae61\", \"#fee08b\", \"#ffffbf\", \"#e6f598\", \"#abdda4\", \"#66c2a5\", \"#3288bd\", \"#5e4fa2\", \"#a50026\", \"#d73027\", \"#f46d43\", \"#fdae61\", \"#fee08b\", \"#ffffbf\", \"#d9ef8b\", \"#a6d96a\", \"#66bd63\", \"#1a9850\", \"#006837\"];\n currentXPalette = palettes[Math.floor(Math.random()*palettes.length)];\n currentYPalette = palettes[Math.floor(Math.random()*palettes.length)];\n // currentXPalette = palettes[0];\n // currentYPalette = palettes[0];\n updateScreen();\n $(\"#loading\").fadeOut(500);\n \n \n }", "function getColor(value) {\n // More votes for republican, show red\n var red = 0;\n var blue = 0;\n var green = 0;\n if (value > 1) {\n var trimmed_value = Math.min(value, 3);\n red = 255;\n blue = Math.round((1 - trimmed_value / 3) * 255);\n green = Math.round((1 - trimmed_value / 3) * 255);\n trimmed_value = null;\n } else if (value == 1) {\n return \"#FFFFFF\";\n } else if (value < 1) {\n var trimmed_value = 1 / value;\n trimmed_value = Math.min(trimmed_value, 3);\n blue = 255;\n red = Math.round((1 - trimmed_value / 3) * 255);\n green = Math.round((1 - trimmed_value / 3) * 255);\n trimmed_value = null;\n }\n var second = red % 16;\n var first = (red - second) / 16;\n var fourth = green % 16;\n var third = (green - fourth) / 16;\n var sixth = blue % 16;\n var fifth = (blue - sixth) / 16;\n return (\"#\" + first.toString(16) + second.toString(16) + third.toString(16) + fourth.toString(16) + fifth.toString(16) + sixth.toString(16));\n }", "function colorList(R, G, B) {\n // shapeCol = color(H, S, 100);\n shapeCol = color(\"white\");\n goldCol = color(\"white\");\n // userTypedColor = color(\"green\");\n // txtCol = color(\"beige\");\n introTxtCol = color(\"beige\");\n circleCol = color(\"beige\");\n circleCol.setAlpha(200);\n introTxtCol2 = color(37, 5, 245);\n bkCol = color(0, 0, 17);\n}", "function getUsernameColor(){\n\t\tvar colore;\n\t\tvar nmCasuale = function (){\n\t\t\tvar j = Math.floor( Math.random() * 255);\n\t\t\treturn j;\n\t\t}\n\t\tcolore = \"rgb(\"+nmCasuale()+\",\" +nmCasuale()+ \",\" +nmCasuale()+\")\";\n\t\treturn colore;\n\t}", "function buildPalette() {\n let r = 255,\n g = 0,\n b = 0;\n\n for (g = 0; g <= 255; g++) {\n addToPalette(r, g, b, );\n }\n g--;\n\n for (r = 254; r >= 0; r--) {\n addToPalette(r, g, b, );\n }\n r++;\n\n for (b = 1; b <= 255; b++) {\n addToPalette(r, g, b, );\n }\n b--;\n\n for (g = 254; g >= 0; g--) {\n addToPalette(r, g, b, );\n }\n g++;\n\n for (r = 1; r <= 255; r++) {\n addToPalette(r, g, b, );\n }\n r--;\n\n for (b = 254; b > 0; b--) {\n addToPalette(r, g, b, );\n }\n b++;\n\n function addToPalette(r, g, b) {\n\n var color = new BABYLON.Color4(r / 255, g / 255, b / 255, 1);\n\n let mat = new BABYLON.StandardMaterial(\"mat\", scene);\n mat.diffuseColor = color;\n mat.specularColor = new BABYLON.Color3(0, 0, 0);\n mat.ambientColor = new BABYLON.Color3(r / 255 * .4, g / 255 * .4, b / 255 * .4);\n\n\n palette.push({\n r,\n g,\n b,\n color,\n mat\n });\n }\n\n // console.log(palette);\n }", "static getRandomColor() {\n let alphabet = '0123456789ABCDEF';\n let color = '#';\n for(let i = 0; i < 6; ++i) {\n color += alphabet[Math.floor(Math.random()*10)];\n }\n return color;\n }", "function overwriteColour(){\n\n var i = 0;\n var k = 0;\n var p = 0;\n\n // Check every superpixel to see if it has been assigned a colour\n for (p = 0; p < 1000; p ++){\n\n // This has been classified already! Recolour it\n if ($scope.isPainted[p] == 1){\n\n // Select the colour (classification) it was previously assigned\n // Key '1'\n if ($scope.newValue[p] == 1) {\n // Colour 'orange'\n $scope.colour_f = $scope.color1RGBA;\n }\n // Key '2'\n else if ($scope.newValue[p] == 2) {\n // Colour 'Green'\n $scope.colour_f = $scope.color2RGBA;\n\n }\n // Key '3'\n else if ($scope.newValue[p] == 3) {\n // Colour 'Pink'\n //$scope.colour_f = \"rgba(128, 128, 255, 0.4)\";\n $scope.colour_f = $scope.color3RGBA;\n }\n // Key '4'\n else if ($scope.newValue[p] == 4) {\n // Colour 'Yellow'\n $scope.colour_f = $scope.color4RGBA;\n }\n // Key '5'\n else if ($scope.newValue[p] == 5) {\n // Colour 'Blue'\n $scope.colour_f = $scope.color5RGBA;\n }\n // Key '6'\n else if ($scope.newValue[p] == 6) {\n // Colour 'Grey'\n $scope.colour_f = $scope.color6RGBA;\n }\n // Key '7'\n else if ($scope.newValue[p] == 7) {\n // Colour 'Grey'\n $scope.colour_f = $scope.color7RGBA;\n }\n // Key '8'\n else if ($scope.newValue[p] == 8) {\n // Colour 'Grey'\n $scope.colour_f = $scope.color8RGBA;\n }\n // Key '9'\n else if ($scope.newValue[p] == 9) {\n // Colour 'Grey'\n $scope.colour_f = $scope.color9RGBA;\n }\n // Key '10'\n else if ($scope.newValue[p] == 10) {\n // Colour 'Grey'\n $scope.colour_f = $scope.color10RGBA;\n }\n\n // Very similar to the standard colouring function\n var mask_value = p;\n $scope.length_2 = $scope.mask_data.length;\n $scope.length_1 = $scope.mask_data[0].length;\n\n // Iterate through every pixel and colour it in\n for (i = 0; i < $scope.length_2; i ++){\n $scope.iter2 = i;\n\n for (k = 0; k < $scope.length_1; k++){\n $scope.iter1 = k;\n\n // Colour in the single pixel the appropiate colour\n if (mask_value == $scope.mask_data[$scope.iter2][$scope.iter1]){\n $scope.mask_copy[$scope.iter2][$scope.iter1] = $scope.newValue[p];\n contextTop.fillStyle = $scope.colour_f;\n contextTop.fillRect( $scope.scaleImgX*$scope.iter1, $scope.scaleImgY*$scope.iter2, 1, 1 );\n }\n // Do nothing\n else {\n }\n }\n }\n }\n }\n }", "function getRandomColor() {\n var letters = '0123456789ABCDEF'.split('');\n var color66 = [];\n for(var j = 0; j<66; j++){\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n color66.push(color);\n }\n return color66;\n }", "function newHexColor() {\n\tvar letters = \"0123456789ABCDEF\";\n\tvar color = \"#\";\n\tfor (var i = 0; i < 6; i++) {\n\t\tcolor += letters[Math.floor(Math.random() * 16)];\n\t}\n\treturn color;\n}", "function change_background(){\r\n\r\n for(x=0;x<6;x++){\r\n generated = hexa[color_generator()];\r\n color += generated;\r\n\r\n };\r\n body.style.backgroundColor = color;\r\n span.innerText = color;\r\n color = \"#\"; // reinitialize the value of color to '#'\r\n \r\n\r\n \r\n\r\n \r\n}", "static StandardColors() {\n\t\tif ( !Civ.colors ) { \n\t\t\tCiv.next_standard_color_index = -1;\n\t\t\tCiv.colors = [\n\t\t\t\t[128, 0, 0], \t\t// maroon\n\t\t\t\t[45, 130, 220], \t// blue\n\t\t\t\t[219, 210, 72], \t// yellow\n\t\t\t\t[10, 128, 30], \t\t// forest green\n\t\t\t\t[15, 120, 155],\t\t// teal\n\t\t\t\t[192, 192, 192], \t// silver\n\t\t\t\t[255, 0, 0], \t\t// red\n\t\t\t\t[0, 220, 0], \t\t// green\n\t\t\t\t[100, 100, 100], \t// grey\n\t\t\t\t[128, 128, 0], \t\t// olive\n\t\t\t\t[20, 66, 170], \t\t// navy\n\t\t\t\t[255, 0, 255],\t\t// fuschia\n\t\t\t\t[128, 0, 128],\t\t// purple\n\t\t\t\t[0, 255, 255],\t\t// aqua\n\t\t\t\t[140,205,140],\t\t// spring green\n\t\t\t\t[195,144,212],\t\t// lavender\n\t\t\t\t[212,161,144],\t\t// mid brown\n\t\t\t\t[120,80,24],\t\t// dark brown\n\t\t\t\t[222,195,144],\t\t// tan\n\t\t\t\t[190,102,40],\t\t// dull orange\n\t\t\t\t[255,149,0],\t\t// orange \n\t\t\t\t[162,255,31],\t\t// chartreuse\n\t\t\t\t[230,119,119],\t\t// salmon\n\t\t\t\t[255,186,206]\t\t// pink\n\t\t\t\t];\n\t\t\tCiv.colors.shuffle();\n\t\t\t// random colors to finish off the set\n\t\t\tfor ( let n = 0; n < 124; ) {\n\t\t\t\tlet c = [ \n\t\t\t\t\tutils.RandomInt(0,255),\n\t\t\t\t\tutils.RandomInt(0,255),\n\t\t\t\t\tutils.RandomInt(0,255),\n\t\t\t\t\t];\n\t\t\t\tif ( c[0] + c[1] + c[2] > 200 ) { \n\t\t\t\t\tCiv.colors.push(c); \n\t\t\t\t\tn++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\treturn Civ.colors;\n\t\t}", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }", "function __generateColorCombinations() {\n var combinations = {};\n for (var s = 1; s <= colorCount; s++) {\n for (var p = 1; p <= colorCount; p++) {\n combinations[(s + (p * colorCount)) - colorCount] = {pri: p - 1, sec: s - 1}\n }\n }\n return combinations;\n}", "generateColors(palette, allColorsFilterBy){\n let shades=[];\n let allColors = palette.colors;\n for(let key in allColors){\n shades = shades.concat(\n allColors[key].filter(colors =>(\n colors.id ===allColorsFilterBy\n ))\n )\n }\n //return all shades of given colors \n return shades.slice(1); \n }", "function mapColor(id,type) {\n var arrColors = guiData.colorPalette;\n var resColor = \"hsl(195, 100%, 35%)\";\n //console.log(emailDomains);\n //console.log(id);\n if (id != -1) {\n if (id < arrColors.length - 1) {\n resColor = arrColors[id];\n }else{\n resColor = arrColors[arrColors.length - 1];\n }\n }else{\n switch (type) {\n case 'node': resColor = arrColors[0]; break;\n case 'edge': resColor = arrColors[0];\n //\"rgba(0, 134, 179,0.5)\";\n //\"rgba(59, 124, 171, 0.42)\";\n break;\n }\n }\n return resColor;\n }", "function generateColors(num)\n{\n for(var i=0;i<num;i++)\n {\n colors.push(\"rgb(\"+Math.floor(Math.random()*255)+\", \"+Math.floor(Math.random()*255)+\", \"+Math.floor(Math.random()*255)+\")\");\n }\n}", "function color(){\n var random_colors = [\"#c2ff3d\",\"#ff3de8\",\"#3dc2ff\",\"#04e022\",\"#bc83e6\",\"#ebb328\",\"#ekb123\"];\n\n if(i > random_colors.length - 1){\n i = 0;\n }\n return random_colors[i++];\n}", "function determine_color(num) {\n if (num === 0) {\n return \"beige\";\n } else if (num === 2) {\n return \"beige\";\n } else if (num === 4) {\n return \"yellow\";\n } else if (num === 8) {\n return \"#f4b042\";\n } else if (num === 16) {\n return \"#f48641\";\n } else if (num === 32) {\n return \"#f45241\";\n } else if (num === 64) {\n return \"#ff1800\";\n } else if (num === 128) {\n return \"#ff00b2\";\n } else {\n return \"black\";\n }\n}", "function randomColor() {\n const hexa = '0123456789ABCDEF';\n let cor = '#';\n\n for (let index = 0; index < 6; index += 1) {\n cor += hexa[Math.floor(Math.random() * 16)];\n }\n return cor;\n}", "function wallColorizer() {\n return 'rgb(150,150,150)';\n}", "function getRandomColor() {\n let letters = \"0123456789ABCDEF\";\n let color = \"#\";\n let colorCounter = 0;\n for ( colorCounter; colorCounter<6; colorCounter ++) {\n let randomLetter = letters[Math.floor(Math.random()*16)];\n color += randomLetter;\n }\n return color;\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }" ]
[ "0.7444679", "0.73473984", "0.7258371", "0.72360754", "0.7078691", "0.6997037", "0.6968734", "0.69417775", "0.6917109", "0.68845403", "0.6883309", "0.68771887", "0.686044", "0.686044", "0.68508625", "0.68232095", "0.68117523", "0.67966133", "0.6775468", "0.67696106", "0.67657864", "0.67170554", "0.6713433", "0.6705175", "0.6698045", "0.66952616", "0.6671717", "0.66681194", "0.66662765", "0.66662765", "0.6655976", "0.66535944", "0.66164774", "0.6602359", "0.65990525", "0.65987575", "0.65936583", "0.6592889", "0.6590483", "0.6575734", "0.6571204", "0.6552704", "0.65517604", "0.6542791", "0.653533", "0.65333146", "0.6527689", "0.6525249", "0.65231144", "0.6518206", "0.65123016", "0.64899695", "0.6485797", "0.64828485", "0.6477556", "0.6472428", "0.64709216", "0.64694273", "0.6469344", "0.6460237", "0.6458766", "0.64581615", "0.6454978", "0.64481753", "0.6448108", "0.6446327", "0.644371", "0.6443392", "0.64388216", "0.64282274", "0.64244944", "0.642373", "0.6423213", "0.64220566", "0.6418006", "0.6414709", "0.64138556", "0.6413731", "0.64133364", "0.641227", "0.6409246", "0.6407577", "0.6406994", "0.6402862", "0.639969", "0.6397713", "0.639569", "0.63955295", "0.63915145", "0.6389548", "0.638565", "0.6382559", "0.63794315", "0.6379419", "0.63757473", "0.63755554", "0.6372922", "0.63713473", "0.63711166", "0.6368551", "0.6368551" ]
0.0
-1
Moves and draws the text
function testSin() { //Local counter, increment t (x-position) and refresh the stage var i = 0; t = t-0.14; stage.draw(); var Drawn = 0; //Draw out the text! while (i < sctext.length) { //Only bother to print out chars that are inside the canvas if (i*spacing+t*10 < 0-1.5*spacing) { //Not visible, ignore } else if (i*spacing+t*10 < sw) { //Draw char! Drawn++; sinText.setText(sctext[i]); sinText.setX(i*spacing+t*10); if (mode == 1) { //Upwards sinText.setY(110+1.2*Math.tan(t+i*2)*10); } else if (mode == 2) { //Sideways-S if (i*spacing+t*10 > 300) { // sinText.setY(110+1.2*Math.pow(2, -(60-(t+i*2)))*10); sinText.setY(110+1.2*Math.pow(2, i*spacing+t*10-640)*10); } else { sinText.setY(110+1.2*-Math.pow(2, -(i*spacing+t*10)+20)*10); } } else if (mode == 3) { //Downwards sinText.setY(110+1.2*Math.tan(-(t+i*2))*10); } else { //Wave sinText.setY(110+1.2*Math.sin(t+i*2)*10); } sinText.setStroke(textcol[i]); // sinText.setFill(textcol[i]); sinText.draw(); } else { //Why recheck other characters when we're outside the frame! break; } ++i; } //Clear the text to stop overlapping sinText.setText(''); if (Drawn == 0 && t < 0) { //Finished drawing. t = 70; if (Finished == 0) { sctext = "~~ Still here? ;) Wait for it! ♥ xx ~~"; Finished++; } else if (Finished == 1) { sctext = "Extra Special Greets: Tom Von Annie Liz DCB West Cpt.Snow Christopher Lemon Walv Derp Sarge Eskimo Podder Emily"; //Text Finished++; setTimeout(DoCode, 50); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n drawText();\n}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "function draw() {\n background(28, 22, 70);\n\n posX = 80;\n posY = 300;\n randomSeed(actRandomSeed);\n\n // iterate through all characters in the text and draw them\n for (var i = 0; i < joinedText.length; i++) {\n // find the index of the current letter in the character set\n var upperCaseChar = joinedText.charAt(i).toUpperCase();\n var index = charSet.indexOf(upperCaseChar);\n if (index < 0) continue;\n\n // calculate parameters for text image\n var charOpacity = 100;\n if (drawOpacity) {\n charOpacity = counters[index];\n }\n\n var my = map(mouseY, 50, height - 50, 0, 1);\n my = constrain(my, 0, 1);\n var charSize = counters[index] * my * 3;\n\n var mx = map(mouseX, 50, width - 50, 0, 1);\n mx = constrain(mx, 0, 1);\n var lineLength = charSize;\n var lineAngle = random(-PI, PI) * mx - HALF_PI;\n var newPosX = lineLength * cos(lineAngle);\n var newPosY = lineLength * sin(lineAngle);\n\n // draw elements\n push();\n translate(posX, posY);\n stroke(0, 137, 160, charOpacity);\n if (drawLines) {\n line(0, 0, newPosX, newPosY);\n }\n\n // draw elipse and text\n noStroke();\n fill(111, 90, 254, charOpacity * 4);\n if (drawEllipses) {\n ellipse(0, 0, charSize / 10, charSize / 10);\n }\n if (drawText) {\n fill(255, 255, 255, charOpacity * 5);\n text(joinedText.charAt(i), newPosX, newPosY);\n }\n pop();\n\n posX += textWidth(joinedText.charAt(i));\n if (posX >= width - 200 && upperCaseChar == \" \") {\n posY += int(tracking * my + 30);\n posX = 80;\n }\n }\n}", "function onTextUp(txt) {\n textUp(txt)\n draw()\n}", "doDraw() {\n draw_context.strokeStyle = \"#000\";\n draw_context.fillStyle = \"#eee\";\n draw_context.font = \"40px Times\";\n draw_context.lineWidth = 10;\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "function draw(){\n\tbackground ('lightblue');\n\n\t// draw characters\n\timage(jak, JakX, JakY);\n\timage(daxter, DaxterX, DaxterY);\n\n\t\t// narration\n\ttextSize(30);\n\ttextAlign(CENTER, CENTER);\n\ttext(story, width/4, 20, width/2);\n}", "function drawText(){\n ctx.save();\n \n ctx.beginPath();\n \n ctx.translate(centerX, centerY);\n \n ctx.rotate(180 * Math.PI / 180);\n \n ctx.fillText(\"Current Wind speed is around: \" + Math.round(windSpeed), 0, 490);\n ctx.fillText(\"Bugs shot: \" + bugsShot, 550, 490);\n ctx.restore();\n}", "function onTextDown(txt) {\n textDown(txt)\n draw()\n}", "function drawText() {\n if (!gameOver) {\n return;\n }\n\n //setup text parameters\n let size = grid[0][0].h;\n ctx.fillStyle = gameTied ? COLOR_TIE : playersTurn ? COLOR_PLAYER : COLOR_COMPUTER;\n ctx.font = size + \"px dejavu sans mono\";\n ctx.lineJoin = \"round\";\n ctx.lineWidth = size / 10;\n ctx.strokeStyle = gameTied ? COLOR_TIE_DRK : playersTurn ? COLOR_PLAYER_DARK : COLOR_COMPUTER_DARK;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n\n //draw the text\n let offset = size * 0.55;\n let text = gameTied ? TEXT_TIE : playersTurn ? TEXT_PLAYER : TEXT_COMPUTER;\n if (gameTied) {\n ctx.strokeText(text, width / 2, height / 2);\n ctx.fillText(text, width / 2, height / 2);\n } else {\n ctx.strokeText(text, width / 2, height / 2 - offset);\n ctx.fillText(text, width / 2, height / 2 - offset);\n ctx.strokeText(TEXT_WIN, width / 2, height / 2 + offset);\n ctx.fillText(TEXT_WIN, width / 2, height / 2 + offset);\n\n }\n}", "function drawText(text, x, y) {\n context.fillStyle = '#000';\n context.fillText(text, x-1, y-1);\n context.fillText(text, x+1, y+1);\n context.fillText(text, x+1, y-1);\n context.fillText(text, x-1, y+1);\n context.fillStyle = '#fff';\n context.fillText(text, x, y);\n}", "render() {\n\t\tif (!this.visible || !this.ctx) return;\n\t\tthis.ctx.font = this.textStyle.font;\n\t\tthis.ctx.fillStyle = this.textStyle.fillStyle;\n\t\tthis.ctx.textAlign = this.textStyle.textAlign;\n\t\tthis.ctx.fillText(this.text, this.x, this.y);\n\t}", "function drawMenu(text) {\n ctx.save(); \n\n ctx.fillStyle = \"black\";\n ctx.fillRect(0, 0, width, 90);\n\n ctx.fillStyle = \"white\";\n ctx.font = '40px sans-serif';\n // ctx.fillText(x.toFixed(2), 10, 62);\n ctx.fillText(\"IronJump - \" + -1*camera.y, 10, 62);\n ctx.restore(); \n}", "function drawText(width, height, color, x, y) {\n this.gamearea = gameArea;\n this.width = width;\n this.height = height;\n this.speedX = 0;\n this.speedY = 0;\n this.x = x;\n this.y = y;\n this.update = function() {\n ctx = gameArea.context;\n ctx.font = this.width + ' ' + this.height;\n ctx.fillStyle = color;\n ctx.fillText(this.text, this.x, this.y);\n }\n this.newPos = function() {\n this.x += this.speedX;\n this.y += this.speedY;\n }\n}", "instructions() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText('Goal: Avoid the monsters. Reach the princess.',10,105);\n }", "function texting() {\n push();\n fill(21, 200, 0);\n textFont(\"IMPACT\");\n textStyle(ITALIC);\n stroke(182, 56, 204);\n strokeWeight(35);\n textSize(70);\n text(openingText, 25, 180);\n pop();\n\n fill(182, 56, 204);\n stroke(random(80), random(80), random(80));\n strokeWeight(10);\n rect(240, 430, 200, 80);\n\n push();\n fill(21, 200, 0);\n textFont(\"IMPACT\");\n textStyle(ITALIC);\n stroke(182, 56, 204);\n textSize(35);\n strokeWeight(5);\n text(start, 248, 485);\n pop();\n \n\n\n\n\n\n}", "function drawText(text,x,y){ //Function used to draw text to the canvas using a specified text string and a starting x and y coordinate.\r\n\tctx.font = '35px pokefont';\r\n\tctx.fillText(text,x,y);\r\n\tctx.fillStyle = \"#ffffff\";\r\n}", "draw() {\n this.scoreText = \"Score: \" + gameNs.game.score;\n this.timeText = \"Time: \" + gameNs.game.timePassed;\n document.body.style.background = \"#000000\";\n gameNs.game.ctx.font = '120px Spy Hunter'; //48\n gameNs.game.ctx.fillStyle = \"white\"\n gameNs.game.ctx.fillText(\"SPY HUNTER\", 300, 150);\n gameNs.game.ctx.font = '80px Spy Hunter'; //48\n gameNs.game.ctx.fillStyle = \"yellow\"\n gameNs.game.ctx.fillText(this.startText, 250, 500);\n gameNs.game.ctx.fillText(this.scoreText, 450, 600);\n gameNs.game.ctx.fillText(this.timeText, 450, 700);\n }", "function draw(){\n background('#BAE1FF'); //powder blue\n rect(20,100,400,400,20);\n //STATS:\n textSize(32); //size\n fill(150, 102, 153); //color of words\n text(`Happiness: ${stat.love}`, 10, 60); //string and position\n textSize(32); //size\n text(`Cleanliness: ${stat.hygiene}`, 10, 90); //string and position\n fill(150, 102, 153); //color of words\n textSize(32); //size\n text(`Hunger: ${stat.food}`, 10, 30); //string and position\n fill(150, 102, 153); //color of word\n fill(150, 102, 153); //color of word\n text(`ATLS 3300 - Object`, 300, 30); //string and position\n\n //Instructions\n textSize(30); //size\n fill(150, 102, 153); //color of words\n text(`Scan a plushy to take care of Mimitchi!`, 450, 150); //string and position\n textSize(30); //size\n text(`Cake: Feed Mimitchi`, 450, 200); //string and position\n text(`Duck Ring: Clean Mimitchi`, 450, 250); //string and position\n text(`Heart: Pet Mimitchi`, 450, 310); //string and position\n \n translate(80, 150);\n getAnimation();\n}", "function drawStrokedText(context, text, x, y) {\n\t\tcontext.fillStyle = \"rgb(0,0,0)\";\n\t\tif (time - prevTime > 110) {\n\t\t\tstrokeText(context, text, x, y);\n\t\t} else {\n\t\t\tshowText(context, text, x - 1, y - 1);\n\t\t\tshowText(context, text, x + 1, y - 1);\n\t\t\tshowText(context, text, x - 1, y);\n\t\t\tshowText(context, text, x + 1, y);\n\t\t\tshowText(context, text, x - 1, y + 1);\n\t\t\tshowText(context, text, x + 1, y + 1);\n\t\t}\n\t\tcontext.fillStyle = \"rgb(255,220,150)\";\n\t\tshowText(context, text, x, y);\n\t}", "function textOnScreen() {\n createP('Refresh The Page To Reset');\n createP('Press W to Remove Obstacles');\n createP('Press Q To Increase Number of Obstacles');\n }", "function drawText(font, text, x, y) {\n cxt.font = font;\n cxt.fillStyle = \"white\";\n cxt.fillText(text, x, y);\n}", "function trackDrawText()\r\n{\r\n\r\n if(ActiveElem==null&&DrawTextStarted==true)\r\n {\r\n\r\n DrawX.style(\"display\", \"inline\")\r\n DrawX.attr(\"transform\", \"translate(\"+SVGx+\" \"+SVGy+\")\")\r\n\r\n }\r\n}", "function titleCanvas(){\n var canvas = document.getElementById(\"mainText\"),\n promotion = canvas.getContext(\"2d\");\n\n //whre the text is going to start moving to the right\n var start = -300;\n setInterval(function(){\n\n //moving velocity to the right.\n start += 2;\n\n //backgroung of the canvas\n promotion.fillStyle = \"gray\";\n promotion.fillRect(0, 0, canvas.width, canvas.height);\n\n //text for the canvas \n promotion.fillStyle = \"white\";\n promotion.font = \"30px Arial\";\n promotion.fillText(\"10% Man Haircut\", start, 70);\n\n }, 40);\n }", "function draw() {\n background(0);\n\n push();\n fill(255);\n text(instructionTxt, width / 2, height / 2);\n pop();\n\n displayAnswer();\n}", "function drawText() {\n //font size weight fill etc\n push();\n textSize(30);\n fill('black');\n strokeWeight(1);\n stroke('black');\n text('Choose a key (1 or 2)', 100, 60);\n pop();\n}", "function drawStart(){\n graphics.font = \"60px Arial\";\n graphics.fillStyle = \"red\";\n graphics.fillText(\"Press y to start\",100,300);\n }", "function draw() {\n if(mouseIsPressed) {\n //the first part is location of circle where ever the mouse is and second bit is size\n circle(mouseX, mouseY, pmouseX, pmouseY);\n }\n //variable for text and what it says\n var t = 'Press Spacebar to clear canvas'\n textSize(20);\n //t is the text first 2 numbers position then second size of textbox\n text(t, 640, 530, 200, 200);\n}", "function drawText() {\n if (!gameOver) return;\n\n // Set up text.\n let textSize = grid[0][0].height;\n context.fillStyle = gameTied\n ? COLOUR_DRAW\n : playerTurn\n ? COLOUR_PLAYER\n : COLOUR_COMPUTER;\n context.font = textSize + \"px dejavu sans mono\";\n context.lineJoin = \"round\";\n context.lineWidth = textSize / 10;\n context.strokeStyle = gameTied\n ? COLOUR_DRAW_DARK\n : playerTurn\n ? COLOUR_PLAYER_DARK\n : COLOUR_COMPUTER_DARK;\n context.textAlign = \"center\";\n context.textBaseline = \"middle\";\n\n // Draw text.\n let text = gameTied ? TEXT_DRAW : playerTurn ? TEXT_PLAYER : TEXT_COMPUTER;\n if (gameTied) {\n context.strokeText(text, width / 2, height / 2);\n context.fillText(text, width / 2, height / 2);\n } else {\n // Set offset\n let offset = textSize * 0.55;\n\n // Player / Computer\n context.strokeText(text, width / 2, height / 2 - offset);\n context.fillText(text, width / 2, height / 2 - offset);\n\n // Wins\n context.strokeText(TEXT_WIN, width / 2, height / 2 + offset);\n context.fillText(TEXT_WIN, width / 2, height / 2 + offset);\n }\n}", "function setText(t, x, y ){\n push();\n textSize(30);\n fill(200, 220, 60);\n stroke(100,110,213);\n strokeWeight(5);\n text(t, x, y);\n pop();\n}", "function handleMouseMove(e) {\n if (selectedText < 0) {\n return;\n }\n e.preventDefault();\n var mouseX = parseInt(e.clientX - text_canvas.offset().left);\n var mouseY = parseInt(e.clientY - text_canvas.offset().top);\n\n // Put your mousemove stuff here\n var dx = mouseX - text_startX;\n var dy = mouseY - text_startY;\n text_startX = mouseX;\n text_startY = mouseY;\n\n var text = texts[selectedText];\n text.x += dx;\n text.y += dy;\n drawText(text_ctx);\n }", "doDraw() {\n console.log(\"big game over\");\n draw_context.fillStyle = \"#000F\";\n draw_context.fillRect(0,0, canvas_element.width,canvas_element.height);\n draw_context.lineWidth = 20;\n draw_context.lineJoin = \"round\";\n draw_context.textAlign = \"center\";\n draw_context.font = \"80px Lemon\";\n draw_context.strokeStyle = \"#fff\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.lineWidth = 10;\n draw_context.strokeStyle = \"#000\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n \n draw_context.fillStyle = this.grad1;\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "strokeText(text, x, y) {\n CanvasManager.strokeText(findNodeHandle(this), text, x, y)\n }", "function drawText(txt, x, y) {\n ctx.textBaseline = 'top';\n ctx.textAlign = 'left';\n ctx.font = font;\n ctx.fillText(txt, x - 4, y - 4);\n}", "drawHUD() {\n this.text.draw();\n }", "function blinkText(){\n if(!blink){\n context.font =\"30px menuFont\";\n context.fillStyle = \"white\";\n context.fillText(\"Press Enter\", canvas.width/2-70, canvas.height/2+60);\n blink = true;\n }\n else if(blink){\n context.fillStyle = \"black\";\n context.fillRect(canvas.width/2-80, canvas.height/2+33, 200, 35);\n blink = false;\n }\n}", "function LolWut()\n{\n\t//Change fill and outline colours\n\tsimpleText.setFill((getRandomColour()));\n\tsimpleText.setStroke((getRandomColour()));\n//stage.draw();\n\t//Redraw text\n\tsimpleText.draw();\n}", "function draw() {\n background(255);\n frameRate(12);\n text(pmouseY - mouseY, 0, height/4);\n}", "function screenText(){\n ctx.fillStyle = \"white\";\n ctx.fillText(\"Target on enemy. Zoom factor 10x\", 200, 390); \n}", "function handleMouseMove(e) {\n\n if (selectedText < -1) { return; }\n e.preventDefault();\n mouseX = parseInt(e.clientX - offsetX);\n mouseY = parseInt(e.clientY - offsetY);\n\n // Put your mousemove stuff here\n var dx = mouseX - startX;\n var dy = mouseY - startY;\n startX = mouseX;\n startY = mouseY;\n\n var text = texts[selectedText];\n text.x += dx;\n text.y += dy;\n draw();\n\n\n}", "function drawLanded(){\n ctx.font = \"30px Molengo\";\n ctx.fillStyle = \"#00FF00\";\n ctx.fillText(\"You Landed\", x - 50, y - 25);\n}", "function Controls() {\n push();\n //defining location for mouse coordinates to show the text\n //(when the mouse is located inside the frame)\n if (mouseX>innerWidth/2 - 300 && mouseX<innerWidth/2 + 300 && mouseY>innerHeight/2 - 300 && mouseY<innerHeight/2 + 300) {\n textSize (28);\n fill(50, 50, 50);\n //draws text underneath the frame \n text(\"Slide to change scaling\", innerWidth/2 - 160, innerHeight/2 + 390);\n text(\"Hold '↑' or '↓' to change speed\", innerWidth/2 - 160, innerHeight/2 + 420);\n text(\"Press 'C' to clean\", innerWidth/2 - 160, innerHeight/2 + 450);\n text(\"Press 'F' when satisfied\", innerWidth/2 - 160, innerHeight/2 + 480);\n pop();\n }\n}", "draw()\n {\n document.body.style.background = \"#66F9FF\";\n\n\n //ctx.fillText(this.title, 100,100);\n }", "function displayPause()\r\n{context.font = \"20px Arial\";\r\ncontext.fillStyle = \"black\";\r\ncontext.fillText(\"Press Shift to Continue\", 650, 20);\r\n\r\n}", "function gameOverText () {\n style = { font: \"65px Arial\", fill: \"#fff\", align: \"center\" };\n var text = game.add.text(game.camera.x+450, game.camera.y+250, \"You Lose! Try Again...\", style);\n text.anchor.set(0.5);\n }", "function placeText() {\n const name = type.value();\n placeText.html('hello ' + name + '!');\n this.c = color(random(255), random(255), random(255));\n type.value('');\n//number of text\n for (let i = 0; i < 150; i++) {\n push();\n fill(this.c);\n translate(random(1800), random(1500));\n text(name, 0, 0);\n pop();\n }\n}", "draw(context) {\n\t\t\tcontext.textAlign = 'center';\n\t\t\tcontext.fillStyle = 'rgba(57, 228, 57,' + this.opacity + ')';\n\t\t\tcontext.fillText(this.name, this.x, this.y);\n\t\t}", "function paintTextLastScreen(){\r\n\t\t\r\n\t\tvar gameover = AppSAS.ui.resources.images['game_over'];\r\n\t\tvar finalHeightGameOver = gameover.height * AppSAS.ui.ratio;\r\n\t\tvar xDistance = AppSAS.isPortrait() ? AppSAS.ui.canvas.width / 2 : AppSAS.ui.canvas.width / 4;\r\n\t\tvar topDistanceLbl = 100 + finalHeightGameOver + (AppSAS.isPortrait() ? 175 : 140);\r\n\t\tAppSAS.ui.context.font = '50pt Minecraftia';\r\n\t\tAppSAS.ui.context.textAlign = 'center';\r\n\t\tAppSAS.ui.context.fillStyle = '#0d5d74';\r\n\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\tAppSAS.ui.context.shadowOffsetY = 0;\r\n\t\tAppSAS.ui.context.shadowBlur = 0;\r\n \tAppSAS.ui.context.fillText('DISTANCE', xDistance, topDistanceLbl);\r\n\r\n\t\tvar topDistance = topDistanceLbl + 75;\r\n\t\tAppSAS.ui.context.font = '70pt MineCrafter_3';\r\n\t\tAppSAS.ui.context.textAlign = 'center';\r\n\t\tAppSAS.ui.context.fillStyle = 'white';\r\n\t\tAppSAS.ui.context.shadowColor = '#0d5d74';\r\n\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\tAppSAS.ui.context.shadowOffsetY = 10;\r\n\t\tAppSAS.ui.context.shadowBlur = 4;\r\n \tAppSAS.ui.context.fillText(Math.floor(AppSAS.gameModel.distanceSkiff)+' M', xDistance, topDistance); \t\r\n\r\n \tvar topHighScore = AppSAS.isPortrait() ? topDistance + 225 : 150;\r\n \tvar xHighScore = AppSAS.isPortrait() ? AppSAS.ui.canvas.width / 2 : (AppSAS.ui.canvas.width * 3) / 4\r\n\t\tAppSAS.ui.context.font = '50pt Minecraftia';\r\n\t\tAppSAS.ui.context.textAlign = 'center';\r\n\t\tAppSAS.ui.context.fillStyle = '#0d5d74';\r\n\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\tAppSAS.ui.context.shadowOffsetY = 0;\r\n\t\tAppSAS.ui.context.shadowBlur = 0;\r\n \tAppSAS.ui.context.fillText('HIGH SCORES', xHighScore, topHighScore);\r\n\r\n \tvar highScores = AppSAS.gameModel.highScores;\r\n \tvar limit = Math.min(AppSAS.isPortrait() ? ConstSAS.NB_HIGHSCORES_PORTRAIT : ConstSAS.NB_HIGHSCORES_PASYAGE, highScores.length);\r\n \tfor (var i =1 ; i <= limit;i++){\r\n \t\tvar user = highScores[i-1];\r\n \t\tvar topHighScoreRow = topHighScore + (i-1) * 70 + (AppSAS.isPortrait() ? 150 : 90);\r\n \t\tvar xHighScoreRow = AppSAS.isPortrait() ? 150 : (AppSAS.ui.canvas.width / 2)+50;\r\n \t\tvar xHighScoreRowUser = xHighScoreRow + 100;\r\n\t\t\tAppSAS.ui.context.font = '30pt Minecraftia';\r\n\t\t\tAppSAS.ui.context.textAlign = 'right';\r\n\t\t\tAppSAS.ui.context.fillStyle = '#0d5d74';\r\n\t\t\tAppSAS.ui.context.shadowColor = 'white';\r\n\t\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\t\tAppSAS.ui.context.shadowOffsetY = 5;\r\n\t\t\tAppSAS.ui.context.shadowBlur = 2;\r\n\t\t\tAppSAS.ui.context.fillText(''+i, xHighScoreRow, topHighScoreRow);\r\n\t\t\tAppSAS.ui.context.textAlign = 'left';\r\n\t\t\tAppSAS.ui.context.fillStyle = 'white';\r\n\t\t\tAppSAS.ui.context.shadowOffsetX = 0;\r\n\t\t\tAppSAS.ui.context.shadowOffsetY = 0;\r\n\t\t\tAppSAS.ui.context.shadowBlur = 0;\r\n\t\t\tAppSAS.ui.context.fillText(user.login, xHighScoreRowUser, topHighScoreRow);\r\n\t\t\tAppSAS.ui.context.textAlign = 'right';\r\n\t\t\tAppSAS.ui.context.fillText(Math.floor(user.distance)+' M', AppSAS.ui.canvas.width - 150, topHighScoreRow);\r\n \t}\r\n\t}", "draw() {\n let ctx = this.ctx;\n ctx.beginPath();\n ctx.fillStyle = Action.BGCOLOR;\n if (this.activated) {\n ctx.fillStyle = Action.BGACTIVATEDCOLOR;\n }\n CanvasHelper.fillRect(\n ctx,\n this.x, this.y, this.w, this.h,\n Action.PADDING\n );\n\n let fontSize = 30;\n\n ctx.fillStyle = Action.TEXT_COLOR;\n ctx.font = fontSize + \"px serif\";\n ctx.fillText(this.typeSymbol, this.x + this.w / 3, this.y + this.h * 3 / 4);\n }", "function draw() {\n let el = getCurrImgEl();\n drawImage(el);\n for (var i = 0; i < gMeme.existText.length; i++) {\n drawText(gMeme.existText[i])\n }\n}", "function drawLives(){\r\n ctx.font = fontType;\r\n ctx.fillStyle = \"#0095DD\";\r\n ctx.fillText(\"❤x\"+lives, canvas.width-43, 20);\r\n}", "function draw() {\n\tvar x = width / 2;\n\tvar y = height / 2;\n\tif (mouseX !== 0 && mouseY !== 0) {\n\t\tx = mouseX;\n\t\ty = mouseY;\n\t}\n\n\tbackground(0, 25);\n\tpush();\n\t\ttranslate(x, y);\n\t\trotate(frameCount / 30)\n\t\ttext(\"I'm working\", 0, 0);\n\tpop();\n}", "function drawText(text, x, y, color, fontSize, align = \"left\"){\n\tg_canvas.fillStyle = color;\n\tlet size = getFontPixelsFromPercentage(fontSize) + \"px\";\n\tg_canvas.font = size + \" Righteous\";\n\tg_canvas.textAlign = align;\n\tg_canvas.fillText(text, x, y);\n}", "function drawText(size,color,alignment,text,x,y,font=\"Arial\") {\n\tctx.font = size + \"px \" + font;\n\tctx.fillStyle = color;\n\tctx.textAlign=alignment;\n\tctx.fillText(text,x,y);\n\tctx.textAlign=\"start\";\n}", "function drawText(TextMgr) {\n TextMgr.getTextPath(function(path){\n canvas_model.drawPoints(svg_tools.svgToPoints(path.commands));\n });\n}", "function reposText(x,y,num){\n x*=100; // Skalierung auf ganze Zahlen\n y*=100; // Skalierung auf ganze Zahlen\n if(num==1)t1left = (x+7.1)*2 // Position des oberen Textes anpassen (für Serverside Generierung)\n if(num==2)t3left = (x+7.1)*2 // Position des unteren Textes anpassen (für Serverside Generierung)\n //console.log(\"t1left:\"+t1left+\", t3left\"+t3left);\n if(num==1){ // tatsächliche Neupositionierung des oberen Textes auf dem Bild\n x -= 42;\n y -= 86;\n //console.log(x+\", \"+y)\n document.getElementsByClassName(\"MemeTextTop\")[0].style.left=(x*3.6)+100+\"px\";\n document.getElementsByClassName(\"MemeTextTop\")[0].style.top=-y-20+\"px\";\n }\n if(num==2){ // tatsächliche Neupositionierung des unteren Textes auf dem Bild\n x -=50;\n y -=22;\n //console.log(x+\", \"+y+\", 2\")\n document.getElementsByClassName(\"MemeTextBottom\")[0].style.left=(x*3.6)+100+\"px\";\n document.getElementsByClassName(\"MemeTextBottom\")[0].style.top=-(y*1.4)+235+\"px\";\n }\n}", "function animateText() {\n finish.play();\n var x = Math.floor(Math.random() * 11 + 1);\n var supportText = [\n \"Wunderbar\",\n `Go, ${currPlayer}`,\n \"Super\",\n \"Great\",\n \"Amazing\",\n \"You rock\",\n \"Crazy\",\n \"Insane\",\n `Wow, ${currPlayer}`,\n \"Outstanding\",\n \"Unbelievable\",\n `wtf, ${currPlayer}`\n ];\n $(\".gogoText\")\n .html(supportText[x])\n .addClass(\"animate\");\n setTimeout(() => {\n $(\".gogoText\").removeClass(\"animate\");\n }, 1000);\n }", "function drawEnterText() {\n push();\n textAlign(CENTER);\n textFont(fontChangaBold);\n fill(hexDark[3]);\n stroke(hexDark[0]);\n strokeWeight(3);\n textSize(22);\n if( adventureManager.getStateName() === \"Brothel\") {\n text('Press [E] to exit', playerSprite.position.x, playerSprite.position.y - playerSpriteH - 100);\n }\n else {\n text('Press [E] to enter', playerSprite.position.x, playerSprite.position.y - playerSpriteH - 50);\n }\n pop();\n}", "draw_txt(txt, x, y) {\n return () => {\n fill(255);\n textAlign(CENTER);\n text(txt, x, y);\n };\n }", "function drawText(x, y, text, color, font)\r\n{\r\n\tx = parseInt(x);\r\n\ty = parseInt(y);\r\n\t\r\n\tif(pointOnScreen(x, y))\r\n\t{\r\n\t\tcontext.fillStyle = color;\r\n\t\tcontext.font = typeof font == 'undefined' ? default_font : font;\r\n\t\tcontext.textBaseline = 'top';\r\n\t\tcontext.fillText(text, x, y);\r\n\t}\r\n}", "doDraw() {\n let v = Math.min(Math.floor(Math.abs((this.life_time%120)-60.0)*(16/60)),15);\n draw_context.strokeStyle = \"#000\" + v.toString(16);\n draw_context.fillStyle = \"#FFF\" + v.toString(16);\n draw_context.font = \"40px Times\";\n draw_context.lineWidth = 10;\n draw_context.strokeText(this.text, canvas_element.width/2, 400);\n draw_context.fillText(this.text, canvas_element.width/2, 400);\n }", "gameOver() {\n this.ctx.font = \"50px serif\";\n this.ctx.fillText(\"Game Over\", 300, 90);\n }", "function winner() {\n background(0);\n fill(66, 244, 69);\n textFont(myFont, 80);\n textAlign(CENTER);\n text(\"WINNER\", 400, 200);\n textSize(32);\n text(\"AS YOU OFFER HIM THE WATER\", 400, 270);\n text(\"HE SNATCHES IT FROM YOUR HANDS\", 400, 285);\n text(\"AND PROCEEDS TO CHUG IT.\", 400, 300);\n text(\"HAVING DRANK TOO FAST, HE BEGINS TO CHOKE, THEN DIES.\", 400, 315);\n text(\"YOU TOO WILL NOW DIE, FOR THERE IS NO MORE WATER LEFT.\", 400, 330);\n text(\"BUT AT LEAST YOU DID THE RIGHT THING ACCORDING TO KANT.\", 400, 345);\n textSize(40);\n text(\"REFRESH THE PAGE TO PLAY AGAIN\", 400, 485);\n}", "addTexts(){\n var startingMessage = (game.singleplayer || game.vsAi) ? \"Current Turn: X\" : \"Searching for Opponent\"\n\n game.turnStatusText = game.add.text(\n game.world.centerX, 50, startingMessage,\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.turnStatusText.anchor.setTo(0.5, 0.5)\n game.turnStatusText.key = 'text'\n\n game.playerPieceText = game.add.text(\n game.world.centerX, 600-50, '',\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.playerPieceText .anchor.setTo(0.5, 0.5)\n game.playerPieceText.key = 'text'\n\n\n\n }", "function drawWin() {\n togglePause();\n ctx.font = '45px Ubuntu';\n ctx.strokeStyle = '#FF6600';\n ctx.textAlign = 'center';\n ctx.strokeText('You win!', canvas.width / 2, canvas.height / 2)\n}", "function changeTopText (newText, loc, delayDisappear, delayAppear, finalText, xloc, w) {\n\n\t/*If finalText is not provided, it is not the last text of the Draw step*/\n\tif(typeof(finalText)==='undefined') finalText = false;\n\t\n\tif(typeof(xloc)==='undefined') xloc = 0;\n\tif(typeof(w)==='undefined') w = 350;\n\t\n\tmiddleTextTop\t\n\t\t/*Current text disappear*/\n\t\t.transition().delay(700 * delayDisappear).duration(700)\n\t\t.attr('opacity', 0)\t\n\t\t/*New text appear*/\n\t\t.call(endall, function() {\n\t\t\tmiddleTextTop.text(newText)\n\t\t\t.attr(\"y\", -24*loc + \"px\")\n\t\t\t.attr(\"x\", xloc + \"px\")\n\t\t\t.call(wrap, w);\t\n\t\t})\n\t\t.transition().delay(700 * delayAppear).duration(700)\n\t\t.attr('opacity', 1)\n\t\t.call(endall, function() {\n\t\t\tif (finalText == true) {\n\t\t\t\td3.select(\"#clicker\")\n\t\t\t\t\t.text(buttonTexts[counter-2])\n\t\t\t\t\t.style(\"pointer-events\", \"auto\")\n\t\t\t\t\t.transition().duration(400)\n\t\t\t\t\t.style(\"border-color\", \"#363636\")\n\t\t\t\t\t.style(\"color\", \"#363636\");\n\t\t\t\t};\n\t\t});\n}", "function changeTopText (newText, loc, delayDisappear, delayAppear, finalText, xloc, w) {\n\n\t/*If finalText is not provided, it is not the last text of the Draw step*/\n\tif(typeof(finalText)==='undefined') finalText = false;\n\t\n\tif(typeof(xloc)==='undefined') xloc = 0;\n\tif(typeof(w)==='undefined') w = 350;\n\t\n\tmiddleTextTop\t\n\t\t/*Current text disappear*/\n\t\t.transition().delay(700 * delayDisappear).duration(700)\n\t\t.attr('opacity', 0)\t\n\t\t/*New text appear*/\n\t\t.call(endall, function() {\n\t\t\tmiddleTextTop.text(newText)\n\t\t\t.attr(\"y\", -24*loc + \"px\")\n\t\t\t.attr(\"x\", xloc + \"px\")\n\t\t\t.call(wrap, w);\t\n\t\t})\n\t\t.transition().delay(700 * delayAppear).duration(700)\n\t\t.attr('opacity', 1)\n\t\t.call(endall, function() {\n\t\t\tif (finalText == true) {\n\t\t\t\td3.select(\"#clicker\")\n\t\t\t\t\t.text(buttonTexts[counter-2])\n\t\t\t\t\t.style(\"pointer-events\", \"auto\")\n\t\t\t\t\t.transition().duration(400)\n\t\t\t\t\t.style(\"border-color\", \"#363636\")\n\t\t\t\t\t.style(\"color\", \"#363636\");\n\t\t\t\t};\n\t\t});\n}", "function drawTxt(txtObj) {\n gCtx.font = `bold ${txtObj.size}px Impact`;\n gCtx.fillStyle = txtObj.fillColor\n gCtx.strokeStyle = txtObj.strokeColor\n gCtx.textAlign = txtObj.align;\n gCtx.fillText(txtObj.line, (gCanvas.width / 2), txtObj.yPos);\n gCtx.strokeText(txtObj.line, (gCanvas.width / 2), txtObj.yPos);\n}", "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n \n push();\n\n // title text\n fill(255);\n textAlign(LEFT);\n textFont(headlineFont);\n textSize(24);\n\n text(this.titleText, this.drawX , this.drawY - 120);\n \n // Draw text in a box\n //text(this.titleText, width/6, height/6, this.textBoxWidth, this.textBoxHeight );\n \n textFont(bodyFont);\n textSize(20);\n\n text(this.bodyText, this.drawX, this.drawY - 80, width - 480,height - (this.drawY+100) );\n \n pop();\n }", "function drawText(x,y,text,color){\r\n ctx.fillStyle = color;\r\n ctx.font=\"50px arial\";\r\n ctx.fillText(text,x,y);\r\n}", "function update() {\n requestAnimationFrame(update);\n context.fillStyle = \"#000\";\n context.fillRect(0, 0, canvas.width, canvas.height);\n\n context.textBaseline = \"middle\";\n textObjects.forEach(textObject => {\n textObject.draw();\n });\n }", "update(txt) {\n this.domElement.innerText = txt;\n this.rect = this.domElement.getBoundingClientRect();\n }", "function writeMsg() {\r\n\r\n\t// Clear the previous frame of the bottom left corner text\r\n\ttextctx.clearRect(10,540,500,30);\r\n\t// Clear the previous frame of the top left corner text\r\n\ttextctx.clearRect(10,25,200,50);\r\n\t\r\n\t\r\n\ttextctx.fillStyle = \"rgb(250, 250, 250)\";\r\n\ttextctx.font = \"15px pixelmixregular\";\r\n\ttextctx.textAlign = \"left\";\r\n\ttextctx.textBaseline = \"top\";\r\n\r\n\t\r\n\t\r\n\r\n\t// Only write if the game isn't over\r\n\tif (!gameOver){\r\n\t\r\n\t\ttextctx.fillText(\"Nb Vies : \" + player.lives, 18, 25);\r\n\t\ttextctx.fillText(\"Sante : \" + player.health, 18, 50);\r\n\t\t\r\n\t\tif (presentsToCollect <= 5) {\r\n\t\t\ttextctx.fillText(\"Nombre de cadeaux restants : \" + presentsToCollect, 18, 540);\r\n\t\t}else{\r\n\t\t\t//textctx.fillText(\"Tous les cadeaux sont recueillis! Retournez au début.\");\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n}", "function draw()\n{\n\tdraw_sprite(canvas, mirror, 300, 30);\n\tdraw_sprite(canvas, nam, nam_x, man_y);\n\tif (draw_text) textout_centre(canvas, font, \"you suck\", 400, 60+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_text) textout_centre(canvas, font, \"& are stupid\", 400, 150+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_alt_text) textout_centre(canvas, font, \"believe in\", 400, 150, 8, makecol(128, 200, 255));\n\tif (draw_alt_text) textout_centre(canvas, font, \"yourself\", 400, 190, 8, makecol(128, 200, 255));\n\tdraw_sprite(canvas, not_mirror, 0, 0);\n\tdraw_sprite(canvas, man, man_x, man_y);\n}", "function draw() {\n\n //textColor changes so it has to be in draw instead of setup\n //starts as transparent clicking i turns it opaque\n textColor = color(0, 0, 0, o);\n textColor2 = color(255,255,255,o);\n\n //main screen only shows up when turning program on\n if (main === true) {\n noStroke();\n fill(0);\n textSize(16);\n text(\"Press i at any time to turn on instructions.\", 150, 175);\n text(\"Pressing i again will turn them off, if the background is white\", 150, 200);\n text(\"you will need to refresh the page by hitting the same number\", 150, 225);\n text(\"to get rid of the instructions.\", 150, 250);\n text(\"To begin press 1,2,3,4, or 5.\", 150, 275);\n \n //title whimsical\n //color changes with mouse position\n fill(mouseX%255,255-mouseY%255,187);\n stroke(0);\n textSize(100);\n text(\"w\",150,500);\n text(\"h\",205,500);\n text(\"i\",240,500);\n text(\"m\",240,500);\n text(\"s\",305,500);\n text(\"i\",335,500);\n text(\"c\",338,500);\n text(\"a\",372,500);\n text(\"l\",407,500);\n textSize(16);\n }\n \n //related to the switch case to switch between modes\n if (bubble === true) {\n bubbles(50);\n }\n if (vortex === true) {\n depth();\n }\n if (box === true) {\n boxes();\n }\n if (stacks === true) {\n stacking();\n }\n if (dots === true) {\n drawing();\n }\n}", "function showText(ctx, text, x, y) {\n\t\tif (browser != -1)\n\t\t\tctx.fillText(text, Math.round(x), Math.round(y));\n\t\telse\n\t\t\tctx.fillText(text, Math.round(x + ctx.measureText(text).width), Math.round(y));\n\t}", "draw() {\n strokeWeight(10);\n point(this.x, this.y);\n text(this.name, this.x + 10, this.y + 10)\n }", "function draw() {\n\n noStroke();\n fill(255);\n var extraSpace = 0;//The words have its own length , so it needs to be offset to the right \n // i MEANS THE FIRST LETTER OF THE sentence \n\n for (let i = 0; i < words.length; i++) {\n // appearing over time...\n //note that canvas Is loading 60 times per second which means if the first letter is 1 then when francount reaches and goes beyond 1*100 the first word get pirnted \n\n if (frameCount > i * 100) {\n var wordMarginLeft = 30 * i; //The distance of each word is 30 // letters got print with the distance of 30 \n \n if (i > 0) {\n extraSpace = extraSpace + words[i - 1].length * 13; //we need to add extra space in letters and it's caculated by the length of the letters\n }\n fill(255);\n text(words[i], wordMarginLeft + extraSpace, 20);\n }\n }\n \n \n}", "function drawText(){\r\n ctx.font = `${HEIGHT/40}px Arial`;\r\n ctx.fillText(`Score: ${score}`, WIDTH - 150, HEIGHT/15);\r\n\r\n}", "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n \n push();\n\n // title text\n fill(0);\n textAlign(CENTER);\n textFont(headlineFont);\n textSize(32);\n\n text(this.titleText, width/2 , this.drawY);\n \n // Draw text in a box\n //text(this.titleText, width/6, height/6, this.textBoxWidth, this.textBoxHeight );\n \n textFont(bodyFont);\n textSize(18);\n\n text(this.bodyText, this.drawX, this.drawY + 32, 770, 500);\n \n pop();\n }", "function text(x, y, text, color, font){\n ctx.fillStyle = color;\n ctx.font = font;\n ctx.fillText(text, x, y);\n}", "printText () {\n\n push();\n\n translate ( this.xCoord, this.yCoord );\n\n fill ( 250, 250, 250 );\n noStroke();\n\n triangle( 0, - this.size / 3, this.size / 5, -this.size / 2, - this.size / 5, -this.size / 2 );\n ellipse ( 0, - 2 * (this.size / 3), this.size - 20, this.size / 2 );\n\n textAlign( CENTER );\n textStyle ( BOLD );\n textSize ( this.size / 12 );\n fill ( 70, 70, 70 );\n\n text ( this.name, 0, - 15 * ( this.size / 20 ) );\n textSize ( this.size / 16 );\n text ( \"Pre\", -this.size / 5, - 13 * (this.size / 20 ) );\n text ( \"Post\", this.size / 5, - 13 * (this.size / 20 ) );\n\n textSize ( this.size / 12 );\n text ( this.preCovidPercentage + \"%\", - this.size / 5, - 11 * ( this.size / 20 ));\n text ( this.postCovidPercentage + \"%\", this.size / 5, - 11 * ( this.size / 20 ));\n\n pop();\n }", "function displayWin() {\n push();\n background(0);\n textAlign(CENTER);\n textSize(20);\n textFont(myFont);\n fill(255);\n var winText = \"you win\";\n text(winText,width/2,height/2);\n pop();\n}", "function drawTitle(){\n\t\n\t//Adjustment for text\n\tvar Xadj = -1;\n\tvar Yadj = 20;\n\t\n\t//Draws Text\n\tcanvasContext.fillStyle = \"black\";\n\tcanvasContext.font = \"25px georgia\";\n\tcanvasContext.fillText(\"the button\",25+Xadj,25+Yadj);\n\t\n}", "function drawLevelName() {\n game.context.fillStyle = \"black\";\n game.context.fillRect(300, 400, 100, 100)\n\n game.context.fillStyle = \"white\";\n game.context.font = \"10px 'Press Start 2P'\";\n game.context.fillText(levels[indexLevels].name, 300, 450);\n\n}", "function drawGameOver() {\n togglePause();\n ctx.font = '45px Ubuntu';\n ctx.strokeStyle = '#FF6600';\n ctx.textAlign = 'center';\n ctx.strokeText('Game Over!', canvas.width / 2, canvas.height / 2)\n \n}", "function winGame() {\r\n\r\n\t// Clear the entire screen text\r\n\ttextctx.clearRect(0,0,1000,1000);\r\n\t\r\n\t\r\n\ttextctx.font = \"25px pixelmixregular\";\r\n\ttextctx.fillText(pName + \" EST LE BEST!\", 200,210);\r\n\ttextBox.style.display = \"block\";\r\n\r\n}", "function draw()\r\n\t{\r\n\t\t// set the draw fill style colour to black\r\n\t\tcontext.fillStyle = \"#000000\";\r\n\t\t// fill the canvas with black\r\n\t\tcontext.fillRect(0,0,canvas.width,canvas.height);\r\n\t\t// choose a font for our message\r\n\t\tcontext.font = \"40pt Calibri\";\r\n\t\t// set the draw fill colour to white\r\n\t\tcontext.fillStyle = \"#ffffff\";\r\n\t\t// draw the text at the specified position\r\n\t\tcontext.fillText(\"Hello World!\", 150, canvas.height);\r\n\t}", "function handleText() {\n if (index < text.length) {\n id(\"output\").innerText = \"\";\n let curWord = text[index];\n id(\"output\").innerText = curWord;\n index++;\n } else {\n endGame();\n }\n }", "draw(context)\n\t{\n\t\tif ( !this.visible )\n\t\t\treturn;\n\n\t\tcontext.font = this.fontSize + \"px \" + this.fontName;\n\t\tcontext.fillStyle = this.fontColor;\n\t\tcontext.textAlign = this.alignment;\n\t\t\n\t\tcontext.setTransform(1,0, 0,1, 0,0); \n\t\tcontext.globalAlpha = this.opacity;\n\n\t\t// shadow draw settings\n\t\tif (this.drawShadow)\n\t\t{\n\t\t\tcontext.shadowColor = this.shadowColor;\n\t\t\tcontext.shadowBlur = this.shadowSize;\n\t\t}\n\n\t\t// add support for multiline text (line breaks indicated by \"\\n\")\n\t\tlet textArray = this.text.split(\"\\n\");\n\t\tlet lineSkip = this.fontSize * this.lineHeight;\n\n\t\t// draw filled in text (multiple times to increase drop shadow intensity)\n\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t{\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t}\n\n\t\t// disable shadowBlur, otherwise all sprites drawn later will have shadows\n\t\tcontext.shadowBlur = 0;\n\t\t// draw filled text again, to fill over interior shadow blur, that may be a different color\n\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t{\n\t\t\tcontext.fillText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t}\n\n\t\t// draw border last, so not hidden by filled text\n\t\tif (this.drawBorder)\n\t\t{\n\t\t\tcontext.strokeStyle = this.borderColor;\n\t\t\tcontext.lineWidth = this.borderSize;\n\t\t\tfor (let i = 0; i < textArray.length; i++)\n\t\t\t{\n\t\t\t\tcontext.strokeText( textArray[i], this.position.x, this.position.y + i * lineSkip);\n\t\t\t}\n\t\t}\t\t\n\t}", "function drawText(h, m, s) {\n\t// noFill();\n\ttextSize(25);\n\tfill('#FFB48F');\n\n\ttext(s, 240, 300);\n\ttext(m, 550, 540);\n\ttext(h, 860, 770);\n}", "function drawTextIntoCanvasAtTile(text, x, y) {\n var textGraphic = new createjs.Text(text, \"7px Monospace\", \"#00aa00\");\n textGraphic.setTransform(x * PROCEDURAL_MAZE.config.tileSize, y * PROCEDURAL_MAZE.config.tileSize);\n stage.addChild(textGraphic);\n}", "function gameOver() {\n background(0);\n fill(255, 0, 0);\n textFont(myFont, 80);\n textAlign(CENTER);\n text(\"LOSER\", 400, 200);\n textSize(32);\n text(\"HAVING DRANK ALL THE WATER, OR ATTEMPTED TO SHARE IT,\", 400, 270);\n text(\"YOU HAVE DONE THE WRONG THING!\", 400, 285);\n text(\"THE DUTIFUL THING WOULD HAVE BEEN TO GIVE IT\", 400, 300);\n text(\" TO THE DYING PERSON FIRST.\", 400, 315);\n text(\"BETTER LUCK NEXT TIME.\", 400, 330);\n textSize(40);\n text(\"REFRESH THE PAGE TO PLAY AGAIN\", 400, 485);\n}", "function simulateText(text, finializeFunc){\r\n\tif(!state.newRNG){\r\n\t\tanimationBoxes();\r\n\t}\r\n\tstartTime = engine.timing.timestamp;\r\n\tconsole.log(\"startTime: \"+startTime);\r\n\r\n\topentype.load(\"BO-Midnight.ttf\", function(err, font) {\r\n\r\n\t\ttext = text.replace(/\\s/g,'');\r\n\r\n\t\tvar amount, glyph, ctx, x, y, fontSize;\r\n\t\tif (err) {\r\n\t\t\tconsole.log(err.toString());\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmousepos = [100,100];\r\n\t\tcrackPoint = new Path.Circle([-100,-100],5);\r\n\t\tcrackPoint.fillColor = textColor;\r\n\r\n\t\tvar textwidth = font.getAdvanceWidth(text, 500);\r\n\t\tvar fontpaths = font.getPaths(text,(paper.view.viewSize.width-textwidth)/2,0,500);\r\n\r\n\t\tfor(var i = 0; i<fontpaths.length; i++){\r\n\r\n\t\t\tif(fontpaths[i].commands == 0) continue;\r\n\r\n\t\t\t//import test as SVG into paper\r\n\t\t\tvar boundingboxData = fontpaths[i].getBoundingBox();\r\n\t\t\tvar boundingbox = new Rectangle([boundingboxData.x1, boundingboxData.y1], [boundingboxData.x2-boundingboxData.x1, boundingboxData.y2-boundingboxData.y1]);\r\n\t\t\tvar paperpath = paper.project.importSVG(fontpaths[i].toSVG());\r\n\t\t\tpaperpath.fillColor = '#DCDCDC';\r\n\r\n\t\t\tif(i==0){\r\n\t\t\t\tconsole.log(paper.view.bounds.x);\r\n\t\t\t\tconsole.log(boundingbox.bottomLeft.x);\r\n\t\t\t\twhile(paper.view.bounds.x+200>boundingbox.bottomLeft.x){\r\n\t\t\t\t\tpaper.view.zoom = paper.view.zoom-0.05;\r\n\t\t\t\t\tconsole.log(paper.view.bounds.x);\r\n\t\t\t\t\tconsole.log(boundingbox.bottomLeft.x);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//paperpath = prepareLetter(paperpath, leanside);\r\n\r\n\t\t\tvar rrad = (state.getNextInt(0,60)-30)/100;\r\n\t\t\tpaperpath.rotate(rrad * (180/Math.PI));\r\n\r\n\t\t\tpaperpath.bounds.bottomCenter = [boundingbox.center.x, groundheight-80];\r\n\t\t\tif(animation){\r\n\t\t\t\tpaperpath.bounds.bottomCenter = [boundingbox.center.x, groundheight-380];\r\n\t\t\t}\r\n\t\t\tcrackShapeObject(paperpath);\r\n\r\n\t\t}\r\n\t\tcrackPoint.bringToFront();\r\n\r\n\t\tfinializeFunc();\r\n\t});\r\n}", "function drawText(label, xPos, yPos, txtSize, txtWeight) {\n textAlign(CENTER);\n textFont(\"Arial\");\n textSize(txtSize);\n textStyle(txtWeight);\n fill(textColor);\n strokeWeight(0);\n text(label, xPos, yPos);\n //The stroke weight needed for the lines is making the text too thick.\n //I should probably fix this via CSS instead\n strokeWeight(1);\n}", "draw(context) {\r\n\r\n var x = this.sprite.x_pos + this.sprite.x_offset;\r\n var y = this.sprite.y_pos + this.sprite.y_offset;\r\n\r\n context.fillStyle = '#ffffff';\r\n\r\n if (this.sprite.debug) {\r\n if (this.ghost.direction_current != null && this.ghost.direction_future != undefined) {\r\n context.fillText('Direction Current=' + this.ghost.direction_current.name, x + 20 + this.sprite.width, y + 40);\r\n context.fillText('Direction Future=' + this.ghost.direction_future.name, x + 20 + this.sprite.width, y + 60);\r\n }\r\n }\r\n //context.fillText('Target', 300, 280);\r\n super.draw(context);\r\n\r\n }", "updateGraphicPosition () {\n this.textGfx.setPosition(this.getPosition())\n this.textGfx.setMatrix(\n math.matrix.matmul(math.matrix.createTranslationMatrix(this.getX(), this.getY()),\n math.matrix.matmul(this.rotationMtx, math.matrix.createTranslationMatrix(-this.getX(), -this.getY()))))\n }", "function UpdateText(ref, newText){\n // Default vals\n noStroke(0); fill(255); textSize(20); textAlign(LEFT);\n \n switch(ref){\n case (0): { text(newText, 500, 25); break;}\n case (2): { text(newText, 200, 25); break;}\n case (3): {textAlign(CENTER); text(newText, width/2, 640); break;}\n }\n\n }", "function text() {\n context.fillStyle = \"white\"; \n if(mediaQuery.matches){\n context.font = \"40px Cousine\";\n } else {\n context.font = \"70px Cousine\";\n }\n context.textAlign = \"center\";\n context.fillText(\"Hello I'm Meekit Patel\", (canvas.width/2), (canvas.height/2)); \n}", "function AddTextPosition(){\r\n\tLCD.begin()\r\n\tLCD.clear(255,0,0)\r\n\tLCD.text(\"Hello Nice to meet you!\",\"HCENTER&VCENTER\", 10, 90, \"Mono.ttf\", 30, 0, 0, 255)\r\n\tLCD.display()\r\n}", "_drawSourceText(text) {\n let context = this.getContext();\n context.font = COMPARE_TEXT_FONT;\n\n let yPos = this.cellSize - 25;\n let xPos;\n let textSize;\n for (let i = 0; i < text.length; i++) {\n textSize = context.measureText(text.charAt(i));\n xPos = (this.cellSize * (i + 2)) - Math.round(textSize.width / 2);\n context.fillText(text.charAt(i), xPos, yPos);\n }\n }", "function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}" ]
[ "0.76521015", "0.7532574", "0.75104934", "0.741328", "0.7272683", "0.7173339", "0.7138787", "0.7132935", "0.71317434", "0.7123729", "0.7100793", "0.7090229", "0.70706534", "0.70541763", "0.69711286", "0.6970651", "0.6964934", "0.69635653", "0.695962", "0.69258195", "0.6902727", "0.6896307", "0.6892241", "0.6871685", "0.6864975", "0.6864848", "0.68352264", "0.6812284", "0.6792265", "0.6765428", "0.6759486", "0.67484814", "0.67472225", "0.67423415", "0.6732869", "0.67320865", "0.67205113", "0.6718374", "0.67177105", "0.6714181", "0.67089623", "0.6707006", "0.6699377", "0.669313", "0.6684587", "0.66762763", "0.6671833", "0.6670673", "0.66656643", "0.66603714", "0.6658591", "0.6656641", "0.6653871", "0.6651084", "0.6649935", "0.6647205", "0.6642652", "0.66387826", "0.6636265", "0.66312", "0.6617904", "0.6601507", "0.6599173", "0.6597133", "0.6596295", "0.6596295", "0.659427", "0.6589983", "0.65895", "0.6583188", "0.6581001", "0.6576964", "0.65732646", "0.6569274", "0.6560673", "0.6558846", "0.65580267", "0.6549052", "0.6530164", "0.6528211", "0.6526825", "0.65149623", "0.6512094", "0.651162", "0.6499505", "0.64948756", "0.64826655", "0.6476038", "0.6470843", "0.64605147", "0.6455162", "0.64525914", "0.64485735", "0.64484406", "0.6444887", "0.64366794", "0.6430407", "0.642677", "0.6426675", "0.6423904", "0.6423427" ]
0.0
-1
Change the mode of the text
function changeSinMode() { mode = mode +1; if (mode > 3) { mode = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textLevel(mode)\r\n{\r\n textMode = mode;\r\n console.log(textMode);\r\n return textMode;\r\n}", "function changeTextMode(field, mode)\n{\n\tif(mode != 1)\n\t{\n\t\tfield.readOnly = true;\n\t\tfield.style.backgroundColor = \"#E1E1E1\";\n\t}\n\telse\n\t{\n\t\tfield.readOnly = false;\n\t\tfield.style.backgroundColor = \"#ffffff\";\n\t}\n}", "function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}", "function Vn(e){e.doc.mode=He(e.options,e.doc.modeOption),Kn(e)}", "function changeText() {\n \n }", "startTextMode() {\n if (this.getCurrentState() !== states.TEXT) {\n this._state = states.TEXT;\n\n this._getModule(modules.TEXT).start({\n mousedown: this._onFabricMouseDown.bind(this),\n select: this._onFabricSelect.bind(this),\n selectClear: this._onFabricSelectClear.bind(this),\n dbclick: this._onDBClick.bind(this),\n remove: this._handlers.removedObject\n });\n }\n }", "function drawMode(){\n ctx.font = '50px serif';\n //ctx.fillText('Hello world', 50, 90);\n if (buildMode){\n ctx.fillText('Mode: Build', 10,50);\n } else {\n ctx.fillText('Mode: Attack', 10,50);\n }\n}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "set mode(value) {}", "function viewText(n) {\r\n var getDocument = document.getElementById(\"wysiwyg\" + n).contentWindow.document;\r\n var browserName = navigator.appName;\r\n\r\n\t// View Text for IE\r\n if (browserName == \"Microsoft Internet Explorer\") {\r\n var iText = getDocument.body.innerText;\r\n getDocument.body.innerHTML = iText;\r\n\t}\r\n\r\n\t// View Text for Mozilla/Netscape\r\n else {\r\n var html = getDocument.body.ownerDocument.createRange();\r\n html.selectNodeContents(getDocument.body);\r\n getDocument.body.innerHTML = html.toString();\r\n\t}\r\n\r\n\t// Hide the Text Mode button and show the HTML Mode button\r\n document.getElementById('textMode' + n).style.display = 'none';\r\n\tdocument.getElementById('HTMLMode' + n).style.display = 'block';\r\n\r\n\t// reset the font values\r\n getDocument.body.style.fontSize = \"\";\r\n\tgetDocument.body.style.fontFamily = \"\";\r\n\tviewTextMode = 0;\r\n}", "endTextMode() {\n if (this.getCurrentState() !== states.TEXT) {\n return;\n }\n this._state = states.NORMAL;\n this._getModule(modules.TEXT).end();\n }", "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function switchMode() {\n\tif (html_mode) {\n\t\t// Set content\n\t\tCKEDITOR.instances.page_content.setData(content_editor.getValue());\n\t\thtml_mode = false;\n\t} else {\n\t\t// Set content\n\t\tcontent_editor.setValue(CKEDITOR.instances.page_content.getData());\n\t\thtml_mode = true;\n\t}\n}", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n }else{\n mode = 3;\n console.log(\"RC mode : 3\");\n }\n }", "function changeMode(mode) {\n\t// Mathml mode.\n\tif (mode == 'xml') {\n\t\t_wrs_conf_saveMode = 'xml';\n\t}\n\t// Image mode.\n\telse if (mode == 'image') {\n\t\t_wrs_conf_saveMode = 'image';\n\t}\n\t// Base64 mode.\n\telse if (mode == 'base64') {\n\t\t_wrs_conf_saveMode = 'base64';\n\t\t// With this variable, formulas are stored as a base64 image on the database but showed with\n\t\t// a showimage src on the editor.\n\t\t_wrs_conf_editMode = \"image\";\n\t}\n\t// Updating Preview and HTML tabs.\n\tupdateFunction();\n}", "function switcherText(mode){\n //console.log(mode);\n\tif(mode === 'S'){\n\t\treturn \">Swap to Killer\";\n\t}\n\telse {\n\t\treturn \">Swap to Survivor\";\n\t}\n}", "setMode(mode) {\n this._mode = mode;\n }", "function onChangeTextAlign(direction) {\n changeCurrMeme('text-direction', direction);\n renderCanvas();\n}", "function changeItalic() {\r\n var fontStyle = document.querySelector(\"textarea\").style.fontStyle;\r\n if (fontStyle == \"italic\") {\r\n document.querySelector(\"#text\").style.fontStyle = \"\";\r\n } else {\r\n document.querySelector(\"#text\").style.fontStyle = \"italic\";\r\n }\r\n}", "function changeMode1() {\n\tvar mode = document.getElementById(\"modeSelect1\");\n\tvar strUser = mode.options[mode.selectedIndex].text;\n\teditor.getSession().setMode(\"ace/mode/\" + strUser);\n\teditor.focus();\n\tchangeMod();\n}", "function changeMode() {\n if ($(\"#mode\").html() === \"EASY MODE\") {\n $(\"#mode\").html(\"ADVANCED MODE\"); //Change title of menu link\n $(\"#advancedMode\").css(\"display\", \"none\"); // hide Advance Mode elements\n $(\"#easyMode\").css(\"display\", \"block\"); // unhide Easy Mode elements\n } else {\n $(\"#mode\").html(\"EASY MODE\"); //Change title of menu link\n $(\"#easyMode\").css(\"display\", \"none\"); // hide Easy Mode elements\n $(\"#advancedMode\").css(\"display\", \"flex\"); // unhide Advance Mode elements\n\n }\n}", "function changeItalic() {\n var fontStyle = document.querySelector(\"textarea\").style.fontStyle;\n if (fontStyle == \"italic\") {\n document.querySelector(\"#text\").style.fontStyle = \"\";\n } else {\n document.querySelector(\"#text\").style.fontStyle = \"italic\";\n }\n}", "function changeMode(evt) { \n console.log(evt.keyCode);\n var newMode = findMode('keyCode', evt.keyCode)\n if(_keys.indexOf(evt.keyCode) > -1) {\n _colorInput.value = _colorToCopy;\n _colorInput.focus();\n _colorInput.select();\n } \n if(newMode) {\n _mode = newMode;\n text.renderColor();\n }\n }", "set wrapMode(value) {}", "function renderTextByMode(){\n switch(mode){\n case 'display':\n return (\n <span \n className=\"display-mode\">\n {content.text}\n </span>\n );\n case 'edit':\n return (\n <textarea \n name={content.label.toLowerCase()}\n className=\"edit-mode\" \n value={content.text} \n onChange={onInputChangeCallback}\n />\n );\n default:\n console.log('TextField component rendered in invalid mode');\n }\n }", "editCommand(){const richtext=this.shadowRoot.getElementById(\"richtext\"),editmode=richtext.contentDocument;editmode.designMode=\"on\"}", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = cm.options.flattenSpans;\n var curText = \"\", curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize);\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n if (stream.pos > 5000) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.pos + 50000);\n style = null;\n }\n var substr = stream.current();\n stream.start = stream.pos;\n if (!flattenSpans || curStyle != style) {\n if (curText) f(curText, curStyle);\n curText = substr; curStyle = style;\n } else curText = curText + substr;\n }\n if (curText) f(curText, curStyle);\n }", "set richText(value) {}", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = cm.options.flattenSpans;\n var curText = \"\", curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize);\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n if (stream.pos > 5000) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n }\n var substr = stream.current();\n stream.start = stream.pos;\n if (!flattenSpans || curStyle != style) {\n if (curText) f(curText, curStyle);\n curText = substr; curStyle = style;\n } else curText = curText + substr;\n }\n if (curText) f(curText, curStyle);\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = cm.options.flattenSpans;\n var curText = \"\", curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize);\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n var style = mode.token(stream, state);\n if (stream.pos > 5000) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n }\n var substr = stream.current();\n stream.start = stream.pos;\n if (!flattenSpans || curStyle != style) {\n if (curText) f(curText, curStyle);\n curText = substr; curStyle = style;\n } else curText = curText + substr;\n }\n if (curText) f(curText, curStyle);\n }", "toggleItalic() {\n if (this.viewer.owner.isReadOnlyMode) {\n return;\n }\n let value = this.getCurrentSelectionValue('italic');\n this.selection.characterFormat.italic = value;\n }", "function changetextitalic() {\n var currentIndex = findCurrentIndex(tempKey);\n if (mainDiagram.model.nodeDataArray[currentIndex].Italic) {\n mainDiagram.model.nodeDataArray[currentIndex].Italic = false\n }\n else {\n mainDiagram.model.nodeDataArray[currentIndex].Italic = true;\n }\n getRadio(mainDiagram.selection.Ca.value);\n}", "set text(value) {}", "set text(value) {}", "_setText(text) {\n // Reset the dialog\n if (this.text) this.text.destroy();\n\n const x = this.padding + 10;\n const y = this._getGameHeight() - this.windowHeight - this.padding + 10;\n\n this.text = this.scene.make.text({\n x,\n y,\n text,\n style: {\n wordWrap: { width: this._getGameWidth() - (this.padding * 2) - 25 }\n }\n });\n }", "function switchMode(mode) {\n\tvar modeData = modes[mode];\n\tif (!modeData) {\n\t\tconsole.log(\"No mode found for \" + mode);\n\t} else {\n\t\tui.mode = modeData;\n\t\tconsole.log(\"Start: \" + modeData.title);\n\n\t\t// Set the title and clear the UI\n\t\t$(\"#left-col > .section-header > .section-title\").html(modeData.title);\n\t\t$(\"#main-entities\").html(\"\");\n\t\t$(\"#side-entities\").html(\"\");\n\n\t\t// Custom behavior\n\t\tmodeData.onStart();\n\n\t\t// Record as the last mode\n\t\tlocalStorage.setItem(\"lastMode\", mode);\n\n\t}\n}", "function dotmode() {\n mode = \"dot\"\n}", "set renderMode(value) {}", "set renderMode(value) {}", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n stream.pos = Math.min(text.length, stream.start + 50000);\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n if (curStart < stream.pos) f(stream.pos, curStyle);\n }", "function ChangeTextSpeed(speed) {\n switch (speed) {\n case \"slow\":\n characterRevealDelay = 80;\n break;\n case \"fast\":\n characterRevealDelay = 20;\n break;\n // superfast is used by the skip button to make the text rapidly appear\n case \"superfast\":\n characterRevealDelay = 5;\n break; \n default:\n characterRevealDelay = 35;\n break;\n };\n}", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "function switchtext(){\n\t\t$(\"replaceMe\").html(\"blockquotes\", \"no quote\");\n\t\n\t}", "function editable() {\n text.blur();\n setTimeout(function() {\n text.setEditable(true);\n }, 500);\n\n win.removeEventListener('postlayout', editable);\n }", "function editable() {\n text.blur();\n setTimeout(function() {\n text.setEditable(true);\n }, 500);\n\n win.removeEventListener('postlayout', editable);\n }", "function switchtext(){\n\t\t$(\"ol\").html(\"falseFact\");\n\t\t$(\"ol\").html(\"TrueFact\");\n\t\n\t}", "changeGameMode(mode) {\n DATA.difficultyMode = mode;\n VIEW.displayDifficulty();\n }", "toggleCase() {\n\n this.isLowerCase = !this.isLowerCase;\n\n this.keys.forEach( ( key ) => {\n\n const char = key.info.chars[ key.panel.charset ] || key.info.chars[ 0 ];\n\n const newContent = this.isLowerCase || !char.upperCase ? char.lowerCase : char.upperCase;\n\n const textComponent = key.children.find( child => child.isText );\n\n if ( !textComponent ) return\n\n key.info.input = newContent;\n\n textComponent.set({\n content: newContent\n });\n\n textComponent.update( true, true, true );\n\n });\n\n }", "function textCodeSwitch() {\n const textArea = document.querySelector('#text-area')\n const textOptions = document.querySelector('.text-options')\n const codeArea = document.querySelector('#code-area')\n const codeOptions = document.querySelector('.code-options')\n textArea.style.display = 'none';\n codeArea.style.display = 'block';\n textOptions.style.display = 'none';\n codeOptions.style.display = 'block';\n}", "function editModeOn() {\n\tif(document.getElementById(\"editorTextInputField\")){\n\t\talert(\"Egyszerre egy mezot szerkeszthetsz!\");\n\t\treturn;\n\t}\n\thiddenMenusOff();\n\tif(!editMode) {\n\t\t$('#edit-mode').addClass(\"active\");\n\t\teditMode = true;\n\t\tonclickToTexts();\n\t} else {\n\t\tif(document.getElementById(\"editorTextInputField\")){\n\t\t\talert(\"Fejezd be a szerkesztest mielott kilepsz a szerkesztesmodbol!\");\n\t\t\treturn;\n\t\t}\n\t\thiddenMenusOff();\n\t\teditMode = false;\n\t}\n}", "function toggleTextArea() {\n\t\tvar disabled = document.getElementById(\"note-view\").readOnly;\n\t\tif (disabled) {\n\t\t\tdocument.getElementById(\"note-view\").readOnly = false;\n\t\t\t$(\"#toggle_edit\").text(\"Read Only\");\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById(\"note-view\").readOnly = true;\n\t\t\t$(\"#toggle_edit\").text(\"Edit\");\n\t\t}\n\t}", "updateText(text) {\n\t\tthis.text = text;\n\t}", "autowriterText() {\n // clear the interval of alternating text\n clearInterval(this.interval);\n this.counter = 0;\n this._interval = setInterval(() => {\n this.displayText += this.text.charAt(this.counter);\n this.counter++;\n // to display alternating text\n if (this.counter === this.text.length) {\n this.alternatingWriterText();\n }\n }, this.speed);\n }", "onTextChange()\n {\n let data = this.pad.getContents()\n\n // add type\n data[\"@type\"] = \"mycelium::rich-text\"\n\n this.shroom.setData(this.key, data)\n }", "function runMode(cm, text, mode, state, f) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n stream.pos = text.length;\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function setTextInput(text) {\n setText(text);\n }", "set text(text) {\n\t\tthis._text = text;\n\t}", "function setMode(mode) {\n\tlocalSet({mode});\n\treturn false;\n}", "function changeMode()\n{\n mode = $('input[name=mode]:checked').val();\n \n $('#shape').hide();\n $('#color').hide();\n $('#filters').hide();\n $('#optimization').hide();\n showAll(); // shows all elements (circles and triangles)\n removeBehaviors(); // disables click and drag behaviors\n removeTextBoxes(); // removes any text boxes from optimizations\n\n switch (mode)\n {\n case \"Add\":\n {\n modeAdd();\n break;\n }\n case \"Resize\":\n {\n modeResize();\n break;\n }\n case \"Move\":\n {\n modeMove();\n break;\n }\n case \"Delete\":\n {\n modeDelete();\n break;\n }\n case \"Filter\":\n {\n modeFilter();\n break;\n }\n case \"Optimize\":\n {\n modeOptimize();\n break;\n }\n }\n\n changeText(instructions[mode]);\n}", "function CameraCommand_Action_ProcessMode_TypeText(elapsed)\n{\n\t//basic not done yet?\n\tif (!this.Mode_TypeText_Basic)\n\t{\n\t\t//Process Basic\n\t\tthis.Mode_TypeText_Basic = this.ProcessMode_Basic(elapsed);\n\t}\n\t//animation not yet done?\n\telse if (!this.Mode_TypeText_Animation)\n\t{\n\t\t//add an animation command\n\t\tthis.Camera.Commands.push(new CameraCommand_Animation(this.Camera, __CAMERA_UI_TYPE_KEYDOWN));\n\t\t//done with this\n\t\tthis.Mode_TypeText_Animation = true;\n\t}\n\t//focus not set\n\telse if (!this.Mode_TypeText_Focused)\n\t{\n\t\t//screenshot mode?\n\t\tif (__SCREENSHOTS_ON)\n\t\t{\n\t\t\t//fake focus\n\t\t\tthis.Object.HTML.STATES_FOCUSED = true;\n\t\t\t//not ignoring events?\n\t\t\tif (!this.Object.HTML.IGNORE_EVENTS)\n\t\t\t{\n\t\t\t\t//trigger state update\n\t\t\t\tBasic_UpdateState(this.Object.HTML, this.Object);\n\t\t\t}\n\t\t\t//has focused?\n\t\t\tif (this.Object.HTML.State_OnFocus)\n\t\t\t{\n\t\t\t\t//trigger it\n\t\t\t\tthis.Object.HTML.State_OnFocus(this.Object);\n\t\t\t}\n\t\t\t//now set the value directly\n\t\t\tthis.Target.value = Get_String(this.Data[0], \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//set it\n\t\t\tthis.Target.focus();\n\t\t}\n\t\t//reset elapsed time as we are about to start typing\n\t\tthis.ElapsedTime = 0;\n\t\t//done with this\n\t\tthis.Mode_TypeText_Focused = true;\n\t}\n\t//text not readied?\n\telse if (!this.Mode_TypeText_TextProcessed)\n\t{\n\t\t//increase elapsed time\n\t\tthis.ElapsedTime += elapsed;\n\t\t//calculate how many keys to type\n\t\tvar cKeysToType = Math.floor(this.Speed * this.ElapsedTime);\n\t\t//calculate remaining time\n\t\tthis.ElapsedTime = this.ElapsedTime - (cKeysToType / this.Speed);\n\n\t\t//while we have keys to type\n\t\twhile (cKeysToType > 0)\n\t\t{\n\t\t\t//one less key to type\n\t\t\tcKeysToType--;\n\t\t\tvar typeDate = /date/i.test(this.Target.getAttribute(\"type\"));\n\t\t\tif (typeDate)\n\t\t\t\tthis.Target.value = this.Data[0];\n\t\t\t//get current value\n\t\t\tvar strCurrent = this.Target.value.replace(/\\r\\n/g, \"\\n\").replace(/\\n/g, \"\\r\\n\");\n\t\t\t//get target value\n\t\t\tvar strTarget = Get_String(this.Data[0], \"\");\n\n\t\t\t//are they the same?\n\t\t\tif (strCurrent == strTarget)\n\t\t\t{\n\t\t\t\t//done with this\n\t\t\t\tthis.Mode_TypeText_TextProcessed = true;\n\t\t\t\t//all done\n\t\t\t\tcKeysToType = 0;\n\t\t\t\t//check the class\n\t\t\t\tswitch (this.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\t\t\t//Not in QA? or in Edge (Edge seems to refuse to fire the OnChange during QA)\n\t\t\t\t\t\tif (typeDate || __BROWSER_EDGE || !(__QA_ON && __QA.UseQACamera()))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//trigger edit on change\n\t\t\t\t\t\t\tEdit_ValueChanged(null, this.Target);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_CLASS_COMBO_BOX:\n\t\t\t\t\t\t//fake an Enter action\n\t\t\t\t\t\tComboBox_OnKeyUp({ srcElement: this.Target, target: this.Target, keyCode: 0x0d }, true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//target is greater than current and target starts with current\n\t\t\t\tif (strTarget.length > strCurrent.length && strTarget.StartsWith(strCurrent))\n\t\t\t\t{\n\t\t\t\t\t//loop through characters to add (some are ignored by html after we set them)\n\t\t\t\t\tfor (var charToAdd = strTarget.charAt(strCurrent.length), bLoop = true; bLoop; charToAdd = strTarget.charAt(strCurrent.length))\n\t\t\t\t\t{\n\t\t\t\t\t\t//in QA Mode?\n\t\t\t\t\t\tif (__QA_ON && __QA.UseQACamera())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//check this char\n\t\t\t\t\t\t\tswitch (charToAdd)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase '\\r':\n\t\t\t\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\t\t\t\t//ask the qa to type enter\n\t\t\t\t\t\t\t\t\t__QA.TypeReturn();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t//ask the qa to type a char\n\t\t\t\t\t\t\t\t\t__QA.TypeChar(charToAdd);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//end loop\n\t\t\t\t\t\t\tcKeysToType = 0;\n\t\t\t\t\t\t\t//we done\n\t\t\t\t\t\t\tbLoop = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//add the char\n\t\t\t\t\t\t\tstrCurrent += charToAdd;\n\t\t\t\t\t\t\t//check this char\n\t\t\t\t\t\t\tswitch (charToAdd)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase '\\r':\n\t\t\t\t\t\t\t\tcase '\\n':\n\t\t\t\t\t\t\t\t\t//these are removed when added to the html so keep on adding more chars\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase '.':\n\t\t\t\t\t\t\t\t\t//this one can cause problems if the edit is of type number as \"x.\" is not a valid number\n\t\t\t\t\t\t\t\t\tbLoop = /number/i.test(this.Target.type); //only break if its not a number type\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t//we done\n\t\t\t\t\t\t\t\t\tbLoop = false;\n\t\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\telse\n\t\t\t\t{\n\t\t\t\t\t//in QA Mode?\n\t\t\t\t\tif (__QA_ON && __QA.UseQACamera())\n\t\t\t\t\t{\n\t\t\t\t\t\t//this a space filled object?\n\t\t\t\t\t\tif (Get_String(this.Object.Properties[__NEMESIS_PROPERTY_SPACEFILLED], null) !== null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//get the char we are removing\n\t\t\t\t\t\t\tvar removing = strCurrent.charAt(strCurrent.length - 1);\n\t\t\t\t\t\t\t//get the filling char\n\t\t\t\t\t\t\tvar fillingChar = Get_String(this.Object.Properties[__NEMESIS_PROPERTY_FILLINGCHAR], null);\n\t\t\t\t\t\t\t//this the removing char?\n\t\t\t\t\t\t\tif (removing === \" \" || removing === fillingChar)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//ok then enter a loop\n\t\t\t\t\t\t\t\twhile (removing === \" \" || removing === fillingChar)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//remove last character from the current string\n\t\t\t\t\t\t\t\t\tstrCurrent = strCurrent.substring(0, strCurrent.length - 1);\n\t\t\t\t\t\t\t\t\t//get the char we are removing\n\t\t\t\t\t\t\t\t\tremoving = strCurrent.charAt(strCurrent.length - 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//now force it\n\t\t\t\t\t\t\t\tthis.Target.value = strCurrent;\n\t\t\t\t\t\t\t\t//end exit completely (we dont want to get hit by the edge force onchange)\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//ask the qa to delete a char\n\t\t\t\t\t\t__QA.TypeDelete();\n\t\t\t\t\t\t//end loop\n\t\t\t\t\t\tcKeysToType = 0;\n\t\t\t\t\t}\n\t\t\t\t\t//are we removing a end of line?\n\t\t\t\t\telse if (/\\n$|\\r\\n$/i.test(strCurrent))\n\t\t\t\t\t{\n\t\t\t\t\t\t//remove it\n\t\t\t\t\t\tstrCurrent = strCurrent.replace(/\\n$|\\r\\n$/i, \"\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the char we are removing\n\t\t\t\t\t\tvar removing = strCurrent.charAt(strCurrent.length - 1);\n\t\t\t\t\t\t//is it a space? or the filling char?\n\t\t\t\t\t\tif (removing == \" \" || removing == Get_String(this.Object.Properties[__NEMESIS_PROPERTY_FILLINGCHAR], null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we dont count this one\n\t\t\t\t\t\t\tcKeysToType++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//remove last character from the current string\n\t\t\t\t\t\tstrCurrent = strCurrent.substring(0, strCurrent.length - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//not qa? or in Edge (Edge seems to refuse to fire the OnChange during QA)\n\t\t\t\tif (!(__QA_ON && __QA.UseQACamera()) || __BROWSER_EDGE)\n\t\t\t\t{\n\t\t\t\t\t//update value\n\t\t\t\t\tthis.Target.value = strCurrent;\n\t\t\t\t\t//check the class\n\t\t\t\t\tswitch (this.Class)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase __NEMESIS_CLASS_EDIT:\n\t\t\t\t\t\t\t//trigger edit on change\n\t\t\t\t\t\t\tEdit_ValueChanged(null, this.Target);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//finished!\n\telse\n\t{\n\t\t//finished!\n\t\tthis.State = __CAMERA_CMD_STATE_FINISHED;\n\t}\n}", "function editor_setmode(objname, mode) {\n var config = document.all[objname].config;\n var editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\n // wait until document is fully loaded\n if (document.readyState != 'complete') {\n setTimeout(function() { editor_setmode(objname,mode) }, 25);\n return;\n }\n\n // define different editors\n var TextEdit = '<textarea ID=\"_' +objname + '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ '; margin-v65333: -1px; margin-bottom: -1px;\"></textarea>';\n var RichEdit = '<iframe ID=\"_' +objname+ '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ ';\"></iframe>';\n\n // src=\"' +_editor_url+ 'popups/blank.html\"\n\n //\n // Switch to TEXTEDIT mode\n //\n\n if (mode == \"textedit\" || editor_obj.tagName.toLowerCase() == 'iframe') {\n config.mode = \"textedit\";\n var editdoc = editor_obj.contentWindow.document;\n var contents = editdoc.body.createTextRange().htmlText;\n editor_obj.outerHTML = TextEdit;\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\n editor_obj.value = contents;\n editor_event(objname);\n\n editor_updateToolbar(objname, \"disable\"); // disable toolbar items\n\n // set event handlers\n editor_obj.onkeydown = function() { editor_event(objname); }\n editor_obj.onkeypress = function() { editor_event(objname); }\n editor_obj.onkeyup = function() { editor_event(objname); }\n editor_obj.onmouseup = function() { editor_event(objname); }\n editor_obj.ondrop = function() { editor_event(objname, 100); } // these events fire before they occur\n editor_obj.oncut = function() { editor_event(objname, 100); }\n editor_obj.onpaste = function() { editor_event(objname, 100); }\n editor_obj.onblur = function() { editor_event(objname, -1); }\n\n editor_updateOutput(objname);\n editor_focus(editor_obj);\n }\n\n //\n // Switch to WYSIWYG mode\n //\n\n else {\n config.mode = \"wysiwyg\";\n var contents = editor_obj.value;\n if (mode == 'init') { contents = document.all[objname].value; } // on init use original textarea content\n\n // create editor\n editor_obj.outerHTML = RichEdit;\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\n\n // get iframe document object\n\n // create editor contents (and default styles for editor)\n var html = \"\";\n html += '<html><head>\\n';\n if (config.stylesheet) {\n html += '<link href=\"' +config.stylesheet+ '\" rel=\"stylesheet\" type=\"text/css\">\\n';\n }\n html += '<style>\\n';\n html += 'body {' +config.bodyStyle+ '} \\n';\n for (var i in config.fontstyles) {\n var fontstyle = config.fontstyles[i];\n if (fontstyle.classStyle) {\n html += '.' +fontstyle.className+ ' {' +fontstyle.classStyle+ '}\\n';\n }\n }\n html += '</style>\\n'\n + '</head>\\n'\n + '<body contenteditable=\"true\" topmargin=1 leftmargin=1'\n\n// still working on this\n// + ' oncontextmenu=\"parent.editor_cMenu_generate(window,\\'' +vfd085+'\\');\"'\n +'>'\n +contents\n +'</body>\\n'\n +'</html>\\n';\n var v7a135 =editor_obj.contentWindow.document;\n v7a135.open();\n v7a135.write(html);\n v7a135.close();\n editor_updateToolbar(objname,\"enable\"); \n v7a135.objname =objname;\n v7a135.onkeydown =function(){editor_event(objname); }\n v7a135.onkeypress =function(){editor_event(objname); }\n v7a135.onkeyup =function(){editor_event(objname); }\n v7a135.onmouseup =function(){editor_event(objname); }\n v7a135.body.ondrop =function(){editor_event(objname,100); }\n v7a135.body.oncut =function(){editor_event(objname,100); }\n v7a135.body.onpaste =function(){editor_event(objname,100); }\n v7a135.body.onblur =function(){editor_event(objname,-1); }\n if (mode !='init'){editor_focus(v43c91);\n }\n }\n if (mode !='init'){editor_event(vfd085);\n }\n}", "function continueModeChange() {\n var mode = targetMode[0].id.split('-')[1];\n robopaint.switchMode(mode); // Actually switch to the mode\n}", "doEditMode() {\n\n }", "function enableEditMode() {\n richTextField.document.designMode = \"On\";\n}", "function changeText() {\n document.getElementById(\"p1\").style.fontSize = \"7em\";\n document.getElementById(\"p1\").style.fontStyle = \"italic\";\n document.getElementById(\"p1\").style.backgroundColor = \"blue\";\n document.getElementById(\"p1\").style.fontWeight = \"bold\";\n}", "function alterText() {\n document.getElementById(\"class\").style.fontSize = \"6em\";\n document.getElementById(\"class\").style.fontStyle = \"italic\";\n document.getElementById(\"class\").style.backgroundColor = \"gray\";\n document.getElementById(\"class\").style.fontWeight = \"bold\";\n}", "set(mode) {\n this.oldMode = this.mode;\n this.mode = mode;\n this.updateUITools();\n }", "get textDirection() { return this.viewState.defaultTextDirection; }", "typeAnimation(){\n\t\t//preserve a copy of all the text we're about to display incase we need to save\n\t\tthis.saveCopy();\n\t\t\n\t\tFileManager.writing = false; \n\t\t\n\t\t//figure out how fast we want to type the screen based on how much content needs typing \n\t\tvar letters = 0;\n\t\tfor (i=0; i< this.state.toShowText.length; i++){\t\t\t \n\t\t\tletters += this.state.toShowText[i].text.length;\n\t\t}\n\t\tvar scale = Math.floor(letters/20);\n\t\tif(scale < 1){\n\t\t\tscale = 1;\n\t\t}\n\t\t\n\t\t\n\t\t//do the actual typing\n\t\tthis.typeAnimationActual(scale);\n\t\t\n\t}", "setActualState(autoModeIdx) { \r\n if(autoModeIdx >= 0 && autoModeIdx < this.modeTitleList.length){\r\n this.actValText = this.modeTitleList[autoModeIdx];\r\n } else {\r\n this.actValText = \"????\";\r\n }\r\n this.hasData = true;\r\n }", "function setGameMode(mode) {\n gameMode = mode;\n decks.player2.name = (mode === 'ai')? 'Mr. AI' : 'Player 2';\n updatePlayerStatuses();\n}", "function changeMode() {\n\n\tlet visibleContent = $('#switchMode').find('.visible').first()\n\tlet hiddenContentIcon = $('#switchMode').find('.hidden').first().find('.icon').first()\n\n\tif (visibleContent.html().includes('VIDEO')) {\n\t\tvisibleContent.html('SWITCH TO IMAGE MODE')\n\t} else {\n\t\tvisibleContent.html('SWITCH TO VIDEO MODE')\n\t}\n\n\thiddenContentIcon.toggleClass('image')\n\thiddenContentIcon.toggleClass('video')\n}", "function TextEditor() {}", "function runMode(cm, text, mode, state, f, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (cm.options.addModeClass) {\n var mName = CodeMirror.innerMode(mode, state).mode.name;\n if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function editor_setmode(objname, mode) {\r\n var config = document.all[objname].config;\r\n var editor_obj = document.all[\"_\" +objname + \"_editor\"];\r\n\r\n // wait until document is fully loaded\r\n if (document.readyState != 'complete') {\r\n setTimeout(function() { editor_setmode(objname,mode) }, 25);\r\n return;\r\n }\r\n\r\n // define different editors\r\n var TextEdit = '<textarea ID=\"_' +objname + '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ '; margin-top: -1px; margin-bottom: -1px;\"></textarea>';\r\n var RichEdit = '<iframe ID=\"_' +objname+ '_editor\" style=\"width:' +editor_obj.style.width+ '; height:' +editor_obj.style.height+ ';\"></iframe>';\r\n\r\n // src=\"' +_editor_url+ '/html/egovframework/com/cmm/utl/htmlarea/popups/blank.html\"\r\n\r\n //\r\n // Switch to TEXTEDIT mode\r\n //\r\n\r\n if (mode == \"textedit\" || editor_obj.tagName.toLowerCase() == 'iframe') {\r\n config.mode = \"textedit\";\r\n var editdoc = editor_obj.contentWindow.document;\r\n var contents = editdoc.body.createTextRange().htmlText;\r\n editor_obj.outerHTML = TextEdit;\r\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\r\n editor_obj.value = contents;\r\n editor_event(objname);\r\n\r\n editor_updateToolbar(objname, \"disable\"); // disable toolbar items\r\n\r\n // set event handlers\r\n editor_obj.onkeydown = function() { editor_event(objname); }\r\n editor_obj.onkeypress = function() { editor_event(objname); }\r\n editor_obj.onkeyup = function() { editor_event(objname); }\r\n editor_obj.onmouseup = function() { editor_event(objname); }\r\n editor_obj.ondrop = function() { editor_event(objname, 100); } // these events fire before they occur\r\n editor_obj.oncut = function() { editor_event(objname, 100); }\r\n editor_obj.onpaste = function() { editor_event(objname, 100); }\r\n editor_obj.onblur = function() { editor_event(objname, -1); }\r\n\r\n editor_updateOutput(objname);\r\n editor_focus(editor_obj);\r\n }\r\n\r\n //\r\n // Switch to WYSIWYG mode\r\n //\r\n\r\n else {\r\n config.mode = \"wysiwyg\";\r\n var contents = editor_obj.value;\r\n if (mode == 'init') { contents = document.all[objname].value; } // on init use original textarea content\r\n\r\n // create editor\r\n editor_obj.outerHTML = RichEdit;\r\n editor_obj = document.all[\"_\" +objname + \"_editor\"];\r\n\r\n // get iframe document object\r\n\r\n // create editor contents (and default styles for editor)\r\n var html = \"\";\r\n html += '<html lang=\\\"ko\\\"><head>\\n';\r\n if (config.stylesheet) {\r\n html += '<link href=\"' +config.stylesheet+ '\" rel=\"stylesheet\" type=\"text/css\">\\n';\r\n }\r\n html += '<style>\\n';\r\n html += 'body {' +config.bodyStyle+ '} \\n';\r\n for (var i in config.fontstyles) {\r\n var fontstyle = config.fontstyles[i];\r\n if (fontstyle.classStyle) {\r\n html += '.' +fontstyle.className+ ' {' +fontstyle.classStyle+ '}\\n';\r\n }\r\n }\r\n html += '</style>\\n'\r\n + '</head>\\n'\r\n + '<body contenteditable=\"true\" topmargin=1 leftmargin=1'\r\n\r\n// still working on this\r\n// + ' oncontextmenu=\"parent.editor_cMenu_generate(window,\\'' +objname+ '\\');\"'\r\n +'>'\r\n + contents\r\n + '</body>\\n'\r\n + '</html>\\n';\r\n\r\n // write to editor window\r\n var editdoc = editor_obj.contentWindow.document;\r\n\r\n editdoc.open();\r\n editdoc.write(html);\r\n editdoc.close();\r\n\r\n editor_updateToolbar(objname, \"enable\"); // enable toolbar items\r\n\r\n // store objname under editdoc\r\n editdoc.objname = objname;\r\n\r\n // set event handlers\r\n editdoc.onkeydown = function() { editor_event(objname); }\r\n editdoc.onkeypress = function() { editor_event(objname); }\r\n editdoc.onkeyup = function() { editor_event(objname); }\r\n editdoc.onmouseup = function() { editor_event(objname); }\r\n editdoc.body.ondrop = function() { editor_event(objname, 100); } // these events fire before they occur\r\n editdoc.body.oncut = function() { editor_event(objname, 100); }\r\n editdoc.body.onpaste = function() { editor_event(objname, 100); }\r\n editdoc.body.onblur = function() { editor_event(objname, -1); }\r\n\r\n // bring focus to editor\r\n if (mode != 'init') { // don't focus on page load, only on mode switch\r\n editor_focus(editor_obj);\r\n }\r\n\r\n }\r\n\r\n // Call update UI\r\n if (mode != 'init') { // don't update UI on page load, only on mode switch\r\n editor_event(objname);\r\n }\r\n\r\n}", "function loadMode(cm) {\n\t\t cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n\t\t resetModeState(cm);\n\t\t }", "function formatText(id, n, selected) {\r\n\r\n // When user clicks toolbar button make sure it always targets its respective WYSIWYG\r\n document.getElementById(\"wysiwyg\" + n).contentWindow.focus();\r\n\r\n\t// When in Text Mode these execCommands are disabled\r\n\tvar formatIDs = new Array(\"FontStyle\",\"Bold\",\"Italic\",\"Underline\",\"Subscript\",\"Superscript\",\"Strikethrough\",\"Justifyleft\",\"Justifyright\",\"Justifycenter\",\"Justifyfull\",\"InsertUnorderedList\",\"InsertOrderedList\",\"Indent\",\"Outdent\",\"ForeColor\",\"BackColor\",\"InsertImage\",\"InsertTable\",\"CreateLink\");\r\n\r\n\t// Check if button clicked is in disabled list\r\n\tfor (var i = 0; i <= formatIDs.length;) {\r\n\t\tif (formatIDs[i] == id) {\r\n\t\t\t var disabled_id = 1;\r\n\t\t}\r\n\t i++;\r\n\t}\r\n\r\n\t// Check if in Text Mode and disabled button was clicked\r\n\tif (viewTextMode == 1 && disabled_id == 1) {\r\n\t alert (\"You are in HTML Mode. This feature has been disabled.\");\r\n\t}\r\n\r\n\telse {\r\n\r\n\t // FontStyle\r\n\t if (id == \"FontStyle\") {\r\n //document.getElementById(\"wysiwyg\" + n).contentWindow.document.execCommand(\"FontStyle\", false, selected);\r\n if (selected == FontStyles[3])\r\n insertHTML('<p>Texto</p>', n);\r\n else\r\n insertHTML('<' + selected + '>Título</' + selected + '>', n);\r\n\t }\r\n\r\n\t\t// FontName\r\n\t else if (id == \"FontName\") {\r\n document.getElementById(\"wysiwyg\" + n).contentWindow.document.execCommand(\"FontName\", false, selected);\r\n\t }\r\n\r\n\t // ForeColor and BackColor\r\n else if (id == 'ForeColor' || id == 'BackColor') {\r\n var w = screen.availWidth;\r\n var h = screen.availHeight;\r\n var popW = 210, popH = 165;\r\n var leftPos = (w-popW)/2, topPos = (h-popH)/2;\r\n var currentColor = _dec_to_rgb(document.getElementById(\"wysiwyg\" + n).contentWindow.document.queryCommandValue(id));\r\n\r\n\t window.open(popupsDir + 'select_color.html?color=' + currentColor + '&command=' + id + '&wysiwyg=' + n,'popup','location=0,status=0,scrollbars=0,width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos);\r\n }\r\n\r\n\t// InsertImage\r\n else if (id == \"InsertImage\") {\r\n var imagesPath = document.getElementById(n).imagesPath;\r\n var imagesUrl = document.getElementById(n).imagesUrl;\r\n var height = ((imagesPath != '') && (imagesUrl != '')) ? 406 : 210;\r\n window.open(popupsDir + 'insert_image.jsp?wysiwyg=' + n + '&imagesPath=' + imagesPath + '&imagesUrl=' + imagesUrl,'popupImage','location=0,status=0,scrollbars=0,resizable=0,width=400,height=' + height);\r\n }\r\n\r\n\t // InsertTable\r\n\t else if (id == \"InsertTable\") {\r\n\t window.open(popupsDir + 'create_table.jsp?wysiwyg=' + n,'popupTable','location=0,status=0,scrollbars=0,resizable=0,width=400,height=362');\r\n\t }\r\n\r\n\t // CreateLink\r\n\t else if (id == \"CreateLink\") {\r\n var documentsPath = document.getElementById(n).imagesPath;\r\n var documentsUrl = document.getElementById(n).imagesUrl;\r\n var height = ((imagesPath != '') && (imagesUrl != '')) ? 299 : 93;\r\n\t window.open(popupsDir + 'insert_hyperlink.jsp?wysiwyg=' + n + '&documentsPath=' + documentsPath + '&documentsUrl=' + documentsUrl, 'popupHyperlink', 'location=0,status=0,scrollbars=0,resizable=0,width=400,height=' + height);\r\n\t }\r\n\r\n\t\t// ViewSource\r\n else if (id == \"ViewSource\") {\r\n\t viewSource(n);\r\n\t }\r\n\r\n\t\t// ViewText\r\n\t\telse if (id == \"ViewText\") {\r\n\t viewText(n);\r\n\t }\r\n\r\n\t\t// Help\r\n\t\telse if (id == \"Help\") {\r\n\t window.open(popupsDir + 'about.html','popup','location=0,status=0,scrollbars=0,resizable=0,width=400,height=330');\r\n\t }\r\n\r\n\t\t// Every other command\r\n\t else {\r\n document.getElementById(\"wysiwyg\" + n).contentWindow.document.execCommand(id, false, null);\r\n\t\t}\r\n }\r\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n\t\t var flattenSpans = mode.flattenSpans;\n\t\t if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n\t\t var curStart = 0, curStyle = null;\n\t\t var stream = new StringStream(text, cm.options.tabSize, context), style;\n\t\t var inner = cm.options.addModeClass && [null];\n\t\t if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n\t\t while (!stream.eol()) {\n\t\t if (stream.pos > cm.options.maxHighlightLength) {\n\t\t flattenSpans = false;\n\t\t if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n\t\t stream.pos = text.length;\n\t\t style = null;\n\t\t } else {\n\t\t style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n\t\t }\n\t\t if (inner) {\n\t\t var mName = inner[0].name;\n\t\t if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n\t\t }\n\t\t if (!flattenSpans || curStyle != style) {\n\t\t while (curStart < stream.start) {\n\t\t curStart = Math.min(stream.start, curStart + 5000);\n\t\t f(curStart, curStyle);\n\t\t }\n\t\t curStyle = style;\n\t\t }\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t while (curStart < stream.pos) {\n\t\t // Webkit seems to refuse to render text nodes longer than 57444\n\t\t // characters, and returns inaccurate measurements in nodes\n\t\t // starting around 5000 chars.\n\t\t var pos = Math.min(stream.pos, curStart + 5000);\n\t\t f(pos, curStyle);\n\t\t curStart = pos;\n\t\t }\n\t\t }", "function toggleItalic(editor) {\n execCommand_1.default(editor, \"italic\" /* Italic */);\n}", "open (text) {\n return super.open(text)\n }", "open (text) {\n return super.open(text)\n }", "switchMode(arg) {\n let mode = arg;\n // if force mode not provided, switch to opposite of current mode\n if (!mode || mode instanceof MouseEvent)\n mode = this.currentView === 'source' ? 'preview' : 'source';\n if (arg instanceof MouseEvent) {\n if (obsidian.Keymap.isModEvent(arg)) {\n this.app.workspace.duplicateLeaf(this.leaf).then(() => {\n var _a, _b;\n const viewState = (_a = this.app.workspace.activeLeaf) === null || _a === void 0 ? void 0 : _a.getViewState();\n if (viewState) {\n viewState.state = Object.assign(Object.assign({}, viewState.state), { mode: mode });\n (_b = this.app.workspace.activeLeaf) === null || _b === void 0 ? void 0 : _b.setViewState(viewState);\n }\n });\n }\n else {\n this.setState(Object.assign(Object.assign({}, this.getState()), { mode: mode }), {});\n }\n }\n else {\n // switch to preview mode\n if (mode === 'preview') {\n this.currentView = 'preview';\n obsidian.setIcon(this.changeModeButton, 'pencil');\n this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');\n this.renderPreview(this.recipe);\n this.previewEl.style.setProperty('display', 'block');\n this.sourceEl.style.setProperty('display', 'none');\n }\n // switch to source mode\n else {\n this.currentView = 'source';\n obsidian.setIcon(this.changeModeButton, 'lines-of-text');\n this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');\n this.previewEl.style.setProperty('display', 'none');\n this.sourceEl.style.setProperty('display', 'block');\n this.editor.refresh();\n }\n }\n }", "function aumentarTamanhoTexto() {\n document.documentElement.classList.contains('textoMaior')\n ? (aumentarTexto.textContent = 'A+')\n : (aumentarTexto.textContent = 'A-');\n\n document.documentElement.classList.toggle('textoMaior');\n }", "function runMode(cm, text, mode, state, f, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize), style;\n if (text == \"\" && mode.blankLine) mode.blankLine(state);\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) processLine(cm, text, state, stream.pos);\n stream.pos = text.length;\n style = null;\n } else {\n style = mode.token(stream, state);\n }\n if (!flattenSpans || curStyle != style) {\n if (curStart < stream.start) f(stream.start, curStyle);\n curStart = stream.start; curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444 characters\n var pos = Math.min(stream.pos, curStart + 50000);\n f(pos, curStyle);\n curStart = pos;\n }\n }", "function changeText2() {\n var sen = document.getElementById(\"changeMe\");\n var sen2 = document.getElementById(\"changeMe2\");\n if (clicked2) {\n sen.style.fontStyle = \"italic\";\n sen.style.fontWeight = \"bold\";\n sen.style.color = \"purple\";\n sen2.style.fontStyle = \"italic\";\n sen2.style.fontWeight = \"bold\";\n sen2.style.color = \"purple\";\n }\n else {\n sen.style.fontStyle = \"\";\n sen.style.fontWeight = \"\";\n sen.style.color = \"\";\n sen2.style.fontStyle = \"\";\n sen2.style.fontWeight = \"\";\n sen2.style.color = \"\";\n }\n clicked2 = !clicked2;\n}", "function setTargetText() {\n\n // The target text should display at least one character\n var targetLength = Settings.TARGET_TEXT_LENGTH\n if (targetLength < 1) {\n targetLength = 1\n }\n\n // Length of the target text should be odd as equal number of\n // characters should be displayed on either side of the\n // character to be typed\n if (targetLength % 2 == 0) {\n targetLength--\n }\n\n // Number of characters on either side of the character to be\n // typed, assuming that the character to be typed is at the\n // centre\n var prefixLength = (targetLength - 1) / 2\n\n // Calculate the start index and the end index of the substring\n // to be selected from the subunit text to display as the target\n // text\n var i = my.current.correctInputLength\n var textLength = my.current.subunitText.length\n if (i <= prefixLength) {\n var startIndex = 0\n } else if (i >= textLength - 1 - prefixLength) {\n var startIndex = textLength - targetLength\n } else {\n var startIndex = i - prefixLength\n }\n var endIndex = startIndex + targetLength\n\n // Select prefix string\n var s = my.current.subunitText.substring(startIndex, i)\n my.current.targetPrefix = Util.visual(s)\n\n // Select target character\n if (i < textLength) {\n s = my.current.subunitText.charAt(i)\n my.current.targetChar = Util.visual(s)\n } else {\n my.current.targetChar = ''\n }\n\n // Select suffix string\n s = my.current.subunitText.substring(i + 1, endIndex)\n my.current.targetSuffix = Util.visual(s)\n }", "get mode() { return this._mode; }", "get mode() { return this._mode; }", "function getModeHtml(val) {\n\t\t\t//不是undefined、null和空字符串中的一种\n\t\t\tif (!!val) {\n\t\t\t\tif (val == 1) {\n\t\t\t\t\treturn '(自动模式)';\n\t\t\t\t} else if (val == 2) {\n\t\t\t\t\treturn '(手动模式)';\n\t\t\t\t} else if (val == 3) {\n\t\t\t\t\treturn '(被授时自动模式)';\n\t\t\t\t} else {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}", "doTextOperation(){let root=this,selection=root.selection;if(root.toggled&&null!==root.toggledCommand){document.execCommand(root.toggledCommand,!1,root.toggledCommand||\"\")}else if(null!==root.command){root.dispatchEvent(new CustomEvent(root.command+\"-button\",{bubbles:!0,cancelable:!0,composed:!0,detail:root}));document.execCommand(root.command,!1,root.commandVal||\"\");root.selection=selection}}", "function modeSwitch(mode) {\n\tresetViews();\n resetCameras();\n\tswitch(mode) {\n\t\tcase \"absolute\":\n\t\t\tupdateShipData(true);\n\t\t\tstepSize = 1; // reset step size\n\t\t\tcurrentMode = 1;\n\t\tbreak;\n\t\tcase \"relative\":\n\t\t\tupdateShipData(false);\n\t\t\tstepSize = Math.PI/64; // reset step size\n\t\t\tcurrentMode = 2;\n\t\tbreak;\n\t\tcase \"geosynchronous\":\n\t\t\tupdateShipData(false);\n\t\t\tcurrentPlanet = 3;\n\t\t\tcurrentMode = 3;\n\t\t\tupdateGeoSyncLookAt(earth, false);\n\t\tbreak;\n\t}\n}", "function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {\n\t\t var flattenSpans = mode.flattenSpans;\n\t\t if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;\n\t\t var curStart = 0, curStyle = null;\n\t\t var stream = new StringStream(text, cm.options.tabSize), style;\n\t\t var inner = cm.options.addModeClass && [null];\n\t\t if (text == \"\") extractLineClasses(callBlankLine(mode, state), lineClasses);\n\t\t while (!stream.eol()) {\n\t\t if (stream.pos > cm.options.maxHighlightLength) {\n\t\t flattenSpans = false;\n\t\t if (forceToEnd) processLine(cm, text, state, stream.pos);\n\t\t stream.pos = text.length;\n\t\t style = null;\n\t\t } else {\n\t\t style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses);\n\t\t }\n\t\t if (inner) {\n\t\t var mName = inner[0].name;\n\t\t if (mName) style = \"m-\" + (style ? mName + \" \" + style : mName);\n\t\t }\n\t\t if (!flattenSpans || curStyle != style) {\n\t\t while (curStart < stream.start) {\n\t\t curStart = Math.min(stream.start, curStart + 50000);\n\t\t f(curStart, curStyle);\n\t\t }\n\t\t curStyle = style;\n\t\t }\n\t\t stream.start = stream.pos;\n\t\t }\n\t\t while (curStart < stream.pos) {\n\t\t // Webkit seems to refuse to render text nodes longer than 57444 characters\n\t\t var pos = Math.min(stream.pos, curStart + 50000);\n\t\t f(pos, curStyle);\n\t\t curStart = pos;\n\t\t }\n\t\t }", "function changeStyleOnMode(isEdit) {\n if (isEdit) {\n $('#editable-mode').addClass('selected');\n $(\"#sortable-mode\").removeClass('selected');\n $('#page-preview').css('cursor', 'text');\n } else {\n $('#editable-mode').removeClass('selected');\n $(\"#sortable-mode\").addClass('selected');\n $('#page-preview').css('cursor', 'move');\n }\n}", "function ChangeMode(Sender) {\r\n\tvar res = true;\r\n\tif ( cbMode.Text == \"Delimiter\") res = false;\r\n\tlbDelimiter.Visible = !res;\r\n\tedDelimiter.Visible = !res;\r\n\tlbPosition.Visible = res;\r\n\tedPosition.Visible = res;\r\n}", "function switchText(){\n\tif(Text_Index >= text.length){\n\t\tredirectPage();\n\t}\n\tif(Time_Index % 2 == 1) Time_Index = 11;\n\telse Time_Index = 10;\n document.getElementById(\"speechtext\").textContent = text[Text_Index];\n Text_Index += 1;\n document.getElementById(\"clicktocontinue\").style.visibility = \"hidden\";\n}", "function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\r\n var flattenSpans = mode.flattenSpans;\r\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\r\n var curStart = 0, curStyle = null;\r\n var stream = new StringStream(text, cm.options.tabSize, context), style;\r\n var inner = cm.options.addModeClass && [null];\r\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\r\n while (!stream.eol()) {\r\n if (stream.pos > cm.options.maxHighlightLength) {\r\n flattenSpans = false;\r\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\r\n stream.pos = text.length;\r\n style = null;\r\n } else {\r\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\r\n }\r\n if (inner) {\r\n var mName = inner[0].name;\r\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\r\n }\r\n if (!flattenSpans || curStyle != style) {\r\n while (curStart < stream.start) {\r\n curStart = Math.min(stream.start, curStart + 5000);\r\n f(curStart, curStyle);\r\n }\r\n curStyle = style;\r\n }\r\n stream.start = stream.pos;\r\n }\r\n while (curStart < stream.pos) {\r\n // Webkit seems to refuse to render text nodes longer than 57444\r\n // characters, and returns inaccurate measurements in nodes\r\n // starting around 5000 chars.\r\n var pos = Math.min(stream.pos, curStart + 5000);\r\n f(pos, curStyle);\r\n curStart = pos;\r\n }\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function UpdateText(ref, newText){\n // Default vals\n noStroke(0); fill(255); textSize(20); textAlign(LEFT);\n \n switch(ref){\n case (0): { text(newText, 500, 25); break;}\n case (2): { text(newText, 200, 25); break;}\n case (3): {textAlign(CENTER); text(newText, width/2, 640); break;}\n }\n\n }", "function boxmode() {\n mode = \"box\"\n}" ]
[ "0.719321", "0.71184945", "0.68040085", "0.67591006", "0.67067283", "0.6601631", "0.6566229", "0.6476135", "0.6411494", "0.6344079", "0.6280976", "0.6205678", "0.61954355", "0.6161406", "0.6143829", "0.61231166", "0.6118049", "0.6083623", "0.60792536", "0.60662776", "0.60439867", "0.6038887", "0.6027577", "0.5993663", "0.59876186", "0.5952657", "0.5936402", "0.591898", "0.5907878", "0.5907878", "0.58900917", "0.5878477", "0.58778656", "0.58778656", "0.58731663", "0.58588916", "0.585136", "0.58381826", "0.58381826", "0.5836072", "0.58247626", "0.57995224", "0.5799254", "0.57912916", "0.57912916", "0.5789242", "0.5774571", "0.5773066", "0.57651544", "0.57638323", "0.5760084", "0.57474834", "0.5744984", "0.5740499", "0.57283366", "0.5715231", "0.57126164", "0.5701506", "0.56966054", "0.56931764", "0.5680387", "0.5665901", "0.5665638", "0.56560373", "0.5652057", "0.5625512", "0.56208354", "0.56203383", "0.5615004", "0.56114745", "0.5603124", "0.56002253", "0.55970293", "0.55939054", "0.5590625", "0.5582589", "0.55762434", "0.55755395", "0.5554911", "0.5551298", "0.5551298", "0.5546827", "0.5543675", "0.55411804", "0.5526302", "0.55244386", "0.55208313", "0.55208313", "0.55148864", "0.55142057", "0.55111724", "0.55057496", "0.5505443", "0.5504357", "0.54971814", "0.54929245", "0.54924005", "0.54924005", "0.54924005", "0.5490272", "0.54842454" ]
0.0
-1
A statushoz tartozo szamok
makeDict() { const dict = {}; const { invitations } = this.state; invitations.forEach((inv) => { dict[inv.status] = 0; }); invitations.forEach((inv) => { dict[inv.status] += 1; }); this.setState({ statusDict: dict }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayBackgroundUpdateStatus(taustapaivityksenTila) {\n var finished = taustapaivityksenTila.valmistui\n var statusBeginning = taustapaivityksenTila.kaynnistetty\n ? 'Viimeisin päivitys ' +\n taustapaivityksenTila.hakujenMaara +\n ' haulle on käynnistetty ' +\n taustapaivityksenTila.kaynnistetty\n : 'Päivitystä ei ole käynnistetty'\n var statusText =\n statusBeginning + (finished ? ' ja valmistui ' + finished : '')\n document.getElementById('latestBackgroundUpdateStatus').innerText = statusText\n}", "function statusON() {\n\tshowStatus = true;\n\t// Setup Einstellungen Anzeigen\n\tstatusPart.style.display = \"block\";\n // Setup Botton umbenennen\n statusBtn.innerText = \"Hidde status option\";\n}", "function status(ele, st, done) {\n const s = make('div', { class: `icon ${st}` });\n append(s, make('i'));\n replaceMarker(ele, 'status', s);\n\n setTimeout(() => {\n addClass(s, 'going');\n setTimeout(() => {\n replaceMarker(ele, 'status');\n removeClass(s, 'going');\n\n if (done) {\n done();\n }\n }, 2000);\n }, 2000);\n}", "createStatusText() {\n let status;\n if (this.stateHistory.currentState().isFinished()) status = \"Program beendet\"\n else status = \"Nächste Zeile: \" + this.stateHistory.currentState().nextCommandLine;\n return \"Status: \" + status;\n }", "function checkStatus() {\n\n }", "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "function setStatus() {\n const parent = $(this).parent();\n parent.addClass('loading');\n $.getJSON(this.href + '?format=json&jsoncallback=?', function (data) {\n $('.mqueue_status_links_' + data.id).each(function () {\n $(this).replaceWith(data.status);\n });\n\n parent.removeClass('loading');\n $('.mqueue_status_links_' + data.id + ' .mqueue_status').click(setStatus);\n });\n return false;\n }", "function updateStatus() {\nconst defaultStatus = \"Click on Palette to Start\";\n\t//\tse non è attiva nessuna modalità, mostro il testo predefinito\n\tif (mode == \"\")\n\t\td3.select('#statusline').text(defaultStatus);\n\t//\taltrimenti stampo la modalità e il tipo di shape correnti\n\telse if (mode == \"draw\")\n\t\td3.select('#statusline').text(\"draw \" + shapeType);\n\telse\n\t\td3.select('#statusline').text(mode + \" \" + active.shape);\n}", "function IndicadorEstadoCivil () {}", "function namestatus(){}", "updateStatus(){\n getStatus();\n }", "function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}", "function mostrarHoteles() {\n if (mostraStatus) {\n mostrarHotelesActivados();\n } else {\n mostrarHotelesDesactivados();\n }\n}", "function statusLimpa()\r\n{\r\n self.status = '';\r\n return true;\r\n}", "function getStatus() {\r\n\r\n var success = false;\r\n var newText = document.createElement('span');\r\n \r\n var oDivProps = document.getElementById('props');\r\n var aDivStatus = oDivProps.getElementsByClassName('mystatus');\r\n \r\n if( aDivStatus.length == 0 ) return;\r\n \r\n var oDivStatus = aDivStatus[0];\r\n \r\n var aA = oDivStatus.getElementsByTagName('a');\r\n \r\n if( aA.length > 0 )\r\n {\r\n var href = aA[0].href;\r\n \r\n if( href.match(\"hospital\") )\r\n {\r\n var tempo = aA[0].getElementsByTagName('span')[0].getAttribute('title');\r\n newText.innerHTML = \"No hospital até \" + getDate(tempo);\r\n }\r\n else if( href.match(\"jail\") )\r\n {\r\n var tempo = aA[0].getElementsByTagName('span')[0].getAttribute('title');\r\n newText.innerHTML = \"Na cadeia até \" + getDate(tempo);\r\n }\r\n else if( href.match(\"map\") )\r\n {\r\n var text = aA[0].innerHTML;\r\n newText.innerHTML = \"Status \" + text;\r\n }\r\n \r\n success = ( newText.innerHTML.length > 0 )\r\n }\r\n \r\n if( !success ) newText.innerHTML = \"Status não identificado\";\r\n \r\n return newText;\r\n\r\n}", "function checkStatus() {\n var checkUrl = Routing.generate(\"openview_export_api_v1_check\");\n $.ajax({\n 'url': checkUrl\n }).done(function(data){\n var jobStatus = JSON.parse(data);\n // if no job is active\n if (jobStatus.activejob == 0) {\n // sho start button\n $('.box-start-process').removeClass('hidden');\n $('.box-process-status').addClass('hidden');\n // if no job is active, but at previous check there was some job active, it means that it has just finished.\n // so show the finished export panel\n if (exporting) {\n exporting = false;\n $('.box-process-finished').removeClass('hidden');\n }\n } \n // if a job is active\n else {\n // remember a job is currently in progress\n exporting = true;\n // show statusbar and hides everithing else\n $('.box-start-process').addClass('hidden');\n $('.box-process-status').removeClass('hidden');\n updateStatus(jobStatus.job);\n }\n $('.box-waiting').addClass('hidden');\n }).fail(function(){\n $('.box-waiting').addClass('hidden');\n });\n}", "function getStatus() {\r\n\r\n var success = false;\r\n var newText = $(\"<span></span>\")[0];\r\n\r\n var aA = $(\".right-col .mystatus a\");\r\n\r\n if( aA.length > 0 )\r\n {\r\n if( aA[0].href.search(\"hospital\") >= 0 )\r\n {\r\n newText.innerHTML = \"No hospital\";\r\n\r\n var div = document.getElementById('msgbox');\r\n if( div )\r\n {\r\n div = div.getElementsByClassName('minfo');\r\n if( div.length > 0 )\r\n {\r\n var tempo = div[0].getElementsByTagName('span')[0].innerHTML;\r\n newText.innerHTML += \" até \" + getDate(tempo);\r\n }\r\n }\r\n }\r\n else if( aA[0].href.search(\"jail\") >= 0 )\r\n {\r\n newText.innerHTML = \"Na cadeia\";\r\n\r\n var div = document.getElementById('msgbox');\r\n if( div )\r\n {\r\n div = div.getElementsByClassName('minfo');\r\n if( div.length > 0 )\r\n {\r\n var tempo = div[0].getElementsByTagName('span')[0].innerHTML;\r\n newText.innerHTML += \" até \" + getDate(tempo);\r\n }\r\n }\r\n }\r\n else if( aA[0].href.match(\"map\") )\r\n {\r\n var text = aA[0].innerHTML;\r\n newText.innerHTML = \"Status \" + text;\r\n }\r\n\r\n success = ( newText.innerHTML.length > 0 )\r\n }\r\n\r\n if( !success ) newText.innerHTML = \"Status não identificado\";\r\n\r\n return newText;\r\n\r\n}", "function displayStatus (catLadyStatus)\n {\n $('.status-image img').attr('src', 'images/'+catLadyStatus.image);\n\n $('.status-title').text(catLadyStatus.title);\n }", "function check_status() {\n var open, ptotal, sample, pid, pname, line, match, tmp, i;\n\n // Handle operation disabled\n if (!controller.settings.en) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"System Disabled\")+\"</p>\",function(){\n areYouSure(_(\"Do you want to re-enable system operation?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&en=1\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n // Handle open stations\n open = {};\n for (i=0; i<controller.status.length; i++) {\n if (controller.status[i]) {\n open[i] = controller.status[i];\n }\n }\n\n if (controller.options.mas) {\n delete open[controller.options.mas-1];\n }\n\n // Handle more than 1 open station\n if (Object.keys(open).length >= 2) {\n ptotal = 0;\n\n for (i in open) {\n if (open.hasOwnProperty(i)) {\n tmp = controller.settings.ps[i][1];\n if (tmp > ptotal) {\n ptotal = tmp;\n }\n }\n }\n\n sample = Object.keys(open)[0];\n pid = controller.settings.ps[sample][0];\n pname = pidname(pid);\n line = \"<div><div class='running-icon'></div><div class='running-text'>\";\n\n line += pname+\" \"+_(\"is running on\")+\" \"+Object.keys(open).length+\" \"+_(\"stations\")+\" \";\n if (ptotal > 0) {\n line += \"<span id='countdown' class='nobr'>(\"+sec2hms(ptotal)+\" \"+_(\"remaining\")+\")</span>\";\n }\n line += \"</div></div>\";\n change_status(ptotal,\"green\",line,function(){\n changePage(\"#status\");\n });\n return;\n }\n\n // Handle a single station open\n match = false;\n for (i=0; i<controller.stations.snames.length; i++) {\n if (controller.settings.ps[i][0] && controller.status[i] && controller.options.mas !== i+1) {\n match = true;\n pid = controller.settings.ps[i][0];\n pname = pidname(pid);\n line = \"<div><div class='running-icon'></div><div class='running-text'>\";\n line += pname+\" \"+_(\"is running on station\")+\" <span class='nobr'>\"+controller.stations.snames[i]+\"</span> \";\n if (controller.settings.ps[i][1] > 0) {\n line += \"<span id='countdown' class='nobr'>(\"+sec2hms(controller.settings.ps[i][1])+\" \"+_(\"remaining\")+\")</span>\";\n }\n line += \"</div></div>\";\n break;\n }\n }\n\n if (match) {\n change_status(controller.settings.ps[i][1],\"green\",line,function(){\n changePage(\"#status\");\n });\n return;\n }\n\n // Handle rain delay enabled\n if (controller.settings.rd) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Rain delay until\")+\" \"+dateToString(new Date(controller.settings.rdst*1000))+\"</p>\",function(){\n areYouSure(_(\"Do you want to turn off rain delay?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&rd=0\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n // Handle rain sensor triggered\n if (controller.options.urs === 1 && controller.settings.rs === 1) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Rain detected\")+\"</p>\");\n return;\n }\n\n // Handle manual mode enabled\n if (controller.settings.mm === 1) {\n change_status(0,\"red\",\"<p class='running-text center'>\"+_(\"Manual mode enabled\")+\"</p>\",function(){\n areYouSure(_(\"Do you want to turn off manual mode?\"),\"\",function(){\n showLoading(\"#footer-running\");\n send_to_os(\"/cv?pw=&mm=0\").done(function(){\n update_controller(check_status);\n });\n });\n });\n return;\n }\n\n $(\"#footer-running\").slideUp();\n}", "function loadingMessageStatus(statut) {\n \n if (statut === \"in\") {\n $('#' + divLoadingMessage).append(loadingMessage);\n $('#' + divLoadingMessage).css('visibility', 'visible');\n $('#' + divLoadingMessage).center($('#' + divLoadingMessage).width(), $('#' + divLoadingMessage).height());\n \n } else if (statut === \"out\") {\n $('#' + divLoadingMessage).remove();\n }\n}", "function showStatus(status='success') {\n const success = document.getElementById('save-success');\n const fail = document.getElementById('save-fail');\n\n if (status === 'success')\n success.style.bottom = '-5px';\n else\n fail.style.bottom = '-5px';\n\n setTimeout(() => {\n success.style.bottom = '-70px';\n fail.style.bottom = '-70px';\n }, 5000);\n}", "async function updateTableStatus(res) {\n var tbody = $(\"#tbodyStatus\");\n tbody.empty();\n var trNode = document.createElement('tr'); //Crea la fila\n var tdStatusNode = document.createElement('td');\n tdStatusNode.textContent = res.status;\n trNode.append(tdStatusNode);\n var tdRunningNode = document.createElement('td');\n tdRunningNode.textContent = res.running;\n trNode.append(tdRunningNode);\n var tdPendingNode = document.createElement('td');\n tdPendingNode.textContent = res.pending;\n trNode.append(tdPendingNode);\n var tdFinishedNode = document.createElement('td');\n tdFinishedNode.textContent = res.finished;\n trNode.append(tdFinishedNode);\n var tdNodeNameNode = document.createElement('td');\n tdNodeNameNode.textContent = res.node_name;\n trNode.append(tdNodeNameNode);\n tbody.append(trNode);\n }", "function aktifkan(id){\n \tvar th = $('#'+mnu+'TD_'+id).html();\n if(confirm(' mengaktifkan \"'+th+'\"\" ?'))\n $.ajax({\n url:dir,\n type:'post',\n data:'aksi=aktifkan&id_'+mnu+'='+id,\n dataType:'json',\n success:function(dt){\n var cont,clr;\n if(dt.status!='sukses'){\n cont = '..Gagal Mengaktifkan '+th+' ..';\n clr ='red';\n }else{\n // viewTB($('#departemenS').val());\n cont = '..Berhasil Mengaktifkan '+th+' ..';\n clr ='green';\n viewTB();\n }\n notif(cont,clr);\n }\n });\n }", "function showStatus(status) {\r\n\t\t\tif (status === STATUS_CONNECTING) {\r\n\t\t\t\tself.bbgCss.jq.statusConnecting.show();\r\n\t\t\t\tself.bbgCss.jq.statusStreaming.hide();\r\n\t\t\t\tself.bbgCss.jq.statusPaused.hide();\r\n\t\t\t\tself.bbgCss.jq.statusEnded.hide();\r\n\t\t\t\tself.bbgCss.jq.statusNotStarted.hide();\r\n\t\t\t} else if (status === STATUS_CONNECTED) {\r\n\t\t\t\tself.bbgCss.jq.statusConnecting.hide();\r\n\t\t\t\tself.bbgCss.jq.statusStreaming.show();\r\n\t\t\t\tself.bbgCss.jq.statusPaused.hide();\r\n\t\t\t\tself.bbgCss.jq.statusEnded.hide();\r\n\t\t\t\tself.bbgCss.jq.statusNotStarted.hide();\r\n\t\t\t} else if (status === STATUS_ENDED) {\r\n\t\t\t\tself.bbgCss.jq.statusConnecting.hide();\r\n\t\t\t\tself.bbgCss.jq.statusStreaming.hide();\r\n\t\t\t\tself.bbgCss.jq.statusPaused.hide();\r\n\t\t\t\tself.bbgCss.jq.statusEnded.show();\r\n\t\t\t\tself.bbgCss.jq.statusNotStarted.hide();\r\n\t\t\t} else if (status === STATUS_PAUSED) {\r\n\t\t\t\tself.bbgCss.jq.statusConnecting.hide();\r\n\t\t\t\tself.bbgCss.jq.statusStreaming.hide();\r\n\t\t\t\tself.bbgCss.jq.statusPaused.show();\r\n\t\t\t\tself.bbgCss.jq.statusEnded.hide();\r\n\t\t\t\tself.bbgCss.jq.statusNotStarted.hide();\r\n\t\t\t} else if (status === STATUS_PENDING) {\r\n\t\t\t\tself.bbgCss.jq.statusConnecting.hide();\r\n\t\t\t\tself.bbgCss.jq.statusStreaming.hide();\r\n\t\t\t\tself.bbgCss.jq.statusPaused.hide();\r\n\t\t\t\tself.bbgCss.jq.statusEnded.hide();\r\n\t\t\t\tself.bbgCss.jq.statusNotStarted.show();\r\n\t\t\t} else {\r\n\t\t\t\tself.bbgCss.jq.statusConnecting.hide();\r\n\t\t\t\tself.bbgCss.jq.statusStreaming.hide();\r\n\t\t\t\tself.bbgCss.jq.statusPaused.hide();\r\n\t\t\t\tself.bbgCss.jq.statusEnded.hide();\r\n\t\t\t\tself.bbgCss.jq.statusNotStarted.hide();\r\n\t\t\t}\r\n\t\t}", "function montarSelectStatus(idTipoSituacao) {\n sistemaController.getTiposSituacoes().then(\n data => {\n let selectStatus = $('#sistema').find('#status');\n tiposSituacoes = data;\n definirOption(selectStatus,{id : '', descricao : 'Selecione'});\n\n tiposSituacoes.forEach(tiposSituacao => {\n definirOption(selectStatus, tiposSituacao, idTipoSituacao);\n });\n }, error => {\n mensagem.adicionaMensagemErro(error);\n }\n );\n}", "function setStatus(args) {\n console.log(\"setStatus : \" + args)\n}", "function setStatus(x,y){\n status.text(\"\"); // Clear current status message\n status.text(x); // Set new status string\n var sa = $(\"#stat-area\"); // Status container\n if(y == 0){ // Status only (not an error)\n sa.removeClass(\"red\");\n sa.removeClass(\"grn\");\n sic.removeClass(\"fa-exclamation-circle\");\n sic.removeClass(\"fa-check-circle\");\n status.removeClass(\"err\"); // Remove past error class\n } else if(y == 1){ // Error code\n status.addClass(\"err\"); // Add error class\n sa.addClass(\"red\");\n sa.removeClass(\"grn\");\n sic.addClass(\"fa-exclamation-circle\");\n sic.removeClass(\"fa-check-circle\");\n } else if(y == 2){ // Good status (success)\n sa.removeClass(\"red\")\n sa.addClass(\"grn\");\n sic.removeClass(\"fa-exclamation-circle\");\n status.removeClass(\"err\");\n sic.addClass(\"fa-check-circle\");\n }\n}", "function setStatus (theStatus, theObj){\r\n\t\tobj = document.getElementById(theObj);\r\n\t\tif (obj){\r\n\t\t\tobj.innerHTML = \"<div class=\\\"bold\\\">\" + theStatus + \"</div>\";\r\n\t\t}\r\n\t}", "function showStatus() {\n\n if ((reporteSeleccionado == 13) || (reporteSeleccionado == 14)) {\n\n if (banderas.banderaTodoSeleccionado == 0) {\n if (Calles.length == 0) {\n ngNotify.set('Seleccione al menos una calle', { type: 'error' });\n }\n else {\n modalStatus();\n }\n }\n else if (banderas.banderaTodoSeleccionado == 1) {\n modalStatus();\n }\n }\n }", "static applyMangaStatus( connector, mangas ) {\n mangas.forEach( ( manga ) => {\n //manga['status'] = 'completed';\n });\n }", "function updateStatus(st) {\r\n\tsrc = st.attr('src');\r\n\tvar s;\r\n\tvar id = st.attr('id');\r\n\tif (src == 'img/check.png') {\r\n\t\tst.attr('src', 'img/uncheck.png');\r\n\t\ts = 0;\r\n\t} else {\r\n\t\tst.attr('src', 'img/check.png');\r\n\t\ts = 1;\r\n\t}\r\n\r\n\t$.post(\"updatestatus.act\", {\r\n\t\ts : s,\r\n\t\tid : id,\r\n\t}, function(data) {\r\n//\t\tclearChild();\r\n//\t\tgetList();\r\n\t});\r\n}", "function checkStatus()\n\t\t{\n\t\t\tvar count = $('.tile').length;\n\t\t\tif(count == 16)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function traer_status_empresa(req,res){\n\tCONN('status').select().then(status =>{\n\t\tif (!status){\n\t\t\tres.status(500).send({ resp: 'error', error: `${error}` });\n\t\t}else{\n\t\t\tres.status(200).send({ resp: 'consulta exitosa de status_empresa', status:status});\n\t\t}\n\t})\n}", "getStatus () {\r\n const timeElapsed = this._getTime()\r\n\r\n return new Status(this._dna[this._getSegIndex(timeElapsed)].pace, \"good\", this._getDistance(timeElapsed), timeElapsed)\r\n }", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "function totalstatus(){\n\tvar temp='<p>';\n\ttemp+='状态汇总:<br><br>现在正监控: '+machinenum+' 台机器<br><br>其中 '+dangerous+' 台异常,最大时间差:'+max+' 秒';\n\ttemp+='</p>';\n\t$temp=$(temp);\n\t$('#statistic').empty();\n\t$temp.appendTo($('#statistic'));\n}", "function check_status() {\n if (!window.controller.settings.en) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"System Disabled\")+\"</p>\");\n return;\n }\n\n if (window.controller.settings.rd) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"Rain delay until\")+\" \"+(new Date(window.controller.settings.rdst*1000).toUTCString().slice(0,-4))+\"</p>\");\n return;\n }\n\n if (window.controller.settings.urs && window.controller.settings.rs) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"Rain detected\")+\"</p>\");\n return;\n }\n\n // Handle open stations\n var open = {};\n $.each(window.controller.status, function (i, stn) {\n if (stn) open[i] = stn;\n });\n\n if (window.controller.options.mas) delete open[window.controller.options.mas-1];\n\n // Handle more than 1 open station\n if (Object.keys(open).length >= 2) {\n var ptotal = 0;\n $.each(open,function (key){\n var tmp = window.controller.settings.ps[key][1];\n if (tmp > ptotal) ptotal = tmp;\n });\n\n var sample = Object.keys(open)[0],\n pid = window.controller.settings.ps[sample][0],\n pname = pidname(pid),\n line = \"<img id='running-icon' width='11px' height='11px' src='img/running.png' /><p id='running-text'>\";\n\n line += pname+\" \"+_(\"is running on\")+\" \"+Object.keys(open).length+\" \"+_(\"stations\")+\" \";\n if (pid!=255&&pid!=99) line += \"<span id='countdown' class='nobr'>(\"+sec2hms(ptotal)+\" \"+_(\"remaining\")+\")</span>\";\n line += \"</p>\";\n change_status(ptotal,window.controller.options.sdt,\"green\",line);\n return;\n }\n\n // Handle a single station open\n var match = false,\n i = 0;\n $.each(window.controller.stations.snames,function (station,name){\n if (window.controller.settings.ps[i][0] && window.controller.status[i] && window.controller.options.mas != i+1) {\n match = true;\n var pid = window.controller.settings.ps[i][0],\n pname = pidname(pid),\n line = \"<img id='running-icon' width='11px' height='11px' src='img/running.png' /><p id='running-text'>\";\n line += pname+\" \"+_(\"is running on station\")+\" <span class='nobr'>\"+name+\"</span> \";\n if (pid!=255&&pid!=99) line += \"<span id='countdown' class='nobr'>(\"+sec2hms(window.controller.settings.ps[i][1])+\" \"+_(\"remaining\")+\")</span>\";\n line += \"</p>\";\n change_status(window.controller.settings.ps[i][1],window.controller.options.sdt,\"green\",line);\n return false;\n }\n i++;\n });\n\n if (match) return;\n\n if (window.controller.settings.mm) {\n change_status(0,window.controller.options.sdt,\"red\",\"<p id='running-text' style='text-align:center'>\"+_(\"Manual mode enabled\")+\"</p>\");\n return;\n }\n\n $(\"#footer-running\").slideUp();\n}", "function getStatus($){\n if ($.status){\n return Label($, { string: $.status, style: smallStyle }),\n } else{\n return Label($, { string: globalStats, style: smallStyle }),\n }\n}", "function showSuccess() {\n showStatus();\n}", "function getStatus(status) {\n\n\t\tlet taskStatus;\n\n\t\tif (status) {\n\t\t\ttaskStatus = 'Completed';\n\t\t} else {\n\t\t\ttaskStatus = 'In progress';\n\t\t}\n\n\t\treturn taskStatus;\n\n}", "generateStatus () {\n return this._removeExistingStatus()\n .then(() => {\n return promise.all([\n this._findTotalNumberOfPages(),\n this._findTotalNumberOfRecipes()\n ]).spread(this._writeStatusToJSONFile);\n });\n }", "function aktifkan(id){\n var th = $('#'+mnu+'TD_'+id).html();\n var dep = $('#'+mnu2+'S').val();\n //alert('d '+dep);\n //return false;\n if(confirm(' mengaktifkan \"'+th+'\"\" ?'))\n $.ajax({\n url:dir,\n type:'post',\n data:'aksi=aktifkan&replid='+id+'&departemen='+dep,\n dataType:'json',\n success:function(dt){\n var cont,clr;\n if(dt.status!='sukses'){\n cont = '..Gagal Mengaktifkan '+th+' ..';\n clr ='red';\n }else{\n viewTB($('#departemenS').val());\n cont = '..Berhasil Mengaktifkan '+th+' ..';\n clr ='green';\n }notif(cont,clr);\n }\n });\n }", "function setWinLabelStatus(status) {\n\n let winModal = document.getElementById('wind_modal');\n document.getElementById('inner-text').innerText = status !== 'pareggio' ?\n `Woohoo! \\r\\n ${status} vince il turno` :\n 'Pareggio';\n winModal.style.display = 'flex';\n }", "function updateExportFileStatus() {\n var options = new Array();\n options['delay'] = '100';\n options['timeout'] = '30000';\n options['extraClasses'] = 'export_file_status';\n\n $$('.export_file_status').each(function(item) {\n var id = item.id.split(\"_status_img\")[0];\n var tooltipTextId = id + \"_tooltip_text\";\n new ToolTip(item.id, $(tooltipTextId).innerHTML, options);\n\n });\n}", "get status() {\n\t\treturn this._status;\n\t}", "function getStatus() {\n return status;\n }", "function displayStatus() {\n Reddcoin.messenger.getconnectionState(function(data){\n Reddcoin.viewWalletStatus.getView(data);\n\n Reddcoin.messenger.getReleaseVersion( function(data) {\n Reddcoin.viewWalletStatus.getView(data);\n });\n });\n}", "sizeStatus(arg, callback) {\n if(arg.status == '1'){\n var up_status = 0;\n }else{\n var up_status = 1;\n }\n db.run(`UPDATE size_mast SET is_active = ? WHERE szid = ?`, [up_status, arg.unique], function (err) {\n if (err) {\n callback(err.message);\n }\n callback('1');\n })\n\t\t\t\n\t\t\n\t}", "check(status, id=null) {\n if(status) {\n return ` اطلاعاتی با شناسه \\'${id}\\'پش از این ثبت گردیده. `\n } else if (status == false) {\n return `اطلاعاتی با شناسه \\'${id}\\' موجود نیست `\n }\n\n }", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "function getStatus() {\n // TODO: perhaps remove this if no other status added\n return status;\n }", "function checkStatus(marker) {\n let cells = document.querySelectorAll('.tic-cell');\n let symbol = marker ? 'O' : 'X';\n\n if (checkwin(cells,symbol)) {\n /*Win logic*/\n isfinishround = true;\n setWinLabelStatus(symbol);\n setCounter(symbol);\n } else if (freespacescounter === 0) {\n /*Draw logic*/\n setWinLabelStatus('pareggio')\n }\n }", "requestCrostiniInstallerStatus() {}", "function toggleStatus( status ){ \n\t\t\n\t\tvar strings = document.getElementById(\"he_strings\");\n\t\t\n\t\tif( status == \"statusLoading\" ) document.getElementById(\"status_icon\").src = \"chrome://helium/content/view/loading.gif\";\n\t\telse if( status == \"statusOk\") document.getElementById(\"status_icon\").src = \"chrome://helium/content/view/circle_green.png\";\n\t\telse if( status == \"statusNotOk\") document.getElementById(\"status_icon\").src = \"chrome://helium/content/view/circle_red.png\";\n\t\t\n\t\tdocument.getElementById(\"status_text\").value = strings.getString(status);\n\t}", "function inputStatus(status, elemento){\n\tclasses = status ? 'fa fa-check text-success' : 'fa fa-times text-danger';\n\telemento.after('<i class=\"status-icon ' + classes + '\" style=\"position: absolute; right: -2px; top: 8px;\"></i>');\n\telemento.next('.status-icon').delay(2000).fadeOut(500).delay(500).queue(function() { $(this).remove(); });\n}", "function check_status() {\n YUI().use(\"io-base\", function(Y) {\n var url = M.cfg.wwwroot+'/local/rlsiteadmin/mass/addonstatus.php?addoncommand='+$response.file+'&hash='+$response.hash;\n var cfg = {\n method: 'GET',\n on: {\n success: function(id, o) {\n var $status = null;\n YUI().use('json-parse', function (Y) {\n try {\n $status = Y.JSON.parse(o.responseText);\n var status = \"waiting\";\n if ($status.running) {\n status = \"running\";\n } else if (!$status.running && $status.fileexists === false && $status.results) {\n status = \"completed\";\n }\n if (status != \"completed\") {\n update_modal(status);\n setTimeout(function() {\n check_status();\n }, 2000);\n } else {\n $response.results = $status.results;\n complete_feedback();\n }\n }\n catch (e) {\n Y.log(\"Parsing failed.\");\n }\n });\n },\n failure: function(c, o) {\n if (o.status == '503') {\n // Ignore failures caused by this site is upgrading messages.\n setTimeout(function() {\n check_status();\n }, 2000);\n return;\n }\n try {\n $status = Y.JSON.parse(o.responseText);\n complete_feedback();\n } catch (e) {\n // Some other error has occured. The progress bar will now stop moving.\n Y.log(\"Parsing failed.\");\n }\n }\n }\n };\n $addons = Y.io(url, cfg);\n });\n }", "async function getStatus()\n{\n let houseBitask = await getKinconyRelays(\n config.houseShuttersController.port, config.houseShuttersController.host);\n\n let garageBitmask = await getKinconyRelays(\n config.garageShuttersController.port, config.garageShuttersController.host);\n\n var status = require('../models/shutters.json');\n\n status.F1.W1 = houseBitask & Number('0b0000000000000001');\n status.F1.W2 = (houseBitask & Number('0b0000000000000010')) >> 1;\n status.F1.W3 = (houseBitask & Number('0b0000000000000100')) >> 2;\n status.F1.W4 = (houseBitask & Number('0b0000000000001000')) >> 3;\n status.F1.W5 = (houseBitask & Number('0b0000000000010000')) >> 4;\n status.F1.W6 = (houseBitask & Number('0b0000000000100000')) >> 5;\n status.F1.W7 = (houseBitask & Number('0b0000000001000000')) >> 6;\n\n status.F2.W1 = (houseBitask & Number('0b0000000010000000')) >> 7;\n status.F2.W2 = (houseBitask & Number('0b0000000100000000')) >> 8;\n status.F2.W3 = (houseBitask & Number('0b0000001000000000')) >> 9;\n status.F2.W4 = (houseBitask & Number('0b0000010000000000')) >> 10;\n status.F2.W5 = (houseBitask & Number('0b0000100000000000')) >> 11;\n status.F2.W6 = (houseBitask & Number('0b0001000000000000')) >> 12;\n status.F2.W7 = (houseBitask & Number('0b0010000000000000')) >> 13;\n status.F2.W8 = (houseBitask & Number('0b0100000000000000')) >> 14;\n status.F2.W9 = (houseBitask & Number('0b1000000000000000')) >> 15;\n\n status.Garage.W1 = garageBitmask & Number('0b0000000000000001'); // Window 1: SW1 (1)\n status.Garage.W2 = (garageBitmask & Number('0b0000000000000100')) >> 2; // Window 2: SW3 (3)\n status.Garage.W3 = (garageBitmask & Number('0b0000000000010000')) >> 4; // Windos 3: SW5 (5)\n\n return status;\n}", "function aktifkan(id){\n \tvar th = $('#'+mnu+'TD_'+id).html();\n \tvar dep = $('#'+mnu2+'S').val();\n \t//alert('d '+dep);\n \t//return false;\n if(confirm(' mengaktifkan \"'+th+'\"\" ?'))\n $.ajax({\n url:dir,\n type:'post',\n data:'aksi=aktifkan&replid='+id+'&departemen='+dep,\n dataType:'json',\n success:function(dt){\n var cont,clr;\n if(dt.status!='sukses'){\n cont = '..Gagal Mengaktifkan '+th+' ..';\n clr ='red';\n }else{\n viewTB($('#departemenS').val());\n cont = '..Berhasil Mengaktifkan '+th+' ..';\n clr ='green';\n }notif(cont,clr);\n }\n });\n }", "function aktifkan(id){\n \tvar th = $('#'+mnu+'TD_'+id).html();\n \tvar dep = $('#'+mnu2+'S').val();\n \t//alert('d '+dep);\n \t//return false;\n if(confirm(' mengaktifkan \"'+th+'\"\" ?'))\n $.ajax({\n url:dir,\n type:'post',\n data:'aksi=aktifkan&replid='+id+'&departemen='+dep,\n dataType:'json',\n success:function(dt){\n var cont,clr;\n if(dt.status!='sukses'){\n cont = '..Gagal Mengaktifkan '+th+' ..';\n clr ='red';\n }else{\n viewTB($('#departemenS').val());\n cont = '..Berhasil Mengaktifkan '+th+' ..';\n clr ='green';\n }notif(cont,clr);\n }\n });\n }", "function setStatus (status) {\n _.each(statusElements, function (el, name) {\n if (name === status) {\n el.style.display = 'inline-block';\n } else {\n el.style.display = 'none';\n }\n })\n }", "function update_status() {\n disable_blocks()\n\n // habilito los divs adyacentes al div vacio.\n if (!first_row_index.includes(emptyBlock)) {\n check_block_position(emptyBlock - 1).status = true\n }\n\n if (!last_row_index.includes(emptyBlock)) {\n check_block_position(emptyBlock + 1).status = true\n }\n check_block_position(emptyBlock - puzzle_size).status = true\n check_block_position(emptyBlock + puzzle_size).status = true\n\n // devuelve el bloque que se encuentra en la posision solicitada.\n function check_block_position(position) {\n objArray.forEach(item => {\n if (item.position == position) {\n obj = item\n return\n }\n })\n return obj\n }\n}", "function SendStatus() {\n message = {\n intended: \"popup\",\n action: \"status\",\n artista: artistName,\n cancion: songName,\n album: albumName,\n cover: coverImage,\n estado: isPlaying,\n volumen: player.getVolume(),\n videoLenght: player.getDuration(),\n videoProgress: player.getCurrentTime(),\n muteado: player.isMuted()\n };\n SendMessage(message);\n}", "function changeorderstatus(id, orderstatus, element){\n\t\n\t//ob kliku na gumb ga spremeni v loading gumbek\n\t$(element).addClass('disabled');\n\t$(element).children('i').addClass('fa fa-circle-o-notch fa-spin');\n\n\t//spremeni status narocila glede na kliknen gumbek\n\tvar request = $.ajax({\n\turl: 'changeOrderStatus.php?id=' + id + '&status=' + orderstatus,\n\ttype: 'get',\n\tdataType: 'html'\n });\n\n\t//ce se uspesno izvrsi, se prikaze obvestilo o tem kaj se je naredilo, stran se poskrolla do vrha kjer je obvestilo\n\t//tabela se ozvezi z novimi podatki in vrstica z narocilom se oznaci po refreshue\n\trequest.done( function ( data ) {\n\t\tvar statusnarocila;\n\t\tvar alerttype;\n\t\tif (orderstatus == \"cancelled\"){\n\t\t\tstatusnarocila = \"<strong>preklicano</strong>.\";\n\t\t\talerttype = \"alert-danger\";\n\t\t}else if (orderstatus == \"completed\"){\n\t\t\tstatusnarocila = \"<strong>zaključeno</strong>.\";\n\t\t\talerttype = \"alert-success\";\n\t }else if (orderstatus == \"processing\"){\n \t statusnarocila = \"označeno kot <strong>plačano</strong>.\";\n \t alerttype = \"alert-info\";\n\t\t}\n\t\tbootstrap_alert.warning('Naročilo ' + id + ' je bilo '+ statusnarocila, alerttype);\n\t\t$(\"html, body\").animate({ scrollTop: 0 }, \"fast\");\n \t$(element).hide();\n\t $.ajax({url: \"tabelaNarocil.php?page=\"+page, success: function(result){\n\t\t\t$(\"#table\").html(result);\t\n\t\t\t$(document).ready(function () {\n\t\t\t\tif (orderstatus == \"processing\"){\n\t\t\t\t\t$(\"#\" + id).toggleClass(\"table-active\");\n\t\t\t\t\t$(\"#expand\"+id).show();\n\t\t\t\t}else\tif (orderstatus == \"completed\"){\n\t\t\t\t\t$(\"#\" + id).animate({opacity: 0.250,}, 2000, function() {}).animate({opacity: 1,}, 500, function() {});\n\n\t\t\t\t}\n\t\t\t\n\t\t\t});\n\t\t}});\n\t});\n\n\t//ce pride do tezave se ta izpise v konzoli\n\trequest.fail( function ( jqXHR, textStatus) {\n\tconsole.log( 'Sorry: ' + textStatus );\n });\n}", "function GetStatusInfo(){\n showBackgroundImage('wait_message');\n getContent('','/cgi-bin/info.cgi?GetStatusInfo','function:SystemStatus');\n}", "function changeStatus(id,obj,status){\n\t \n addOverLay();\n\t $(obj).addClass(\"btn-primary\").siblings().removeClass(\"btn-primary\");\n\t $.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : HOST_PATH+\"admin/user/userstatus\",\n\t\t\tdata : \"id=\"+id+\"&status=\"+status\n\t\t}).done(function(msg) {\n\t\t\tremoveOverLay();\t\n\t}); \n\n}", "function openStatus() {\n\tif((thisDay !== 6 && thisDay !== 0 && thisDay !== 2) && (time >= 10 && time <= 18)) {\n\t\tdocument.getElementById('openStatus').innerHTML = \"åben :)\";\n\t\tdocument.getElementById('openMessage').classList.remove(\"d-none\");\n\t}\n\telse if((thisDay == 2) && (time >= 11 && time <= 19)) {\n\t\tdocument.getElementById('openStatus').innerHTML = \"åben :)\";\n\t\tdocument.getElementById('openMessage').classList.remove(\"d-none\");\n\t}\n\telse {\n\t\tdocument.getElementById('openStatus').innerHTML = \"lukket :(\";\n\t\tdocument.getElementById('closedMessage').classList.remove(\"d-none\");\n\t}\n}", "function showStatus(status) {\n currentStatus = status;\n\n if (status == mmCoreOutdated) {\n $scope.statusMessage = 'mma.mod_scorm.scormstatusoutdated';\n } else if (status == mmCoreNotDownloaded) {\n $scope.statusMessage = 'mma.mod_scorm.scormstatusnotdownloaded';\n } else if (status == mmCoreDownloading) {\n if (!$scope.downloading) {\n // It's being downloaded right now but the view isn't tracking it. \"Restore\" the download.\n downloadScormPackage(true);\n }\n } else {\n $scope.statusMessage = '';\n }\n }", "function statusInf() {\r\n window.status = 'Mensaajeeeeeeeeeeee';\r\n}", "function tamagoOverTo(){\n\t\t\tif (tivoniClickStatus == true && tzimhoniClickStatus == true && kasherClickStatus == true && heraionClickStatus == true && ingridiantClick==true){\n\t\t\tthis.gari.alpha=0.2;\n\t\t\tthis.tobiko.alpha=0.2;\n\t\t\tthis.tuna.alpha=0.2;\n\t\t\tthis.unagi.alpha=0.2;\n\t\t\tthis.surimi.alpha=0.2;\n\t\t\tthis.palamida.alpha=0.2;\n\t\t\tthis.salmon.alpha=0.2;\n\t\t\tthis.skin.alpha=0.2;\n\t\t\tthis.ekora.alpha=0.2;\n\t\t\tthis.panko.alpha=0.2;\n\t\t\tthis.wasabi.alpha=0.2;\n\t\t\tthis.daikon.alpha=0.2;\n\t\t\tthis.shitaki.alpha=0.2;\n\t\t\tthis.nuri.alpha=0.2;\n\t\t\tthis.nato.alpha=0.2;\n\t\t\tthis.tograshi.alpha=0.2;\n\t\t\tthis.canfio.alpha=0.2;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\tif((tzimhoniClickStatus == false || kasherClickStatus == false || heraionClickStatus == false) && ingridiantClick==true){\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\t}", "function get_status(){\n\n $.ajax({\n url: url_path + \"get_status\", type: \"GET\", dataType: \"json\", success: function (msg) {\n if (msg.status[2] === \"true\"){\n $('#current_status').text(\" Annotating Seed\");\n }else{\n $('#current_status').text(\" Annotating Corpus\");\n }\n $('#corpus_progress').text(msg.status[5]+\" / \"+msg.status[6]);\n $('#progress_bar_finished').css('width', (100*parseFloat(msg.status[3])/parseFloat(msg.status[4])).toString()+\"%\");\n }\n });\n}", "function parseArduStatus(status){\n\n \n var hour = (new Date()).getHours();\n \n var lightOn = false; \n if( hour >= status.lOn && hour < status.lOff){\n lightOn = true;\n }\n\n var ventilationOn = false; \n if( hour >= status.vOn && hour < status.vOff){\n \n ventilationOn = true;\n }\n\n return { \n light : lightOn , \n ventilation : ventilationOn\n }\n}", "setStatus(status) {\n this.status = status;\n }", "function setStatus() {\n hour = moment().hours();\n timeBlock.each(function () {\n let thisHour = parseInt($(this).attr(\"id\"));\n if (thisHour > hour) {\n $((this).children[1]).addClass(\"future\")\n }\n else if (thisHour === hour) {\n $((this).children[1]).addClass(\"present\");\n }\n else {\n $((this).children[1]).addClass(\"past\");\n }\n })\n}", "function setStatus(hours){\n var text = 'open';\n var css = 'label label';\n var status = {\n text: text,\n css: css+'-success'\n };\n\n if (hours.timeLeft <= 7200 && hours.timeLeft > 0){\n if (hours.isOpen) status.text = 'closing soon';\n else status.text = 'opening soon';\n status.css = css+'-warning';\n }\n else if (!hours.isOpen){\n status.text = 'closed';\n status.css = css+'-danger';\n }\n hours.status = status;\n return hours;\n }", "function setStatus(status) {\n $('#status').html(status);\n}", "function status () {\n if ((arguments.length === 1) && (typeof (arguments[0]) === 'object')) {\n let s = toStr(arguments[0]);\n _('#status').innerText = s.slice(1, s.length - 1);\n } else {\n _('#status').innerText = [...Array(arguments.length).keys()].map((j) => toStr(arguments[j])).join(', ');\n }\n}", "function get_status() {\n var runningTotal = {},\n allPnames = [],\n color = \"\",\n list = \"\",\n tz = window.controller.options.tz-48;\n\n tz = ((tz>=0)?\"+\":\"-\")+pad((Math.abs(tz)/4>>0))+\":\"+((Math.abs(tz)%4)*15/10>>0)+((Math.abs(tz)%4)*15%10);\n \n var header = \"<span id='clock-s' class='nobr'>\"+(new Date(window.controller.settings.devt*1000).toUTCString().slice(0,-4))+\"</span> GMT \"+tz;\n\n runningTotal.c = window.controller.settings.devt;\n\n var master = window.controller.options.mas,\n ptotal = 0;\n\n var open = {};\n $.each(window.controller.status, function (i, stn) {\n if (stn) open[i] = stn;\n });\n open = Object.keys(open).length;\n\n if (master && window.controller.status[master-1]) open--;\n\n $.each(window.controller.stations.snames,function(i, station) {\n var info = \"\";\n if (master == i+1) {\n station += \" (\"+_(\"Master\")+\")\";\n } else if (window.controller.settings.ps[i][0]) {\n var rem=window.controller.settings.ps[i][1];\n if (open > 1) {\n if (rem > ptotal) ptotal = rem;\n } else {\n ptotal+=rem;\n }\n var remm=rem/60>>0,\n rems=rem%60,\n pid = window.controller.settings.ps[i][0],\n pname = pidname(pid);\n if (window.controller.status[i] && (pid!=255&&pid!=99)) runningTotal[i] = rem;\n allPnames[i] = pname;\n info = \"<p class='rem'>\"+((window.controller.status[i]) ? _(\"Running\") : _(\"Scheduled\"))+\" \"+pname;\n if (pid!=255&&pid!=99) info += \" <span id='countdown-\"+i+\"' class='nobr'>(\"+(remm/10>>0)+(remm%10)+\":\"+(rems/10>>0)+(rems%10)+\" \"+_(\"remaining\")+\")</span>\";\n info += \"</p>\";\n }\n if (window.controller.status[i]) {\n color = \"green\";\n } else {\n color = \"red\";\n }\n list += \"<li class='\"+color+\"'><p class='sname'>\"+station+\"</p>\"+info+\"</li>\";\n i++;\n });\n\n var footer = \"\";\n var lrdur = window.controller.settings.lrun[2];\n\n if (lrdur !== 0) {\n var lrpid = window.controller.settings.lrun[1];\n var pname= pidname(lrpid);\n\n footer = '<p>'+pname+' '+_('last ran station')+' '+window.controller.stations.snames[window.controller.settings.lrun[0]]+' '+_('for')+' '+(lrdur/60>>0)+'m '+(lrdur%60)+'s on '+(new Date(window.controller.settings.lrun[3]*1000).toUTCString().slice(0,-4))+'</p>';\n }\n\n if (ptotal) {\n var scheduled = allPnames.length;\n if (!open && scheduled) runningTotal.d = window.controller.options.sdt;\n if (open == 1) ptotal += (scheduled-1)*window.controller.options.sdt;\n allPnames = allPnames.getUnique();\n var numProg = allPnames.length;\n allPnames = allPnames.join(\" \"+_(\"and\")+\" \");\n var pinfo = allPnames+\" \"+((numProg > 1) ? _(\"are\") : _(\"is\"))+\" \"+_(\"running\")+\" \";\n pinfo += \"<br><span id='countdown-p' class='nobr'>(\"+sec2hms(ptotal)+\" remaining)</span>\";\n runningTotal.p = ptotal;\n header += \"<br>\"+pinfo;\n }\n\n var status = $(\"#status_list\");\n status.html(list);\n $(\"#status_header\").html(header);\n $(\"#status_footer\").html(footer);\n if (status.hasClass(\"ui-listview\")) status.listview(\"refresh\");\n window.totals = runningTotal;\n if (window.interval_id !== undefined) clearInterval(window.interval_id);\n if (window.timeout_id !== undefined) clearTimeout(window.timeout_id);\n\n changePage(\"#status\");\n if (window.totals.d !== undefined) {\n delete window.totals.p;\n setTimeout(get_status,window.totals.d*1000);\n }\n update_timers(window.controller.options.sdt);\n}", "status() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n status: 'OK',\n };\n });\n }", "function setStatus(text) {\n\t\tstatus.innerHTML = String(text)\n\t}", "get status() {\n return privates.get(this).status;\n }", "function checkStatus(status){\n\tif(status === 'Z'){\n\t\tuserStatus = true;\n\t\treturn \"<p style='color: green;'>Alive</p>\";\n\t}\n\tuserStatus = false;\n\treturn \"<p style='color: red;'>Dead</p>\";\n}", "function status(cmd) {\n console.log('\\n');\n console.log('Current Alloy theme is: ' + chalk.cyan(alloyCfg.global.theme || \"not defined\"));\n console.log('\\n');\n }" ]
[ "0.63136774", "0.62519157", "0.6028023", "0.60214186", "0.60138637", "0.5973966", "0.59630316", "0.5940255", "0.5894286", "0.5839702", "0.5812421", "0.58088833", "0.57781154", "0.5743223", "0.5742213", "0.5737909", "0.5720811", "0.5720736", "0.5717034", "0.5688482", "0.5685492", "0.56782144", "0.5676803", "0.56766194", "0.56745166", "0.5662101", "0.5628053", "0.56252384", "0.56244534", "0.5624046", "0.562173", "0.5605155", "0.55932605", "0.5586109", "0.5585504", "0.5585504", "0.5585504", "0.5585504", "0.5585504", "0.5585504", "0.5585504", "0.5585504", "0.5585504", "0.5583544", "0.5580239", "0.557869", "0.5575674", "0.55707157", "0.5570703", "0.5564831", "0.5564823", "0.55624723", "0.5549864", "0.55491084", "0.55490685", "0.5546597", "0.554422", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5535417", "0.5529435", "0.5523407", "0.5515647", "0.5511323", "0.55042356", "0.5503322", "0.5503293", "0.55012435", "0.55012435", "0.5495172", "0.5491619", "0.54911673", "0.54910946", "0.5487053", "0.5478023", "0.54760677", "0.547203", "0.54672426", "0.54651743", "0.5459112", "0.5450203", "0.54481846", "0.5447525", "0.54407305", "0.54373986", "0.54315996", "0.5429082", "0.542885", "0.5426862", "0.5425396", "0.5418352", "0.54156184" ]
0.0
-1
purple color scale: "F0EEFE" "D9D4FC" "ACA0F9" "705BF4" "4327F1" "331EB7" "281791" "1B1060"
function CustomizingThemes() { return ( <Block display="flex" justifyContent="center"> <img src={assetUrl("./mockup_themes.png")} width="60%" /> </Block> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeColorScale() {\n var blue = chroma('darkblue');\n var red = chroma('darkred');\n var white = chroma('white');\n return scale = [[0, blue.css()], [0.35, white.css()], [0.5, white.css()], [0.65, white.css()], [1, red.css()]];\n}", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "_createColorScale() {\n\t\t\treturn new d3.scaleSequential((t) => {\n\t\t\t\t//const saturation = t * 0.2 + 0.4; // 50–60%\n\t\t\t\tconst saturation = 0.7;\n\t\t\t\tconst lightness = (1 - t) * 0.6 + 0.4; // 30–80%\n\t\t\t\t//const lightness = 0.5;\n\t\t\t\t// Hue needs values between 40 and 90\n\t\t\t\tconst hue = t * 100;\n\t\t\t\t//console.warn(t.toFixed(3), hue.toFixed(3), saturation.toFixed(3), lightness.toFixed(3));\n\t\t\t\tconst hsl = d3.hsl(hue, saturation, lightness);\n\t\t\t\treturn hsl.toString();\n\t\t\t});\n\t\t}", "colorScale(color) {\n if (color !== 'red' && color !== 'blue' && color !== 'green') {\n throw new Error('please enter either red, green, or blue')\n } else {\n this.transformType = `${color}-scale`;\n\n let i;\n\n if (color === 'red')\n i = 2;\n if (color === 'green')\n i = 1;\n if (color === 'blue')\n i = 0;\n\n for(i; i < this.colorTableBuffer.length; i+=4) {\n this.colorTableBuffer[i] = this.colorTableBuffer[i] +\n Math.floor(.8 * (255-this.colorTableBuffer[i]));\n }\n }\n }", "function hue2rgb(p,q,h){h = (h + 1) % 1;if(h * 6 < 1){return p + (q - p) * h * 6;}if(h * 2 < 1){return q;}if(h * 3 < 2){return p + (q - p) * (2 / 3 - h) * 6;}return p;}", "function hue2rgb(p,q,h){h = (h + 1) % 1;if(h * 6 < 1){return p + (q - p) * h * 6;}if(h * 2 < 1){return q;}if(h * 3 < 2){return p + (q - p) * (2 / 3 - h) * 6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "function hue2rgb(p,q,h){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6;}if(h*2<1){return q;}if(h*3<2){return p+(q-p)*(2/3-h)*6;}return p;}", "blueify(){\n this.transformType = 'blueified';\n const rgbValues = [...this.colorTable].map(a => {\n return [a.slice(0, 2), a.slice(2,4), a.slice(4, 6)].map((b, i) => {\n let rgb = i === 0 ? 'ff' : Math.floor(parseInt(b,16)/2).toString(16);\n return rgb.length === 1 ? `0${rgb}` : rgb;\n }).join('');\n });\n\n this.updateColorTable(rgbValues.join(''));\n }", "function mapColors(data) {\n let strValue = [];\n for (let i = 0; i < data.length; i ++){\n strValue.push(String(JSON.stringify(data[i]))); // particolare tipo di hashing \n }\n oScale.domain(strValue);\n}", "function colorScale() {\n var linearScale = d3.scaleLinear()\n .domain([d3.min(happinessData, d => d[chosenColor]),\n d3.max(happinessData, d => d[chosenColor])])\n .range([\"rgb(46, 73, 123)\", \"rgb(71, 187, 94)\"]);\n\n return linearScale;\n}", "function singleHueScaleFactory(a){return(0,_scale.scaleOrdinal)({range:[].concat(_theme.allColors[a]||_theme.grayColors).reverse()})}", "function GaugeBarColor (s) {\r\n\t\t\tvar\tcolorScale = d3.scaleLinear()\r\n\t\t\t\t.domain([0,9])\r\n\t\t\t\t.range([0,255]);\r\n\t\t\t//red is (255,0,0), yellow is (255,255,0), green is (0,255,0)\r\n\t\t\t//between red and yellow we need to add to the green channel\r\n\t\t\t//between yellow and green we need to subtract from the red channel\r\n\t\t\t//had to mix some blue at 10% to make the dark green stand out from a (0,255,0)\r\n\t\t\tif(s < 4.5) {\r\n\t\t\t\treturn \"rgb(255,\" + 2 * Math.round(colorScale(s)) + \",0)\"\r\n\t\t\t} else {\r\n\t\t\t\treturn \"rgb(\" + Math.round((255-(colorScale(s)+1))) + \",255,\"+ Math.round(colorScale(s)*0.2)+\")\"\r\n\t\t\t};\r\n\t\t}", "getColor(value) {\n // Test Max\n if (value === 255) {\n console.log(\"MAX!\");\n }\n let percent = (value) / 255 * 50;\n // return 'rgb(V, V, V)'.replace(/V/g, 255 - value);\n return 'hsl(H, 100%, P%)'.replace(/H/g, 255 - value).replace(/P/g, percent);\n }", "function buildColorScale(min, mid, max, minColor, midColor, maxColor) {\n //return scale of colors for min to mid to max values\n var colors = d3.scale.linear()\n .domain([min, mid, max])\n .range([minColor, midColor, maxColor]);\n return colors;\n }", "function color(n) {\r\n // rgb\r\n return `hsl(${n * quickcol * 360},100%,50%)`;\r\n // default\r\n return `hsl(${n * quickcol * 360},${20+n*quickcol*50}%,${n * quickcol * 100}%)`;\r\n // gray-scaled\r\n return `hsl(0, 0%, ${100 - n * quickcol * 100}%)`;\r\n}", "function mapColorToPalette(red,green,blue){\n var color,diffR,diffG,diffB,diffDistance,mappedColor;\n var distance=250000;\n for(var i=0;i<palette.length;i++){\n color=palette[i];\n diffR=( color.r - red );\n diffG=( color.g - green );\n diffB=( color.b - blue );\n diffDistance = diffR*diffR + diffG*diffG + diffB*diffB;\n if( diffDistance < distance ){\n distance=diffDistance;\n mappedColor=palette[i];\n };\n }\n return(mappedColor);\n }", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "function getColor(val) {\n\t\tconst colorScale = d3.scaleLinear().domain([0, max]).range(['rgb(245, 254, 169)', 'rgb(147, 21, 40)']);\n\t\treturn colorScale(val);\n\t}", "function lgColor(o){this.setOptions=function(o){for(i in o){var n=\"set\"+i.charAt(0).toUpperCase()+i.substr(1);if(this[n]){this[n](o[i])}else{this[i]=o[i]}}};this.setFromIntRGB=function(c){this.colorRGB=c};this.setFromFloatRGB=function(r,g,b){if(typeof(r)==\"object\"){g=r[1];b=r[2];r=r[0]}this.setFromByteRGB(Math.min(0,Math.max(255,(r*255)|0)),Math.min(0,Math.max(255,(g*255)|0)),Math.min(0,Math.max(255,(b*255)|0)))};this.setFromByteRGB=function(r,g,b){if(typeof(r)==\"object\"){g=r[1];b=r[2];r=r[0]}this.colorRGB=r<<16|g<<8|b};this.setFromFloatHSL=function(h,s,l){if(typeof(h)==\"object\"){s=h[1];l=h[2];h=h[0]}var a=this.hslToRgb(h,s,l);this.setFromFloatRGB(a[0],a[1],a[2])};this.setFromByteHSL=function(h,s,l){if(typeof(h)==\"object\"){s=h[1];l=h[2];h=h[0]}this.setFromFloatHSL(h/255,s/255,l/255)};this.getIntRGB=function(){return this.colorRGB};this.getHexRGB=function(){return dec2Hex(this.colorRGB,6)};this.getFloatRGB=function(){var a=this.getByteRGB();return[a[0]/255,a[1]/255,a[2]/255]};this.getByteRGB=function(){return[(c>>16)&255,(c>>8)&255,c&255]};this.getFloatHSL=function(){var a=this.getFloatRGB();return this.rgbToHsl(a[0],a[1],a[2])};this.getByteHSL=function(){var a=this.getFloatRGB();var b=this.rgbToHsl(a[0],a[1],a[2]);return[(h*255)&255,(s*255)&255,(l*255)&255]};this.convert=function(v,a,b){this[\"setFrom\"+a](v);return this[\"get\"+b]()};this.hToC=function(x,y,h){var c;if(h<0){h+=1}if(h>1){h-=1}if(h<1/6){c=x+(y-x)*h*6}else{if(h<1/2){c=y}else{if(h<2/3){c=x+(y-x)*(2/3-h)*6}else{c=x}}}return c};this.hslToRgb=function(h,s,l){var x;var y;var r;var g;var b;y=(l>.5)?l+s-l*s:l*(s+1);x=l*2-y;r=this.hToC(x,y,h+1/3);g=this.hToC(x,y,h);b=this.hToC(x,y,h-1/3);return[r,g,b]};this.rgbToHsl=function(r,g,b){var a=Math.max(r,g,b),mn=Math.min(r,g,b);var h,s,l=(a+mn)/2;if(a==mn){h=s=0}else{var d=a-mn;s=l>0.5?d/(2-a-mn):d/(a+mn);switch(a){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return[h,s,l]};this.setOptions({colorRGB:0});if(o){this.setOptions(o)}}", "color(data) {\n\t\treturn d3\n\t\t\t.scaleLinear()\n\t\t\t.domain([0, Math.round(data.length / 2), data.length])\n\t\t\t.range(['#BBE4A0', '#52A8AF', '#00305C'])\n\t}", "colour(d) {\n const vis = this;\n\n const colourScale = d3\n .scaleOrdinal()\n .domain(vis.listOfHabits)\n .range(['#3EBA9D', '#FF815D', '#7B97C1', '#F080B8', '#96D05B']);\n\n return colourScale(d);\n }", "function colorConverter (string) {\n \n// todo: study the Object.freeze \n const colorCodes = Object.freeze({\n \"blue\":\"rgb(40, 116, 237)\",\n \"brown\":\"rgb(255, 102, 102)\",\n \"brownish-red\":\"rgb(196, 136, 124)\",\n \"coral\":\"rgb(255, 102, 102)\",\n \"cream\":\"rgb(240, 237, 218)\",\n \"creamyWhite\":\"rgb(255, 253, 230)\",\n \"darkBlue\":\"rgb(0, 0, 153)\",\n \"darkPink\":\"rgb(255, 102, 153)\",\n \"darkPurple\":\"rgb(103, 0, 103)\",\n \"deepGreen\":\"rgb(0, 102, 0)\",\n \"deepPink\":\"rgb(212, 30, 90)\",\n \"emeraldGreen\":\"rgb(38, 115, 38)\",\n \"gold\":\"rgb(217, 195, 33)\",//stopped here, finish adding colors\n \"green\":\"rgb(50, 133, 59)\",\n \"greenish-white\":\"rgb(217, 242, 217)\",\n \"greenish-yellow\":\"rgb(230, 255, 179)\",\n \"indigoBlue\":\"rgb(74, 51, 222)\",\n \"lavender\":\"rgb(150, 153, 255)\",\n \"lightBlue\":\"rgb(179, 218, 255)\",\n \"lightGreen\":\"rgb(204, 255, 204)\",\n \"lightPink\":\"rgb(255, 204, 225)\",\n \"lilac\":\"rgb(230, 204, 255)\",\n \"magenta\":\"rgb(255, 0, 255)\",\n \"peach\":\"rgb(253, 217, 181)\",\n \"pink\":\"rgb(255, 102, 153)\",\n \"pinkish-lavender\":\"rgb(242, 211, 227)\",\n// \"purple and yellow\":\"rgba(0,100,0,0.75)\",//todo: need code instead of dark green\n \"purpleRed\":\"rgb(192, 0, 64)\",\n \"purplish-pink\":\"rgb(192, 96, 166)\",\n \"rose\":\"rgb(255, 153, 204)\",\n \"violet\":\"rgb(230, 130, 255)\",\n \"whiteAndPurple\":\"rgb(240, 240, 240)\",//todo: need code instead of dark green\n \"yellowish-green\":\"rgb(198, 210, 98)\", \n \"yellowCenter\":\"rgb(200, 200, 0)\"\n });\n \n //remove i_ (used to make inconspicuous) that might be in a name\n \n\t//if an rgb code is sent, return the color name\n if (string.slice(0,3) === \"rgb\") {\n for(let key in colorCodes) {\n if(colorCodes[key] === string) {\n return key;\n }\n }\n }\n //if a color name that needs to be converted is sent, return rgb\n else if (string in (colorCodes)) {\n return colorCodes[string];\n }\n //otherwise return a color name in camel case when needed\n //this is used when the color isn't listed in colorCodes, but\n //its name is valid as is or if converted to camel case notation\n else {\n return camelCase(string);\n }\n \n}", "function getColor(d) {\n\t\t\t\treturn d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5514999 ? '#2E64FE' :\n\t\t\t\t\t d > 5564048 ? '#3B0B0B' :\n\t\t\t\t\t\t\t\t '#3B0B0B';\n\t\t\t}", "hue2rgb(p, q, t){\r\n if(t < 0) t += 1;\r\n if(t > 1) t -= 1;\r\n if(t < 1/6) return p + (q - p) * 6 * t;\r\n if(t < 1/2) return q;\r\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\r\n return p;\r\n }", "createColors(color, num) {\n //receive hex color from parent, return array of colors for gradient\n //num is # of generated color in return array\n let a = []\n let red = parseInt( color.substring(1, 3), 16)\n let green = parseInt(color.substring(3, 5), 16)\n let blue = parseInt(color.substring(5,7), 16)\n \n let k = 0.8 \n //from lighter colder to darker warmer\n // console.log(red, green, blue)\n for (i=0;i<num;i++) {\n let new_red = (Math.floor(red*k)).toString(16)\n let new_green = (Math.floor(green*k)).toString(16)\n let new_blue = (Math.floor(blue*k)).toString(16)\n let new_color = '#'+new_red+new_green+new_blue\n k += 0.1\n a.push(new_color)\n }\n return a\n\n }", "function perc2color(perc) {\n\tvar r, g, b = 0;\n\tif(perc < 50) {\n\t\tr = 255;\n\t\tg = Math.round(5.1 * perc);\n\t}\n\telse {\n\t\tg = 255;\n\t\tr = Math.round(510 - 5.10 * perc);\n\t}\n\tvar h = r * 0x10000 + g * 0x100 + b * 0x1;\n\treturn '#' + ('000000' + h.toString(16)).slice(-6);\n}", "function getColor(value) {\n // More votes for republican, show red\n var red = 0;\n var blue = 0;\n var green = 0;\n if (value > 1) {\n var trimmed_value = Math.min(value, 3);\n red = 255;\n blue = Math.round((1 - trimmed_value / 3) * 255);\n green = Math.round((1 - trimmed_value / 3) * 255);\n trimmed_value = null;\n } else if (value == 1) {\n return \"#FFFFFF\";\n } else if (value < 1) {\n var trimmed_value = 1 / value;\n trimmed_value = Math.min(trimmed_value, 3);\n blue = 255;\n red = Math.round((1 - trimmed_value / 3) * 255);\n green = Math.round((1 - trimmed_value / 3) * 255);\n trimmed_value = null;\n }\n var second = red % 16;\n var first = (red - second) / 16;\n var fourth = green % 16;\n var third = (green - fourth) / 16;\n var sixth = blue % 16;\n var fifth = (blue - sixth) / 16;\n return (\"#\" + first.toString(16) + second.toString(16) + third.toString(16) + fourth.toString(16) + fifth.toString(16) + sixth.toString(16));\n }", "function getGreenAndRedColors(largestValueInDataSet) {\n var colorDomain = [\n -1*largestValueInDataSet,\n -.9*largestValueInDataSet,\n -.8*largestValueInDataSet,\n -.7*largestValueInDataSet,\n -.6*largestValueInDataSet,\n -.5*largestValueInDataSet,\n -.4*largestValueInDataSet,\n -.3*largestValueInDataSet,\n -.2*largestValueInDataSet, \n -.1*largestValueInDataSet, \n .0*largestValueInDataSet, \n .1*largestValueInDataSet, \n .2*largestValueInDataSet, \n .3*largestValueInDataSet, \n .4*largestValueInDataSet, \n .5*largestValueInDataSet, \n .6*largestValueInDataSet, \n .7*largestValueInDataSet, \n .8*largestValueInDataSet, \n .9*largestValueInDataSet, \n 1*largestValueInDataSet\n ]\n var colorRange = [\n \"#fcfcfc\",\n \"#ff1919\",\n \"#ff3232\",\n \"#ff4c4c\",\n \"#ff6666\",\n \"#ff7f7f\",\n \"#ff9999\",\n \"#ffb2b2\",\n \"#ffcccc\",\n \"#ffe5e5\",\n \"#d0d6cd\",\n \"#bdc9be\",\n \"#aabdaf\",\n \"#97b0a0\",\n \"#84a491\",\n \"#719782\",\n \"#5e8b73\",\n \"#4b7e64\",\n \"#387255\",\n \"#256546\",\n \"#125937\",\n \"#004d28\",\n \"#004524\"\n ];\n return [colorDomain, colorRange];\n}", "function hue2rgb( p, q, h ) {\r\nh = ( h + 1 ) % 1;\r\nif ( h * 6 < 1 ) {\r\nreturn p + (q - p) * 6 * h;\r\n}\r\nif ( h * 2 < 1) {\r\nreturn q;\r\n}\r\nif ( h * 3 < 2 ) {\r\nreturn p + (q - p) * ((2/3) - h) * 6;\r\n}\r\nreturn p;\r\n}", "function magnitudeColors(color) {\n if (color < 1){return \"red\"}\n else if (color < 2){return \"orange\"}\n else if (color < 3){return \"yellow\"}\n else if (color < 4){return \"green\"} \n else if (color < 5 ){return \"blue\"}\n else {return \"indigo\"}\n}", "function getColour(mag) {\n if (mag > 5) {\n return \"#FF4500\"\n } else if (mag > 4) {\n return \"#FF6347\"\n } else if (mag > 3) {\n return \"#FF8C00\"\n } else if (mag > 2) {\n return \"#FF7F50\"\n } else if (mag > 1) {\n return \"#FF6347\"\n } else {\n return \"#FFA500\"\n }\n }", "getColor(value) {\n let normalizeValue = 0;\n if (value >= 50) {\n normalizeValue = 100 - (value / 100);\n } else {\n normalizeValue = ((value / 100) - 100) * -1;\n }\n\n const hue = ((1 - normalizeValue) * 120).toString(10);\n\n return [\"hsl(\", hue, \", 100%, 50%)\"].join(\"\");\n }", "function getColor(d) {\n\n\t\tswitch (valueType) {\n\t\tcase \"percent\":\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t\tbreak;\n\t\tcase \"difference\":\n\t\t zoomDiff = 11 - zoomLevel;\n\t\t if (zoomDiff > 0) {\n d = d / Math.pow(4, zoomDiff)\n\t\t }\n\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn d > 500 ? colours[6] :\n\t\t\td > 200 ? colours[5] :\n\t\t\td > 100 ? colours[4] :\n\t\t\td > 50 ? colours[3] :\n\t\t\td > 25 ? colours[2] :\n\t\t\td > 0 ? colours[1] :\n\t\t\t colours[0];\n\t\t}\n\t}", "deColorScale(color) {\n if (color !== 'red' && color !== 'blue' && color !== 'green') {\n throw new Error('please enter either red, green, or blue')\n } else {\n this.transformType = `${color}-removed`;\n\n let i;\n\n if (color === 'red')\n i = 2;\n if (color === 'green')\n i = 1;\n if (color === 'blue')\n i = 0;\n\n for(i; i < this.colorTableBuffer.length; i+=4) {\n this.colorTableBuffer[i] = 0;\n }\n }\n }", "function getColor(value, scale, reverse = false) {\n var color;\n var offset;\n if (reverse) {\n scale = 1-scale;\n }\n color = { r: 255, g: 255, b: 255 };\n if (value > 0) {\n color = { r: Math.round(255-(255-153)*scale), g: Math.round(255-(255-153)*scale), b: Math.round(255-(255-153)*scale) }; //gray\n }\n return color;\n}", "function getColor(d) {\n\tfld_min = 1;\n\tfld_max = 255;\n\tfld_incr = 31.75;\n\treturn d > (fld_min + fld_incr * 7) ? '#800026' :\n\t d > (fld_min + fld_incr * 6) ? '#BD0026' :\n\t d > (fld_min + fld_incr * 5) ? '#E31A1C' :\n\t d > (fld_min + fld_incr * 4) ? '#FC4E2A' :\n\t d > (fld_min + fld_incr * 3) ? '#FD8D3C' :\n\t d > (fld_min + fld_incr * 2) ? '#FEB24C' :\n\t d > (fld_min + fld_incr * 1) ? '#FED976' :\n\t \t\t '#FFEDA0';\n}", "function color(sig) {\n if (sig <= 0.01) {\n return 'red';\n } else if (sig <= 0.05) {\n return 'orange';\n } else if (sig <= 0.1) {\n return 'gold';\n } else if (sig <= 0.2) {\n return 'green';\n } else {\n return '';\n }\n}", "function get_color_scale(mtx) {\n var _flattened_array = [].concat.apply([], mtx)\n var extremes = d3.extent(_flattened_array)\n var c = d3.scale.linear()\n .domain([extremes[0], 0, extremes[1]])\n // .range([\"blue\", \"white\", \"red\"]) // Flat\n .range([\"#138BFF\", \"#fff\", \"#FF0007\"]) // Vivid\n // .range([\"#356089\", \"#fff\", \"#D1464A\"]) // Pastel\n return c\n}", "function thisColor(i) { \n colors = ['#001f3f', '#0074D9', '#B10DC9', '#AAAAAA', '#39CCCC', '#FFDC00', '#FF851B', \n '#01FF70', '#F012BE', '#7FDBFF', '#3D9970', '#85144b', '#2ECC40', '##FF4136', '#F012BE', \n \"#3366cc\", \"#dc3912\", \"#ff9900\"];\n\n cc = d3.scaleLinear()\n .domain([-2, 17])\n .range([1, 0]);\n\n return d3.interpolateSpectral(cc(i));\n}", "_prepareColorShades(min, max) {\n let step = (max - min) / 5;\n this._shades = [];\n for (let i = 0; i < 5; i++) {\n this._shades.push(max - i * step);\n }\n }", "getColor() {\n var i = (this.speed * 255) / 255;\n var r = Math.round(Math.sin(0.024 * i + 0) * 127 + 128);\n var g = Math.round(Math.sin(0.024 * i + 2) * 127 + 128);\n var b = Math.round(Math.sin(0.024 * i + 4) * 127 + 128);\n var rgb = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n\n return rgb;\n }", "function getColor(color) {\n\tif (color.includes(\"Magno-Gold\"))\n\t\treturn \"#F6A723\"\n\telse if (color.includes(\"Gold\"))\n\t\treturn \"#6E5012\"\n\telse if (color.includes(\"Carbon Crystal\"))\n\t\treturn \"#BC3731\"\n\telse if (color.includes(\"Carbon\"))\n\t\treturn \"#7C322E\"\n\telse if (color.includes(\"TetraCobalt\"))\n\t\treturn \"#025B85\"\n\telse if (color.includes(\"Cobalt\"))\n\t\treturn \"#0B4762\"\n\telse if (color.includes(\"Cadmium\"))\n\t\treturn \"#581115\"\n\telse if (color.includes(\"Copper\"))\n\t\treturn \"#946714\"\n\telse if (color.includes(\"Emeril\"))\n\t\treturn \"#294C23\"\n\telse if (color.includes(\"Indium\"))\n\t\treturn \"#0C3662\"\n\telse if (color.includes(\"Chromatic Metal\"))\n\t\treturn \"#251314\"\n\telse if (color.includes(\"Ammonia\"))\n\t\treturn \"#0A723C\"\n\telse if (color.includes(\"Aronium\"))\n\t\treturn \"#F6A723\"\n\telse if (color.includes(\"Ferrite\"))\n\t\treturn \"#5B5A55\"\n\telse if (color.includes(\"Silver\"))\n\t\treturn \"#5C5A55\"\n\telse if (color.includes(\"Cactus Flesh\"))\n\t\treturn \"#1D6827\"\n\telse if (color.includes(\"Destablised Sodium\"))\n\t\treturn \"#F16E17\"\n\telse if (color.includes(\"Sodium\"))\n\t\treturn \"#9C4E22\"\n\telse if (color.includes(\"Salt\"))\n\t\treturn \"#1B623A\"\n\telse if (color.includes(\"Solanium\"))\n\t\treturn \"#78361E\"\n\telse if (color.includes(\"Chlorine\"))\n\t\treturn \"#113611\"\n\telse if (color.includes(\"Chloride Lattice\"))\n\t\treturn \"#1E8941\"\n\telse if (color.includes(\"Coprite\"))\n\t\treturn \"#533E2D\"\n\telse if (color.includes(\"Di-hydrogen Jelly\"))\n\t\treturn \"#C21646\"\n\telse if (color.includes(\"Di-hydrogen\"))\n\t\treturn \"#25465C\"\n\telse if (color.includes(\"Dioxite\"))\n\t\treturn \"#1C3D8C\"\n\telse if (color.includes(\"Mordite\"))\n\t\treturn \"#392634\"\n\telse if (color.includes(\"Dirty Bronze\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Grantine\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Herox\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Geodesite\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Iridesite\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Lemmium\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Thermic Condensate\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Platinum\"))\n\t\treturn \"#385457\"\n\telse if (color.includes(\"Pyrite\"))\n\t\treturn \"#925113\"\n\telse if (color.includes(\"Gamma Root\"))\n\t\treturn \"#7E5E21\"\n\telse if (color.includes(\"Fungal Mould\"))\n\t\treturn \"#08733C\"\n\telse if (color.includes(\"Frost Crystal\"))\n\t\treturn \"#193F8C\"\n\telse if (color.includes(\"Kelp Sac\"))\n\t\treturn \"#1B768F\"\n\telse if (color.includes(\"Oxygen\"))\n\t\treturn \"#7B3430\"\n\telse if (color.includes(\"Living Slime\"))\n\t\treturn \"#3E522F\"\n\telse if (color.includes(\"Runaway Mould\"))\n\t\treturn \"#405130\"\n\telse if (color.includes(\"Marrow Bulb\"))\n\t\treturn \"#475930\"\n\telse if (color.includes(\"Nitrogen\"))\n\t\treturn \"#8D6623\"\n\telse if (color.includes(\"Sulphurine\"))\n\t\treturn \"#214532\"\n\telse if (color.includes(\"Radon\"))\n\t\treturn \"#36305E\"\n\telse if (color.includes(\"Paraffinium\"))\n\t\treturn \"#383442\"\n\telse if (color.includes(\"Phosphorus\"))\n\t\treturn \"#8C240F\"\n\telse if (color.includes(\"Nanite\"))\n\t\treturn \"#192E3F\"\n\telse if (color.includes(\"Pugneum\"))\n\t\treturn \"#4C2A56\"\n\telse if (color.includes(\"Rare Metal Element\"))\n\t\treturn \"#8B7E71\"\n\telse if (color.includes(\"Residual Goop\"))\n\t\treturn \"#5B6F35\"\n\telse if (color.includes(\"Viscous Fluid\"))\n\t\treturn \"#40512F\"\n\telse if (color.includes(\"Glass\"))\n\t\treturn \"#F3A923\"\n\telse if (color.includes(\"Star Bulb\"))\n\t\treturn \"#296879\"\n\telse if (color.includes(\"Rusted Metal\"))\n\t\treturn \"#3E5230\"\n\telse if (color.includes(\"Superoxide Crystal\"))\n\t\treturn \"#BA3930\"\n\telse if (color.includes(\"Tritium\"))\n\t\treturn \"#DDDCD0\"\n\telse if (color.includes(\"Uranium\"))\n\t\treturn \"#A37610\"\n\telse if (color.includes(\"Unstable Plasma\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Warp Cell\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Starship Launch Fuel\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Ion Battery\"))\n\t\treturn \"#F3A923\"\n\telse if (color.includes(\"Life Support Gel\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Deuterium\"))\n\t\treturn \"#25465C\"\n}", "function colorRGB(){\n var coolor = \"(\"+generarNumero(255)+\",\" + generarNumero(255) + \",\" + generarNumero(255) +\")\";\n return \"rgb\" + coolor;\n }", "function getColor(d) {\n\treturn d >= 5 ? \"rgb(240, 107, 107)\" :\n\t\t\t\t\td >= 4 ? \"rgb(240, 167, 107)\" :\n\t\t\t\t\td >= 3 ? \"rgb(243, 186, 77)\" :\n\t\t\t\t\td >= 2 ? \"rgb(243, 219, 77)\" :\n\t\t\t\t\td >= 1 ? \"rgb(225, 243, 77)\" :\n\t\t\t\t\t\t\t\t\t\t\"rgb(183, 243, 77)\";\n}", "function ColorScale(opts) {\n var c, col, cols, me, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;\n me = this;\n me.colors = cols = (_ref2 = opts.colors) != null ? _ref2 : ['#ddd', '#222'];\n for (c = 0, _ref3 = cols.length - 1; 0 <= _ref3 ? c <= _ref3 : c >= _ref3; 0 <= _ref3 ? c++ : c--) {\n col = cols[c];\n if (type(col) === \"string\") cols[c] = new Color(col);\n }\n if (opts.positions != null) {\n me.pos = opts.positions;\n } else {\n me.pos = [];\n for (c = 0, _ref4 = cols.length - 1; 0 <= _ref4 ? c <= _ref4 : c >= _ref4; 0 <= _ref4 ? c++ : c--) {\n me.pos.push(c / (cols.length - 1));\n }\n }\n me.mode = (_ref5 = opts.mode) != null ? _ref5 : 'hsv';\n me.nacol = (_ref6 = opts.nacol) != null ? _ref6 : '#ccc';\n me.setClasses((_ref7 = opts.limits) != null ? _ref7 : [0, 1]);\n me;\n }", "function color (i){\n\tif (i===0){\n\t\treturn \"rgb(1, 95, 102)\";\n\t} else if (i===1) {\n\t\treturn \"rgb(45, 241, 255)\";\n\t} else if (i===2) {\n\t\treturn \"rgb(34, 86, 150)\";\n\t} else if (i===3) {\n\t\treturn \"rgb(0, 132, 88)\";\n\t} else if (i===4) {\n\t\treturn \"rgb(56, 255, 188)\";\n\t} else if (i===5) {\n\t\treturn \"rgb(77, 168, 137)\";\n\t} else {\n\t\treturn \"rgb(1, 95, 102)\";\n\t}\n}", "greener(){\n\t\tthis.multiplyColorValue(\"green\", 1.2);\n\t}", "function colorScale(color, parties) {\n color.domain(parties.map(d => d.name));\n color.range(parties.map(d => d.color));\n}", "ratioColor(fromColor, toColor, ratio) {\n // Turn string hashcode into triplet of base 10 values\n let coordify10 = function(hexCode) {\n // Strip pound sign\n if (hexCode.charAt(0) === '#') hexCode = hexCode.substring(1);\n\n return [\n parseInt(hexCode.substring(0, 2), 16),\n parseInt(hexCode.substring(2, 4), 16),\n parseInt(hexCode.substring(4, 6), 16)\n ];\n }\n\n // Turn coordinates back into hex code\n let hexify = function(coordinates) {\n return _.reduce(coordinates, (hexCode, coordinate) => {\n let code = coordinate.toString(16)\n if (code.length < 2) code = '0' + code;\n return hexCode + code;\n }, '#')\n }\n\n let ri = function(from, to, ratio) {\n return Math.round(((to - from) * ratio) + from)\n }\n\n let hexFrom = coordify10(fromColor);\n let hexTo = coordify10(toColor);\n\n let red = ri(hexFrom[0], hexTo[0], ratio)\n let green = ri(hexFrom[1], hexTo[1], ratio)\n let blue = ri(hexFrom[2], hexTo[2], ratio)\n\n return hexify([red, green, blue])\n }", "function getColor(value) {\n if( value >= 0 && value < 5242880 ) {\n return \"rgb(0, 0, 255)\";\n }\n else if( value >= 5242880 && value < 10485760 ) {\n return \"rgb(0, 85, 255)\";\n }\n else if( value >= 10485760 && value < 52428800) {\n return \"rgb(0, 170, 255)\"; \n }\n else if( value >= 52428800 && value < 104857600 ) {\n return \"rgb(0, 255, 255)\";\n }\n else if( value >= 104857600 && value < 524288000 ) {\n return \"rgb(0, 255, 170)\";\n }\n else if( value >= 524288000 && value < 1073741824 ) {\n return \"rgb(0, 255, 0)\";\n }\n else if( value >= 1073741824 && value < 2147483648 ) {\n return \"rgb(85, 255, 0)\";\n }\n else if( value >= 2147483648 && value < 3221225472 ) {\n return \"rgb(170, 255, 0)\";\n }\n else if( value >= 3221225472 && value < 4294967296 ) {\n return \"rgb(255, 255, 0)\";\n }\n else if( value >= 4294967296 && value < 5368709120 ) {\n return \"rgb(255, 170, 0)\"; \n }\n else if( value >= 5368709120 && value < 6442450944 ) {\n return \"rgb(255, 85, 0)\";\n }\n else if( value >= 6442450944 && value < 7516192768 ) {\n return \"rgb(255, 0, 0)\";\n }\n else if( value >= 7516192768 && value < 8589934592 ) {\n return \"rgb(255, 0, 85)\";\n }\n else if( value >= 8589934592 && value < 9663676416 ) {\n return \"rgb(255, 0, 170)\";\n }\n else if( value >= 9663676416 && value < 10737418240 ) {\n return \"rgb(255, 0, 255)\";\n }\n else if( value >= 10737418240 ) {\n return \"rgb(170, 0, 255)\";\n }\n else if( value == -1 ) {\n //gray\n return \"rgb(128,128,128)\";\n }\n else if( value == -2 ) {\n //white\n return \"rgb(255,255,255)\";\n }\n else {\n //black \n return \"rgb(0,0,0)\";\n }\n}", "function getColor(d) {\n return d < -2.68321 ? '#aa0000' : // darkest red\n d < -1.60993 ? '#b93d3d' : // second darkest red\n d < -0.65 ? '#c88686' : // light red 53665\n d < 0.65 ? '#d9d9d9' : // grey\n d < 1.60993 ? '#78add3' : // light blue\n d < 2.683212 ? '#5082af' : // Darker blue\n d < 900 ? '#2b5c8a' : // dark blue\n '#d9d9d9'; //grey\n \n}", "function computeColor(heat){\n\n /*\n var scaledForce = 50000 * heat;\n // clamp values to < 255\n if( Math.abs(scaledForce) > 255 ) {\n scaledForce = 255 * (scaledForce/Math.abs(scaledForce));\n }\n\n var ratio = 2 * (scaledForce+255) / 510;\n colors.b = ~~(Math.max(0, 255*(ratio - 1)));\n colors.r = ~~(Math.max(0, 255*(1 - ratio)));\n colors.g = 255 - colors.b - colors.r;\n */\n\n cycle+=0.1;\n if(cycle>100){\n cycle = 0;\n }\n colors.r = ~~(Math.sin(.3*cycle + 0) * 127+ 128);\n colors.g = ~~(Math.sin(.3*cycle + 2) * 127+ 128);\n colors.b = ~~( Math.sin(.3*cycle + 4) * 127+ 128);\n}", "function changeColorScheme() {\n\n}", "function getColor(magnitude) {\n if (magnitude > 5) {\n return \"#ea2c2c\";\n }\n if (magnitude > 4) {\n return \"#ea822c\";\n }\n if (magnitude > 3) {\n return \"#ee9c00\";\n }\n if (magnitude > 2) {\n return \"#eecc00\";\n }\n if (magnitude > 1) {\n return \"#d4ee00\";\n }\n return \"#98ee00\";\n}", "function getColor(magnitude) {\n switch (true) {\n case magnitude > 6:\n return \"purple\";\n case magnitude > 5:\n return \"maroon\";\n case magnitude > 4:\n return \"red\";\n case magnitude > 3:\n return \"darkorange\";\n case magnitude > 2:\n return \"yellow\";\n case magnitude > 1:\n return \"lime\";\n default:\n return \"green\";\n }\n }", "function colorScale(frequenciesArray){ \n\t//accepts an array of all frequency values and defines the class breaks based on the lowest and highest \n\t\n\t//create quantile classes with color scale \n\tvar color = d3.scale.pow() //designate quantile scale \n\t\t.range ([\n\t\t \"#000\",\n\t\t\t//\"#302C29\", //grey-ish\n\t\t\t//\"#45455C\",\t\t\t\n\t\t\t//\"#4C61A2\", \n\t\t\t\"#057FFE\" //bright blue\n\t\t]); \n\t\n\t//set min and max data values as domain \n\tcolor.domain ( //[0,1]\n\t\t[\n\t\t\td3.min(frequenciesArray), //lowest \n\t\t\td3.max(frequenciesArray) //highest \n\t\t]\n\t); \n\t\n\t//var low = d3.min(frequenciesArray); //lowest \n\t//var high = d3.max(frequenciesArray); //highest \n\t//console.log(\"colorscale:\"+low+\" to \"+high);\n\t\n\treturn color; //return the color scale generator \t\n}", "function getColor(d) {\n \n if (d > 800000.00) {\n return 'seagreen';\n } else if ( d > 700000.00 ){\n return 'orange';\n } else if (d > 600000.00) {\n return 'red' ;\n } else if (d > 500000.00) {\n return 'brown' ;\n } else if (d > 400000.00) {\n return 'lavender'; \n } else if (d > 300000.00) {\n return 'yellow'; \n } else if (d > 150000.00) {\n return 'pink';\n } else if (d > 100000.00) {\n return 'aqua';\n } else if (d > 50000.00) {\n return 'coral';\n } else {\n return 'slategrey';\n } \n}", "function colourNameToRGB(colourName) {\n\n}", "function getColor(magnitude) {\r\n if (magnitude > 5) {\r\n return \"#ea2c2c\";\r\n }\r\n if (magnitude > 4) {\r\n return \"#ea822c\";\r\n }\r\n if (magnitude > 3) {\r\n return \"#ee9c00\";\r\n }\r\n if (magnitude > 2) {\r\n return \"#eecc00\";\r\n }\r\n if (magnitude > 1) {\r\n return \"#d4ee00\";\r\n }\r\n return \"#98ee00\";\r\n}", "function gnomeColor(color) {\n\t\t\t\treturn color.toString().replace(/#(.{2})(.{2})(.{2})/, '#$1$1$2$2$3$3');\n\t\t\t}", "function gnomeColor(color) {\n\t\t\t\treturn color.toString().replace(/#(.{2})(.{2})(.{2})/, '#$1$1$2$2$3$3');\n\t\t\t}", "function getColor(magnitude) {\n if (magnitude > 5) {\n return \"#ea2c2c\";\n }\n if (magnitude > 4) {\n return \"#ea822c\";\n }\n if (magnitude > 3) {\n return \"#ee9c00\";\n }\n if (magnitude > 2) {\n return \"#eecc00\";\n }\n if (magnitude > 1) {\n return \"#d4ee00\";\n }\n return \"#98ee00\";\n}", "function getColorFromColorscale(colorObj) {\n drawColorImage(colorObj);\n for (var i = 0; i < pixelColorData.length; i++) {\n if ((i + 1) % 4 != 0) {\n colorData.push(pixelColorData[i] / 255.0);\n }\n }\n}", "function makeColorScale(data){\n\n // default colorScale\n var colorClasses = colorbrewer.PuBuGn[5];\n\n var colorScale = d3.scale.quantile()\n .range(colorClasses);\n\n var domainArray = [];\n for (var i = 0; i < data.length; i++){\n\n var val = parseFloat(data[i][expressed]);\n domainArray.push(val);\n };\n\n colorScale.domain(domainArray);\n\n return colorScale;\n\n }", "function getColor(d) {\n\n // Correct for null values\n if( d == \"\" || d == null ){ return grayColor; }\n\n // Divide by interval_width for id of color bin\n d = Math.floor( d / self.interval_width );\n\n if( d < 8 ){\n return colors[d];\n } else {\n // All numbers beyond the last bin go in the last bin\n return colors[colors.length - 1]; // last color\n }\n }", "function getColor(mag) {\r\n switch (true) {\r\n case mag > 5:\r\n return \"#FF0000\";\r\n case mag > 4:\r\n return \"#ff9933\";\r\n case mag > 3:\r\n return \"#ffcc00\";\r\n case mag > 2:\r\n return \"#ccff33\";\r\n case mag > 1:\r\n return \"#d4ee00\";\r\n default:\r\n return \"#98ee00\";\r\n }\r\n }", "function getColor(value) {\n var hue = ((1 - value) * 200).toString(10);\n return [\"hsl(\", hue, \",100%,50%)\"].join(\"\");\n }", "function color(magnitude){\n\n if (magnitude > 5){\n return 'red'\n } else if (magnitude > 4){\n return 'orange'\n } else if (magnitude > 3){\n return 'yellow'\n } else if (magnitude > 2){\n return 'green'\n } else if (magnitude > 1){\n return 'lightblue'\n } else {\n return 'purple'\n }\n }", "function setColor(magnitude) {\n \tif (magnitude > 5) {\n \treturn '#FF0000'\n \t} else if (magnitude > 4) {\n \treturn '#FF7C00'\n \t} else if (magnitude > 3) {\n \treturn '#FFBE00'\n \t} else if (magnitude > 2) {\n \treturn '#FFF500'\n \t} else if (magnitude > 1) {\n \treturn '#AEFF00'\n \t} else {\n \treturn '#39FF00'\n \t}\n}", "function getColor(val) {\n switch (true) {\n case val > 90:\n return colorScale[5];\n case val > 70:\n return colorScale[4];\n case val > 50:\n return colorScale[3];\n case val > 30:\n return colorScale[2];\n case val > 10:\n return colorScale[1];\n default:\n return colorScale[0];\n\n }\n}", "function mapColor(value) {\n let r = map(value, 0, 1, 0, 255);\n let g = map(value, 0, 1, 255, 0);\n let b = 255 - g - r;\n return { \n r:r,\n g:g,\n b:b\n }\n}", "function mapColor(id,type) {\n var arrColors = guiData.colorPalette;\n var resColor = \"hsl(195, 100%, 35%)\";\n //console.log(emailDomains);\n //console.log(id);\n if (id != -1) {\n if (id < arrColors.length - 1) {\n resColor = arrColors[id];\n }else{\n resColor = arrColors[arrColors.length - 1];\n }\n }else{\n switch (type) {\n case 'node': resColor = arrColors[0]; break;\n case 'edge': resColor = arrColors[0];\n //\"rgba(0, 134, 179,0.5)\";\n //\"rgba(59, 124, 171, 0.42)\";\n break;\n }\n }\n return resColor;\n }", "function makeColorScale(data){\n\t\tvar colorClasses=[\n\t\t\t\"#ffffb2\",\n\t\t\t\"fecc5c\",\n\t\t\t\"fb8d3c\",\n\t\t\t\"f03b20\",\n\t\t\t\"bd0026\"\n\n\t\t];\n\t\t//create color scale generator\n\t\tvar colorScale=d3.scaleThreshold()\n\t\t\t.range(colorClasses);\n\n\t\t//build arrary of all values of the expressed attribute\n\t\tvar domainArray= [];\n\t\tfor (var i=0; i<data.length; i++){\n\t\t\tvar val=parseFloat(data[i][expressed]);\n\t\t\tdomainArray.push(val);\n\t\t};\n\n\t\t//cluster data using ckmeans clustering algorithm to create natural breaks\n\t\tvar clusters=ss.ckmeans(domainArray,5);\n\n\t\t//reset domain arrary to cluster minimums\n\t\tdomainArray=clusters.map(function(d){\n\t\t\treturn d3.min(d);\n\t\t});\n\n\t\t//remove first value from domain arrary to create class breakpoints\n\t\tdomainArray.shift();\n\n\t\t//assign array of last 4 cluster minimyms as domain\n\t\tcolorScale.domain(domainArray);\n\t\t// return the varibale colorScale for easier referencing\n\t\treturn colorScale;\n\t}", "function color2Rgb(color) {\n if (color.toLowerCase() in engColors) {\n // Decode English language colors with the map\n color = engColors[color.toLowerCase()];\n }\n var match,\n factor;\n if (color.length >= 6) {\n // Match double-wide characters\n match = color.match(/^\\#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);\n factor = 1;\n } else {\n // Match single-wide characters\n match = color.match(/^\\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i);\n factor = 16;\n }\n if (match == null || match.length < 4) {\n return null;\n } else {\n var vals = $$.select(match.slice(1, 4), function(val) { return /*factor **/ parseInt(val, 16); });\n return {\n r: vals[0],\n g: vals[1],\n b: vals[2],\n base: 256 / factor\n };\n }\n}", "function colorRange(magnituge) {\n switch (true) {\n case magnituge >= 5.0:\n return 'red';\n break;\n case magnituge >= 4.0:\n return 'orangered';\n break;\n case magnituge >= 3.0:\n return 'orange';\n break;\n case magnituge >= 2.0:\n return 'gold';\n break;\n case magnituge >= 1.0:\n return 'yellow';\n break;\n default:\n return 'greenyellow';\n };\n}", "function getColor(magnitude) {\n if (magnitude > 7) {\n return 'red'\n } else if (magnitude > 6) {\n return 'orange'\n } else if (magnitude > 5) {\n return 'yellow'\n } else if (magnitude > 4) {\n return 'lightgreen'\n } else if (magnitude > 2) {\n return 'green'\n } else {\n return 'blue'\n }\n}", "function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }", "function color(interest1) { //interest1 is 0-1 scaled relative value of first word in pair\n if (interest1 === undefined || interest1 === GREYVALUE) {\n return GREYCOLOR;\n }\n let red = 255 * interest1;\n let blue = 255 * (1 - interest1);\n return `rgb(${red}, 25, ${blue})` //backtick means string, ${} interpolates rgb values \n}", "function getColour(value) {\n var hue = ((1 - value) * 120).toString(10);\n return [`hsl(${hue}, 100%, 50%)`].join(\"\");\n}", "function getColor(mag) {\n return mag >= 5 ? \"#EA2C2C\" : \n mag >= 4? \"#EA822C\" :\n mag >= 3? \"#EE9C00\" :\n mag > 2? \"#EECC00\" :\n mag > 1? \"#D4EE00\" :\n \"#98EE00\";\n}", "function hue2rgb(p, q, t) {\n if (t < 0) t += 1\n if (t > 1) t -= 1\n if (t < 1 / 6) return p + (q - p) * 6 * t\n if (t < 1 / 2) return q\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6\n return p\n}", "set ETC_RGB4(value) {}", "function getColor(magnitude) {\n switch (true) {\n case magnitude > 5:\n return \"#ea2c2c\";\n case magnitude > 4:\n return \"#ea822c\";\n case magnitude > 3:\n return \"#ee9c00\";\n case magnitude > 2:\n return \"#eecc00\";\n case magnitude > 1:\n return \"#d4ee00\";\n default:\n return \"#98ee00\";\n }\n }", "function getColor(d)\n\t\t{\n\t\t\tvar fill=['#006837','#1a9850','#66bd63','#a6d96a','#d9ef8b','#ffffbf','#fee08b','#fdae61','#f46d43','d73027'];\n\t\t\tvar mid1 = min;\n\t\t\tvar blue=['#0281a1','#0fafd7','#68d9f5'];\n\t\t\tvar green =['#006837','#1a9850','#66bd63','#a6d96a'];\n\t\t\tvar red = ['#ffffbf','#fee08b','#fdae61','#f46d43','d73027'];\n\t\t\tvar mid2 = min+(max-min)*0.35;\n\t\t\tvar mid3 = min;\n\t\t\tif(d<mid1){return fill[0]}\n\t\t\tif(d>mid2){return fill[fill.length-1]}\n\t\t\tvar he = Math.floor((d-mid1)/(mid2-mid1)*fill.length)%fill.length;\n\t\t\treturn fill[he];\n\t\t}", "function getColor(mag) {\n return mag >= 5 ? 'red' :\n mag >= 4 ? 'salmon' :\n mag >= 3 ? 'orange' :\n mag >= 2 ? 'gold' :\n mag >= 1 ? 'greenyellow' :\n 'green';\n }", "function colorthis(measurement) {\r\n\t\r\n\tM = parseFloat(measurement)\r\n\t//rgb to hex conversion function borrowed from https://campushippo.com/lessons/how-to-convert-rgb-colors-to-hexadecimal-with-javascript-78219fdb\r\n\tfunction rgbToHex(rgb){ \r\n\t\tvar hex = Number(rgb).toString(16);\r\n\t\tif (hex.length < 2) {\r\n\t\t hex = \"0\" + hex;\r\n\t\t}\r\n\t\treturn hex;\r\n\t\t};\r\n\t\r\n\t//map the measurement domain on the the RGB color range\r\n\tvar\tcolorScale = d3.scaleLinear()\r\n\t\t.domain([d_min,d_max])\r\n\t\t.range([0,255]);\r\n\t\r\n\t//starting at (0,255,0); for values less than the midpoint we need to add the red channel until we get to (255,255,0)\r\n\tif(M < d_midpt){\r\n\t\tvar red = Math.round(2 * colorScale(M))\r\n\t\tvar green = 255\r\n\t\tvar blue = 0\r\n\t\tvar hexcolor = \"#\"+rgbToHex(red)+rgbToHex(green)+rgbToHex(blue)\r\n\t\treturn hexcolor\r\n\t\r\n\t//for values greater than the midpoint we need to subtract from the green channel until we get to (255,0,0)\r\n\t} else {\r\n\t\tred = 255 \r\n\t\tgreen = (255-Math.round(colorScale(M)))\r\n\t\tblue = 0\r\n\t\tvar hexcolor = \"#\"+rgbToHex(red)+rgbToHex(green)+rgbToHex(blue)\r\n\t\treturn hexcolor\r\n\t};\r\n}", "function makeColorScale(data){\n var colorClasses = [\n \"#66D6F2\",\n \"#00A1C7\",\n \"#0086A6\",\n \"#00596E\",\n \"#002F3B\"\n ];\n\n //create color scale generator\n var colorScale = d3.scaleQuantile()\n .range(colorClasses);\n\n //build array of all values of the expressed attribute\n var domainArray = [];\n for (var i=0; i<data.length; i++){\n var val = parseFloat(data[i][expressed]);\n domainArray.push(val);\n };\n\n //assign array of expressed values as scale domain\n colorScale.domain(domainArray);\n\n return colorScale;\n }", "function transformColor(c) {\r\n\tif(c === 16) {\r\n\t return colorID; // Main color\r\n }\r\n\telse if(c === 24) {\r\n\t return colorID < 0 ? colorID : -colorID-1; // Edge color\r\n }\r\n\treturn c;\r\n }", "function makeColorScale2(data, color){\n\n var colorClasses = getColorClasses(color);\n\n var colorScale = d3.scale.quantile()\n .range(colorClasses);\n\n var domainArray = [];\n for (var i = 0; i < data.length; i++){\n\n var val = parseFloat(data[i][1]);\n domainArray.push(val);\n };\n\n colorScale.domain(domainArray);\n\n return colorScale;\n\n }", "function getColor(magnitude) {\n switch (true) {\n case magnitude > 5:\n return \"#ea2c2c\";\n case magnitude > 4:\n return \"#ea822c\";\n case magnitude > 3:\n return \"#ee9c00\";\n case magnitude > 2:\n return \"#eecc00\";\n case magnitude > 1:\n return \"#d4ee00\";\n default:\n return \"#98ee00\";\n }\n }", "function hue2rgb( p, q, h ) {\r\n\th = ( h + 1 ) % 1;\r\n\tif ( h * 6 < 1 ) {\r\n\t\treturn p + (q - p) * h * 6;\r\n\t}\r\n\tif ( h * 2 < 1) {\r\n\t\treturn q;\r\n\t}\r\n\tif ( h * 3 < 2 ) {\r\n\t\treturn p + (q - p) * ((2/3) - h) * 6;\r\n\t}\r\n\treturn p;\r\n}", "function getColor(magnitude) {\n switch (true) {\n case magnitude > 5:\n return \"#ea2c2c\";\n case magnitude > 4:\n return \"#ea822c\";\n case magnitude > 3:\n return \"#ee9c00\";\n case magnitude > 2:\n return \"#eecc00\";\n case magnitude > 1:\n return \"#d4ee00\";\n default:\n return \"#98ee00\";\n }\n }", "function hue2rgb(p, q, h) {\n h = (h + 1) % 1;\n if (h * 6 < 1) {\n return p + (q - p) * h * 6;\n }\n if (h * 2 < 1) {\n return q;\n }\n if (h * 3 < 2) {\n return p + (q - p) * (2 / 3 - h) * 6;\n }\n return p;\n }", "function colour(v,type){\n\n\t\t// Colour scales defined by SAOImage\n\t\tif(type==\"blackbody\" || type==\"heat\") return [((v<=127.5) ? v*2 : 255), ((v>63.75) ? ((v<191.25) ? (v-63.75)*2 : 255) : 0), ((v>127.5) ? (v-127.5)*2 : 0)];\n\t\telse if(type==\"A\") return [((v<=63.75) ? 0 : ((v<=127.5) ? (v-63.75)*4 : 255)), ((v<=63.75) ? v*4 : ((v<=127.5) ? (127.5-v)*4 : ((v<191.25) ? 0: (v-191.25)*4))), ((v<31.875) ? 0 : ((v<127.5) ? (v-31.875)*8/3 : ((v < 191.25) ? (191.25-v)*4 : 0)))];\n\t\telse if(type==\"B\") return [((v<=63.75) ? 0 : ((v<=127.5) ? (v-63.75)*4 : 255)), ((v<=127.5) ? 0 : ((v<=191.25) ? (v-127.5)*4 : 255)), ((v<63.75) ? v*4 : ((v<127.5) ? (127.5-v)*4 : ((v<191.25) ? 0 : (v-191.25)*4 ))) ];\n\t\telse{\n\t\t\t// The Planck colour scheme\n\t\t\tvar dv,dr,dg,db,rgb;\n\t\t\t\n\t\t\tif(v < 42){\n\t\t\t\tdv = v/42;\n\t\t\t\trgb = [0,0,255];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = 112;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 42 && v < 85){\n\t\t\t\tdv = (v - 42)/43;\n\t\t\t\trgb = [0,112,255];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = 109;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 85 && v < 127){\n\t\t\t\tdv = (v - 85)/42;\n\t\t\t\trgb = [0,221,255];\n\t\t\t\tdr = 255;\n\t\t\t\tdg = 16;\n\t\t\t\tdb = -38;\n\t\t\t}else if(v >= 127 && v < 170){\n\t\t\t\tdv = (v - 127)/43;\n\t\t\t\trgb = [255,237,217];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = -57;\n\t\t\t\tdb = -217;\n\t\t\t}else if(v >= 170 && v < 212){\n\t\t\t\tdv = (v-170)/42;\n\t\t\t\trgb = [255,180,0];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = -105;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 212){\n\t\t\t\tdv = (v-212)/43;\n\t\t\t\trgb = [255,75,0];\n\t\t\t\tdr = -155;\n\t\t\t\tdg = -75;\n\t\t\t\tdb = 0;\n\t\t\t}\n\t\t\treturn [Math.round(rgb[0] + dv*dr), Math.round(rgb[1] + dv*dg), Math.round(rgb[2] + dv*db)];\n\t\t}\n\t}", "function getColor(magnitude) {\n switch (true) {\n case magnitude > 5:\n return \"#581845\";\n case magnitude > 4:\n return \"#900C3F\";\n case magnitude > 3:\n return \"#C70039\";\n case magnitude > 2:\n return \"#FF5733\";\n case magnitude > 1:\n return \"#FFC300\";\n default:\n return \"#DAF7A6\";\n }\n }", "function makeColorScale(data){\n\t\tlet colorClasses = [\n\t\t\t\"#D4B9DA\",\n\t\t\t\"#C994C7\",\n\t\t\t\"#DF65B0\",\n\t\t\t\"#DD1C77\",\n\t\t\t\"#980043\"\n\t\t];\n\n\t\t//Create color scale generator\n\t\tlet colorScale = d3.scaleThreshold()\n\t\t\t.range(colorClasses);\n\n\t\t//Build array of all values of the expressed attribute\n\t\tlet domainArray = [];\n\t\tfor (let i=0; i<data.length; i++){\n\t\t\tlet val = parseInt(data[i][expressed]);\n\t\t\tdomainArray.push(val);\n\t\t};\n\n\t\t//Cluster data using ckmeans clustering algorithm to create natural breaks\n\t\tlet clusters = ss.ckmeans(domainArray, 5);\n\t\t//Reset domain array to cluster minimums\n\t\tdomainArray = clusters.map(function(d){\n\t\t\treturn d3.min(d);\n\t\t});\n\n\t\t//Remove first value from the domain array to create class breakpoints\n\t\tdomainArray.shift();\n\n\t\t//Assign array last 4 cluster minimums as domain\n\t\tcolorScale.domain(domainArray);\n\n\t\treturn colorScale;\n\t}", "redder(){\n\t\tthis.multiplyColorValue(\"red\", 1.2);\n\t}", "function variaceColor(){\n\n\treturn d3.scale.linear()\n\t\t\t\t\t.domain([0, 1])\n\t\t\t\t\t.range(['#fee0d2', '#de2d26']);\n}", "function getColor(mag) {\n if (mag > 5) {\n return \"Purple\";\n }\n if (mag > 4) {\n return \"FireBrick\";\n }\n if (mag > 3) {\n return \"OrangeRed\"\n }\n if (mag > 2) {\n return \"Salmon\";\n }\n if (mag > 1) {\n return \"Yellow\";\n }\n return \"LightGreen\";\n}" ]
[ "0.7524565", "0.7207855", "0.7112867", "0.70557415", "0.6801171", "0.6801171", "0.6800588", "0.6800588", "0.6800588", "0.6789981", "0.6785671", "0.67202264", "0.66722125", "0.66661465", "0.6655424", "0.66240686", "0.6600711", "0.65752125", "0.65680337", "0.6561414", "0.6558907", "0.6558348", "0.654915", "0.65366215", "0.651392", "0.6498664", "0.6493836", "0.6486908", "0.6483082", "0.6467971", "0.6463306", "0.6426421", "0.64201516", "0.6418301", "0.63995725", "0.6390772", "0.638872", "0.6373698", "0.63694865", "0.6363857", "0.6359934", "0.6353957", "0.63516116", "0.6351409", "0.6347064", "0.63305074", "0.63231105", "0.6321781", "0.6306069", "0.63060194", "0.62998796", "0.62991637", "0.6297205", "0.6291112", "0.6288469", "0.62864673", "0.62817794", "0.62799376", "0.62781733", "0.6277412", "0.6273712", "0.6272788", "0.6272788", "0.6263544", "0.62605625", "0.62500864", "0.6250042", "0.62491214", "0.6246951", "0.624647", "0.6242043", "0.6241704", "0.6241144", "0.624112", "0.6229582", "0.6215209", "0.6214768", "0.6208998", "0.62078893", "0.62041324", "0.61987805", "0.61983484", "0.6195399", "0.6195085", "0.6193329", "0.61923635", "0.61906916", "0.61904", "0.618594", "0.61855626", "0.6184977", "0.618434", "0.6183243", "0.61820495", "0.61801594", "0.6177643", "0.6176695", "0.61740154", "0.61739737", "0.6173126", "0.61686856" ]
0.0
-1
Toggle children on clickProc.
function clickProc(d, textclicked) { if (CheckSelectionClick()) { return; } //exit function if it was a panning click, instead of a selection click if (d.expertise_intern) {//zuklappen d._expertise_intern = d.expertise_intern; d.expertise_intern = null; expertise_intern_shown=false; } else { //aufklappen d.expertise_intern = d._expertise_intern; d._expertise_intern = null; } if (d.expertise_extern) {//zuklappen d._expertise_extern = d.expertise_extern; d.expertise_extern = null; expertise_extern_shown=false; } else { //aufklappen d.expertise_extern = d._expertise_extern; d._expertise_extern = null; } collapseExpertise(getRoot(d),d); // console.log(d); updateproc(d); /* vis.attr("transform", "translate(" + d.y + "," + d.x + ")" );*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleChildren() {\n\t\tthis.setState({\n\t\t\tlinksVisible: !this.state.linksVisible\n\t\t});\n\t}", "function toggle_sidebar_sublist()\n{\n $(\".navbar_right_sidebar .sidebar_main_item.expandable\").click(function(){\n var child_container=$(this).find(\".subele_container\");\n if (child_container.hasClass(\"hidden\"))\n child_container.removeClass(\"hidden\");\n else\n child_container.addClass(\"hidden\");\n });\n\n}", "function showMobileChildren(event){\n\n $(event).parent().find('>ul').slideToggle(200, function(){\n\n $(event).parent().toggleClass('mobile-active');\n\n $(event).parent().hasClass('mobile-active') ? \n $(event).parent().find('.mobile-active').trigger('click') : '';\n\n });\n $(event).find('.fa').toggle();\n return false; \n}", "function click(d) {\r\n\ttoggleChildren(d);\r\n\tupdate(d);\r\n}", "_toggleAllTreeItems() {\n this._toggleTreeItem(this.container, !this._lastToggleIsShow);\n }", "toggleSelected(value = null) {\n const toToggle = this;\n if (value == null) {\n if (toToggle.selected === true) {\n toToggle.selected = false;\n } else {\n toToggle.selected = true;\n }\n } else {\n toToggle.selected = value;\n }\n\n if (toToggle.children) {\n toToggle.children.forEach((child) => {\n child.toggleSelected(toToggle.selected);\n });\n }\n }", "function getChilds(){ \n var current = $(this);\n var cat_id = current.attr('data-key');\n if($(\"#product-cat-child-\"+cat_id).length > 0){\n replaceChildHtml(cat_id);\n\n $(\"#product-cat-child-\"+cat_id).slideToggle('slow');\n $(this).toggleClass('carat-up');\n $(this).closest('.parent-checkbox-wrapper').toggleClass('parent-dropdown-open');\n }\n }", "function childClick ($event) {\n $event.stopPropagation();\n }", "function click(d) {\n d = toggleChildren(d);\n update(d);\n }", "function toggle(d) \n\t\t{\n\t\t\tif (d.children) \n\t\t\t{\n\t\t\t\td._children = d.children;\n\t\t\t\td.children = null;\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\td.children = d._children;\n\t\t\t\td._children = null;\n\t\t\t}\n\t\t\tupdate(d);\n\t\t}", "click(e) {\n $(ReactDOM.findDOMNode(e.currentTarget)).siblings('.collapsible-body').toggle();\n }", "function toggleChildren(d) {\n var children = (d.children) ? d.children : null;\n var _children = (d._children) ? d._children : null;\n d._children = children;\n d.children = _children;\n return d;\n }", "function checkChildren() {\n\n\n $(\"#filter-accordion ul.dynatree-container li\").click(function () {\n $('.linkAll').removeClass('active-link');\n });\n}", "function toggle(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n }", "function click(d) {\n\t\t\t\t\t\t//root.children.forEach(collapse);\n\t\t\t\t\t\tif (d.children) {\n\t\t\t\t\t\t\td._children = d.children;\n\t\t\t\t\t\t\td.children = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\td.children = d._children;\n\t\t\t\t\t\t\td._children = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tupdate(d);\n\t\t\t\t\t}", "function clicked(d){\n if(d.children){\n d._children = d.children;\n d.children = null;\n }else{\n d.children = d._children;\n d._children = null;\n }\n updateTree(d);\n console.log(d);\n }", "function toggle(d) {\n\tif (d.children) {\n\t\td._children = d.children;\n\t\td.children = null;\n\t} else {\n\t\td.children = d._children;\n\t\td._children = null;\n\t}\n}", "function onTargetChildrenClick() {\n console.log(\"Clicked onTargetChildrenClick\");\n // update the UI\n w3.toggleClass('#targetChildren', 'w3-red');\n w3.removeClass('#targetLGTBIQ', 'w3-red');\n w3.removeClass('#targetWomen', 'w3-red');\n w3.removeClass('#targetOrigin', 'w3-red');\n // toggle this filter and disable the others\n targetChildren = !targetChildren;\n targetLGTBIQ = false;\n targetWomen = false;\n targetOrigin = false;\n // trigger the find operation\n findLocationsInDatabase(\"FILTER\", -1);\n}", "function click(d) {\n\t\t if (d.children) {\n\t\t\td.hiddenChildren = d.children;\n\t\t\td.children = null;\n\t\t } else {\n\t\t\td.children = d.hiddenChildren;\n\t\t\td.hiddenChildren = null;\n\t\t }\n\t\t update(d);\n\t\t}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n updateTree(d,viewOptions); \n}", "function treeClick(id) {\n var tlr = document.getElementById(id);\n tlr.querySelector(\".nested\").classList.toggle(\"activeToggle\");\n tlr.classList.toggle(\"caret-down\");\n}", "function toggle(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else if (d._children) {\n d.children = d._children;\n d._children = null;\n }\n }", "function toggleChildren(containerID, numTasks) { \n \n let childElements = document.getElementById(containerID.id).childNodes;\n childElements = Array.from(childElements);\n childElements = childElements.filter((node) => {\n return (node.nodeType == Node.ELEMENT_NODE);\n });\n\n console.log(\"length of childNodes: \" + childElements.length);\n\n if (numTasks == 0) { 1// test if empty\n console.log(\"%cNo elements found to drop down\",\"color: orange;\");\n }\n else if (childElements[1].style.display == \"grid\") { // if displaying\n console.log(\"Hiding elements\");\n for (var i = 1; i < childElements.length; i++) { // hide child elements \n console.log(\" hiding element with id: \" + childElements[i].id);\n childElements[i].style.display = \"none\";\n \n }\n } \n else { // if hidden \n console.log(\"Revealing elements\");\n for (var i = 1; i < childElements.length; i++) { // reveal child elements\n console.log(\" revealing element with id: \" + childElements[i].id);\n childElements[i].style.display = \"grid\";\n }\n } \n}", "function toggle(node) {\n if (node[childrenIdentifier]) {\n node._children = node[childrenIdentifier];\n node[childrenIdentifier] = null;\n } else {\n node[childrenIdentifier] = node._children;\n node._children = null;\n }\n }", "function _toggle() {\n\tconst parent = this.parentElement.parentElement;\n\tparent.classList.toggle('hidden')\n}", "function flowChildNodesByClickPnode(node, treeObjName) {\r\n var childNodes = node.childNodes;\n //close\n if (node.booleanOpen == false || (node.booleanOpen == true && node.visible == \"none\")) {\r\n for (var i = 0; i < childNodes.length; i++) {\r\n childNodes[i].visible = \"none\";\n var nodeTR = document.getElementById(treeObjName + \"Trid\" + childNodes[i].id + childNodes[i].pid);\n nodeTR.style.display = childNodes[i].visible;\n if (childNodes[i].booleanLeaf == false) {\r\n flowChildNodesByClickPnode(childNodes[i], treeObjName);\r\n }\r\n }\r\n } else {//open\n if (node.visible == \"\") {\r\n for (var i = 0; i < childNodes.length; i++) {\r\n childNodes[i].visible = \"\";\n var nodeTR = document.getElementById(treeObjName + \"Trid\" + childNodes[i].id + childNodes[i].pid);\n nodeTR.style.display = childNodes[i].visible;\n if (childNodes[i].booleanLeaf == false) {\r\n flowChildNodesByClickPnode(childNodes[i], treeObjName);\r\n }\r\n }\r\n }\r\n }\r\n}", "function click(d) {\r\n\t if (d.children) {\r\n\t d._children = d.children;\r\n\t self.foldGroup(d.name, d.children);\r\n\t d.children = null;\r\n\r\n\t } else {\r\n\t d.children = d._children;\r\n self.unfoldGroup(d.name, d.children);\r\n\t d._children = null;\r\n\t }\r\n\t update(d);\r\n\t getShowData('update');\r\n\t}", "function click(d) {\n if (d.children) {\n \td._children = d.children;\n \td.children = null;\n } else {\n \td.children = d._children;\n \td._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d.children.forEach(expand); //Expand all at once\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n\t\t\t if (d.children) {\n\t\t\t d._children = d.children;\n\t\t\t d.children = null;\n\t\t\t } else {\n\t\t\t d.children = d._children;\n\t\t\t d._children = null;\n\t\t\t }\n\t\t\t update();\n\t\t\t}", "function click(d) {\n if (d.children) {\n\td._children = d.children;\n\td.children = null;\n } else {\n\td.children = d._children;\n\td._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n\td._children = d.children;\n\td.children = null;\n } else {\n\td.children = d._children;\n\td._children = null;\n }\n update(d);\n}", "function toggleAll(node) {\n if (node[childrenIdentifier]) {\n node[childrenIdentifier].forEach(toggleAll);\n toggle(node);\n }\n }", "onClick_() {\n this.fire('toggle-expanded');\n }", "function click(d) {\n\t\n\t\n\t\n\tif (d.children) {\n\t\td._children = d.children;\n\t\td.children = null;\n\t} else {\n\t\td.children = d._children;\n\t\td._children = null;\n\t}\n\tupdate(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n //update();\n }", "function click(d) {\n var updateFlag;\n if (d.children) {\n updateFlag = d.children.length > 0;\n d._children = d.children;\n d.children = null;\n } else {\n updateFlag = d._children.length > 0;\n d.children = d._children;\n d._children = null;\n }\n\n //Avoid updating if node has no children\n if(updateFlag){\n update(d);\n }\n }", "function click(d) {\n console.log(d);\n if (d.children) {\n\td._children = d.children;\n\td.children = null;\n } else {\n\td.children = d._children;\n\td._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n build_tree(d);\n }", "function click(d) {\n /*if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);*/ \n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n //If the node has children, collapse unfolded sibling nodes\n if(d.parent)\n {\n d.parent.children.forEach(function(element){\n \n if(d !== element){\n collapse(element);\n \n }\n });\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "handleMenuClick(e){\n this.toggleMenu();\n \n e.stopPropagation(); //parents not told of the click\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update();\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "onOtherDomClick(){\n this.toggleOpen(false);\n }", "function click(d) {\r\n\t\t\t if (d.children) {\r\n\t\t\t \td._children = d.children;\r\n d.children = null;\r\n\t\t\t } else if(d._children){\r\n\t\t\t \td.children = d._children;\r\n d._children = null;\r\n }\r\n\r\n\t\t\t\t \r\n\t\t\t\t update(d);\r\n\t\t\t}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function dd_click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n dd_update(d);\n}", "function click(d) {\n// use the following to superficially change the text of the node.\n// this.getElementsByTagName('text')[0].textContent = \"clicked all over\"\n\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.classe_id || d.root) {\n if (d.children) {\n //console.log(\"->1\")\n d._children = d.children;\n d.children = null;\n } else {\n if (d._children != null) {\n d.children = d._children;\n d._children = null;\n //console.log(\"anes\")\n //console.log(d.node_id)\n d.children.forEach(function (children) {\n expand(children);\n });\n }\n }\n update(d);\n } else {\n //código para mostrar os gráficos\n tooltip_tablle(d);\n }\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n \n update(d);\n}", "handler( children ) {\n const { classes } = this.props\n const { state } = this\nreturn children.map( ( subOption ) => {\n if ( !subOption.children ) {\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n key={ subOption.name }>\n <Link \n to={ subOption.url }\n className={ classes.links }>\n <ListItemText \n inset \n primary={ subOption.name } \n />\n </Link>\n </ListItem>\n </div>\n )\n }\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n onClick={ () => this.handleClick( subOption.name ) }>\n <ListItemText \n inset \n primary={ subOption.name } />\n { state[ subOption.name ] ? \n <ExpandLess /> :\n <ExpandMore />\n }\n </ListItem>\n <Collapse \n in={ state[ subOption.name ] } \n timeout=\"auto\" \n unmountOnExit\n >\n { this.handler( subOption.children ) }\n </Collapse>\n </div>\n )\n } )\n }", "handler( children ) {\n const { classes } = this.props\n const { state } = this\nreturn children.map( ( subOption ) => {\n if ( !subOption.children ) {\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n key={ subOption.name }>\n <Link \n to={ subOption.url }\n className={ classes.links }>\n <ListItemText \n inset \n primary={ subOption.name } \n />\n </Link>\n </ListItem>\n </div>\n )\n }\n return (\n <div key={ subOption.name }>\n <ListItem \n button \n onClick={ () => this.handleClick( subOption.name ) }>\n <ListItemText \n inset \n primary={ subOption.name } />\n { state[ subOption.name ] ? \n <ExpandLess /> :\n <ExpandMore />\n }\n </ListItem>\n <Collapse \n in={ state[ subOption.name ] } \n timeout=\"auto\" \n unmountOnExit\n >\n { this.handler( subOption.children ) }\n </Collapse>\n </div>\n )\n } )\n }", "onToggleNode() {\n // Need to repopulate grid cache\n this.dependencyGridCache = null;\n // node toggled in tree, can affect resources both above and below, need to redraw all.\n this.scheduleDraw(true);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n\tif (d.children) {\n\t\td._children = d.children;\n\t\td.children = null;\n\t} else {\n\t\td.children = d._children;\n\t\td._children = null;\n\t}\n\tupdate();\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n var shouldWait = false;\n isFirstLoaded = false;\n\n if (d.children || d._children) {\n svg\n .transition()\n .duration(duration)\n .attr('height', attrs.svgHeight);\n\n // collapse\n if (d.children) {\n d.children.forEach(x => {\n if (x.children) {\n shouldWait = true;\n }\n collapse(x);\n });\n\n if (shouldWait) {\n update(d);\n }\n \n d._children = d.children;\n d.children = null;\n d.clicked = null;\n } \n // expand\n else {\n d.children = d._children;\n d._children = null;\n d.clicked = true;\n\n if (d.data.enlargeScreen) {\n svg\n .transition()\n .duration(duration)\n .attr('height', 300)\n }\n\n let third = allNodes.filter(x => x.data.id === getThirdLevelId());\n if (d.depth === 1 && third.length && third[0].clicked) {\n collapse(third[0])\n update(d);\n shouldWait = true;\n }\n }\n\n if (d.depth == 1) {\n root.children.forEach(x => {\n collapse(x, d);\n });\n }\n\n if (shouldWait) {\n setTimeout(() => {\n update(d); \n }, duration + 20);\n } else {\n update(d);\n }\n \n } else {\n let third = allNodes.filter(x => x.data.id === getThirdLevelId());\n if (d.depth === 2 && third.length && third[0].clicked) {\n setTimeout(() => {\n collapse(third[0])\n update(d);\n }, 100);\n\n shouldWait = true;\n }\n\n if (d.depth == 2) {\n setTimeout(() => {\n svg\n .transition()\n .duration(duration)\n .attr('height', attrs.svgHeight);\n }, 100);\n }\n\n nodeUpdate.each(function(x) {\n if (x.clicked && x !== d.parent && x.depth > 1) {\n x.clicked = null;\n d3.select(this).select('circle.node-circle')\n .attr('fill', '#f8f9fa');\n }\n });\n \n d.clicked = true;\n\n d3.select(this).select('circle.node-circle')\n .attr('fill', '#2ebe60');\n \n setTimeout(() => {\n attrs.onChartSelect(d);\n }, 0);\n }\n\n if (d.depth === 1) {\n currentRootNodeId = d.data.id;\n }\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n _this.update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n dupdate(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\r\n if (d.children) {\r\n d._children = d.children;\r\n d.children = null;\r\n } else {\r\n d.children = d._children;\r\n d._children = null;\r\n }\r\n update(d);\r\n}", "function subMenusMobile() {\r\n $(\".sub-active\").each(function() {\r\n $(this).click(function(event) {\r\n event.preventDefault();\r\n // Abrindo o submenu mobile\r\n $(this).children(\".sub-menu-mobile\").slideToggle(\"slow\");\r\n // Abrindo o submenu desktop\r\n $(this).children(\".sub-menu-desk\").slideToggle(\"slow\");\r\n\r\n })\r\n });\r\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n}", "function click(d)\n {\n toggleChildren(d);\n printNodeInfo(d);\n }", "function click(d) {\n\tif (d.children) {\n\t\td._children = d.children;\n\t\td.children = null;\n\t} else {\n\t\td.children = d._children;\n\t\td._children = null;\n\t}\n\tupdate(d);\n}", "toggle(doToggle) {\n // If the menu is horizontal the sub-menus open below and there is no risk of premature\n // closing of any sub-menus therefore we automatically resolve the callback.\n if (this._menu.orientation === 'horizontal') {\n doToggle();\n }\n this._checkConfigured();\n const siblingItemIsWaiting = !!this._timeoutId;\n const hasPoints = this._points.length > 1;\n if (hasPoints && !siblingItemIsWaiting) {\n if (this._isMovingToSubmenu()) {\n this._startTimeout(doToggle);\n }\n else {\n doToggle();\n }\n }\n else if (!siblingItemIsWaiting) {\n doToggle();\n }\n }", "function toggleByClick_( id, sendClick ) {\r\n id = id || false;\r\n sendClick = sendClick || false;\r\n if( !id ) return untoggleByClick.apply(this);\r\n\r\n var parentSel = \"[togglebyclick='\"+id+\"']\";\r\n var childSel = \"[\"+id+\"]\";\r\n if( this.length ) {\r\n parentSel = _z(this);\r\n }\r\n\r\n if( _z(parentSel).data(\"toggleByClick\") )\r\n untoggleByClick.apply(this, [id]);\r\n\r\n var newFunc = function(ev) {\r\n _z(childSel).toggle();\r\n };\r\n _z(parentSel).data(\"toggleByClick\", newFunc);\r\n _z(parentSel).attr(\"_tbc\", id);\r\n _z( parentSel ).on(\"click\", newFunc);\r\n if( sendClick )\r\n newFunc.apply( _z(parentSel) );\r\n\r\n return this;\r\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n updateTree(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function toggleAll(d) {\n\t\t\tif (d && d.children) {\n\t\t\t\td.children.forEach(toggleAll);\n\t\t\t\ttoggle(d);\n\t\t\t}\n\t\t}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n delete d.children;\n } else {\n d.children = d._children;\n delete d._children;\n }\n update();\n}", "function toggleTOCSections () {\r\n $(\".toc-parent\").each (function () {\r\n var parent = $(this);\r\n $(this).find('button').click (function (){\r\n if (parent.next().is (\":hidden\")){\r\n // show subtree\r\n parent.next().show('slow');\r\n $(this).text(\"-\");\r\n } else {\r\n // hide subtree \r\n parent.next().hide('slow');\r\n $(this).text(\"+\");\r\n }\r\n });\r\n });\r\n}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n\n update(d);\n}", "function showUp(parent) {\n parent.children[1].children[0].classList.toggle('active')\n}", "function toggleAllChildrenClass(item, from, to) {\n for (var i = 0; i < item.children.length; ++i) {\n var child = item.children[i];\n child.className = child.className.replace(from, to);\n if (child.children.length > 0) {\n toggleIcon(child); // Toggle all icon under it, too..\n }\n }\n}", "function click(d) {\n\t\tif (d.children) {\n\t\t\td._children = d.children;\n\t\t\td.children = null;\n\t\t} else {\n\t\t\td.children = d._children;\n\t\t\td._children = null;\n\t\t}\n\t\tupdate(d);\n\t}", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }", "function click(d) {\n if (d.children) {\n d._children = d.children;\n d.children = null;\n } else {\n d.children = d._children;\n d._children = null;\n }\n update(d);\n }" ]
[ "0.6737321", "0.663927", "0.6420604", "0.64026815", "0.62457526", "0.62280923", "0.61911494", "0.61800927", "0.61721647", "0.6154921", "0.6134101", "0.6124957", "0.61043066", "0.6100964", "0.60912746", "0.6042099", "0.60410625", "0.60364926", "0.6025569", "0.6017601", "0.60055923", "0.59965456", "0.5992274", "0.59897065", "0.59850127", "0.5980057", "0.5955128", "0.595141", "0.5941034", "0.59382194", "0.59373283", "0.59373283", "0.591926", "0.59122616", "0.5889758", "0.587914", "0.58494425", "0.5835147", "0.5827877", "0.5818364", "0.58032495", "0.5800116", "0.5790939", "0.57858354", "0.57773083", "0.5771493", "0.5771493", "0.5771493", "0.5771493", "0.57671595", "0.5758714", "0.5758573", "0.5758573", "0.5758573", "0.5758573", "0.5756372", "0.5756264", "0.5755516", "0.57455707", "0.5744897", "0.57433796", "0.57433796", "0.57410765", "0.5729269", "0.57275665", "0.5718672", "0.57134634", "0.56993425", "0.56993425", "0.5694862", "0.56895417", "0.56798005", "0.5678546", "0.56756717", "0.56745", "0.5674425", "0.5674425", "0.5674425", "0.5672853", "0.5672853", "0.5672853", "0.5672853", "0.5668653", "0.56647915", "0.56609154", "0.565496", "0.5652696", "0.5652378", "0.5647443", "0.5641301", "0.5641301", "0.5636949", "0.56276494", "0.5621996", "0.5615399", "0.56046426", "0.56046164", "0.56043476", "0.56003344", "0.56003344", "0.56003344" ]
0.0
-1
Click sur une Carte
function Jouer(objID) { // La Carte ne doit pas être retournée if(Tirage && objID.className != "Front") { Tirage = false; if(LastCarte == null) { objID.className = "Front"; objID.style.backgroundImage = "url("+ArrayDonne[objID.id]+".jpg)"; LastCarte = objID; Tirage = true; } else { if(LastCarte.id != objID.id && objID.className != "Front") { // Retourne la Carte et Affiche sa Valeur/Image objID.className = "Front"; objID.style.backgroundImage = "url("+ArrayDonne[objID.id]+".jpg)"; // Si les deux Cartes sont DIFFÉRENTE if(ArrayDonne[objID.id] != ArrayDonne[LastCarte.id]) { // Declenche le Temporisateur a = setTimeout( "ResetChoix(" + objID.id + ", "+ LastCarte.id + ")", Tempor); LastCarte = null; } else { // Les Deux Cartes sont EGALE LastCarte = null; Count ++; PairesOk ++; document.getElementById('paires').innerHTML = PairesOk; // Si Tout Gagner (nbr de paires) if(Count == (NbrValeur/2)) { Gagner ++; document.getElementById('NbrGagner').innerHTML = Gagner; document.getElementById('Rejouer').disabled = false; } Tirage = true; } Tentative ++; document.getElementById('Try').innerHTML = Tentative; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click() { }", "function clickElement(el) {\r\n\t/*var clickMouse = document.createEvent(\"MouseEvents\");\r\n\tclickMouse.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\tplaybutton.dispatchEvent(clickMouse);*/\r\n\tvar clickUI = document.createEvent(\"UIEvents\");\r\n\tclickUI.initUIEvent(\"click\", true, true, window, 1);\r\n\tel.dispatchEvent(clickUI);\r\n}", "function click(el){\n \n \n}", "handleJDotterClick() {}", "function bwClick(itemId) {\n $(itemId).click();\n}", "async click() {\n await t.click(selector);\n }", "function clickHandler(e) {\n // Nur bei Linksklick\n if (e.button !== 0) return;\n clickAt(e.offsetX, e.offsetY);\n }", "function click(el) {\n const eventOptions = {bubbles: true, cancelable: true, view: window};\n el.dispatchEvent(new MouseEvent('mousedown', eventOptions));\n el.dispatchEvent(new MouseEvent('mouseup', eventOptions));\n el.dispatchEvent(new MouseEvent('click', eventOptions));\n }", "function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}", "function click(e) {\r\n\t\tif(!e && typeof e=='string') e=document.getElementById(e);\r\n\t\tif(!e) return;\r\n\t\tvar evObj = e.ownerDocument.createEvent('MouseEvents');\r\n\t\tevObj.initMouseEvent(\"click\",true,true,e.ownerDocument.defaultView,0,0,0,0,0,false,false,false,false,0,null);\r\n\t\te.dispatchEvent(evObj);\r\n\t}", "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "function click(e, type) {\r\nif(!e) {return;}\r\nif(typeof e=='string') e=document.getElementById(e);\r\nvar evObj = document.createEvent('MouseEvents');\r\nevObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);\r\ne.dispatchEvent(evObj);\r\n}", "function click(el){\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true, true,\n window, null,\n 0, 0, 0, 0,\n false, false, false, false,\n 0, null\n );\n el.dispatchEvent(ev);\n}", "function _click(d){\n \n }", "click() {\n this.elements.forEach(element => element.click());\n }", "click() {\n let tour = get(this, 'tour');\n tour.start();\n }", "function ClickGerarElite() {\n GeraElite();\n AtualizaGeral();\n}", "function select() {\n getElements()[selection].getElementsByTagName('a')[0].click();\n\n}", "onClick(element) {\n\t\taction(`You have clicked on element ${element.name}`).call();\n\t}", "ClickOnElectrovanne(Electrovanne){\n this._Electrovanne.RenderPlay(this._DeviceConteneur, Electrovanne)\n }", "function doClick(e) {\n options.onClick(e);\n }", "function click(elm) {\r\n\tvar evt = document.createEvent('MouseEvents');\r\n\tevt.initEvent('click', true, true);\r\n\telm.dispatchEvent(evt);\r\n}", "function click(elm) {\r\n\tvar evt = document.createEvent('MouseEvents');\r\n\tevt.initEvent('click', true, true);\r\n\telm.dispatchEvent(evt);\r\n}", "function click(elm) {\r\n\tvar evt = document.createEvent('MouseEvents');\r\n\tevt.initEvent('click', true, true);\r\n\telm.dispatchEvent(evt);\r\n}", "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "function makeItClickable(){\n\n }", "function onClick () {\n navCur && navCur.click();\n }", "click_Homescreen_TVShows(){\n this.Homescreen_TVShows.waitForExist();\n this.Homescreen_TVShows.click();\n }", "clicked(x, y) {}", "mouseClick(p) {\n }", "function click(elm) {\r\n var evt = document.createEvent('MouseEvents');\r\n evt.initEvent('click', true, true);\r\n elm.dispatchEvent(evt);\r\n }", "click(event) {\n if (event.target === this.get('element')) {\n this.sendAction();\n }\n }", "goToWoman() {\n this.womanBtn.waitForClickable()\n this.womanBtn.click();\n }", "function ClickDescansar(valor) {\n // Cura letal e nao letal.\n EntradasAdicionarFerimentos(-PersonagemNivel(), false);\n EntradasAdicionarFerimentos(-PersonagemNivel(), true);\n EntradasRenovaSlotsFeiticos();\n AtualizaGeralSemLerEntradas();\n AtualizaGeral();\n}", "click(x, y, _isLeftButton) {}", "metodoClick(){\n console.log(\"diste click\")\n }", "function elementClick(e, type) {\r\n\tif (!e) {return;}\r\n\tif (typeof e == 'string') {\r\n\t\te = document.getElementById(e);\r\n\t}\r\n\tvar evObj = document.createEvent('MouseEvents');\r\n\tevObj.initMouseEvent((type||'click'), true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\te.dispatchEvent(evObj);\r\n}", "function clickOn() {\n openedCards[0].click(cardToggle);\n}", "function click(){\n document.getElementById(\"defaultOpen\").click();\n}", "function twitKisminaTikla(){\n let nelerOluor = document.getElementsByClassName(\"public-DraftEditorPlaceholder-inner\");\n nelerOluor[0].click();\n\n}", "function clickMe(el){\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true /* bubble */, true /* cancelable */,\n window, null,\n 0, 0, 0, 0, /* coordinates */\n false, false, false, false, /* modifier keys */\n 0 /*left*/, null\n );\n el.dispatchEvent(ev);\n}", "function ClickGerarComum() {\n GeraComum();\n AtualizaGeral();\n}", "verCartelera(){\n browser.click('.btn.btnEnviar.btnVerCartelera')\n }", "canvasClick() {\n\t\tthis.bird.jumpBird();\n\t}", "function ClickGastarFeitico() {\n AtualizaGeral();\n}", "clickCheckOutRedTea() {\n this.clickElem(this.btnCheckOutRedTea);\n }", "function clickElement(el){\n var ev = document.createEvent(\"MouseEvent\");\n ev.initMouseEvent(\n \"click\",\n true /* bubble */, true /* cancelable */,\n window, null,\n 0, 0, 0, 0, /* coordinates */\n false, false, false, false, /* modifier keys */\n 0 /*left*/, null\n );\n el.dispatchEvent(ev);\n}", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "elementClick(e) {\n if (e.detail) {\n e.detail.target.dispatchEvent(\n new MouseEvent(\"click\", {\n bubbles: true,\n cancelable: true,\n view: window,\n })\n );\n }\n }", "function simulateclick(){\n\tdocument.getElementById('imagefiles').click();\n}", "function clickElement(element) {\r\n\tvar event = document.createEvent('MouseEvents'); \r\n\tevent.initMouseEvent('click', true, true, window, 1, 0, 0); \r\n\telement.dispatchEvent(event); \r\n}", "function click(el) {\n var ev = document.createEvent('MouseEvent');\n ev.initMouseEvent(\n 'click',\n true /* bubble */, true /* cancelable */,\n window, null,\n 0, 0, 0, 0, /* coordinates */\n false, false, false, false, /* modifier keys */\n 0 /*left*/, null\n );\n el.dispatchEvent(ev);\n }", "function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}", "function canvasClick(e) {\n\tblockus.mouseClicked();\n}", "function q(a){a.click(u).mousedown(V)}", "function o(a){a.click(p).mousedown(ka)}", "function klikKlar() {\n document.querySelector(\"#knap\").addEventListener(\"click\", visResultat);\n}", "onParcelClick() {\n console.log('u clicked the lil parcel')\n }", "function buttonClick(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "function clickmovetake(ctrname){\n\ttry{\n\t\tif(Territori[ctrname].jugador==Jugador['jugador'+Turn.turn]){\n\t\t\tdocument.getElementById(ctrname+'less').click();\n\t\t}\n\t}\n\tcatch (err){}\n}", "handleClick( event ){ }", "click_extra() {\r\n }", "function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}", "function click(elt) {\n if (!elt) {\n throw new Error('Error calling \"click\": element is undefined.');\n }\n elt.dispatchEvent(new MouseEvent('click', {\n view: window,\n bubbles: true,\n cancelable: true\n }));\n}", "click() { // add click event\n app.quit();\n }", "click() {\n this.fireEvent(\"click\");\n return this;\n }", "click() {\n this.fireEvent(\"click\");\n return this;\n }", "async click() {\n await $(this.rootElement).click();\n }", "function buttonClicked(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "function clickOptiontoSelect(){\n\n}", "function q(a){a.click(u).mousedown(Ta)}", "function click(el, type) {\r\n\tvar e;\r\n\tif(typeof el === \"string\") e = document.getElementById(el);\r\n\tif(el === null || typeof el === \"undefined\") return;\r\n\t\telse e = el;\r\n\tvar evObj = document.createEvent('MouseEvents');\r\n\tevObj.initMouseEvent((type || 'click'), true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\te.dispatchEvent(evObj);\r\n}", "handleClick() {}", "function triggerClick(browser, normalizedX, normalizedY){\n\tbrowser.execute(function(normalizedX, normalizedY) {\n\t\t// Create mouse events\n\t\t// - https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/MouseEvent\n\t\tvar mouseEvent = new MouseEvent(\"click\", {\n\t\t\tclientX: normalizedX * arSession.arSource.domElementWidth(),\n\t\t\tclientY: normalizedY * arSession.arSource.domElementHeight(),\n\t\t})\n\t\t// dispatch the event\n\t\trenderer.domElement.dispatchEvent(mouseEvent);\n\t}, normalizedX, normalizedY)\t\n}", "clickCheckOutGreenTea() {\n this.clickElem(this.btnCheckOutGreenTea);\n }", "function click(A) {\r\n\tvar B = document.createEvent(\"MouseEvents\");\r\n\tB.initEvent(\"click\", true, true);\r\n\tA.dispatchEvent(B);\r\n}", "clickThrough() {\n let movie = browser.elements('.datalayer-movie.ng-binding');\n movie.value.forEach(function (element) {\n element.click()\n browser.back();\n });\n }", "@api\n click() {\n const anchor = this.emailAnchor;\n if (anchor && anchor.click) {\n anchor.click();\n }\n }", "simulateClick(e){\n this.myRef.current.click()\n }", "function Click() {\n}", "function fAppMeteo() {\n $(\"#bokm\").click(fAffMeteo);\n}", "function clickElById(id) {\n var el = typeof id === 'string' ? getByID(id) : id;\n if (el.click) {\n el.click();\n } else if (D.createEvent) {\n try {\n var event_obj = D.createEvent('MouseEvents');\n event_obj.initEvent('click', true, true);\n el.dispatchEvent(event_obj);\n } catch (err) { // TODO: Писать пользователю в глобальное окно об ошибках 2017.06.06\n sendError('D.createEvent(\"MouseEvents\") => '+err);\n }\n } else { // TODO: Писать пользователю в глобальное окно об ошибках 2017.06.06\n sendError('Нет события click и нет метода createEvent => ');\n }\n}", "function ClickGerarAleatorioElite() {\n GeraAleatorioElite();\n AtualizaGeral();\n}", "click_meetingAll_RaceList_1stHrose(){\n this.meetingAll_RaceList_1stHrose.waitForExist();\n this.meetingAll_RaceList_1stHrose.click();\n }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", "clickFirstRaceTile(){\n this.firstRaceTile.waitForExist();\n this.firstRaceTile.click();\n }", "clickFirstRaceTile(){\n this.firstRaceTile.waitForExist();\n this.firstRaceTile.click();\n }", "function ClickDesfazer() {\n gEntradas = JSON.parse(gEstado.Restaura());\n AtualizaGeralSemLerEntradas();\n}", "onClick() {\n }", "clickDocument(doc){\n this.sendAction('clickDocument', doc);\n }", "function clickSolve(){\n env.click.render() ;\n env.clickCopy.render() ;\n refreshDisplay() ;\n}", "function clic(e){\n swicthView();\n e.preventDefault();\n }", "clickUpdateCart() {\n this.updateCart.click();\n }", "clickSpinActionEvent () {\n this.getInst('ControlDesktopController').clickSpinAction();\n }", "click_Homescreen_RaceResult(){\n this.Homescreen_RaceResult.waitForExist();\n this.Homescreen_RaceResult.click();\n }", "function do_click(reserva) {\n\tvar v = document.getElementById(reserva);\n\tif (v.alt != 2) {\n\t\tif (fila == 0) { // Comprobacion de que es la primera fila que se\n\t\t\t\t\t\t\t// escoje\n\t\t\tfila = parseInt(reserva / 100);\n\t\t\tif (v.alt == 0) {\n\t\t\t\tv.src = 'images/butacas/iconoLibre.ico';\n\t\t\t\tv.alt = 1;\n\t\t\t\tsetSeat(reserva);\n\t\t\t} else if (v.alt == 1) {\n\t\t\t\tv.src = 'images/butacas/iconoElegido.ico';\n\t\t\t\tv.alt = 0;\n\t\t\t\tdeleteSeat(reserva);\n\t\t\t}\n\t\t} else if (parseInt(reserva / 100) == fila) {\n\t\t\tif (v.alt == 0) {\n\t\t\t\tif (contador < 10) {\n\t\t\t\t\tv.src = 'images/butacas/iconoLibre.ico';\n\t\t\t\t\tv.alt = 1;\n\t\t\t\t\tsetSeat(reserva);\n\t\t\t\t} else\n\t\t\t\t\talert(\"No se puede comprar mas de 10 entradas\");\n\t\t\t} else if (v.alt == 1) {\n\t\t\t\tv.src = 'images/butacas/iconoElegido.ico';\n\t\t\t\tv.alt = 0;\n\t\t\t\tdeleteSeat(reserva);\n\t\t\t}\n\t\t} else\n\t\t\talert(\"Las entradas deben pertenecer a la misma fila\");\n\t}\n}" ]
[ "0.7109835", "0.6932361", "0.68938094", "0.68671274", "0.68282276", "0.67586887", "0.67577577", "0.6745214", "0.6737549", "0.6737549", "0.67135024", "0.67135024", "0.67135024", "0.67135024", "0.67135024", "0.67135024", "0.66657233", "0.66607606", "0.665433", "0.6601053", "0.65978855", "0.6596999", "0.6589869", "0.65880424", "0.6552325", "0.65517676", "0.65517676", "0.65517676", "0.6548889", "0.6532967", "0.6530989", "0.6530487", "0.6529088", "0.65271795", "0.6518604", "0.6518091", "0.6515076", "0.64940524", "0.6474043", "0.6472243", "0.64703417", "0.6467096", "0.64625764", "0.64616084", "0.6457954", "0.6451809", "0.6443907", "0.64426875", "0.6436947", "0.64266336", "0.6409211", "0.6402178", "0.64014935", "0.6396987", "0.63915634", "0.6386554", "0.638414", "0.6374511", "0.6371945", "0.63686997", "0.63683474", "0.63602346", "0.63556254", "0.63316363", "0.6327046", "0.632703", "0.6325906", "0.63185954", "0.63184893", "0.6316982", "0.6316982", "0.630983", "0.6282945", "0.6280851", "0.62804025", "0.6277305", "0.62753975", "0.62658674", "0.62498116", "0.6240417", "0.62401503", "0.62389016", "0.6238182", "0.62293535", "0.62096715", "0.6208123", "0.6205489", "0.61972904", "0.6190495", "0.6190495", "0.6190292", "0.6190292", "0.61859715", "0.61786914", "0.61756194", "0.61691815", "0.61535716", "0.61479604", "0.6130707", "0.6129584", "0.6116791" ]
0.0
-1
Check symbols inside combinations
function checkCombines(symbol) { let hasWinner = false; //In each win line we check symbol in every rectangle winCombines.forEach(winLine => { const isWin = winLine.every(rect => rect.dataset.symbol === symbol); if (isWin) { hasWinner = true; winLine.forEach(rect => rect.classList.add('win')); gameField.removeEventListener('click', gameClickHandler); infoTxt.textContent = 'Winner is --->'; infoTxt.style.color = 'rgb(189, 135, 250)'; restartBtn.classList.add('pulse'); } }); return hasWinner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkwin(cells,symbol) {\n return winCombination.some((combination) => {\n return combination.every(function(idx) {\n if (cells[idx].firstChild !== null) {\n return cells[idx].firstChild.getAttribute('value') === symbol;\n } else {\n return false;\n }\n });\n });\n }", "function areOperatorsOk(arr){\r\n\r\n //first element cannot be a restricted Operator\r\n if(restrictedOperators.indexOf(arr[0])!=-1) {\r\n console.log('First character cannot be ' + arr[0]);\r\n return 0;\r\n }\r\n //last element cannot be an operator\r\n if(operators.indexOf(arr[arr.length-1])!=-1){\r\n console.log('last character cannot be ' + arr[0]);\r\n return 0;\r\n }\r\n\r\n for (var i=1;i<arr.length;i++){\r\n //impossible to have two signs next to each other\r\n if((operators.indexOf(arr[i]))!=-1 && (operators.indexOf(arr[i-1]))!=-1){\r\n console.log('Two operators cannot be next to each other');\r\n return 0;\r\n }\r\n //impossible to have a closing bracket just after an operator\r\n if((arr[i])==')' && (operators.indexOf(arr[i-1]))!=-1){\r\n console.log('impossible to have a closing bracket just after an operator');\r\n return 0;\r\n }\r\n }\r\n return 1;\r\n}", "checkCombinations(reelsPositions) {\n var wins = [];\n var that = this;\n $.each(reelsPositions, function(line, symbols) {\n // Check 3 Symbols\n if (symbols[0] == symbols[1] && symbols[1] == symbols[2] && symbols[0] != '') {\n wins.push({\n value: that.payTable[symbols[0]][line],\n line: line,\n symbol: symbols[0]\n });\n }\n\n // Check Seven and Cherry\n if (['7', 'Cherry'].indexOf(symbols[0]) !== -1 && \n ['7', 'Cherry'].indexOf(symbols[1]) !== -1 && \n ['7', 'Cherry'].indexOf(symbols[2]) !== -1 && \n !(symbols[0] == symbols[1] && symbols[1] == symbols[2])) {\n wins.push({\n value: that.payTable['7Cherry'][line],\n line: line,\n symbol: '7Cherry'\n });\n }\n\n // Any BAR symbols\n if ((symbols[0] === 'BAR' || symbols[1] === 'BAR' || symbols[2] === 'BAR') && !(symbols[0] == symbols[1] && symbols[1] == symbols[2])) {\n wins.push({\n value: that.payTable['anyBAR'][line],\n line: line,\n symbol: 'anyBAR'\n });\n }\n });\n return wins;\n }", "validCombination(combo) {\n let non_meta = 0;\n for (const key of combo) {\n if (INVALID_STANDALONE_KEYS.indexOf(key) < 0) {\n non_meta++;\n }\n }\n return non_meta > 0;\n }", "function checkSpecial(pw)\n{\n const symbolsCheck = [\"`\", \"~\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"-\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\", \"}\", \"|\", \";\", \":\", \",\", \"<\", \".\", \">\", \"/\", \"?\"];\n for(let i = 0; i<symbolsCheck.length; i++)\n {\n if(pw.includes(symbolsCheck[i]))\n {\n return true;\n }\n }\n return false;\n}", "function checkCombinator2(i){var type=tokens[i].type;if(type === TokenType.PlusSign || type === TokenType.GreaterThanSign || type === TokenType.Tilde)return 1;else return 0;}", "function SimpleSymbols(str) {\n\n // First, we declare a variable to hold a regex expression to match all upper and lowercase letters\n var alphaTest = /[a-zA-Z]/;\n\n // Next, we loop through each character in the string...\n for (var i = 0; i < str.length; i++) {\n // ... and use the our previously declared regex expression and the .test method to see if the character is a letter\n if (alphaTest.test(str[i])) {\n // If our test returns true, we check if either of the adjacent characters are not +'s\n if ((str[i + 1] != \"+\") || (str[i - 1] != \"+\")) {\n // If one of them isn't, we return false.\n return false;\n }\n }\n }\n\n // If our program is able to check all of the characters and hasn't returned false, we know the string obeys all of the problem's rules and can return true.\n return true;\n}", "function simpleSymbols(str) {\n\n let letters = 'abcdefghijklmnopqrstuvwxyz';\n let i = 0;\n let valid = true\n\n while(valid && i < str.length) {\n if(letters.indexOf(str[i]) >= 0) {\n if(str[i-1] !== '+' || str[i+1] !== '+') {\n valid = false\n }\n }\n i++\n }\n\n return valid;\n\n}", "function containsSymbol(val) {\n\tvar charArray = val.toLowerCase().split('');\n\tvar allowedCharacters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n\n\tfor (var i=0; i < charArray.length; i++) {\n\t\t\tif (allowedCharacters.indexOf(charArray[i]) == -1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t}\n\n\treturn false;\n}", "function isConsBits(/*String:digit string string for checking*/ digit){\n for(var i=1; i<digit.length-1; i++ ){\n var formerBit = parseInt(digit[i-1],10);\n var currentBit = parseInt(digit[i],10);\n var latterBit = parseInt(digit[i+1],10);\n if(formerBit+1==currentBit && currentBit+1 == latterBit) {\n return true;\n }\n }\n return false;\n\n}", "function arePointsOk(arr){\r\n\r\n // console.log('[arePointsOk] - array to control is '+arr)\r\n //first element cannot be a restricted Operator\r\n if(arr[0]=='.') {\r\n console.log('First character cannot be ' + arr[0]);\r\n return 0;\r\n }\r\n\r\n //first element cannot be a restricted Operator\r\n if(arr[arr.length-1]=='.') {\r\n console.log('Last character cannot be ' + arr[arr.length-1]);\r\n return 0;\r\n }\r\n\r\n for (var i=1;i<arr.length-1;i++){\r\n //impossible to have two signs next to each other\r\n if(arr[i]==='.' && (numbers.indexOf(arr[i-1])==-1 || numbers.indexOf(arr[i+1])==-1)){\r\n console.log('Points must be surrounded by numbers');\r\n return 0;\r\n }\r\n }\r\n return 1;\r\n}", "function checkInput(input) {\n for (var i = 0; i < input.length - 1; i++) { //loops over the input characters \n if (input[0].match(/[\\/\\+\\*\\%]/)) { // matches the first character against the operators\n console.log('Invalid Operator at the start'); \n newError('Invalid Operator at the start'); // Alerts user that they can't put certian operators at the start of the equation.\n } \n if ((input[i].match(/[\\/\\+\\-\\*\\%]/)) && (input[i + 1].match(/[\\/\\+\\-\\*\\%]/))) { // If the iteration and the next itteration match the operators\n console.log('terrible maths'); // it throws an error that you are terrible at math.\n newError(\"You're terrible at the maths\");\n }\n }\n}", "function verifyOperator(){\n for ( i = 0; i < operators.length; i++ ){\n for ( j = 0; j < (screen.innerHTML).length; j++ ){\n if (operators[i] == (screen.innerHTML)[j]){\n return true;\n }\n }\n }\n return false;\n}", "function checkForOpperand(char){\n if(char == \"+\"){\n return false;\n }else if(char == \"-\"){\n return false;\n }else if(char == \"/\"){\n return false;\n }else if(char == \"=\"){\n return false;\n }else if(char == \"*\"){\n return false;\n }else if(char == \"%\"){\n return false;\n }else if(char == \".\"){\n return false;\n }else{\n return true;\n }\n}", "exposeDifferentSymbols(i, p) {\n\t\tif (i.length !== p.length) return false;\n\n\t\t// Max. mismatch symbols\n\t \tvar maxMS = Math.ceil(i.length / 10);\n\n\t\tvar res = i\n\t\t\t.split('')\n\t\t\t.filter((symbol, key) => Object.is(symbol, p[key]))\n\t\t\t.length;\n\n\t\treturn res <= p.length && res >= (i.length - maxMS);\n\t}", "function testNormalCombinationOfSurrogates()\n{\n return \"\\uD800\\uDC00\".codePointAt(0) === 65536 && \"\\uD800\\uDC00\".codePointAt(1) === 56320 && \"\\uD800\\uDC00\".codePointAt(2) === undefined;\n}", "function checkWin() {\n for (let i = 0; i < winningCombinations.length; i++) {\n let pattern = winningCombinations[i];\n let [a, b, c] = pattern;\n if ( currentCells[a] === currentCells[b] && currentCells[b] === currentCells[c] ) {\n return true;\n }\n }\n return false;\n}", "function letterCombinations(arr) {\n // ...\n}", "function polybius(input, encode = true) {\n // your solution code here\n //const lowInput = input.toLowerCase()\n if(encode === false && input.split(' ').join('').length % 2 != 0) return false \n\n let alphabet = [\n {letter: 'a', squareCombo: '11'},\n {letter: 'b', squareCombo: '21'},\n {letter: 'c', squareCombo: '31'},\n {letter: 'd', squareCombo: '41'},\n {letter: 'e', squareCombo: '51'},\n {letter: 'f', squareCombo: '12'},\n {letter: 'g', squareCombo: '22'},\n {letter: 'h', squareCombo: '32'},\n {letter: 'i', squareCombo: '42'},\n {letter: 'j', squareCombo: '42'},\n {letter: 'k', squareCombo: '52'},\n {letter: 'l', squareCombo: '13'},\n {letter: 'm', squareCombo: '23'},\n {letter: 'n', squareCombo: '33'},\n {letter: 'o', squareCombo: '43'},\n {letter: 'p', squareCombo: '53'},\n {letter: 'q', squareCombo: '14'},\n {letter: 'r', squareCombo: '24'}, \n {letter: 's', squareCombo: '34'},\n {letter: 't', squareCombo: '44'},\n {letter: 'u', squareCombo: '54'},\n {letter: 'v', squareCombo: '15'},\n {letter: 'w', squareCombo: '25'},\n {letter: 'x', squareCombo: '35'},\n {letter: 'y', squareCombo: '45'},\n {letter: 'z', squareCombo: '55'},\n {letter: ' ', squareCombo: ' '}\n ]\n\n let result = []\n let substring = \"\"\n \n for(let i = 0; i < input.length; i++){\n if(encode === true){\n const findLetter = alphabet.find(letter => letter.letter === input[i]) //find letter ojbect that matches coordinating input letter\n result.push(findLetter.squareCombo)\n } else {\n const num = input[i]\n if (num === ' ') result.push(' ')\n else {\n substring += num\n if(substring.length === 2){\n const findCombo = alphabet.find(combo => combo.squareCombo === substring)\n if (findCombo.squareCombo === \"42\") { result.push('ij')\n }\n else result.push(findCombo.letter)\n substring = \"\"\n }\n }\n }\n }\nreturn result.join('')\n }", "function parensValid(input){\n let closing = 0;\n let opening = 0;\n\n for (let i = 0; i < input.length; i++) {\n const ele = input[i];\n if (closing > opening) {\n return false\n }\n if (ele === '(') {\n opening++\n }\n else if (ele === ')') {\n closing++\n }\n }\n\n return closing === opening\n}", "function isPair(s){\n var r=/\\(\\)|\\[\\]|\\{\\}/g;\n while (r.test(s)) {\n console.log(s);\n s=s.replace(r,\"\");\n }\n return s==\"\";\n}", "function check(a,b){\n for(var i=0;i<a.length;i++){\n if (places.includes(a[i])){\n messageDisplay(\"X\");\n return;\n }\n }\n for(var j=0;j<b.length;j++){\n if (places.includes(b[j])){\n messageDisplay(\"O\");\n return;\n }\n }\n}", "sameSymbolsInline(positions) {\n const { boardState } = this.props;\n if (boardState[positions[0]] === boardState[positions[1]] &&\n boardState[positions[1]] === boardState[positions[2]] &&\n !isEmpty(boardState[positions[0]])) {\n return true;\n }\n\n return false;\n }", "function specialCheck(check){\n \n for(let a=0; a<check.length; a++){\n \n let char_num = check.charCodeAt(a);\n\n if(char_num >= 33 && char_num <= 47 || char_num >= 58 && char_num <= 64 || char_num >= 91 && <= 96 || char_num >= 123 && char_num <= 126){\n return true;\n }\n\n }\n return false;\n\n\n}", "function checkWin() {\n return Winning_combinations.some(combination => {\n return combination.every( index => {\n if (move % 2 !== 0) {\n return cells[index].classList.contains('x');\n }\n else {\n return cells[index].classList.contains('o');\n }\n })\n })\n}", "function getCombinations(chars) {\n var result = [];\n var f = function(prefix, chars) {\n for (var i = 0; i < chars.length; i++) {\n result.push(prefix + chars[i]);\n f(prefix + chars[i], chars.slice(i + 1));\n }\n }\n f('', chars);\n return result;\n}", "function check (n, sym1, sym2, sym3) {\n n = +n.toString()[0];\n\n switch (n) {\n case 1:\n case 2:\n case 3: {\n return (new Array(n + 1)).join(sym1);\n }\n case 4: {\n return sym1 + sym2;\n }\n case 5: {\n return sym2;\n }\n case 6:\n case 7:\n case 8: {\n return sym2 + (new Array(n - 5 + 1)).join(sym1);\n }\n case 9: {\n return sym1 + sym3;\n }\n default: {\n return sym3;\n }\n }\n }", "function check(arr) { // check if the input array has any one of the combinations\r\n let flag = false; // in the win_combination array\r\n win_combination.forEach(x => {\r\n let count2 = 0;\r\n x.forEach(y => {\r\n if (arr.includes(y)) {count2 += 1};\r\n })\r\n if (count2 === 3) {flag = true;};\r\n })\r\n return flag;\r\n}", "isOperator() {\n return \"+-/\".indexOf(this.char) !== -1\n // return \"+-/\".includes(this.char)\n }", "function axiomValidation(axiom){\n\tif(typeof axiom != \"string\"){\n\t\treturn false;\n\t}\n\tlet exists;\n\tfor(char in axiom){\n\t\texists = false;\n\t\tfor(alph in alphabet){\n\t\t\tif(axiom[char] === alphabet[alph]) exists = true;\n\t\t}\n\t\tif(exists === false) return false;\n\t}\n\treturn true;\n}", "accepts(word){\n // restart the backtrack queue\n this.backtrack = [];\n // Verify that every symbol belongs to the alphabet\n for (var char of word){\n if (!this.alphabet.has(char)) return false;\n }\n let q = this.q0;\n q = this.transitionFunc(q, word);\n if (this.F.has(q)) { \n return true;\n }\n return false;\n }", "function checkOptions(concatGrps) {\n let possibleOptions = [1, 2, 3, 4, 5, 6, 7, 8, 9];\n let foundOptions = [];\n\n for (let option of possibleOptions) {\n if (!concatGrps.includes(option)) {\n foundOptions.push(option);\n }\n }\n return foundOptions;\n}", "validateDegreeReqs() {\n let program = this.props.program\n let terms = program.terms\n for (let term of terms) {\n let courses = this.props.courses\n for (let course of program[term].courses) {\n if (course == \"MSCI 261\" || courses[course].replaces == \"MSCI 261\") {\n return true\n }\n }\n }\n\n return false\n }", "function validParentheses(parens) {\n // TODO\n const balance = [];\n for(let parentheses of parens) {\n\n }\n\n}", "function findSym(comp){\n\tif(this == comp.n){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function allow() {\n // two value stacks and one character stack\n return numStack.length >= 2 && operatorStack.length >= 1;\n }", "function contains(symb, arr) {\n var letter = symb;\n pos = 0;\n for (var i = 0; i < arr.length; i++) {\n if (letter === arr[i]) {\n pos = i;\n return true;\n break;\n }\n }\n }", "function checkMatches() {\n\tif (selectedChars[0]==selectedChars[1] && selectedChars[0] ==selectedChars[2]) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function stillExecutableComands(comandList){\n\tfor(var i=0; i<comandList.length; i++){\n\n //Ignore comments\n if(comandList[i].comand.startsWith(\"//\")){\n continue;\n }\n //Ignore empty lines\n if(isTrimmedEmpty(comandList[i].comand) == 1){\n continue;\n }\n\n\n var temp = replaceIfNotEscaped(comandList[i].comand,\",\",\"§\");\n temp = temp.replace(/\\\\/g,\"\");\n var parameters = temp.split(\"§\");\n\t\t\n\t\t//Check state we are in\n\t\tif(general.currentState == parameters[0]){\n\t\t\t//Check char on nastro\n\t\t\tif(general.nastroIndex >=0){\n\t\t\t\tif(general.nastroValue[general.nastroIndex] == parameters[1].charAt(0) || ( general.nastroValue[general.nastroIndex] == undefined && parameters[1].charAt(0) == '_' ) ){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(general.nastroNegValue[(general.nastroIndex*-1)-1] == parameters[1].charAt(0) || ( general.nastroNegValue[(general.nastroIndex*-1)-1] == undefined && parameters[1].charAt(0) == '_' ) ){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}", "function checkWin(symbol) {\n if($(\"#1\").hasClass(symbol) && $(\"#2\").hasClass(symbol) && $(\"#3\").hasClass(symbol)) {\n return true;\n\n } else if ($(\"#4\").hasClass(symbol) && $(\"#5\").hasClass(symbol) && $(\"#6\").hasClass(symbol)) {\n return true;\n\n } else if ($(\"#7\").hasClass(symbol) && $(\"#8\").hasClass(symbol) && $(\"#9\").hasClass(symbol)) {\n } else {\n//Vertical\n }if($(\"#1\").hasClass(symbol) && $(\"#4\").hasClass(symbol) && $(\"#7\").hasClass(symbol)) {\n return true;\n\n } else if ($(\"#2\").hasClass(symbol) && $(\"#5\").hasClass(symbol) && $(\"#8\").hasClass(symbol)) {\n return true;\n\n } else if ($(\"#3\").hasClass(symbol) && $(\"#6\").hasClass(symbol) && $(\"#9\").hasClass(symbol)) {\n } else {\n//Diagonals\n }if($(\"#1\").hasClass(symbol) && $(\"#5\").hasClass(symbol) && $(\"#9\").hasClass(symbol)) {\n return true;\n\n } else if ($(\"#3\").hasClass(symbol) && $(\"#5\").hasClass(symbol) && $(\"#7\").hasClass(symbol)) {\n return true;\n } else {\n\n return false; //If not any of these combos, it is not a win. therefore, no alert.\n }\n }", "function isValid(str) {\n var mp = new Map([\n [\n '{', 1\n ], [\n '}', -1\n ], [\n '[', 2\n ], [\n ']', -2\n ], [\n '(', 3\n ], [\n ')', -3\n ]\n ])\n var arr = str.split('');\n var result = [];\n arr.forEach(item => {\n //括号相等\n if( mp.get( ...result.slice(-1) ) + mp.get(item) === 0){\n result.pop()\n } else {\n result.push(item)\n }\n })\n return result.length === 0;\n}", "function isOperatorValid(Look) {\n try {\n if (isBasicOperator(Look[0]) || isBasicOperator(Look[Look.length-2])) throw \"Operator can not be at the beginning or at the last\";\n var OperatorSub = new Array();\n for (var i = 0; i < Look.length; i++) {\n if (isBasicOperator(Look[i])) {\n OperatorSub.push(i);\n }\n }\n for (var j = 0; j < OperatorSub.length; j++) {\n if (j > 0) {\n if (OperatorSub[j] - OperatorSub[j-1] == 1) throw \"Operator can not be close to each other\";\n }\n }\n for (i = 0; i < Look.length; i++) {\n if ((Look[i] == \"(\" && isBasicOperator(Look[i+1]))) {\n throw \"Operator are wrong with Bracket\";\n }\n if (i > 0) {\n if ((Look[i] == \")\" && isBasicOperator(Look[i-1]))||(Look[i] == \")\" &&Look[i+1] == \".\")) {\n throw \"Operator are wrong with Bracket\";\n }\n if (Look[i] == \"(\" && Look[i-1] == \".\") {\n throw \"Operator error with dot\";\n }\n }\n }\n return true;\n }\n catch(Error) {\n alert(Error);\n ClearAll();\n }\n}", "function getAssociativityRtoL (symbol) {\n return symbol === '^';\n}", "function exOh(str) {\n var arrayX = [],\n arrayO = [];\n\n for(var i = 0; i < str.length; i++){\n if(str[i] === 'x') arrayX.push(i);\n if(str[i] === 'o') arrayO.push(i);\n }\n if(arrayX.length === arrayO.length) return true;\n return false\n\n}", "function hasUniqueChars(char) {\n for(let i = 0; i < char.length; i++)\n for(let j = i + 1; j < char.length - 1; j++)\n if (char[i] === char[j]){\n\n return false;\n \n \n \n\n }\n return true;\n}", "function result(target) {\n let leftParenthesis = createSymbolSet('(', target);\n let rightParenthesis = createSymbolSet(')', target);\n let combinations = [];\n\n return '';\n}", "function checkLettre(m) {\n for (let b = 0; b < m.length; b++) {\n if (lettre == m[b]) {\n return true;\n }\n }\n}", "function lettersAllowed(allowed) {\n // Iterate through alphabet\n for (var i = 0; i < alphabet.length; i++) {\n // Checks if input letter is contained in alphabet\n if (alphabet[i] === allowed) {\n console.log(allowed);\n return false;\n }\n }\n\n return true;\n}", "function validateCharListArray(charList){\r\n\t\t\tfor(var i = 0, len = charList.length, item; i < len; i++){\r\n\t\t\t\titem = charList[i];\r\n\t\t\t\t\r\n\t\t\t\t// item should be array\r\n\t\t\t\tif(!Array.isArray(item))\r\n\t\t\t\t\treturn \"Invalid elements of character list \" + (i + 1) + \"th\";\r\n\r\n\t\t\t\t// array should be of 2 items\r\n\t\t\t\tif(item.length !== 2)\r\n\t\t\t\t\treturn \"Expected 2 elements of character list \" + (i + 1) + \"th\";\r\n\r\n\t\t\t\t// item's elements should be string\r\n\t\t\t\tif(typeof(item[0]) + typeof(item[1]) !== \"stringstring\")\r\n\t\t\t\t\treturn \"Elements of character list \" + (i + 1) + \"th are not strings.\";\r\n\r\n\t\t\t\t// item's elements should be one char in length\r\n\t\t\t\tif(item[0].length !== 1 || item[1].length !== 1)\r\n\t\t\t\t\treturn \"Elements of character list \" + (i + 1) + \"th are not of length 1.\";\r\n\r\n\t\t\t\t// check dupes\r\n\t\t\t\tfor(var j = i + 1; j < len; j++)\r\n\t\t\t\t\tif(item[0] === charList[j][0])\r\n\t\t\t\t\t\treturn \"Elements of character list \" + (i + 1) + \" and \" + (j + 1) + \" are duplicate\";\r\n\t\t\t}\r\n\r\n\t\t\treturn \"true\";\r\n\t\t}", "function nCharOK(c) \n{\n let ch = (String.fromCharCode(c));\n ch = ch.toUpperCase();\n // if the current character is not found in the set of all numbers\n // set the flag variable to fail\n if (filterSet.indexOf(ch) !== -1)\n return true;\n else \n return false;\n}", "validateExpression() {\n for (let i = 0; i < this.expression.length - 1; i++) {\n if (this.expression[i] in OperatorMap && this.expression[i + 1] in OperatorMap) {\n if (this.expression[i] !== \"(\" && this.expression[i] !== \")\" &&\n this.expression[i + 1] !== \"(\" && this.expression[i + 1] !== \")\" && this.expression[i + 1] !== \"-\") {\n return false;\n }\n }\n }\n\n return true;\n }", "function formingMagicSquare(s) { \n const sumRow = (i, m) => m[i][0] + m[i][1] + m[i][2]\n\n const sumCol = (i, m) => m[0][i] + m[1][i] + m[2][i]\n\n const sumDR = (m) => m[0][0] + m[1][1] + m[2][2]\n\n const sumDL = (m) => m[0][2] + m[1][1] + m[2][0]\n\n const isMagic = m => {\n return sumRow(0, m) == 15 &&\n sumRow(1, m) == 15 &&\n sumRow(2, m) == 15 &&\n sumCol(0, m) == 15 &&\n sumCol(1, m) == 15 &&\n sumCol(2, m) == 15 &&\n sumDR(m) == 15 &&\n sumDL(m) == 15;\n }\n\n const uniques = (ar1, ar2, ar3) => {\n let all = [...ar1, ...ar2, ...ar3];\n let valid = true;\n\n all.forEach(e => {\n if (all.filter(x => x == e).length > 1)\n valid = false;\n })\n\n return valid;\n }\n\n const fullCombine = () => {\n let combinations = [];\n let magics = [];\n for(let i = 1; i < 10; i++) {\n for(let j = 1; j < 10; j++) {\n for(let k = 1; k < 10; k++) {\n if (k !== j && j !== i && i !== k && (i + k + j) == 15)\n combinations.push([i, j, k])\n }\n } \n }\n \n for(let i = 0; i < combinations.length; i++) {\n for(let j = 0; j < combinations.length; j++) {\n for(let k = 0; k < combinations.length; k++) {\n if (\n k !== j && \n j !== i && \n i !== k && \n uniques(combinations[i], combinations[j], combinations[k]) &&\n isMagic([combinations[i], combinations[j], combinations[k]])\n ){\n magics.push([combinations[i], combinations[j], combinations[k]])\n }\n }\n } \n }\n\n return magics;\n \n \n \n }\n\n let magics = fullCombine();\n\n let min = 1000000;\n magics.forEach(m => {\n let total = 0;\n for(let y = 0; y < 3; y++) {\n for(let x = 0; x < 3; x++) {\n total += Math.abs(m[y][x] - s[y][x])\n } \n }\n\n if (total < min)\n min = total\n })\n\n return min;\n}", "function checkWin() {\n const combinations = [\n [0,1,2], [3,4,5], [6,7,8], \n [0,3,6], [1,4,7], [2,5,8], \n [0,4,8], [2,4,6],\n ];\n\n let check = false;\n combinations.forEach((items) => {\n const value0 = board[items[0]]; \n const value1 = board[items[1]]; \n const value2 = board[items[2]]; \n check |= value0 != \"\" && value0 == value1 && value1 == value2;\n });\n\n return check;\n}", "function encode_letter(letter, operation, used_codes) {\n // keep encoding until good combination found:\n var task_found = false;\n var attempt_counter = 0;\n while (!task_found){\n attempt_counter += 1;\n var a = arb_random(AA,BB);\n var b = arb_random(AA,BB);\n // is this task/code unique ? positive ?\n potential_code = arithmetic_apply(a,b,operation);\n opstr = op_to_string(operation);\n operation_str = ( a + opstr + b );\n if (used_codes.indexOf(potential_code) > -1) {\n task_found = false;\n console.log(\" failed: \"+operation_str);\n } else if (potential_code < 0) {\n task_found = false;\n console.log(\" failed: \"+operation_str);\n } else {\n task_found = true;\n }\n }\n // we've got this - returning:\n console.log(attempt_counter+\" attempts: \"+operation_str);\n return [a,b,potential_code];\n}", "function verifyClosingCharacters(sequence){\n // iterate over the correct file\n for (var i = 0; i < sequence.length; i++){\n if(!(sequence[i] in opposites)){\n // it is an opening parentheses, add it to the stack\n stack.push(sequence[i]) ;\n }else{\n // it is a closing character, check if it is the same as the top of the stack.\n if(opposites[sequence[i]] === stack.peek()){\n // pop the element as they match\n stack.pop();\n }else{\n // exit the loop, as there is a missmatch\n break;\n }\n }\n }\n if (stack.isEmpty()){\n console.log(\"Todos los caracteres en el String Cierran correctamente!\")\n }else{\n // Clean the stack\n stack = new Stack();\n console.log(\"No todos los caracteres en el String cierran de manera correcta\")\n }\n}", "function checkPermutation(s1, s2) {\n if (s1.length !== s2.length) return false;\n\n const dict = {};\n\n for (let i = 0; i < s1.length; i++) {\n const char = s1[i];\n dict[char] = dict[char] ? dict[char] + 1 : 1;\n }\n\n for (let j = 0; j < s2.length; j++) {\n const char = s2[j];\n if (dict[char]) {\n dict[char]--;\n }\n else return false;\n }\n\n return true;\n}", "isSign(c){ return ('-'==c || c=='+') }", "function duplicateEncode(word){\n // ...\n var letters = word.toLowerCase().split('');\n return letters.map(function(c, i) {\n return letters.some(function(x, j) {\n return x === c && i !== j\n }) ? ')' : '(' ;\n }).join('');\n}", "function basicPasswordValidate(/*String*/ password, /*String*/ passwordAlphabet){\n for(var i = 0; i < password.length; i++){\n var appear = false;\n for(var j = 0; j < passwordAlphabet.length; j++){\n if(password.charAt(i) == passwordAlphabet.charAt(j)){\n appear = true;\n }\n }\n if(!appear)return false;\n }\n return true;\n}", "function isBeautifulString(inp) {\n let alph = \"abcdefghijklmnopqrstuvwxyz\";\n //arrange letters of input string ascending so\n //we can test whether the given letter's quantity is\n //<= that of the previous letter in the alphabet.\n let arr = inp.split(\"\").sort().join(\"\");\n //Next three lines check if input string contains consecutive\n //letters and returns false if not the case. This was added due to 'zaa'\n //fail.\n let uniq = [...new Set(arr)].join(\"\");\n let consecutiveCheck = alph.match(uniq);\n if (consecutiveCheck === null) return false;\n //Breaks sorted string into groups of the same character\n let byLet = arr.match(/([a-z])\\1*/g);\n //Gives an array of the quantities of each character in string\n let quans = byLet.map((i) => i.length);\n //Checks that the quantity of a given letter is less than or equal to\n //the preceeding letter\n let pass = quans.slice(1).map((v, i) => v <= quans[i]);\n //Checks that that's always the case\n let bigPass = pass.every((i) => i === true);\n console.log(arr);\n console.log(\"uniq\", uniq);\n console.log(\"consecutiveCheck\", consecutiveCheck);\n console.log(byLet);\n console.log(quans);\n console.log(quans.slice(1));\n console.log(pass);\n console.log(bigPass);\n console.log(\"test\", alph.split(\"\").includes(\"a\"));\n //Both cases have to be true, as 'bbc' and 'yyz' failed\n //(because there are more b's than a's given that a is not present etc.);\n return bigPass && byLet[0][0] === \"a\";\n}", "function chars(input) {\n return true;\n}", "function isContaineWinCombination(arr, val) {\n let counter = 0;\n let firstCell;\n let lastCell;\n for (let i = 0; i < arr.length; i++) {\n if ( counter === 0) {\n firstCell = arr[i]\n }\n\n if (arr[i].val === val) {\n counter++;\n if (counter === count) {\n lastCell = arr[i];\n printLine(\n countCoordinate(firstCell.j),\n countCoordinate(firstCell.i),\n countCoordinate(lastCell.j),\n countCoordinate(lastCell.i));\n return true\n }\n } else {\n counter = 0;\n }\n }\n return false ;\n}", "function isValid(str) {\r\n const arr = str.split(' ');\r\n const ops = arr.reduce((acc, cur) => {\r\n if (operators.includes(cur)) {return acc + 1} else {return acc}\r\n }, 0)\r\n const nums = arr.reduce((acc, cur) => {\r\n if (Number(cur) == cur) {return acc + 1} else {return acc}\r\n }, 0)\r\n if (nums === ops + 1) {return true} else {return false}\r\n}", "function isValidReaction(substrates, enzyme, products, reactionNumber) {\n //check for repeated enzymes\n for(var i = 0; i < reactionNumber; i++) {\n //compare the name of the current enzyme to that of every enzyme in the pathway already\n if(enzyme[0] == addedReactions[i]['enzyme'][0]) {\n alert('Cannot repeat enzyme: ' + enzyme[0] + \".\");\n return false;\n }\n }\n //check to see if reaction has a product and a substrate\n if(substrates.length < 1 || products.length < 1) {\n alert('Reactions must have at least one substrate and product.')\n return false;\n }\n //check to ensure no duplicate substrates\n for(var i = 0; i < substrates.length; i++) {\n for(var j = i+1; j < substrates.length; j++) {\n if(substrates[i][0] == substrates[j][0]) {\n alert('No duplicate substrates for same reaction!');\n return false;\n }\n }\n }\n //check to ensure no duplicate products\n for(var i = 0; i < products.length; i++) {\n for(var j = i+1; j < products.length; j++) {\n if(products[i][0] == products[j][0]) {\n alert('No duplicate products for same reaction!');\n return false;\n }\n }\n }\n //check to make sure every reaction besides the 1st has at least one sub\n //from previous reaction's product(s)\n if(reactionNumber >= 1) {\n previousProducts = addedReactions[reactionNumber-1][\"products\"];\n for (var i = 0; i < previousProducts.length; i++) {\n for (var j = 0; j < substrates.length; j++) {\n if (previousProducts[i][0] == substrates[j][0]) {\n return true;\n }\n }\n }\n alert(\"None of the products for reaction \" + (reactionNumber) + \" are substrates in the next reaction.\");\n return false;\n }\n //Passed error checks with flying colors :D\n return true;\n}", "function passCheck(pass, lower, upper, number, special){\n var checksOut = false;\n var hasLower = false;\n var hasUpper = false;\n var hasNumber = false;\n var hasSpecial = false;\n\n for(var i = 0; i < pass.length; i++){\n \n /* Uncomment this if you want to assume the password doesn't contain character types that you wanted omitted\n if((lower === hasLower) && (upper === hasUpper) && (number === hasNumber) && (special === hasSpecial)){\n break;\n }\n */\n\n for(var j = 0; j < 26; j++){\n if(pass[i] === makeLowerArray()[j]){\n hasLower = true;\n break;\n }\n\n }\n for(var k = 0; k < 26; k++){\n if(pass[i] === makeUpperArray()[k]){\n hasUpper = true;\n break;\n }\n }\n for(var j = 0; j < 10; j++){\n if(pass[i] === makeNumArray()[j]){\n hasNumber = true;\n break;\n }\n }\n for(var j = 0; j < 33; j++){\n if(pass[i] === makeSpecialArray()[j]){\n hasSpecial = true;\n break;\n }\n }\n }\n\n if((lower === hasLower) && (upper === hasUpper) && (number === hasNumber) && (special === hasSpecial)){\n checksOut = true;\n }\n\n return(checksOut);\n}", "function isBalanced2(s) {\n let aux = -1;\n \n while (s.length != 0) {\n aux = s.length;\n s = s.replace(\"()\",\"\");\n s = s.replace(\"[]\",\"\");\n s = s.replace(\"{}\",\"\");\n \n if (aux == s.length) return \"NO\";\n }\n\n return \"YES\";\n\n}", "function checkForExclusiveSymbols(value, exChars) {\n var\n containsExChar\n ;\n\n containsExChar = false;\n\n if (typeof(exChars) != 'undefined' && exChars !== '') {\n var i = exChars.length;\n while (i--) {\n if (value.indexOf(exChars[i]) != -1) {\n containsExChar = true;\n\n return containsExChar;\n }\n }\n }\n return containsExChar;\n }", "function XO(str) {\n const arr = str.toLowerCase().split('')\n let x = 0\n let o = 0\n arr.forEach(letter => {\n if (letter === 'x') x++\n else if (letter === 'o') o++\n })\n if (x === 0 && o === 0) return true\n else if (x === o) return true\n else return false\n}", "function mutation(arr) {\n var arg1 = arr[0].toLowerCase(),\n arg2 = arr[1].toLowerCase();\n\n for (var i = 0; i < arg2.length; i++) {\n \n var letter = arg2.charAt(i);\n\n if (arg1.indexOf(letter) === -1) {\n return console.log(false);\n }\n\n }\n return console.log(true);\n}", "function polybius(input, encode = true) {\n const square = {\n 11: 'a', 21: 'b', 31: 'c', 41: 'd', 51: 'e',\n 12: 'f', 22: 'g', 32: 'h', 42: '(i/j)', 52: 'k',\n 13: 'l', 23: 'm', 33: 'n', 43: 'o', 53: 'p',\n 14: 'q', 24: 'r', 34: 's', 44: 't', 54: 'u',\n 15: 'v', 25: 'w', 35: 'x', 45: 'y', 55: 'z'\n }\n input = input.toLowerCase()\n let output = \"\"\n if(typeof input !== \"string\") return output = false\n if(encode){ //values = characters; letter = character\n for(values in input){\n const letter = input[values]\n if(letter === \" \"){\n output += letter\n continue\n }\n if(letter === \"i\" || letter === \"j\") {\n output += 42\n continue\n }\n for(value in square) { //letters = value\n if(letter === square[value]) output += value\n }\n }\n } else {\n for(numbers in input){\n let numPairs = input.split(\" \")\n for(element in numPairs){\n if(numPairs[element].length % 2 != 0) {\n return output = false\n } \n }\n const pair = `${input[0]}${input[1]}`\n if(input[0] === \" \"){\n output += input[0]\n input = input.slice(1)\n continue\n }\n for(num in square){\n if (pair === num){\n output += square[num]\n }\n }\n input = input.slice(2)\n }\n }\n return output;\n}", "_checkSymbol(checkToken) {\n for (let token in this._validTokens) {\n if (token == this.match(checkToken)) {\n return token;\n }\n }\n return undefined;\n }", "function validate() {\n\tvar combinations = [\n\t\t\t\t\t\t\t\t\t\t\t[0, 1, 2],\n\t\t\t\t\t\t\t\t\t\t\t[3, 4, 5],\n\t\t\t\t\t\t\t\t\t\t\t[6, 7, 8],\n\t\t\t\t\t\t\t\t\t\t\t[0, 3, 6],\n\t\t\t\t\t\t\t\t\t\t\t[1, 4, 7],\n\t\t\t\t\t\t\t\t\t\t\t[2, 5, 8],\n\t\t\t\t\t\t\t\t\t\t\t[0, 4, 8],\n\t\t\t\t\t\t\t\t\t\t\t[2, 4, 6],];\n\tfor (var i = 0; i < 8; i++) { //iterate over all combinations\n\t\tvar all_x = true;\n\t\tvar all_o = true;\n\t\tfor (var j = 0; j < 3; j++) { //iterate over each space in the combination\n\t\t\tvar ind = combinations[i][j];\n\t\t\tif (board_state[ind] == 1 || board_state[ind] == -1) all_o = false; //it isn't all O's\n\t\t\tif (board_state[ind] == 0 || board_state[ind] == -1) all_x = false; //it isn't all X's\n\t\t}\n\t\tif (all_x) return 1;\n\t\tif (all_o) return 0;\n\t}\n\treturn -1; //no winner\n}", "function XO(str) {\n let xCount = 0;\n let oCount = 0;\n\n for (let i = 0; i < str.length; i++) {\n if (str[i].toLowerCase() === 'x' ) {\n xCount++;\n }\n\n if (str[i].toLowerCase() === 'o' ) {\n oCount++;\n } \n }\n\n if (xCount === 0 && oCount === 0) {\n return true;\n }\n\n else if (xCount === oCount) {\n return true;\n }\n\n else {\n return false;\n }\n}", "function abbreviation(a, b) {\n let m = a.length;\n let n = b.length;\n\n let valid = Array(m + 1).fill().map(() => Array(n + 1).fill(false));\n valid[0][0] = true;\n\n for (let i = 1; i <= m; i++) {\n let end = Math.min(i, n);\n for (let j = 0; j <= end; j++) {\n let a_char = a[i - 1];\n\n if (j == 0) {\n if (a_char == a_char.toLowerCase()) {\n valid[i][j] = valid[i - 1][j];\n }\n }\n else {\n let b_char = b[j - 1];\n\n if (a_char == b_char) {\n valid[i][j] = valid[i - 1][j - 1];\n }\n else if (a_char.toUpperCase() == b_char) {\n valid[i][j] = valid[i - 1][j - 1] | valid[i - 1][j];\n }\n else if (a_char == a_char.toLowerCase()) {\n valid[i][j] = valid[i - 1][j];\n }\n }\n }\n }\n\n if (valid[m][n]) {\n return \"YES\";\n }\n return \"NO\";\n}", "function sym(args) {\n var argArr = [];\n var diff = [];\n for (var i = 0; i < arguments.length; i++) {\n argArr.push(arguments[i]);\n }\n argArr.forEach(function(argVal, argIdx, argArr) {\n console.log('checking argument ' + argVal);\n argVal.forEach(function(val, idx, arr) {\n console.log('checking value ' + val);\n for (var j=0; j < argArr.length; j++) {\n console.log('looking inside argument:');\n console.log(argArr[j]);\n if (notInArr(val, argArr[j])) {\n console.log(val);\n diff.push(val);\n }\n }\n });\n });\n function notInArr(num, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (num === arr[i]) {\n return false;\n }\n }\n return true;\n }\n return diff;\n}", "function letterCombinations(digits) {\n if(digits === '') return [];\n const chosen = [];\n let letters = digits.split('').map(digit => map.get(digit).split(''));\n helper(letters, [], chosen);\n return chosen;\n}", "function compile(pattern) {\n let tokens = [];\n let squares = find.square(pattern);\n for (let pos = 0; pos < pattern.length; pos++) {\n let char=pattern[pos];\n let charRange = rangeUtils.isInRanges(pos, squares);\n if(!charRange){\n tokens.push({\n 'type':'equals',\n value:char\n })\n } else{\ntokens.push({\n type:'contains',\n value:[]\n})\n }\n }\n return tokens;\n}", "function isBalanced(s, caps) {\n let newCaps = caps.split('');\n let newS = s.split('').map((x) => { return newCaps.includes(x) ? x : '' }).join('').split('');\n let diff = [];\n let same = [];\n \n if(newS.length % 2 != 0){\n return false;\n };\n \n while(newCaps.length > 0){\n let temp = newCaps.splice(0,2);\n let opening = temp[0];\n let closing = temp[1];\n \n newS.map((o, index) => {\n if(opening != closing && o == opening){\n diff.push([index, opening, closing]); \n }else if(o == opening){\n same.push([index, opening, closing]);\n };\n });\n };\n \n if(same.length > 0){\n same.sort((a, b) => a[0] - b[0]);\n \n if(same.length % 2 != 0){\n return false;\n };\n let nestedValid = true; \n let sideBySideValid = true;\n \n for(let i = 0; i < same.length / 2; i++){\n let o = same[i][1];\n let c = same[(same.length - 1) - i][1];\n if(o != c){\n nestedValid = false;\n };\n };\n \n for(let i = 0; i <= same.length - 2; i+=2){\n let o = same[i][1];\n let c = same[i + 1][1];\n if(o != c){\n sideBySideValid = false;\n };\n };\n \n if(!nestedValid && !sideBySideValid){\n return false;\n };\n };\n \n if(diff.length > 0){\n diff.sort((a,b) => b[0] - a[0]);\n for(let i = 0; i <= diff.length - 1; i++){\n let index = diff[i][0] + 1;\n let closing = diff[i][2];\n \n if(newS[index] != closing){\n return false;\n } else {\n newS.splice(index - 1, 2);\n };\n };\n if(newS.length > 0){\n return false;\n };\n };\n \n return true;\n}", "function checkSign(){\n return result.length === 1 && (result === \"/\" || result === \"*\" || result === \"+\" || result === \"-\");\n }", "function testCompSubstr(codeCounts, comp, nShips) {\n\tif(comp.charAt(0) === '!') {\n\t\tif(isNaN(comp.charAt(1))) {\n\t\t\t// check if none:\n\t\t\tvar typeCode = comp.substring(1);\n\n\t\t\t// note: we don't check for !XX, since that's impossible for any normal (KC-allowed) fleet.\n\n\t\t\tif(codeCounts.hasOwnProperty(typeCode))\n\t\t\t\treturn false;\n\n\t\t\tif(codeCounts[typeCode] > 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t// test maximum:\n\t\t\tvar maximum = Number(comp.charAt(1));\n\t\t\tvar typeCode = comp.substring(2);\n\n\t\t\tif(typeCode === 'XX') {\n\t\t\t\tif(nShips > maximum) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!codeCounts.hasOwnProperty(typeCode)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif(codeCounts[typeCode] > maximum) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if(!isNaN(comp.charAt(0))) {\n\t\t// test minimum:\n\t\tvar minimum = Number(comp.charAt(0));\n\t\tvar typeCode = comp.substring(1);\n\n\t\tif(typeCode === 'XX') {\n\t\t\tif(nShips < minimum) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif(!codeCounts.hasOwnProperty(typeCode)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif(codeCounts[typeCode] < minimum) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow \"Invalid composition specification: \" + comp;\n\t}\n\n\treturn true;\n}", "function generatePass() {\n // initiate amount of elements in password (according to password range data)\n const passMin = Number(document.querySelector('.noUi-handle-lower').getAttribute('aria-valuenow'));\n const passMax = Number(document.querySelector('.noUi-handle-upper').getAttribute('aria-valuenow'));\n const symbolsPass = Math.floor(Math.random()*(passMax - passMin + 1)) + passMin;\n // initiate empty arrays for checked characters\n const lowercaseArrChecked = [];\n const uppercaseArrChecked = [];\n const numberArrChecked = [];\n const asciiArrChecked = [];\n \n // create new character arrays from only checked\n characters.forEach((arr) => {\n arr.checkedArr(lowercaseArrChecked, uppercaseArrChecked, numberArrChecked, asciiArrChecked);\n })\n \n // generate password\n const passArr = [];\n const arr = [...lowercaseArrChecked, ...uppercaseArrChecked, ...numberArrChecked, ...asciiArrChecked];\n // console.log(arr);\n\n for (let i = 1; i <= symbolsPass; i++) {\n const randomItem = arr[Math.floor(Math.random()*arr.length)];\n passArr.push(randomItem);\n }\n\n // check if there are elements from each array (lowercaseArrChecked, uppercaseArrChecked, numberArrChecked, asciiArrChecked) in generated password\n if (lowercaseArrChecked.length > 0) {\n checkLower = false;\n passArr.forEach( elem => {\n let checkTrue = lowercaseArrChecked.indexOf(elem);\n if (checkTrue > -1) {\n return checkLower = true;\n }\n } )\n }\n if (uppercaseArrChecked.length > 0) {\n checkUpper = false;\n passArr.forEach( elem => {\n let checkTrue = uppercaseArrChecked.indexOf(elem);\n if (checkTrue > -1) {\n return checkUpper = true;\n }\n } )\n }\n if (numberArrChecked.length > 0) {\n checkNumber = false;\n passArr.forEach( elem => {\n let checkTrue = numberArrChecked.indexOf(elem);\n if (checkTrue > -1) {\n return checkNumber = true;\n }\n } )\n }\n if (asciiArrChecked.length > 0) {\n checkAscii = false;\n passArr.forEach( elem => {\n let checkTrue = asciiArrChecked.indexOf(elem);\n if (checkTrue > -1) {\n return checkAscii = true;\n }\n } )\n }\n\n if ( (checkLower === false) || (checkUpper === false) || (checkNumber === false) || (checkAscii === false) ) {\n generatePass();\n } else {\n let pass = passArr.join('');\n \n document.querySelector('#pass-result').value = pass;\n }\n\n}", "function XO(str) {\n let count_o = 0;\n let count_x = 0;\n str= str.toLowerCase();\n for(let elm of str){\n if(elm==='o') count_o ++;\n if(elm === 'x') count_x ++\n }\n return count_o===count_x? true: false;\n}", "function parensValid(input) {\n var openParen = 0\n var closedParen = 0\n for (var i = 0; i < input.length; i++) {\n if (input[i] == ')' && openParen == 0) {\n return false;\n }\n else if (input[i] == '(') {\n openParen++\n }\n else if (input[i] == ')' && openParen > closedParen) {\n closedParen++\n }\n }\n if (openParen == closedParen) {\n return true;\n }\n return false;\n}", "function checkFun( pre, next ) {\n\n let trueArr = [];\n\n for ( let i = 0; i < next.length; i++ ) {\n\n for ( let j = 0; j < next.length; j++ ) {\n\n if ( pre[j] === next[i] ) {\n\n trueArr.push( true );\n\n } else {\n\n trueArr.push( false );\n\n }\n }\n }\n\n if ( trueArr[0] || trueArr[1] || trueArr[2] || trueArr[3] || trueArr[4] || trueArr[5] || trueArr[6] || trueArr[7] || trueArr[8] ) {\n\n return true;\n\n } else {\n\n return false;\n\n }\n\n}", "function letterCombinations(digits) {\n if (digits.length === 0) return [];\n const numLetters = ['_', null, 'abc','def','ghi','jkl','mno','pqrs','tuv','wxyz']\n return allLetterCombinations(digits, numLetters);\n}", "function validParentheses(tempArr){\r\n let len = tempArr.length;\r\n let check =0;\r\n for(let i =0 ; i < len && check >= 0 ; i++){\r\n console.log(check,tempArr[i]);\r\n if(tempArr[i] == \"(\"){\r\n check++;\r\n }else{\r\n check--;\r\n }}\r\n return (check==0);\r\n }", "function checkCombos() {\n\t\twinner = game.gamePlayer ;\n\t\tif (game.gamePlayer == \"X\") \n\t\t{\n\t\t\twinner = \"O\" \n\t\t}\n\t\telse {\n\t\t\twinner = \"X\" \n\t\t}\n\n\t\tfor(var i = 0; i < game.winningCombos.length; i++){\n\t\t\t\tif(game.playerMove[game.winningCombos[i][0]] == winner\t&& game.playerMove[game.winningCombos[i][1]] == winner && game.playerMove[game.winningCombos[i][2]]== winner){\n\t\t\t\t\t\t\n\t\t\t\t\t\talert(\"player \" + winner + \" won!\");\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t\telse if (moves == 9 ) {\n\n\t\t\t\t\t\tcheckDraw();\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t};\n\t\n}", "hasConjuction(sentence) {\n \tvar andSplit = sentence.split(\" and \");\n \tif (sentence.indexOf(\"and\") !== -1 || sentence.indexOf(\"but\") !== -1) {\n \t\tif (this.isThisAndList(andSplit)) {\n \t\t\treturn false;\n \t\t}\n \t\telse {\n \t\t\treturn true;\n \t\t}\n \t}\n \telse {\n \t\treturn false;\n \t}\n }", "function conflicts(slot1, slot2) {\n const sl2iter = slot2.values();\n let sl2 = sl2iter.next();\n for (let sl1 of slot1) {\n sl2 = advance(sl2, sl2iter, (initial) => (((initial.value.start + initial.value.length) < sl1.start)),\n (initial) => (initial.done));\n if (sl2.done) {\n return false;\n }\n \n if (compare(sl1, sl2.value) !== 0) {\n return true;\n }\n }\n return false;\n}", "function XO(str) {\n return str.toLowerCase().split('x').length === str.toLowerCase().split('o').length;\n}", "function chkIntegrity(key) {\n result = key.reduce((isValid,letter) => {\n if (isValid != true) return isValid;\n let count = 0;\n for (index = 0; index <key.length; index++) {\n if(letter === key[index]) count +=1;\n }\n if (count <= 1) {\n isValid = true;\n return isValid;\n }\n else {\n isValid = false;\n return isValid;\n }\n },true); \n return result;\n }", "function matchSymbol() {\n\t\tvar pattern = /^[{}\\(\\)]/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function check(sym,name){\r\n\t\tif((b1.textContent===b2.textContent && b2.textContent===b3.textContent && b3.textContent===sym)||\r\n\t\t\t(b4.textContent===b5.textContent && b5.textContent===b6.textContent && b5.textContent===sym)||\r\n\t\t\t(b7.textContent===b8.textContent && b8.textContent===b9.textContent && b8.textContent===sym)||\r\n\t\t\t(b1.textContent===b4.textContent && b4.textContent===b7.textContent && b4.textContent===sym)||\r\n\t\t\t(b2.textContent===b5.textContent && b2.textContent===b8.textContent && b2.textContent===sym)||\r\n\t\t\t(b3.textContent===b6.textContent && b6.textContent===b9.textContent && b9.textContent===sym)||\r\n\t\t\t(b1.textContent===b5.textContent && b5.textContent===b9.textContent && b1.textContent===sym)||\r\n\t\t\t(b3.textContent===b5.textContent && b5.textContent===b7.textContent && b7.textContent===sym))\r\n\t\t{\r\n\t\t\tgo=true;\r\n\t\t\tupdate.textContent=name+\" won!\";\r\n\t\t\tupdate.classList.add(\"success\");\r\n\r\n\t\t}\r\n\t\telse if(b1.textContent!=\"\" && b2.textContent!=\"\" && b3.textContent!=\"\" &&\r\n\t\t\t\tb4.textContent!=\"\" && b5.textContent!=\"\" && b6.textContent!=\"\" && \r\n\t\t\t\tb7.textContent!=\"\" && b8.textContent!=\"\" && b9.textContent!=\"\")\r\n\t\t{\r\n\t\t\tgo=true;\r\n\t\t\tupdate.textContent=\"Game tied!\";\r\n\r\n\t\t}\r\n}", "function ABCheck(str) {\n var arr = str.split(\"\");\n\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] === \"a\") {\n for(var j = 0 ; j < arr.length; j++) {\n if(arr[j] === \"b\" && Math.abs(j - i) === 4) {\n return \"true\";\n }\n }\n\n }\n }\n\n return false;\n}", "function combination() {\n \n var res = ''\n \n for (var i = 1; i <= 7; i++) {\n for (var j = 1; j <= 7; j++) {\n if (i !== j) {\n res += '(' + i + ',' + j + '), ';\n }\n }\n }\n \n return res\n}", "compStrings() {\n const badWords = this.state.badWords;\n\n const splitPar = this.state.paragraph.split(\" \");\n console.log(splitPar);\n // input paragrahp\n\n const splitTester = this.state.tester.split(\" \");\n console.log(splitTester);\n // if test word doesn't equal control word go to char comp and record wrong chars.\n\n for (let i = 0; i < splitTester.length; i++) {\n if (splitTester[i] === splitPar[i]) {\n console.log(\"yay\");\n } else {\n badWords.push(splitTester[i]);\n this.compWords(splitPar[i], splitTester[i]);\n }\n }\n return badWords.length === 0 ? true : badWords;\n }", "function mutation(arr) {\n var str = arr[0].toLowerCase();\n var charChk = arr[1].toLowerCase();\n for (var pos = 0; pos <= charChk.length;) {\n if (str.indexOf(charChk) !== -1) { // Checks whether the entirety of charChk exist as is in str\n return true\n }\n else if (str.indexOf(charChk[pos]) !== -1) { //Checks for occurances for each index individually, only incrementing to the next position if an occurance is found\n pos++ // Only incrememnts if an occurance is found\n }\n else if (pos == charChk.length) {\n return true //If the position reaches the full length arr[1] then an occurance of all items were found and a true statement is returned\n }\n else {\n return false\n }\n }\n}", "function checkValidityExp(arr) {\r\n\tif (arr.length < 3) {\r\n\t\treturn false; // If expression is incomplete - doesn't have 3 elements (num, sym, num)\r\n\t}\r\n\tif (!/\\d/.test(arr[0]) || !/\\d/.test(arr[2])) {\r\n\t\treturn false; // check that expression starts and ends with numbers\r\n\t}\r\n\treturn true;\r\n}", "function charCountCompabilityCheck(seqs) {\n\tvar positionArray = new Array(seqs[0].length);\n\t// Create a base counter for each position:\n\tfor(var i = 0, n = seqs[0].length; i < n; i++) {\n\t\tpositionArray[i] = {A:0, T:0, G:0, C:0};\n\t}\n\t// Iterate over all sequences:\n\tvar seq;\n\tfor(var i = 0, n = seqs.length; i < n ; i++) {\n\t\tseq = seqs[i];\n\t\t// Iterate over all positions in current sequence:\n\t\tfor(var j = 0, m = seq.length; j < m; j++) {\n\t\t\t// Add one to the count for the base in this position:\n\t\t\tpositionArray[j][seq[j]] += 1;\n\t\t}\n\t}\n\t// Sum channel distribution:\n\tvar green;\n\tvar red;\n\tfor(var i = 0, n = seqs[0].length; i < n ; i++) {\n\t\tgreen = positionArray[i].T + positionArray[i].G;\n\t\tred = positionArray[i].A + positionArray[i].C;\n\t}\n\treturn (green > 0 && red > 0);\n}", "function parensValid(string){\n // For this algorithm, we're going to use an array to keep track of our opening parentheses\n let check = [];\n\n // Now let's loop through the string we were given\n for(let i = 0; i < string.length; i++) {\n\n // We'll check if each character is an opening parentheses\n if(string[i] == \"(\") {\n // if it is, let's push it into our check array\n check.push(string[i]);\n }\n // Otherwise, let's check 2 things. 1) if the character is a closing parentheses and\n // 2) if the check array has any previously found open parentheses\n\n // If we have not found any open parentheses before, then a closing parentheses means \n // we have an invalid parentheses configuration\n else if (string[i] == \")\" && check.length == 0) {\n // And so, we exit out of everything and call it a day.\n return false;\n }\n // If we HAVE found an open parentheses before, than we have a valid open and close pair,\n // so we can remove the previous open parentheses from our check array.\n else if (string[i] == \")\" && check.length > 0 ) {\n check.pop();\n }\n }\n\n // If, after iterating through the entire string, we STILL have something in our check array, that means\n // we have open parentheses that were never closed!\n if(check.length > 0) {\n // So we say no!\n return false;\n }\n // If that check array is, in fact, empty, then we have a valid parentheses configuration\n else {\n // Hurray!\n return true;\n }\n}" ]
[ "0.6485642", "0.63190293", "0.6194346", "0.61056167", "0.60941476", "0.607304", "0.59655255", "0.5926665", "0.5824737", "0.5817394", "0.57199466", "0.5695219", "0.56815994", "0.56677413", "0.56654525", "0.5638078", "0.5628671", "0.56219906", "0.56219715", "0.55694383", "0.5560148", "0.55372816", "0.5535228", "0.5513403", "0.54893446", "0.54886514", "0.5485745", "0.5476912", "0.5450502", "0.54464316", "0.5429169", "0.5422622", "0.5405347", "0.5396819", "0.53963673", "0.53956914", "0.5391748", "0.5388749", "0.5386328", "0.5374451", "0.53564423", "0.5354335", "0.5344608", "0.5330687", "0.5320983", "0.53194845", "0.531891", "0.5311039", "0.5303223", "0.5299929", "0.52998316", "0.52964497", "0.5294782", "0.527761", "0.5274175", "0.52724123", "0.52716035", "0.5270892", "0.5269614", "0.5266138", "0.5265", "0.52543426", "0.52502406", "0.523879", "0.5232847", "0.5229936", "0.5228414", "0.52277035", "0.5226437", "0.5223176", "0.5218188", "0.5215867", "0.521573", "0.52147794", "0.52142185", "0.5208813", "0.5207719", "0.52040297", "0.5201878", "0.51985455", "0.5195758", "0.519067", "0.51851875", "0.5182119", "0.51735", "0.51730776", "0.51699936", "0.5167173", "0.5159994", "0.5159495", "0.51581895", "0.5157792", "0.5157614", "0.51568204", "0.5152257", "0.5151492", "0.5149346", "0.5149331", "0.5149102", "0.5145317" ]
0.60770273
5
Enable / Disable form button when user filled input
function keyupInput() { if(!!parseFloat(document.getElementById('value').value)) { document.getElementById("Button").disabled = false; document.getElementById("Button").style.backgroundColor = '#edc298'; } else { document.getElementById("Button").disabled = true; document.getElementById("Button").style.backgroundColor = '#9e8065'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableButton() {\n const input = document.querySelector('.form-input');\n const button = document.querySelector('.form-submit');\n input.onkeyup = () => {\n if (input.value.length > 0) {\n button.disabled = false;\n }\n else {\n button.disabled = true;\n }\n };\n}", "function checkForm() {\n var value;\n\n value = document.getElementById(\"ChatLauncherNombre\").value;\n if (value === '') {\n\tdocument.getElementById(\"ChatLauncherStartButton\").disabled = true;\n\treturn;\n }\n \n value = document.getElementById(\"ChatLauncherTelefono\").value;\n if (value === '') {\n\tdocument.getElementById(\"ChatLauncherStartButton\").disabled = true;\n\treturn;\n } \n\n value = document.getElementById(\"ChatLauncherTopicID\").value;\n if (value === '') {\n\tdocument.getElementById(\"ChatLauncherStartButton\").disabled = true;\n\treturn;\n }\n\n \n document.getElementById(\"ChatLauncherStartButton\").disabled = false;\n}", "function habilitar() {\n \n var contr_pasw = document.getElementById(\"contr_pasw\");\n var btn_enviar = document.getElementById(\"btn_enviar\");\n\n if(contr_pasw.value != \"\"){\n btn_enviar.disabled = false;\n }\n else{\n btn_enviar.disabled = true;\n } \n}", "function manage(initials) {\n var bt = document.getElementById('saveScoreBtn');\n if (initials.value != '') {\n bt.disabled = false;\n }\n else {\n bt.disabled = true;\n \n }\n}", "function enableDisableButton() {\n if (\n nameInput.value != '' &&\n emailInput.value != '' &&\n phoneInput.value != '' &&\n messageInput.value != '' &&\n errName.innerHTML == '' &&\n errEmail.innerHTML == '' &&\n errPhone.innerHTML == '' &&\n errMessage.innerHTML == ''\n )\n submitButton.disabled = false\n else submitButton.disabled = true\n}", "function enableOrDisableSubmitButton() {\n\n if (isNameValid &&\n isEmailValid &&\n isPasswordValid &&\n isPasswordMathced) {\n\n if (isStudentSignup) {\n if (isBatchSelected &&\n isProgramSelected &&\n isNumberValid) {\n\n buttonSubmit.prop('disabled', false);\n }\n } else {\n buttonSubmit.prop('disabled', false);\n }\n\n } else {\n buttonSubmit.prop('disabled', true);\n }\n\n }", "function toggleButton() {\n if (pinInputElement.value) {\n submitButtonElement.removeAttribute('disabled');\n } else {\n submitButtonElement.setAttribute('disabled', 'true');\n }\n}", "function checkFields(){\n if (!first_name || !last_name || !email){\n setDisableButton('disable_btn');\n }else{\n setDisableButton('');\n }\n }", "function enableInput() {\n inputField.removeAttr('disabled');\n}", "function buttonEnableDisable() {\n\n\tif (input.value.length > 2 ) {\n\t subButton.disabled = false;\n\t}\n\telse {\n\t subButton.disabled = true;\n\t}\n}", "function generateOn() {\n handleClearButton.disabled = true;\n handleReadTextButton.disabled = true;\n handleSubmitButton.disabled = false;\n}", "function toggleButton() {\n if (messageInputElement.value) {\n submitButtonElement.removeAttribute('disabled');\n } else {\n submitButtonElement.setAttribute('disabled', 'true');\n }\n }", "function enableForm() {\n getFormControls().prop('disabled', false).removeClass('disabled');\n cancelButton.prop('disabled', false).show();\n submitButton.prop('disabled', false).show();\n passwordToggleButton.prop('disabled', false);\n editButton.hide().prop('disabled', true);\n }", "function setSaveBtnState(inptval) \r\n{ \r\n let btn=document.getElementById('saveScoreBtn');\r\n if(inptval.value ==='')\r\n { \r\n btn.disabled=true;\r\n }\r\n else\r\n {\r\n btn.disabled=false;\r\n }\r\n}", "function enableSubmitButton() {\n show(\"validate\");\n hide(\"formIsUnvalide\");\n}", "function user_press_enable(_form) {\n\t\t_form.find('input, button, select').each(function() {\n\t\t\t$(this).prop('disabled', false);\n\t\t});\n\t}", "function toggleButton() {\n if (formIsValid) {\n submitBtn.disabled = false\n } else {\n submitBtn.disabled = true\n }\n}", "toggleButton() {\n if (this.noteMessageInput.value) {\n this.addNoteButton.removeAttribute(\"disabled\");\n } else {\n this.addNoteButton.setAttribute(\"disabled\", \"true\");\n }\n }", "function disableButton(str) {\r\n let mark = document.getElementById('turn').value;\r\n if (mark != undefined) {\r\n document.getElementById(str).disabled = true;\r\n}\r\n}", "function mdm_enable() {\n\tdocument.getElementById(\"entry\").value = \"\";\n\tdocument.getElementById(\"entry\").disabled = false;\n\tdocument.getElementById(\"ok_button\").disabled = false;\n}", "function formEnable() {\n document.getElementById(\"fieldsetProfile\").removeAttribute(\"disabled\");\n document.getElementById(\"editProfileBtn\").classList.add(\"visually-hidden\");\n document.getElementById(\"updateProfileBtn\").classList.remove(\"visually-hidden\");\n }", "function enableSubmitAnswer() {\n if ($('#answer_text').val()) {\n $('#submit_answer').attr('disabled', false);\n } else {\n $('#submit_answer').attr('disabled', true); \n }\n}", "function toggleButton() {\n if (textInput.value.length < 1) {\n sendButton.classList.add(\"disabled\");\n sendButton.setAttribute(\"disabled\", \"disabled\");\n } else {\n sendButton.classList.remove(\"disabled\");\n sendButton.removeAttribute(\"disabled\");\n }\n}", "function toggleButton() {\n if (messageInputElement.value) {\n submitButtonElement.removeAttribute('disabled');\n } else {\n submitButtonElement.setAttribute('disabled', 'true');\n }\n}", "function toggleButton() {\n if (messageInputElement.value) {\n submitButtonElement.removeAttribute('disabled');\n } else {\n submitButtonElement.setAttribute('disabled', 'true');\n }\n}", "function checkInfo (){\n //first check for info \n if (guess.value === \"\") {\n // If no info disable button \n guessSubmit.setAttribute(\"disabled\", \"true\");\n reset.setAttribute(\"disabled\", \"true\");\n clear.setAttribute(\"disabled\", \"true\");\n }\n //If info then enable button\n else {\n guessSubmit.removeAttribute(\"disabled\");\n reset.removeAttribute(\"disabled\");\n clear.removeAttribute(\"disabled\");\n }\n\n}", "checkValidationForm(){\n this.me.checkValidity() && this.isPasswordConfirmed() \n ? this.me.querySelector('button').removeAttribute('disabled')\n : this.me.querySelector('button').setAttribute('disabled', true);\n }", "function btnCheck() {\n let btn = document.getElementById('search-btn');\n\n if (query.value.length === 0) {\n setAttribute(btn, 'disabled', 'true');\n } else {\n btn.removeAttribute('disabled');\n }\n}", "enable () {\n this.getFormElement().removeAttribute('disabled');\n this.getUIElement().classList.remove(this.options.disabledClass);\n }", "function checkSubmitButton() {\n if ($('#over18').val() && $('#privacy').val() && $('#name').val() && $('#email').val()) {\n $('#submit').removeAttr('disabled')\n } else {\n $('#submit').attr('disabled', 'disabled')\n }\n}", "function validateBtn (val) {\n let btnDOM = document.getElementById(\"button\")\n \n // IF THE INPUT HAS A VALUE LENGTH LESS THEN 1 BUTTON IS DISABLED \n if( val.length <1 ) { \n btnDOM.disabled = true \n btnDOM.innerHTML=\"Enter stock symbol\"\n } // ELSE BUTTON IS ENABLED WITH SOME ADDED TEXT\n else { btnDOM.disabled = false; btnDOM.innerHTML=\"Request Data\" }\n}", "function validateButton(){\n if(validateEmail() == true && validateName() == true && validateMessage() == true){\n $('.sendButton').removeAttr('disabled');\n }\n }", "enableSubmit() {\n\t\tlet enabled = this.login.username.length > 0 && this.login.password.length > 0;\n\t\tif (this.state.submitButtonEnabled !== enabled) {\n\t\t\tthis.state.submitButtonEnabled = enabled;\n\t\t\tetch.update(this);\n\t\t}\n\t}", "enable() {\n var self = this;\n self.input.disabled = false;\n self.control_input.disabled = false;\n self.control_input.tabIndex = self.tabIndex;\n self.isDisabled = false;\n self.unlock();\n }", "function disableTRUE(){\n \t\t $('#letterButton').prop(\"disabled\", true);\n \t\t $('#letterInput').prop(\"disabled\", true);\n \t\t $('#checkWord').prop(\"disabled\", true);\n \t\t $('#challengeButton').prop(\"disabled\", true);\n\t }", "checkButton() {\r\n if (this.checkEmail() === false || this.checkPhone() === false || this.checkAddress() === false || this.checkName() === false) {\r\n this.state.buttonControl = 'disabled';\r\n } else {\r\n this.state.buttonControl = '';\r\n }\r\n }", "function toggleAllowInput(isEnabled) {\n if (isEnabled) {\n $(\".conf-ctl\").removeClass(\"disabled\");\n $(\".conf-ctl:input\").attr(\"disabled\", false);\n } else {\n $(\".conf-ctl\").addClass(\"disabled\");\n $(\".conf-ctl:input\").attr(\"disabled\", true);\n }\n\n }", "function refreshButton(){\n //if the state of both validMood and validTrigger are true, enable the button, othwerwise disable\n if( !! valid['#mood-menu option'] && !! valid['#trigger-menu option']){\n $('button').prop('disabled', false);\n } else {\n $('button').prop('disabled', true);// button disabled\n }\n }", "function enableEnter(event) {\n if (titleInput.value != \"\" && urlInput.value != \"\"){\n submitButton.disabled = false;\n }\n else if (titleInput.value == \"\" || urlInput.value == \"\"){\n submitButton.disabled = true;\n\n }\n else {\n submitButton.disabled = true;\n }\n}", "function enableButton () {\n $(element).removeClass(options.waitClass)\n $(element).removeAttr('disabled')\n\n if (element.value) {\n element.value = originalText\n } else {\n element.innerHTML = originalText\n }\n }", "function verifForm() {\n if(document.getElementById(\"prenom\").value != \"\" && \n document.getElementById(\"nom\").value!= \"\" && \n document.getElementById(\"adresse\").value != \"\" && \n document.getElementById(\"ville\").value != \"\" &&\n document.getElementById(\"email\").value != \"\") {\n document.getElementById(\"confirmCommand\").disabled=false;\n } else {\n document.getElementById(\"confirmCommand\").disabled=true;\n }\n}", "function disable (){\n $(\"#updateStudentForm :input\").prop(\"disabled\", true);\n}", "function enableFormFields(event) {\n aForm = event.data.f;\n aButton = event.data.b\n console.log('aButton: ' + aButton);\n $(aForm + ' input[disabled]').removeAttr(\"disabled\");\n $(aForm + ' select[disabled]').removeAttr(\"disabled\");\n if(aButton) {\n $(aButton).attr('disabled', 'disabled');\n }\n }", "function fanTuriYozishUpdate() {\n let nomi = document.forms['updateFanTuriForm']['nomiUpdate'].value;\n let tugma = document.getElementById('fanTuriUpdate');\n if (nomi == \"\") {\n tugma.disabled = true;\n } else {\n tugma.disabled = false;\n }\n}", "function enableChangeButton() {\t\t\n\tvar xbutton = document.getElementById(\"enableChange\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"enableChange\").removeAttribute('hidden');\n\t}\n\treturn true;\n}", "function setEnabled(enable) {\n\t\t\t\t\t$(element).find(\"input\")[0].disabled = enable?false:\"disabled\";\n\t\t\t\t}", "function enableRegister() {\n $('#register-submit').prop( \"disabled\", false );\n }", "function handleDisable(){\n var button = document.getElementById(\"build\");\n var inputText = document.getElementById(\"text_input\");\n if(inputText.value == 0 || inputText.value == \"\" || inputText.value == null){\n button.disabled = true;\n }\n else{\n button.disabled = false;\n }\n}", "function enable() {\n buttonReservation.removeAttribute(\"disabled\");\n }", "function disableButton() {\n var saveButton = $('.save-btn');\n if ($('#title-input').val() !== \"\" && $('#body-input').val() !== \"\") {\n $('.save-btn').removeAttr('disabled');\n } else if ($('#title-input').val() === \"\" || $('#body-input').val() === \"\") {\n $('.save-btn').attr(\"disabled\", true);\n }\n}", "function generateOff() {\n handleClearButton.disabled = false;\n handleReadTextButton.disabled = false;\n handleSubmitButton.disabled = true;\n}", "function setActive() {\n if (document.querySelector('#roundedges').value.length > 0)\n document.querySelector('.roundedgesbtn').disabled = false;\n else\n document.querySelector('.roundedgesbtn').disabled = true;\n}", "function activarBotonAgregar(txtProducto,txtCantidaProducto){\n if( $(txtCantidaProducto).val() !== \"\" ){\n $(txtProducto).prop('disabled', false);\n }else{\n $(txtProducto).prop('disabled', true);\n }\n}", "function deButton() {\n if(document.getElementById(\"submitSignUp\")) {\n document.getElementById(\"submitSignUp\").disabled = true;\n }\n}", "function onChange() {\n setDisabled(!disabled);\n }", "function user_press_disabled(_form) {\n\t\t_form.find('input, button, select').each(function() {\n\t\t\t$(this).prop('disabled', true);\n\t\t});\n\t}", "function addressfinderinput() {\r\n var empty = false;\r\n $('.input--findaddress').each(function() {\r\n if ($(this).val() == '') {\r\n empty = true;\r\n }\r\n });\r\n\r\n if (empty) {\r\n $('.btn--findaddress').attr('disabled', 'disabled');\r\n } else {\r\n $('.btn--findaddress').removeAttr('disabled');\r\n }\r\n }", "function newDeviceInfoUpdatedButton() {\n /*\n\tdomUpdateDeviceInfoFormSubmitButton.disabled = true;\n\tif (newDisplayOrderInput.value.length > 0 || newFriendlyNameInput.value.length > 0 || newDeviceNotesInput.value.length > 0 ) {\n domUpdateDeviceInfoFormSubmitButton.disabled = false;\n\t}\n */\n }", "enableSubmit() {\n this._disableSubmit = false;\n }", "function submitButtonEnable(){\n $(conformation_cb).on( 'click', function() {\n if ($(submit_request).attr('disabled') == 'disabled') {\n $(submit_request).removeAttr('disabled');\n } else {\n $(submit_request).attr('disabled','disabled')\n } \n });\n}", "function disableInput() {\n inputField.attr('disabled', 'disabled');\n}", "function validateButton() {\n\tbutton.disabled = !(!_parameters.params.origin.code === false && !_parameters.params.destination.code === false);\n}", "function isDisable() {\n var value = document.getElementById(\"form-question-7\");\n if (value.value.toLowerCase() == \"tak\") {\n document.getElementById(\"form-question-8\").disabled = false;\n } else document.getElementById(\"form-question-8\").disabled = true;\n}", "function enableSubmit() {\n submitButton.removeAttribute('disabled');\n }", "function otkljucajDugmeNastavi() {\r\n if(formValidacija.ime && formValidacija.email && formValidacija.telefon)\r\n {\r\n $('#btnDaljeKorisnik').removeAttr('disabled');\r\n }\r\n else {\r\n $('#btnDaljeKorisnik').attr('disabled', true);\r\n }\r\n}", "function enableSave() {\n var titleInput = $('.js-title-input').val().trim();\n var bodyInput = $('.js-body-input').val().trim();\n var isDisabled = (!titleInput || !bodyInput);\n $('.js-save-btn').prop('disabled', isDisabled);\n}", "function formVal () {\n creditCheck ();\n if (payment.options[1].value === payment.value) {\n if (firstName.value === \"\") {\n registerButton.disabled = true;\n } else if (emailResult === false) {\n registerButton.disabled = true;\n } else if (checkBoxResult === false) {\n registerButton.disabled = true; \n } else if (creditCardResult === false) {\n registerButton.disabled = true; \n } else if (zipResult === false) {\n registerButton.disabled = true; \n } else if (cvvResult === false) {\n registerButton.disabled = true; \n } else {\n registerButton.disabled = false; \n }\n } else {\n if (firstName.value === \"\") {\n registerButton.disabled = true;\n } else if (emailResult === false) {\n registerButton.disabled = true;\n } else if (checkBoxResult === false) {\n registerButton.disabled = true; \n } else {\n registerButton.disabled = false; \n } \n }\n if (registerButton.disabled === true) {\n registerButton.style.color = 'white';\n registerButton.style.backgroundColor = 'grey';\n registerButton.style.cursor = 'not-allowed';\n } else {\n registerButton.style.color = null;\n registerButton.style.backgroundColor = null;\n registerButton.style.cursor = 'pointer';\n }\n}", "function enabledInputBrowse(boo, input1, input2, boton) {\r\n\tdocument.getElementById(input1).value = \"\";\r\n\tdocument.getElementById(input2).value = \"\";\r\n\tdocument.getElementById(boton).disabled = !boo;\r\n}", "function updateVerifyCodeButtonUI() {\n //alert(!!window.verifyingCode|| !getCodeFromUserInput());\n document.getElementById('verify-code-button').disabled =\n !!window.verifyingCode\n || !getCodeFromUserInput();\n }", "function checkForm(){\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){\n btn.disabled = false; //enable submit btn if form filled correctly\n }else{\n btn.disabled = true;\n }\n }", "checkButton()\n {\n if(this.imeModel==\"\" || this.emailModel==\"\" || this.telefonModel==\"\")\n {\n this.butShow=false;\n }\n else\n {\n this.butShow=true;\n }\n }", "function submitController(){\n if (errors.nombre|| errors.primerEscrito || errors.primerParcial || errors.segundoEscrito || errors.segundoParcial || errors.tercerEscrito || errors.faltas) {\n submitButton.toggleAttribute('disabled', true)\n } else {\n submitButton.toggleAttribute('disabled', false)\n }\n}", "function enableInputs() {\n Array.from(emailForm.children).forEach((item) => {\n if (item.tagName === \"INPUT\" || item.tagName === \"TEXTAREA\") {\n item.disabled = false;\n\n if (item.type !== \"submit\") {\n item.style.transition = \"color 1.5s\";\n item.style.color = \"#fff\";\n }\n }\n });\n }", "function decisionSubmit() {\n\n // press button\n $('input[value=\"send\"]').select().click();\n\n // disable all input while sending\n $(\"input\").prop(\"disabled\", true);\n\n}", "function fanTuriYozish() {\n let nomi = document.forms['createFanTuriForm']['nomi'].value;\n let tugma = document.getElementById('fanTuriQushish');\n if (nomi == \"\") {\n tugma.disabled = true;\n } else {\n tugma.disabled = false;\n }\n}", "function blockInput() {\n var form = document.getElementById(\"form\");\n if (form != null) {\n var elements = form.elements;\n for (var i = 0, len = elements.length; i < len; ++i) {\n elements[i].disabled = true;\n }\n } else {\n var button = document.getElementById(\"register\");\n if (button != null) {\n button.disabled = true;\n }\n }\n}", "function enablebtnProceed(){\n $('#btnProceed').prop('disabled', false);\n}", "function enablebtnProceed(){\n $('#btnProceed').prop('disabled', false);\n}", "function usernameGood(button, usernameField){\n button.disabled = false;\n}", "enabledEditMode() {\n\n this.state.inEdit = true;\n var vinput = document.getElementById(\"valueInput\" + this.state.id)\n vinput.disabled = !this.state.inEdit\n\n }", "function enabledisablesubmit() {\n if (firstnameinput.value && lastnameinput.value && ageinput.value) {\n if (parseInt(ageinput.value) >= 18 && licenseinput.value) {\n submit.disabled = false;\n } else if (parseInt(ageinput.value) < 18 && !licenseinput.value) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n }\n } else {\n submit.disabled = true;\n }\n}", "function Validate() {\n var correctForm = true;\n \n if (document.getElementById(\"Name\").value == \"\") {\n \n correctForm = false;\n }\n \n \n if (document.getElementById(\"Email\").value == \"\") {\n \n correctForm = false;\n }\n \n \n if (document.getElementById(\"PhoneNumber\").value == \"\") {\n \n correctForm = false;\n }\n \n if (correctForm == false) {\n \n $(\"#EditBtn\").prop('disabled', true);\n \n\n }\n else {\n $(\"#EditBtn\").prop('disabled', false);\n \n }\n}", "function enable_input() {\r\n\targ=enable_input.arguments;\r\n\tfor(i=0;i<arg.length;i++) {\r\n\t\tif(typeof(arg[i]) == 'string') _z = _ge(arg[i]);\r\n\t\telse if (typeof(arg[i]) != null) _z = arg[i];\r\n\t\t else return;\r\n\t\tif (_z && typeof(_z.disabled) == 'boolean') {\r\n\t\t\tif (_z.type && _z.type == 'text') _z.style.backgroundColor='white';\r\n\t\t\t_z.disabled=false;\r\n\t\t}\r\n\t}\r\n}", "function btnValid() {\n let isValid = true;\n loginInput.each((index, item) => {\n isValid = isValid && !!$(item).val();\n })\n const passwordMatch = $('#password').val() === $('#confirm_password').val();\n\n isValid = isValid && passwordMatch;\n\n loginBtn.attr('disabled', !isValid)\n }", "function disableInput() {\n myInput.disabled = true;\n}", "function enableSubmit(myval) {\n //Submit Disable Activition and Color\n\tif(myval.checked == true)\n\t{\n\t\tdocument.getElementById('submit').disabled = false;//Submit Disable Activition\n\t\tdocument.getElementById('submit').style.color = '#000';//Submit Disable Activition Color\n\t}\n //Submit Able Activition and Color\n\tif(myval.checked == false)\n\t{\n\t\tdocument.getElementById('submit').disabled = true;//Submit Able Activition\n\t\tdocument.getElementById('submit').style.color = '#eee';//Submit Able Activition Color\n\t}\n}", "function checkForm() {\n\n if (s1 && s2) {\n $(\"#configure-button\").attr(\"disabled\", false);\n } else {\n $(\"#configure-button\").attr(\"disabled\", true);\n }\n\n}", "function fin()\r\n{\r\n // deshabilitamos el casilla de entrar el numero, y el\r\n // boton de enviar\r\n document.getElementById(\"numero\").disabled=true;\r\n document.getElementById(\"btnEnviar\").disabled=true;\r\n}", "function disableOrEnableEditButton(){\n // gdy po przejsciu przez ponizszego for'a, flag będzie true, to znaczy\n // że wszystkie pola sa poprawnie uzupełnione i można aktywowac przycisk\n let flag = true;\n const btnRegister = $('#editUserInfoButton');\n\tfor (var k in validationObjects){\n\t\tif (validationObjects.hasOwnProperty(k)) {\n\t\t\tif(!validationObjects[k][1]){\n\t\t\t\tbtnRegister.removeClass(\"btnSaveEdit\");\n\t\t\t\tbtnRegister.addClass(\"btnSaveEditDisabled\");\n btnRegister.attr(\"disabled\", \"disabled\");\n flag = false;\n\t\t\t}\n\t\t}\n }\n if(flag){\n // wszystkie elementy poprawne, można aktywować przycisk Register\n btnRegister.removeClass(\"btnSaveEditDisabled\");\n btnRegister.addClass(\"btnSaveEdit\");\n btnRegister.removeAttr(\"disabled\");\n }\n}", "function disableChangeButton() {\t\t\n\tvar xbutton = document.getElementById(\"enableChange\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"enableChange\").setAttribute('hidden', 'true');\n\t}\n\treturn true;\n}", "function enableButton ( button ){\n button.disabled = false;\n}", "function enableEdit() {\n $('input[readonly]').prop('readonly', false);\n $('.enable-edit').addClass('d-none');\n $('.submit-button').removeClass('d-none');\n}", "function disableBtn() {\n // document.getElementById(idElement).disabled = true;\n $uWbuttonEdit.disabled = true;\n $uWbuttonEditUser.disabled = true;\n $uWbuttonEditEmail.disabled = true;\n $uWbuttonEditPassword.disabled = true;\n $uWbuttonEditRegion.disabled = true;\n}", "function checkInput() {\n if (inputText.value === \"\") {\n hideButton();\n } else {\n showButton();\n }\n }", "function data_valid() {\n\tif (passName === true && passPrivilege === true) {\n\t\tsubmit.disabled = false;\n\t} else {\n\t\tsubmit.disabled = true;\n\t}\n}", "function updateSignInButtonUI() {\n document.getElementById('quickstart-sign-in').disabled =\n !isCaptchaOK()\n || !isPhoneNumberValid()\n || !!window.signingIn;\n }", "validateForm() {\r\n if(this.getInputVal(this.inputBill) !== \"\" && \r\n this.getInputVal(this.inputPeople) !== \"\" &&\r\n (this.getInputVal(this.inputCustom) !== \"\" || \r\n this.percentageBtns.some(btn => btn.classList.contains(\"active\")))) \r\n {\r\n this.disableReset(false);\r\n return true;\r\n }\r\n else {\r\n this.disableReset(true);\r\n this.displayResult(\"__.__\", \"__.__\");\r\n return false;\r\n }\r\n }", "disable () {\n this.getFormElement().setAttribute('disabled', 'true');\n this.getUIElement().classList.add(this.options.disabledClass);\n }", "function submit_btn() {\n var btn = document.getElementById(\"submit-btn\");\n\n if (\n urnFlage &&\n passFlage &&\n cpassFlage &&\n nameFlage &&\n emailFlage &&\n phoneFlage\n ) {\n btn.disabled = false;\n btn.style.backgroundColor = \"green\";\n } else {\n btn.style.backgroundColor = \"#a30000\";\n btn.disabled = true;\n }\n}", "function enabledInput(boo, input) {\r\n\tdocument.getElementById(input).disabled = !boo;\r\n}", "function disableOpinion(){\n console.log(document.getElementById(\"opinionInput\").value)\n document.getElementById(\"opinionInput\").setAttribute(\"disabled\",\"true\");\n document.getElementById(\"sendOpinion\").disable=true;\n}" ]
[ "0.7383982", "0.72251654", "0.715211", "0.7132965", "0.70729905", "0.7038714", "0.70330554", "0.7024157", "0.69708055", "0.69494426", "0.69272727", "0.6921037", "0.69065183", "0.68852717", "0.6884972", "0.68826354", "0.68753934", "0.6831376", "0.68268913", "0.68108326", "0.6788397", "0.67774826", "0.6775706", "0.67457175", "0.67457175", "0.67418426", "0.6733614", "0.6719525", "0.6718848", "0.6700618", "0.6692959", "0.66671115", "0.66639566", "0.6650997", "0.6649147", "0.6641573", "0.66342986", "0.6631215", "0.66248226", "0.66153747", "0.6606667", "0.66039914", "0.6594125", "0.6589757", "0.6586313", "0.65807146", "0.6577426", "0.655034", "0.65481555", "0.65460974", "0.6535496", "0.6534406", "0.65256023", "0.6525237", "0.65247595", "0.65230364", "0.6521148", "0.6518593", "0.6517589", "0.65085375", "0.6503922", "0.6502763", "0.6500674", "0.6483248", "0.64742446", "0.64729065", "0.6471397", "0.64699274", "0.6459368", "0.64525473", "0.6449125", "0.64438057", "0.64437", "0.64375645", "0.64362407", "0.6429357", "0.64293075", "0.64293075", "0.64053255", "0.6404789", "0.6401809", "0.6390195", "0.63839084", "0.6382952", "0.63804096", "0.63774407", "0.6368458", "0.6367071", "0.63524646", "0.63465863", "0.6332053", "0.6330439", "0.63248223", "0.63241166", "0.63204354", "0.631971", "0.6317222", "0.63165075", "0.6312828", "0.6303154", "0.63006926" ]
0.0
-1
matcheds 3rd party API output to CSS emotion
emotionPicker() { let emotionalRendering; console.log("this is this.props.emotionInput ", this.props.emotionInput) if (this.props.emotionInput == "Verypositive") { emotionalRendering = <input id="happy" type="radio" name="smiley" defaultValue="Happy" checked={true} className="emotion-radio"/> console.log("Emotion component will choose happy face") } else if (this.props.emotionInput == "Positive") { emotionalRendering = <input id="happy" type="radio" name="smiley" defaultValue="Happy" checked={true} className="emotion-radio"/> console.log("Emotion component will choose happy face") } else if (this.props.emotionInput == "Negative") { emotionalRendering = <input id="angry" type="radio" name="smiley" defaultValue="Angry" checked={true} className="emotion-radio"/> console.log("Emotion component will choose mad face") } else if (this.props.emotionInput == "Neutral") { emotionalRendering = <input id="normal" type="radio" name="smiley" defaultValue="Normal" checked={true} className="emotion-radio"/> console.log("Emotion component will choose neutral face") } else if (this.props.emotionInput == "Verynegative") { emotionalRendering = <input id="furious" type="radio" name="smiley" defaultValue="Furious" checked={true} className="emotion-radio"/> console.log("Emotion component will choose furious mad face") } else { console.log("Emotion cannot be chosen, incorrect input") } return emotionalRendering; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_css$l() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-18ymnss-style\";\n\tstyle.textContent = \".wrapper.svelte-18ymnss.svelte-18ymnss{height:var(--size);width:var(--size);position:relative;display:flex;justify-content:center;align-items:center}.wrapper.svelte-18ymnss .svelte-18ymnss{line-height:0;box-sizing:border-box}.spinner-inner.svelte-18ymnss.svelte-18ymnss{height:var(--size);width:var(--size);transform:scale(calc(var(--size) / 70))}.mask.svelte-18ymnss.svelte-18ymnss{position:absolute;border-radius:2px;overflow:hidden;perspective:1000;backface-visibility:hidden}.plane.svelte-18ymnss.svelte-18ymnss{background:var(--color);width:400%;height:100%;position:absolute;z-index:100;perspective:1000;backface-visibility:hidden}#top.svelte-18ymnss .plane.svelte-18ymnss{z-index:2000;animation:svelte-18ymnss-trans1 var(--duration) ease-in infinite 0s backwards}#middle.svelte-18ymnss .plane.svelte-18ymnss{transform:translate3d(0px, 0, 0);background:var(--rgba);animation:svelte-18ymnss-trans2 var(--duration) linear infinite calc(var(--duration)/4) backwards}#bottom.svelte-18ymnss .plane.svelte-18ymnss{z-index:2000;animation:svelte-18ymnss-trans3 var(--duration) ease-out infinite calc(var(--duration)/2) backwards}#top.svelte-18ymnss.svelte-18ymnss{width:53px;height:20px;left:20px;top:5px;transform:skew(-15deg, 0);z-index:100}#middle.svelte-18ymnss.svelte-18ymnss{width:33px;height:20px;left:20px;top:21px;transform:skew(-15deg, 40deg)}#bottom.svelte-18ymnss.svelte-18ymnss{width:53px;height:20px;top:35px;transform:skew(-15deg, 0)}@keyframes svelte-18ymnss-trans1{from{transform:translate3d(53px, 0, 0)}to{transform:translate3d(-250px, 0, 0)}}@keyframes svelte-18ymnss-trans2{from{transform:translate3d(-160px, 0, 0)}to{transform:translate3d(53px, 0, 0)}}@keyframes svelte-18ymnss-trans3{from{transform:translate3d(53px, 0, 0)}to{transform:translate3d(-220px, 0, 0)}}\";\n\tappend(document.head, style);\n}", "function add_css$2(target) {\n\t\tappend_styles(target, \"svelte-19lt9ee\", \".chat_msg_item_admin.svelte-19lt9ee{overflow-wrap:break-word;letter-spacing:.1px;text-rendering:optimizeLegibility;font-family:'Roboto';font-weight:500;-webkit-font-smoothing:antialiased;font-size:12px;line-height:18px;position:relative;margin:8px 0 15px 0;padding:8px 10px;max-width:60%;display:block;border-radius:3px;animation:zoomIn .5s cubic-bezier(.42, 0, .58, 1);clear:both;z-index:999;margin-left:60px;float:left;background:rgba(0, 0, 0, 0.03);color:#666}.chat_avatar.svelte-19lt9ee{letter-spacing:.1px;text-rendering:optimizeLegibility;font-family:'Roboto';font-weight:500;-webkit-font-smoothing:antialiased;font-size:12px;line-height:18px;color:#666;position:absolute;top:0;width:40px;height:40px;text-align:center;border-radius:50%;left:-52px;background:rgba(0, 0, 0, 0.03)}img.svelte-19lt9ee{letter-spacing:.1px;text-rendering:optimizeLegibility;font-family:'Roboto';font-weight:500;-webkit-font-smoothing:antialiased;font-size:12px;line-height:18px;color:#666;width:40px;height:40px;text-align:center;border-radius:50%}\");\n\t}", "function get_css_by_screensize(size) {\n\n if (iframe.find(\".yp_current_styles\").length <= 0) {\n return '';\n }\n\n var totalCreated, classes, selector, data;\n\n totalCreated = '';\n\n iframe.find(\".yp_current_styles:not(.yp_step_end)[data-size-mode='\" + size + \"']\").each(function () {\n\n if (!$(this).hasClass(\"yp_step_end\")) {\n\n if ($(this).first().html().indexOf(\"@media\") != -1) {\n data = $(this).first().html().split(\"{\")[1] + \"{\" + $(this).first().html().split(\"{\")[2].replace(\"}}\", \"}\");\n } else {\n data = $(this).first().html();\n }\n\n data = data.replace(/\\/\\*(.*?)\\*\\//g, \"\");\n\n selector = data.split(\"{\")[0];\n\n totalCreated += selector + \"{\\r\";\n\n classes = $(this).data(\"style\");\n\n iframe.find(\"style[data-style=\" + classes + \"][data-size-mode='\" + size + \"']\").each(function () {\n\n var datai;\n if ($(this).first().html().indexOf(\"@media\") != -1) {\n datai = $(this).first().html().split(\"{\")[1] + \"{\" + $(this).first().html().split(\"{\")[2].replace(\"}}\", \"}\");\n } else {\n datai = $(this).first().html();\n }\n\n totalCreated += \"\\t\" + datai.split(\"{\")[1].split(\"}\")[0] + ';\\r';\n\n $(this).addClass(\"yp_step_end\");\n\n });\n\n totalCreated += \"}\\r\\r\";\n\n $(this).addClass(\"yp_step_end\");\n\n }\n\n });\n\n iframe.find(\".yp_step_end\").removeClass(\"yp_step_end\");\n\n return totalCreated;\n\n }", "function add_css$2() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-yxps3a-style\";\n\tstyle.textContent = \".wrapper.svelte-yxps3a{width:var(--size);height:var(--size);display:flex;justify-content:center;align-items:center;line-height:0;box-sizing:border-box}.inner.svelte-yxps3a{transform:scale(calc(var(--floatSize) / 52))}.ball-container.svelte-yxps3a{animation:svelte-yxps3a-ballTwo var(--duration) infinite;width:44px;height:44px;flex-shrink:0;position:relative}.single-ball.svelte-yxps3a{width:44px;height:44px;position:absolute}.ball.svelte-yxps3a{width:20px;height:20px;border-radius:50%;position:absolute;animation:svelte-yxps3a-ballOne var(--duration) infinite ease}.ball-top-left.svelte-yxps3a{background-color:var(--ballTopLeftColor);top:0;left:0}.ball-top-right.svelte-yxps3a{background-color:var(--ballTopRightColor);top:0;left:24px}.ball-bottom-left.svelte-yxps3a{background-color:var(--ballBottomLeftColor);top:24px;left:0}.ball-bottom-right.svelte-yxps3a{background-color:var(--ballBottomRightColor);top:24px;left:24px}@keyframes svelte-yxps3a-ballOne{0%{position:absolute}50%{top:12px;left:12px;position:absolute;opacity:0.5}100%{position:absolute}}@keyframes svelte-yxps3a-ballTwo{0%{transform:rotate(0deg) scale(1)}50%{transform:rotate(360deg) scale(1.3)}100%{transform:rotate(720deg) scale(1)}}\";\n\tappend(document.head, style);\n}", "function add_css$2() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-42yfje-style\";\n \tstyle.textContent = \".cl-editor-modal.svelte-42yfje.svelte-42yfje{position:absolute;top:37px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);max-width:520px;width:100%;height:140px;backface-visibility:hidden;z-index:11}.cl-editor-overlay.svelte-42yfje.svelte-42yfje{position:absolute;background-color:rgba(255,255,255,.5);height:100%;width:100%;left:0;top:0;z-index:10}.modal-box.svelte-42yfje.svelte-42yfje{position:absolute;top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);max-width:500px;width:calc(100% - 20px);padding-bottom:36px;z-index:1;background-color:#FFF;text-align:center;font-size:14px;box-shadow:rgba(0,0,0,.2) 0 2px 3px;-webkit-backface-visibility:hidden;backface-visibility:hidden}.modal-title.svelte-42yfje.svelte-42yfje{font-size:24px;font-weight:700;margin:0 0 20px;padding:2px 0 4px;display:block;border-bottom:1px solid #EEE;color:#333;background:#fbfcfc}.modal-label.svelte-42yfje.svelte-42yfje{display:block;position:relative;margin:15px 12px;height:29px;line-height:29px;overflow:hidden}.modal-label.svelte-42yfje input.svelte-42yfje{position:absolute;top:0;right:0;height:27px;line-height:25px;border:1px solid #DEDEDE;background:#fff;font-size:14px;max-width:330px;width:70%;padding:0 7px;transition:all 150ms}.modal-label.svelte-42yfje input.svelte-42yfje:focus{outline:none}.input-error.svelte-42yfje input.svelte-42yfje{border:1px solid #e74c3c}.input-info.svelte-42yfje.svelte-42yfje{display:block;text-align:left;height:25px;line-height:25px;transition:all 150ms}.input-info.svelte-42yfje span.svelte-42yfje{display:block;color:#69878f;background-color:#fbfcfc;border:1px solid #DEDEDE;padding:1px 7px;width:150px}.input-error.svelte-42yfje .input-info.svelte-42yfje{margin-top:-29px}.input-error.svelte-42yfje .msg-error.svelte-42yfje{color:#e74c3c}.modal-button.svelte-42yfje.svelte-42yfje{position:absolute;bottom:10px;right:0;text-decoration:none;color:#FFF;display:block;width:100px;height:35px;line-height:33px;margin:0 10px;background-color:#333;border:none;cursor:pointer;font-family:\\\"Lato\\\",Helvetica,Verdana,sans-serif;font-size:16px;transition:all 150ms}.modal-submit.svelte-42yfje.svelte-42yfje{right:110px;background:#2bc06a}.modal-reset.svelte-42yfje.svelte-42yfje{color:#555;background:#e6e6e6}\";\n \tappend(document.head, style);\n }", "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-5qo5ik-style';\n \tstyle.textContent = \".codemirror-container.svelte-5qo5ik{position:relative;width:100%;height:100%;border:none;line-height:1.5;overflow:hidden}.codemirror-container.svelte-5qo5ik .CodeMirror{height:100%;background:transparent;font:400 14px/1.7 var(--font-mono);color:var(--base)}.codemirror-container.flex.svelte-5qo5ik .CodeMirror{height:auto}.codemirror-container.flex.svelte-5qo5ik .CodeMirror-lines{padding:0}.codemirror-container.svelte-5qo5ik .CodeMirror-gutters{padding:0 16px 0 8px;border:none}.codemirror-container.svelte-5qo5ik .error-loc{position:relative;border-bottom:2px solid #da106e}.codemirror-container.svelte-5qo5ik .error-line{background-color:rgba(200, 0, 0, .05)}textarea.svelte-5qo5ik{visibility:hidden}pre.svelte-5qo5ik{position:absolute;width:100%;height:100%;top:0;left:0;border:none;padding:4px 4px 4px 60px;resize:none;font-family:var(--font-mono);font-size:13px;line-height:1.7;user-select:none;pointer-events:none;color:#ccc;tab-size:2;-moz-tab-size:2}.flex.svelte-5qo5ik pre.svelte-5qo5ik{padding:0 0 0 4px;height:auto}\";\n \tappend(document.head, style);\n }", "function add_css$g() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1a4ojx1-style\";\n\tstyle.textContent = \".wrapper.svelte-1a4ojx1{position:relative;display:flex;justify-content:center;align-items:center;width:var(--size);height:var(--size)}.ring.svelte-1a4ojx1{position:absolute;border:2px solid var(--color);border-radius:50%;background-color:transparent;animation:svelte-1a4ojx1-motion var(--duration) ease infinite}@keyframes svelte-1a4ojx1-motion{0%{transform:translateY(var(--motionOne))}50%{transform:translateY(var(--motionTwo))}100%{transform:translateY(var(--motionThree))}}\";\n\tappend(document.head, style);\n}", "function add_css$4() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-hc4l1g-style\";\n\tstyle.textContent = \".svelte-hc4l1g{overflow:hidden;position:relative;text-indent:-9999px;display:inline-block;background:#f86;border-radius:50%;transform:rotateZ(90deg);transform-origin:50% 50%;animation:svelte-hc4l1g-plus-loader-background var(--duration) infinite ease-in-out}.svelte-hc4l1g:after{background:#f86;border-radius:50% 0 0 50%;content:\\\"\\\";position:absolute;right:50%;top:0;width:50%;height:100%;transform-origin:100% 50%;animation:svelte-hc4l1g-plus-loader-top var(--duration) infinite linear}.svelte-hc4l1g:before{background:#fc6;border-radius:50% 0 0 50%;content:\\\"\\\";position:absolute;right:50%;top:0;width:50%;height:100%;transform-origin:100% 50%;animation:svelte-hc4l1g-plus-loader-bottom var(--duration) infinite linear}@keyframes svelte-hc4l1g-plus-loader-top{2.5%{background:#f86;transform:rotateY(0deg);animation-timing-function:ease-in}13.75%{background:#ff430d;transform:rotateY(90deg);animation-timing-function:step-start}13.76%{background:#ffae0d;transform:rotateY(90deg);animation-timing-function:ease-out}25%{background:#fc6;transform:rotateY(180deg)}27.5%{background:#fc6;transform:rotateY(180deg);animation-timing-function:ease-in}41.25%{background:#ffae0d;transform:rotateY(90deg);animation-timing-function:step-start}41.26%{background:#2cc642;transform:rotateY(90deg);animation-timing-function:ease-out}50%{background:#6d7;transform:rotateY(0deg)}52.5%{background:#6d7;transform:rotateY(0deg);animation-timing-function:ease-in}63.75%{background:#2cc642;transform:rotateY(90deg);animation-timing-function:step-start}63.76%{background:#1386d2;transform:rotateY(90deg);animation-timing-function:ease-out}75%{background:#4ae;transform:rotateY(180deg)}77.5%{background:#4ae;transform:rotateY(180deg);animation-timing-function:ease-in}91.25%{background:#1386d2;transform:rotateY(90deg);animation-timing-function:step-start}91.26%{background:#ff430d;transform:rotateY(90deg);animation-timing-function:ease-in}100%{background:#f86;transform:rotateY(0deg);animation-timing-function:step-start}}@keyframes svelte-hc4l1g-plus-loader-bottom{0%{background:#fc6;animation-timing-function:step-start}50%{background:#fc6;animation-timing-function:step-start}75%{background:#4ae;animation-timing-function:step-start}100%{background:#4ae;animation-timing-function:step-start}}@keyframes svelte-hc4l1g-plus-loader-background{0%{background:#f86;transform:rotateZ(180deg)}25%{background:#f86;transform:rotateZ(180deg);animation-timing-function:step-start}27.5%{background:#6d7;transform:rotateZ(90deg)}50%{background:#6d7;transform:rotateZ(90deg);animation-timing-function:step-start}52.5%{background:#6d7;transform:rotateZ(0deg)}75%{background:#6d7;transform:rotateZ(0deg);animation-timing-function:step-start}77.5%{background:#f86;transform:rotateZ(270deg)}100%{background:#f86;transform:rotateZ(270deg);animation-timing-function:step-start}}\";\n\tappend(document.head, style);\n}", "function add_css(){var style=element(\"style\");style.id=\"svelte-r8gx3p-style\";style.textContent=\"div.svelte-r8gx3p{display:flex;justify-content:center;align-items:center;font-size:inherit;font-family:inherit;padding:0.3em;border-radius:40px;transition:background 150ms ease-in-out}div.svelte-r8gx3p:hover{background:#eeeeee;cursor:pointer}.bn-notify-dark-mode-close-background.svelte-r8gx3p:hover{background:#00222c}\";append(document.head,style)}", "function add_css$m() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-156enpk-style\";\n\tstyle.textContent = \"span.svelte-156enpk{width:var(--size);height:calc(var(--size) / 4);position:relative}div.svelte-156enpk{width:calc(var(--size) / 4);height:calc(var(--size) / 4);position:absolute;left:0;top:0;border-radius:2px;background:var(--color);transform:translateX(-50%) rotate(45deg) scale(0);animation:svelte-156enpk-diamonds var(--duration) linear infinite}div.svelte-156enpk:nth-child(1){animation-delay:calc(var(--duration)*2/3*-1)}div.svelte-156enpk:nth-child(2){animation-delay:calc(var(--duration)*2/3*-2)}div.svelte-156enpk:nth-child(3){animation-delay:calc(var(--duration)*2/3*-3)}@keyframes svelte-156enpk-diamonds{50%{left:50%;transform:translateX(-50%) rotate(45deg) scale(1)}100%{left:100%;transform:translateX(-50%) rotate(45deg) scale(0)}}\";\n\tappend(document.head, style);\n}", "function add_css$6() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1viuzhq-style\";\n\tstyle.textContent = \".wrapper.svelte-1viuzhq{width:var(--size);height:var(--stroke);transform:scale(calc(var(--floatSize) / 75));display:flex;justify-content:center;align-items:center}.line.svelte-1viuzhq{width:var(--size);height:var(--stroke);background:var(--color);border-radius:var(--stroke);transform-origin:center center;animation:svelte-1viuzhq-spineLine var(--duration) ease infinite}@keyframes svelte-1viuzhq-spineLine{0%{transform:rotate(-20deg);height:5px;width:75px}5%{height:5px;width:75px}30%{transform:rotate(380deg);height:5px;width:75px}40%{transform:rotate(360deg);height:5px;width:75px}55%{transform:rotate(0deg);height:5px;width:5px}65%{transform:rotate(0deg);height:5px;width:85px}68%{transform:rotate(0deg);height:5px}75%{transform:rotate(0deg);height:5px;width:1px}78%{height:5px;width:5px}90%{height:5px;width:75px;transform:rotate(0deg)}99%,100%{height:5px;width:75px;transform:rotate(-20deg)}}\";\n\tappend(document.head, style);\n}", "function add_css$8() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1h8zs46-style\";\n\tstyle.textContent = \".wrapper.svelte-1h8zs46{height:calc(var(--size) / 15);width:calc(var(--size) * 2);background-color:var(--rgba);position:relative;overflow:hidden;background-clip:padding-box}.lines.svelte-1h8zs46{height:calc(var(--size) / 15);background-color:var(--color)}.small-lines.svelte-1h8zs46{position:absolute;overflow:hidden;background-clip:padding-box;display:block;border-radius:2px;will-change:left, right;animation-fill-mode:forwards}.small-lines.\\\\31 .svelte-1h8zs46{animation:var(--duration) cubic-bezier(0.65, 0.815, 0.735, 0.395) 0s infinite normal\\r\\n none running svelte-1h8zs46-long}.small-lines.\\\\32 .svelte-1h8zs46{animation:var(--duration) cubic-bezier(0.165, 0.84, 0.44, 1) calc((var(--duration)+0.1)/2) infinite normal\\r\\n none running svelte-1h8zs46-short}@keyframes svelte-1h8zs46-long{0%{left:-35%;right:100%}60%{left:100%;right:-90%}100%{left:100%;right:-90%}}@keyframes svelte-1h8zs46-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}100%{left:107%;right:-8%}}\";\n\tappend(document.head, style);\n}", "function add_css$i() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-vhggjq-style\";\n\tstyle.textContent = \".wrapper.svelte-vhggjq{position:relative;display:flex;justify-content:center;align-items:center;width:var(--size);height:var(--size)}.shadow.svelte-vhggjq{color:var(--color);font-size:var(--size);overflow:hidden;width:var(--size);height:var(--size);border-radius:50%;margin:28px auto;position:relative;transform:translateZ(0);animation:svelte-vhggjq-load var(--duration) infinite ease, svelte-vhggjq-round var(--duration) infinite ease}@keyframes svelte-vhggjq-load{0%{box-shadow:0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em,\\r\\n 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em}5%,95%{box-shadow:0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em,\\r\\n 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em}10%,59%{box-shadow:0 -0.83em 0 -0.4em, -0.087em -0.825em 0 -0.42em,\\r\\n -0.173em -0.812em 0 -0.44em, -0.256em -0.789em 0 -0.46em,\\r\\n -0.297em -0.775em 0 -0.477em}20%{box-shadow:0 -0.83em 0 -0.4em, -0.338em -0.758em 0 -0.42em,\\r\\n -0.555em -0.617em 0 -0.44em, -0.671em -0.488em 0 -0.46em,\\r\\n -0.749em -0.34em 0 -0.477em}38%{box-shadow:0 -0.83em 0 -0.4em, -0.377em -0.74em 0 -0.42em,\\r\\n -0.645em -0.522em 0 -0.44em, -0.775em -0.297em 0 -0.46em,\\r\\n -0.82em -0.09em 0 -0.477em}100%{box-shadow:0 -0.83em 0 -0.4em, 0 -0.83em 0 -0.42em, 0 -0.83em 0 -0.44em,\\r\\n 0 -0.83em 0 -0.46em, 0 -0.83em 0 -0.477em}}@keyframes svelte-vhggjq-round{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}\";\n\tappend(document.head, style);\n}", "function get_css_result(res) {\r\n\tvar css = res.responseText;\r\n\tvar status = res.status;\r\nLOG.output(\"HTTP status:\"+status);\r\n\tif ( status != 200 ) {\t// failed\r\n\t\tGM_log(\"Can't get CSS file (HTTP status=\"+status+\")\");\r\n\t\treturn;\r\n }\r\n Add_CSS(css);\r\n}", "function add_css$f() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-qjpt5m-style\";\n\tstyle.textContent = \".wrapper.svelte-qjpt5m{position:relative;display:flex;justify-content:center;align-items:center;width:var(--size);height:calc(var(--size) / 2.5)}.cube.svelte-qjpt5m{position:absolute;top:0px;width:calc(var(--size) / 5);height:calc(var(--size) / 2.5);background-color:var(--color);animation:svelte-qjpt5m-motion var(--duration) cubic-bezier(0.895, 0.03, 0.685, 0.22) infinite}@keyframes svelte-qjpt5m-motion{0%{opacity:1}50%{opacity:0}100%{opacity:1}}\";\n\tappend(document.head, style);\n}", "function add_css$5(){var style=element(\"style\");style.id=\"svelte-1xe6894-style\";style.textContent=\"div.svelte-1xe6894{display:flex;flex-flow:column nowrap;justify-content:center;font-size:inherit;font-family:inherit;margin-left:0.75em;max-width:78%}p.svelte-1xe6894{margin:0.5em 0 0 0;opacity:0.7;font-size:0.889em;line-height:1.15;font-family:\\\"Helvetica Neue\\\"}span.svelte-1xe6894{font-family:\\\"Helvetica Neue\\\"}\";append(document.head,style)}// (42:4) {#if notification.type === 'pending' && notification.startTime}", "function get_preview_css_result(res) {\r\n\tvar css = res.responseText;\r\n\tvar status = res.status;\r\nLOG.output(\"HTTP status:\"+status);\r\n\tif ( status != 200 ) {\t// failed\r\n\t\twindow.alert(\"Can't get CSS file (HTTP status=\"+status+\")\");\r\n\t\treturn;\r\n }\r\n Add_Preview_CSS(css);\r\n}", "function add_css$1(target) {\n\t\tappend_styles(target, \"svelte-1yqi94n\", \".chat_msg_item_user.svelte-1yqi94n{overflow-wrap:break-word;letter-spacing:.1px;text-rendering:optimizeLegibility;font-family:'Roboto';font-weight:500;-webkit-font-smoothing:antialiased;font-size:12px;line-height:18px;position:relative;margin:8px 0 15px 0;padding:8px 10px;max-width:60%;display:block;border-radius:3px;animation:zoomIn .5s cubic-bezier(.42, 0, .58, 1);clear:both;z-index:999;margin-right:20px;float:right;background:#42a5f5;color:#eceff1}\");\n\t}", "function getMicromedia(mm){var div=document.createElement('sfandiv');div.insertAdjacentHTML('afterbegin','<a href=\"'+mm.url+'\" target=\"_blank\"><img src=\"'+mm.x1+'\"></a>');div.classList.add('micromedia');return div;}", "function e$2(e){switch(e.type){case\"esriSMS\":return `${e.style}.${e.path}`;case\"esriSLS\":return `${e.style}.${e.cap}`;case\"esriSFS\":return `${e.style}`;case\"esriPFS\":case\"esriPMS\":return e.imageData?`${e.imageData}${e.width}${e.height}`:`${e.url}${e.width}${e.height}`;default:return \"mosaicHash\"in e?e.mosaicHash:JSON.stringify(e)}}", "function Get_Preview_CSS_by_GM_xmlhttpRequest(url) {\r\n\tcall_GM_xmlhttpRequest(url, get_preview_css_result)\r\n}", "function add_css$2(){var style=element(\"style\");style.id=\"svelte-1sck9uz-style\";style.textContent=\"i.svelte-1sck9uz{width:15px;height:16px;display:inline-block;background-image:url(\\\"https://assist.blocknative.com/images/jJu8b0B.png\\\");background-position:-66px 0px;vertical-align:sub}\";append(document.head,style)}", "function add_css$c() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-19yho4w-style\";\n\tstyle.textContent = \".wrapper.svelte-19yho4w{width:var(--size);height:calc(var(--size) / 2);overflow:hidden}.rainbow.svelte-19yho4w{width:var(--size);height:var(--size);border-left-color:transparent;border-bottom-color:transparent;border-top-color:var(--color);border-right-color:var(--color);box-sizing:border-box;transform:rotate(-200deg);border-radius:50%;border-style:solid;animation:var(--duration) ease-in-out 0s infinite normal none running svelte-19yho4w-rotate}@keyframes svelte-19yho4w-rotate{0%{border-width:10px}25%{border-width:3px}50%{transform:rotate(115deg);border-width:10px}75%{border-width:3px}100%{border-width:10px}}\";\n\tappend(document.head, style);\n}", "function loadCustomCSS() {\n let style = storyJSON.style;\n let $background = (style.use_background_image ? 'url(' + style.background_image + ')' : style.background_color);\n let $chat_color, $chat_text_color, $chat_sent_color, $help_color;\n let additional_css = \"\";\n switch (style.chat_theme) {\n case 'dark':\n $help_color = 'black';\n $chat_color = '#575b5f';\n $chat_sent_color = '#6c757d'\n $chat_text_color = 'white';\n break;\n case 'light':\n $help_color = 'black';\n $chat_color = 'white';\n $chat_sent_color = '#c7c7c7';\n $chat_text_color = 'black';\n additional_css = `#chat .panel-primary {\n border: black solid 2px;\n }`;\n break;\n case 'pink':\n $help_color = '#9932CC';\n $chat_color = '#9932CC';\n $chat_sent_color = '#761ea0';\n $chat_text_color = 'white';\n break;\n }\n\n style['activity_area_color'] = convertHex(style.activity_area_color, style.activity_area_opacity);\n style['background'] = $background;\n style['help_color'] = $help_color;\n style['chat_sent_color'] = $chat_sent_color;\n style['chat_color'] = $chat_color;\n style['chat_text_color'] = $chat_text_color;\n let css = document.getElementById('template-css').innerHTML.tpl(style);\n switch (style.title_font) {\n case 'All The Roll':\n additional_css = `\n h1 {\n font-size:10vh;\n line-height: .7;\n }\n h1::before {\n content: '(';\n }\n h1::after {\n content: ')';\n }\n `\n break;\n }\n if (style.title_font_color == '#ffffff') {\n additional_css +=\n `#score {\n text-shadow:none; \n }`\n }\n css = css.replace('</style>', '');\n css += additional_css;\n $('head').append(css + '</style>');\n\n}", "function add_css$d() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1l12hh6-style\";\n\tstyle.textContent = \".wrapper.svelte-1l12hh6{position:relative;display:flex;justify-content:center;align-items:center;width:calc(var(--size) * 2.5);height:var(--size);overflow:hidden}.bar.svelte-1l12hh6{position:absolute;top:calc(var(--size) / 10);width:calc(var(--size) / 5);height:calc(var(--size) / 10);margin-top:calc(var(--size) - var(--size) / 10);transform:skewY(0deg);background-color:var(--color);animation:svelte-1l12hh6-motion var(--duration) ease-in-out infinite}@keyframes svelte-1l12hh6-motion{25%{transform:skewY(25deg)}50%{height:100%;margin-top:0}75%{transform:skewY(-25deg)}}\";\n\tappend(document.head, style);\n}", "function user_style() {\r\n\tres.contentType = 'text/css';\r\n\tres.write(this.custom_style);\r\n}", "function Hilitor2(id, tag)\n{\n\n var targetNode = document.getElementById(id) || document.body;\n var hiliteTag = tag || \"EM\";\n var skipTags = new RegExp(\"^(?:\" + hiliteTag + \"|SCRIPT|FORM)$\");\n var colors = [\"#0e7582\", \"#0e7582\", \"#0e7582\", \"#0e7582\", \"#0e7582\"];\n var wordColor = [];\n var colorIdx = 0;\n var matchRegex = \"\";\n var openLeft = false;\n var openRight = false;\n\n this.setMatchType = function(type)\n {\n switch(type)\n {\n case \"left\":\n this.openLeft = false;\n this.openRight = true;\n break;\n case \"right\":\n this.openLeft = true;\n this.openRight = false;\n break;\n case \"open\":\n this.openLeft = this.openRight = true;\n break;\n default:\n this.openLeft = this.openRight = false;\n }\n };\n\n function addAccents(input)\n {\n retval = input;\n retval = retval.replace(/([ao])e/ig, \"$1\");\n retval = retval.replace(/\\\\u00E[024]/ig, \"a\");\n retval = retval.replace(/\\\\u00E[89AB]/ig, \"e\");\n retval = retval.replace(/\\\\u00E[EF]/ig, \"i\");\n retval = retval.replace(/\\\\u00F[46]/ig, \"o\");\n retval = retval.replace(/\\\\u00F[9BC]/ig, \"u\");\n retval = retval.replace(/\\\\u00FF/ig, \"y\");\n retval = retval.replace(/\\\\u00DF/ig, \"s\");\n retval = retval.replace(/a/ig, \"([aàâä]|ae)\");\n retval = retval.replace(/e/ig, \"[eèéêë]\");\n retval = retval.replace(/i/ig, \"[iîï]\");\n retval = retval.replace(/o/ig, \"([oôö]|oe)\");\n retval = retval.replace(/u/ig, \"[uùûü]\");\n retval = retval.replace(/y/ig, \"[yÿ]\");\n retval = retval.replace(/s/ig, \"(ss|[sß])\");\n return retval;\n }\n\n this.setRegex = function(input)\n {\n input = input.replace(/\\\\([^u]|$)/g, \"$1\");\n input = input.replace(/[^\\w\\\\\\s']+/g, \"\").replace(/\\s+/g, \"|\");\n input = addAccents(input);\n var re = \"(\" + input + \")\";\n if(!this.openLeft) re = \"(?:^|[\\\\b\\\\s])\" + re;\n if(!this.openRight) re = re + \"(?:[\\\\b\\\\s]|$)\";\n matchRegex = new RegExp(re, \"i\");\n };\n\n this.getRegex = function()\n {\n var retval = matchRegex.toString();\n retval = retval.replace(/(^\\/|\\(\\?:[^\\)]+\\)|\\/i$)/g, \"\");\n return retval;\n };\n\n // recursively apply word highlighting\n this.hiliteWords = function(node)\n {\n if(node === undefined || !node) return;\n if(!matchRegex) return;\n if(skipTags.test(node.nodeName)) return;\n\n if(node.hasChildNodes()) {\n for(var i=0; i < node.childNodes.length; i++)\n this.hiliteWords(node.childNodes[i]);\n }\n if(node.nodeType == 3) { // NODE_TEXT\n if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) {\n if(!wordColor[regs[1].toLowerCase()]) {\n wordColor[regs[1].toLowerCase()] = colors[colorIdx++ % colors.length];\n }\n\n var match = document.createElement(hiliteTag);\n match.appendChild(document.createTextNode(regs[1]));\n match.style.backgroundColor = wordColor[regs[1].toLowerCase()];\n match.style.fontStyle = \"inherit\";\n match.style.color = \"#000\";\n\n var after;\n if(regs[0].match(/^\\s/)) { // in case of leading whitespace\n after = node.splitText(regs.index + 1);\n } else {\n after = node.splitText(regs.index);\n }\n after.nodeValue = after.nodeValue.substring(regs[1].length);\n node.parentNode.insertBefore(match, after);\n }\n };\n };\n\n // remove highlighting\n this.remove = function()\n {\n var arr = document.getElementsByTagName(hiliteTag);\n while(arr.length && (el = arr[0])) {\n var parent = el.parentNode;\n parent.replaceChild(el.firstChild, el);\n parent.normalize();\n }\n };\n\n // start highlighting at target node\n this.apply = function(input)\n {\n this.remove();\n if(input === undefined || !(input = input.replace(/(^\\s+|\\s+$)/g, \"\"))) return;\n input = convertCharStr2jEsc(input);\n this.setRegex(input);\n this.hiliteWords(targetNode);\n };\n\n // added by Yanosh Kunsh to include utf-8 string comparison\n function dec2hex4(textString)\n {\n var hexequiv = new Array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\");\n return hexequiv[(textString >> 12) & 0xF] + hexequiv[(textString >> 8) & 0xF] + hexequiv[(textString >> 4) & 0xF] + hexequiv[textString & 0xF];\n }\n\n function convertCharStr2jEsc(str, cstyle)\n {\n // Converts a string of characters to JavaScript escapes\n // str: sequence of Unicode characters\n var highsurrogate = 0;\n var suppCP;\n var pad;\n var n = 0;\n var outputString = '';\n for(var i=0; i < str.length; i++) {\n var cc = str.charCodeAt(i);\n if(cc < 0 || cc > 0xFFFF) {\n outputString += '!Error in convertCharStr2UTF16: unexpected charCodeAt result, cc=' + cc + '!';\n }\n if(highsurrogate != 0) { // this is a supp char, and cc contains the low surrogate\n if(0xDC00 <= cc && cc <= 0xDFFF) {\n suppCP = 0x10000 + ((highsurrogate - 0xD800) << 10) + (cc - 0xDC00);\n if(cstyle) {\n pad = suppCP.toString(16);\n while(pad.length < 8) {\n pad = '0' + pad;\n }\n outputString += '\\\\U' + pad;\n } else {\n suppCP -= 0x10000;\n outputString += '\\\\u' + dec2hex4(0xD800 | (suppCP >> 10)) + '\\\\u' + dec2hex4(0xDC00 | (suppCP & 0x3FF));\n }\n highsurrogate = 0;\n continue;\n } else {\n outputString += 'Error in convertCharStr2UTF16: low surrogate expected, cc=' + cc + '!';\n highsurrogate = 0;\n }\n }\n if(0xD800 <= cc && cc <= 0xDBFF) { // start of supplementary character\n highsurrogate = cc;\n } else { // this is a BMP character\n switch(cc)\n {\n case 0:\n outputString += '\\\\0';\n break;\n case 8:\n outputString += '\\\\b';\n break;\n case 9:\n outputString += '\\\\t';\n break;\n case 10:\n outputString += '\\\\n';\n break;\n case 13:\n outputString += '\\\\r';\n break;\n case 11:\n outputString += '\\\\v';\n break;\n case 12:\n outputString += '\\\\f';\n break;\n case 34:\n outputString += '\\\\\\\"';\n break;\n case 39:\n outputString += '\\\\\\'';\n break;\n case 92:\n outputString += '\\\\\\\\';\n break;\n default:\n if(cc > 0x1f && cc < 0x7F) {\n outputString += String.fromCharCode(cc);\n } else {\n pad = cc.toString(16).toUpperCase();\n while(pad.length < 4) {\n pad = '0' + pad;\n }\n outputString += '\\\\u' + pad;\n }\n }\n }\n }\n return outputString;\n }\n\n}", "function add_css() {\n var style = element$1(\"style\");\n style.id = \"svelte-cm45hh-style\";\n style.textContent = \".circle.svelte-cm45hh{height:var(--size);width:var(--size);border-color:var(--color) transparent var(--color) var(--color);border-width:calc(var(--size) / 15);border-style:solid;border-image:initial;border-radius:50%;animation:0.75s linear 0s infinite normal none running svelte-cm45hh-rotate}@keyframes svelte-cm45hh-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}\";\n append$1(document.head, style);\n }", "function add_css$a() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-ihyvhn-style\";\n\tstyle.textContent = \".wrapper.svelte-ihyvhn{position:relative;width:var(--size);height:var(--size)}.border.svelte-ihyvhn{border-color:var(--color);position:absolute;top:0px;left:0px;width:var(--size);height:var(--size);opacity:0.4;perspective:800px;border-width:6px;border-style:solid;border-image:initial;border-radius:100%}.border.\\\\31 .svelte-ihyvhn{animation:var(--duration) linear 0s infinite normal none running svelte-ihyvhn-ringOne}.border.\\\\32 .svelte-ihyvhn{animation:var(--duration) linear 0s infinite normal none running svelte-ihyvhn-ringTwo}@keyframes svelte-ihyvhn-ringOne{0%{transform:rotateX(0deg) rotateY(0deg) rotateZ(0deg)}100%{transform:rotateX(360deg) rotateY(180deg) rotateZ(360deg)}}@keyframes svelte-ihyvhn-ringTwo{0%{transform:rotateX(0deg) rotateY(0deg) rotateZ(0deg)}100%{transform:rotateX(180deg) rotateY(360deg) rotateZ(360deg)}}\";\n\tappend(document.head, style);\n}", "loadThemingScss() {\n // return this.http.get('https://www.iot-ensemble.com/assets/theming/theming.scss', { responseType: 'text' })\n return this.http.get(this.MaterialTheme, { responseType: 'text' })\n .pipe(map((x) => {\n return x\n .replace(/\\n/gm, '??')\n .replace(/\\$mat-([^:?]+)\\s*:\\s*\\([? ]*50:[^()]*contrast\\s*:\\s*\\([^)]+\\)[ ?]*\\);\\s*?/g, (all, name) => name === 'grey' ? all : '')\n .replace(/\\/\\*.*?\\*\\//g, '')\n .split(/[?][?]/g)\n .map((l) => l\n .replace(/^\\s*(\\/\\/.*)?$/g, '')\n .replace(/^\\$mat-blue-gray\\s*:\\s*\\$mat-blue-grey\\s*;\\s*/g, '')\n .replace(/^\\s*|\\s*$/g, '')\n .replace(/:\\s\\s+/g, ': '))\n .filter((l) => !!l)\n .join('\\n');\n }), map((txt) => \n // writeFile allows this file to be accessed from styles.scss\n Sass.writeFile('~@angular/material/theming', txt, (result) => {\n // console.log('Sass.writeFile', result);\n }))).toPromise();\n }", "function add_css$3() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-cwiakx-style\";\n\tstyle.textContent = \".wrapper.svelte-cwiakx{position:relative;width:var(--size);height:var(--size)}.circle.svelte-cwiakx{position:absolute;width:var(--size);height:var(--size);background-color:var(--color);border-radius:100%;opacity:0.6;top:0;left:0;animation-fill-mode:both;animation-name:svelte-cwiakx-bounce !important}@keyframes svelte-cwiakx-bounce{0%,100%{transform:scale(0)}50%{transform:scale(1)}}\";\n\tappend(document.head, style);\n}", "function add_css$k() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1z105v1-style\";\n\tstyle.textContent = \".wrapper.svelte-1z105v1{height:var(--size);width:var(--size);border-radius:100%;animation:svelte-1z105v1-moonStretchDelay var(--duration) 0s infinite linear;animation-fill-mode:forwards;position:relative}.circle-one.svelte-1z105v1{top:var(--moonSize);background-color:var(--color);width:calc(var(--size) / 7);height:calc(var(--size) / 7);border-radius:100%;animation:svelte-1z105v1-moonStretchDelay var(--duration) 0s infinite linear;animation-fill-mode:forwards;opacity:0.8;position:absolute}.circle-two.svelte-1z105v1{opacity:0.1;border:calc(var(--size) / 7) solid var(--color);height:var(--size);width:var(--size);border-radius:100%;box-sizing:border-box}@keyframes svelte-1z105v1-moonStretchDelay{100%{transform:rotate(360deg)}}\";\n\tappend(document.head, style);\n}", "function add_css$j() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-igcne5-style\";\n\tstyle.textContent = \".square.svelte-igcne5{height:var(--size);width:var(--size);background-color:var(--color);animation:svelte-igcne5-squareDelay var(--duration) 0s infinite cubic-bezier(0.09, 0.57, 0.49, 0.9);animation-fill-mode:both;perspective:100px;display:inline-block}@keyframes svelte-igcne5-squareDelay{25%{-webkit-transform:rotateX(180deg) rotateY(0);transform:rotateX(180deg) rotateY(0)}50%{-webkit-transform:rotateX(180deg) rotateY(180deg);transform:rotateX(180deg) rotateY(180deg)}75%{-webkit-transform:rotateX(0) rotateY(180deg);transform:rotateX(0) rotateY(180deg)}100%{-webkit-transform:rotateX(0) rotateY(0);transform:rotateX(0) rotateY(0)}}\";\n\tappend(document.head, style);\n}", "function add_css$4(){var style=element(\"style\");style.id=\"svelte-82cst2-style\";style.textContent=\"span.svelte-82cst2{font-size:inherit;font-family:inherit}\";append(document.head,style)}", "function add_css$3(){var style=element(\"style\");style.id=\"svelte-82cst2-style\";style.textContent=\"span.svelte-82cst2{font-size:inherit;font-family:inherit}\";append(document.head,style)}", "function add_css$1(){var style=element(\"style\");style.id=\"svelte-1l3nhhx-style\";style.textContent=\"p.svelte-1l3nhhx{margin:0;font-family:\\\"Helvetica Neue\\\";font-size:inherit}\";append(document.head,style)}", "function load_css_buffer(response){\r\n\t// split all uncommented segments of code\r\n\tlet uncommented = response.split(/\\/\\*[a-zA-Z\\s]*\\*\\//);\r\n\tfor(let i in uncommented){\r\n\t\t// for all snippets of uncommented code\r\n\t\tlet snippet = uncommented[i];\r\n\t\t\r\n\t\t// if snippet not empty\r\n\t\tif(snippet.trim() != ''){\r\n\t\t\t// as each class and id styling are separated by [.#][a-zA-Z]*{ ... } so split it by '}'\t\r\n\t\t\tlet group = snippet.split('}');\r\n\t\t\t\r\n\t\t\tfor(let i in group){\r\n\t\t\t\tlet css_instance = group[i].trim(); // for each styling group (class or id) spaces trimmed at the end\r\n\t\t\t\tif(css_instance != ''){ // if split item is not empty\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(css_instance.startsWith('.')){ // if starts with '.' then it is a class\r\n\t\t\t\t\t\tcss_instance = css_instance.split('.')[1];\r\n\t\t\t\t\t\tlet className = css_instance.split('{')[0].trim();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// set new class for each className in styling file loaded\r\n\t\t\t\t\t\tcss_classes[className.toString()] = JSON.parse(JSON.stringify(default_styling));\r\n\r\n\t\t\t\t\t\t// add each css property eg. padding:100px; separate by ';' and then add each property\r\n\t\t\t\t\t\tlet css_props = group[i].split('{')[1].split(';');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(let i in css_props){\r\n\t\t\t\t\t\t\tlet css_prop = css_props[i].trim();\r\n\t\t\t\t\t\t\tif(css_prop!=''){\r\n\t\t\t\t\t\t\t\tlet key = css_prop.split(':')[0].trim();\r\n\t\t\t\t\t\t\t\tlet value = css_prop.split(':')[1].trim();\r\n\t\t\t\t\t\t\t\tcss_classes[className.toString()][key.toString()] = value.toString();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// same logic for id which start with '#'\r\n\t\t\t\t\telse if(css_instance.startsWith('#')){\r\n\t\t\t\t\t\tcss_instance = css_instance.split('#')[1];\r\n\t\t\t\t\t\tlet idName = css_instance.split('{')[0].trim();\r\n\t\t\t\t\t\tcss_ids[idName.toString()] = JSON.parse(JSON.stringify(default_styling));\r\n\r\n\t\t\t\t\t\tlet css_props = group[i].split('{')[1].split(';');\r\n\t\t\t\t\t\tfor(let i in css_props){\r\n\t\t\t\t\t\t\tlet css_prop = css_props[i].trim();\r\n\t\t\t\t\t\t\tif(css_prop!=''){\r\n\t\t\t\t\t\t\t\tlet key = css_prop.split(':')[0].trim();\r\n\t\t\t\t\t\t\t\tlet value = css_prop.split(':')[1].trim();\r\n\t\t\t\t\t\t\t\tcss_ids[idName.toString()][key.toString()] = value.toString();\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\t// update list of classes and ids\r\n\tupdate_classes_list();\r\n\tupdate_ids_list();\r\n\tget_class_css();\r\n\tget_id_css();\r\n\r\n\t// update css buffer\r\n\ttmp_css_properties();\r\n}", "function add_css$b() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1meein0-style\";\n\tstyle.textContent = \".wrapper.svelte-1meein0{height:var(--size);width:var(--size);display:flex;align-items:center;justify-content:center}.dot.svelte-1meein0{height:var(--dotSize);width:var(--dotSize);background-color:var(--color);margin:2px;display:inline-block;border-radius:100%;animation:svelte-1meein0-sync var(--duration) ease-in-out infinite alternate both running}@-webkit-keyframes svelte-1meein0-sync{33%{-webkit-transform:translateY(10px);transform:translateY(10px)}66%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes svelte-1meein0-sync{33%{-webkit-transform:translateY(10px);transform:translateY(10px)}66%{-webkit-transform:translateY(-10px);transform:translateY(-10px)}100%{-webkit-transform:translateY(0);transform:translateY(0)}}\";\n\tappend(document.head, style);\n}", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function getCSS(file) {\n\n var rawFile = new XMLHttpRequest();\n var allText = '';\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = function () {\n if(rawFile.readyState === 4) {\n if(rawFile.status === 200 || rawFile.status == 0) {\n allText = rawFile.responseText;\n }\n }\n };\n rawFile.send(null);\n return allText;\n\n }", "function add_css$e() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1go2d9c-style\";\n\tstyle.textContent = \".wrapper.svelte-1go2d9c{width:calc(var(--size) * 1.3);height:calc(var(--size) * 1.3);display:flex;justify-content:center;align-items:center}.firework.svelte-1go2d9c{border:calc(var(--size) / 10) dotted var(--color);width:var(--size);height:var(--size);border-radius:50%;animation:svelte-1go2d9c-fire var(--duration) cubic-bezier(0.165, 0.84, 0.44, 1) infinite}@keyframes svelte-1go2d9c-fire{0%{opacity:1;transform:scale(0.1)}25%{opacity:0.85}100%{transform:scale(1);opacity:0}}\";\n\tappend(document.head, style);\n}", "function lgm_addStyles() {\n GM_addStyle(\"a.hi-dlink, a.hi-dlink:hover {position:relative;top:2px;text-decoration:none;padding:1pt 2pt;border:#000000 solid 1px;background-color:#ffffff;color:#000000;font-size:8pt;font-weight:bold\");\n GM_addStyle(\"a.hi-dlink:hover {border:1pt #ff6080 solid;background-color:#ff6080;color:#ffffff}\");\n GM_addStyle(\"div.hi-preview {position:absolute;overflow:hidden;padding:0px;margin:0px;border:solid #cccccc 1px;\"\n + \"z-index:1997;background-color:#eeeeee;font-family:Arial,Courier;font-size:\" + picTextFontSize + \";font-weight:bold;}\");\n GM_addStyle(\"img.hi-preview {border:0pt none #ffffff;z-index:1998;}\");\n GM_addStyle(\"div.hi-wait {font-size:10pt;font-weight:bold; }\");\n GM_addStyle(\"div.hi-caption {font-size:\" + picTextFontSize + \";font-weight:bold;overflow:hidden;background-color:#eeeeee;z-index:1999;}\");\n}", "getStyles() {\n return {\n wrapperDiv: {\n color: this.getAttribute('stars-color'), // this.getAttribute(attrName) is the recommended way to access the attributes our component received in the mjml\n 'font-size': this.getAttribute('font-size'),\n },\n contentP: {\n 'text-align': this.getAttribute('align'),\n 'font-size': '20px'\n },\n contentSpan: {\n color: this.getAttribute('color')\n }\n }\n }", "returnAdditionalDisplay(response) {\n return <div>\n <div className=\"pulledText\">\n <h3>Result:</h3>\n <p>{response}</p>\n </div>\n </div>;\n }", "createCSS() {\n return \"\";\n }", "function add_css$5() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-hf9ydw-style\";\n\tstyle.textContent = \".wrapper.svelte-hf9ydw{width:var(--size);height:var(--size)}.circle.svelte-hf9ydw{width:var(--size);height:var(--size);background-color:var(--color);animation-duration:var(--duration);border-radius:100%;display:inline-block;animation:svelte-hf9ydw-scaleOut var(--duration) ease-in-out infinite}@keyframes svelte-hf9ydw-scaleOut{0%{transform:scale(0)}100%{transform:scale(1);opacity:0}}\";\n\tappend(document.head, style);\n}", "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = 'svelte-aggp9g-style';\n\tstyle.textContent = \".firebaseui-idp-email.svelte-aggp9g,.firebaseui-idp-email.svelte-aggp9g:hover,.firebaseui-idp-email.svelte-aggp9g:active,.firebaseui-idp-email.svelte-aggp9g:focus{background-color:#db4437;color:white}.firebaseui-idp-phone.svelte-aggp9g,.firebaseui-idp-phone.svelte-aggp9g:hover,.firebaseui-idp-phone.svelte-aggp9g:active,.firebaseui-idp-phone.svelte-aggp9g:focus{background-color:#02bd7e;color:white}.firebaseui-idp-google.svelte-aggp9g,.firebaseui-idp-google.svelte-aggp9g:hover,.firebaseui-idp-google.svelte-aggp9g:active,.firebaseui-idp-google.svelte-aggp9g:focus{background-color:#fff;color:black}.firebaseui-idp-github.svelte-aggp9g,.firebaseui-idp-github.svelte-aggp9g:hover,.firebaseui-idp-github.svelte-aggp9g:active,.firebaseui-idp-github.svelte-aggp9g:focus{background-color:#333;color:white}.firebaseui-idp-facebook.svelte-aggp9g,.firebaseui-idp-facebook.svelte-aggp9g:hover,.firebaseui-idp-facebook.svelte-aggp9g:active,.firebaseui-idp-facebook.svelte-aggp9g:focus{background-color:#3b5998}.firebaseui-idp-twitter.svelte-aggp9g,.firebaseui-idp-twitter.svelte-aggp9g:hover,.firebaseui-idp-twitter.svelte-aggp9g:active,.firebaseui-idp-twitter.svelte-aggp9g:focus{background-color:#55acee}.firebaseui-idp-anonymous.svelte-aggp9g,.firebaseui-idp-anonymous.svelte-aggp9g:hover,.firebaseui-idp-anonymous.svelte-aggp9g:active,.firebaseui-idp-anonymous.svelte-aggp9g:focus{background-color:#f4b400}.centered.svelte-aggp9g{margin:auto;max-width:300px}.container.svelte-aggp9g{display:flex;justify-content:center;flex-direction:column;max-width:300px;align-items:center;margin:auto}.container.svelte-aggp9g button img.svelte-aggp9g{max-width:20px}.container.svelte-aggp9g button.svelte-aggp9g{display:flex;align-items:center}.container.svelte-aggp9g button span.svelte-aggp9g{flex:1}\";\n\tappend(document.head, style);\n}", "function get_clean_css(a) {\n\n var data = get_css_by_screensize('desktop');\n\n // Adding break\n data = data.replace(/\\)\\{/g, \"){\\r\").replace(/\\)\\{/g, \"){\\r\");\n\n // Clean spaces for nth-child and not.\n\n // Clean spaces for nth-child and not.\n var ars = Array(\n \"nth-child\",\n \"not\",\n \"lang\",\n \"nth-last-child\",\n \"nth-last-of-type\",\n \"nth-of-type\"\n );\n\n for (var ai = 0; ai < ars.length; ai++) {\n\n // Reg\n var k = new RegExp(ars[ai] + \"\\\\((.*?)\\\\)\\{\\r\\r\", \"g\");\n\n // Replace\n data = data.replace(k, ars[ai] + \"\\($1\\)\\{\");\n\n }\n\n\n if (iframe.find(\".yp_current_styles\").length > 0) {\n\n var mediaArray = [];\n\n iframe.find(\".yp_current_styles\").each(function () {\n var v = $(this).attr(\"data-size-mode\");\n\n if ($.inArray(v, mediaArray) === -1 && v != 'desktop') {\n mediaArray.push(v);\n }\n });\n\n $.each(mediaArray, function (i, v) {\n\n var q = get_css_by_screensize(v);\n\n // Add extra tab for media query content.\n q = \"\\t\" + q.replace(/\\r/g, '\\r\\t').replace(/\\t$/g, '').replace(/\\t$/g, '');\n\n if (v == 'tablet') {\n v = '(min-width: 768px) and (max-width: 991px)';\n }\n\n if (v == 'mobile') {\n v = '(max-width:767px)';\n }\n\n data = data + \"\\r\\r@media \" + v + \"{\\r\\r\" + q + \"}\";\n\n });\n\n }\n\n if (a === true) {\n data = data.replace(/\\r\\ta:a !important;/g, \"\");\n data = data.replace(/a:a !important;/g, \"\");\n data = data.replace(/a:a;/g, \"\");\n }\n\n // Clean first empty lines.\n data = data.replace(/^\\r/g, '').replace(/^\\r/g, '');\n\n data = data.replace(/\\}\\r\\r\\r\\r@media/g, '}\\r\\r@media');\n\n return data;\n\n }", "function parseCss(css, createAnimation) {\n const uniCode = String(Math.random()).slice(2)\n let keyframes = ''\n const cssObj = {}\n css = String(css).replace(/\\.([^.,{ ]+) *\\n? *{([^}]*)}/g, function(stylesheel, classname, ctx) {\n const uniname = classname + '-animal-say-' + uniCode\n cssObj[classname] = uniname\n if(createAnimation)\n keyframes += `@keyframes ${uniname} { 0% { ${ctx} } } \\n`\n return stylesheel.replace(classname, uniname)\n })\n css = keyframes + css\n render(h('style', null, css), 'head')\n return cssObj\n}", "function extract() {\n var cssText = $('#source').val();\n Palette.init(cssText);\n display(Palette.bw, $('#bw'));\n display(Palette.colors, $('#colors'));\n $('.color-palette').show();\n\n // Reset\n selected_colors = [];\n RefreshClickListener();\n}", "injectStitchFrameworkCss() {\n\n let node_string = \"<style type=\\\"text/css\\\">\" + Stitch_FrameWork_EmbeddedStyles + \"</style>\";\n\n let style = document.createElement(\"style\");\n style.type = 'text/css';\n\n if (style.styleSheet) {\n style.styleSheet.cssText = node_string;\n } else {\n style.appendChild(document.createTextNode(Stitch_FrameWork_EmbeddedStyles));\n }\n\n document.getElementsByTagName(\"head\")[0].appendChild(style);\n }", "function handleSuccessResponse(session, body) {\r\n var tag = \"\";\r\n var desctiption = \"\";\r\n var metadata = \"\";\r\n var dominantColor = \"\";\r\n if (body) {\r\n //console.log(\"caption :::::::::::::::::::: \" + body.color.dominantColors);\r\n\r\n for (var i = 0; i < body.tags.length; i++) {\r\n\r\n tag = tag + body.tags[i].name + \" , \";\r\n\r\n }\r\n\r\n desctiption = body.description.captions[0].text;\r\n metadata = body.metadata;\r\n dominantColor = body.color.dominantColors;\r\n \r\n session.send(\"Tags : [ \" + tag.substring(0, tag.length - 2) + \" ]\");\r\n session.send(\"Desctiption : [ \" + desctiption + \" ]\");\r\n session.send(\"dominantColor : [ \" + dominantColor + \" ]\");\r\n session.send(\"metaData : [ Width = \" + metadata.width + \" Height = \" + metadata.height + \" Format = \" + metadata.format + \" ]\");\r\n\r\n\r\n\r\n if (desctiption.match(/red/g)) {\r\n caption = \"당신 이미지의 차량 색상은 빨간색 입니다.\";\r\n session.send(caption);\r\n session.beginDialog('/korDesignSelectValentineRed', { sendMsg: \"image\", key: userId, beginTime: date.getTime(), intent: \"korDesignSelectValentineRed\", tableNm: \"insert_history\", chanelID: session.message.address.channelId });\r\n } else if (desctiption.match(/white/g)) {\r\n caption = \"당신 이미지의 차량 색상은 하얀색 입니다.\";\r\n session.send(caption);\r\n session.beginDialog('/korDesignSelectWhiteCream', { sendMsg: \"image\", key: userId, beginTime: date.getTime(), intent: \"korDesignSelectWhiteCream\", tableNm: \"insert_history\", chanelID: session.message.address.channelId });\r\n } else if (desctiption.match(/black/g)) {\r\n caption = \"당신 이미지의 차량 색상은 검정색 입니다.\";\r\n session.send(caption);\r\n session.beginDialog('/korDesignSelectMidnightBlack', { sendMsg: \"image\", key: userId, beginTime: date.getTime(), intent: \"korDesignSelectMidnightBlack\", tableNm: \"insert_history\", chanelID: session.message.address.channelId });\r\n }\r\n //else {\r\n\r\n // for (var i = 0; i < body.tags.length; i++) {\r\n\r\n // tag = tag + body.tags[i].name + \" , \";\r\n\r\n // }\r\n\r\n // desctiption = body.description.captions[0].text;\r\n // metadata = body.metadata;\r\n // dominantColor = body.color.dominantColors;\r\n \r\n // session.send(\"Tags : [ \" + tag.substring(0, tag.length - 2) + \" ]\");\r\n // session.send(\"Desctiption : [ \" + desctiption + \" ]\");\r\n // session.send(\"dominantColor : [ \" + dominantColor + \" ]\");\r\n // session.send(\"metaData : [ Width = \" + metadata.width + \" Height = \" + metadata.height + \" Format = \" + metadata.format+\" ]\");\r\n //}\r\n //session.send('I think it\\'s ' + caption);\r\n \r\n }\r\n else {\r\n session.send('Couldn\\'t find a caption for this one');\r\n }\r\n\r\n}", "function displayCSS() {\n\tcss.textContent = body.style.background + \";\";\n\tdirection.focus();\n}", "function textToCSS(text){\r\n //Variables\r\n ///A temporary variable to store the output - returned at the end of the function\r\n var output = text;\r\n\r\n\r\n //Replacing\r\n ///Uses regex to remove all invalid characters, excluding spaces\r\n output = output.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\");\r\n\r\n ///Replaces any spaces with dashed\r\n output = output.replaceAll(\" \", \"-\");\r\n\r\n ///Converts the string to lower case\r\n output = output.toLowerCase();\r\n\r\n return output;\r\n}", "function estampaCSS(target) {\n\t\t\tcamisetaService.estampaCSS(target);\n\t\t}", "function add_css$h() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1rda9iq-style\";\n\tstyle.textContent = \".wrapper.svelte-1rda9iq{height:var(--size);width:var(--size);display:flex;justify-content:center;align-items:center}.spinner.svelte-1rda9iq{height:var(--size);width:var(--size);animation:svelte-1rda9iq-rotate var(--duration) infinite linear}.dot.svelte-1rda9iq{width:60%;height:60%;display:inline-block;position:absolute;top:0;background-color:var(--color);border-radius:100%;animation:svelte-1rda9iq-bounce var(--duration) infinite ease-in-out}@keyframes svelte-1rda9iq-rotate{100%{transform:rotate(360deg)}}@keyframes svelte-1rda9iq-bounce{0%,100%{transform:scale(0)}50%{transform:scale(1)}}\";\n\tappend(document.head, style);\n}", "function displayCollyModemStyle() {\n // Process the querystring parameters\n var querystringParams = new URLSearchParams(window.location.search);\n var collyName = querystringParams.get(\"collyname\");\n var displayMode = querystringParams.get(\"displaymode\");\n var lineHeight = Number(querystringParams.get(\"lineheight\"));\n var extendedColumns = Number(querystringParams.get(\"extendedcolumns\"));\n var disableblink = querystringParams.get(\"disableblink\");\n var font = querystringParams.get(\"font\");\n\n // Set the base directory to load collys from\n var collyPath = \"collys/\" + collyName;\n\n // Load and display the colly\n var controller = AnsiLove.animate(\n collyPath,\n function (canvas) {\n document.getElementById(\"colly-content\").appendChild(canvas);\n document.getElementById(\"colly-name\").innerHTML = \"LoADING: \" + collyName;\n controller.play(57600, function () {\n document.getElementById(\"colly-name\").innerHTML =\n \"SHoWING: <a href='\" + collyPath + \"'>\" + collyName + \"</a>\";\n });\n },\n {\n font: font || \"topazplus\",\n bits: displayMode || \"8\",\n icecolors: 0,\n rows: lineHeight,\n extendedcolumns: extendedColumns || 0,\n disableblink: disableblink || \"false\",\n }\n );\n}", "function style() {\n verb(\"Styling...\")\n var e = document.createElement(\"style\")\n var css = \"\"\n var csss = []\n\n var ids = []\n try { ids = JSON.parse(localStorage['beta-memberids']) }\n catch(e) { debu(e.toString()) }\n\n for (var i = 0; i < ids.length; i++)\n csss.push(\"a[href*=\\\"\" + ids[i] + \"\\\"]\")\n\n css = csss.join(',')\n if (css.length > 0) css += \" { display: none !important }\"\n\n css += \".beta-loading { animation: loading 2s infinite; border-width: 4px; \"\n + \"border-style: solid } \"\n + \".beta-load-ok { animation: success 2s infinite; border-width: 4px; \"\n + \"border-style: solid }\"\n + \".beta-load-fail { animation: failure 2s infinite; border-width: 4px; \"\n + \"border-style: solid }\"\n + \"@keyframes loading { 0% { border-color: transparent } 50% { \"\n + \"border-color: #16B } 100% { border-color: transparent } }\"\n + \"@keyframes success { 20% { border-color: lime } 30% { border-color: \"\n + \"lime } 31% { border-color: transparent } 36% { border-color: \"\n + \"transparent } 37% { border-color: lime } 57% { border-color: lime } }\"\n + \"@keyframes failure { 20% { border-color: crimson } 30% { \"\n + \"border-color: crimson } 31% { border-color: transparent } 36% {\"\n + \"border-color: transparent } 37% { border-color: crimson } 57% {\"\n + \"border-color: crimson } }\"\n\n e.innerHTML = css\n\n document.body.appendChild(e)\n\n return e\n}", "getCssString() {\n const text = fs.readFileSync(\"./src/hero.css\", 'utf8');\n return (text.replace(/\\s+/g, ' '));\n }", "function createCSS (obj) {\n let contentCSS = ''\n contentCSS = label(contentCSS)\n contentCSS = centerHor(contentCSS)\n contentCSS = centerVer(contentCSS)\n contentCSS = lineSpace(contentCSS)\n contentCSS = linesStyle(contentCSS)\n contentCSS = printCenterLabel(contentCSS)\n\n return contentCSS\n\n function printCenterLabel (str) {\n let marginTopValue = (obj.paper.height - fromMilliToMicro(obj.label.height)) / 2000\n let marginLeftValue = (obj.paper.width - fromMilliToMicro(obj.label.width)) / 2000\n if (marginTopValue <= 1) {\n marginTopValue = 0\n }\n /*\n with electron 3.0.4 and printToPDF(marginsType 1) there is a margin of 2mm by default\n even with @print margin 0mm\n thats why we substract 2\n */\n marginLeftValue = marginLeftValue - 1\n\n let marginTopAdjustmentValue = document.getElementById('marginTop').value\n if (marginTopAdjustmentValue === '') {\n marginTopAdjustmentValue = 0\n }\n str += '@media print {\\n#toPrint.format_' + obj.name + ' > .innerBox {\\nmargin: ' + marginTopValue + 'mm 0mm 0mm ' + marginLeftValue + 'mm;\\n}\\n'\n str += 'body {\\nmargin: 0px;\\n}\\n'\n str += '#toPrint.format_' + obj.name + ' > .innerBox > .line_1 {\\nmargin-top: ' + marginTopAdjustmentValue + 'mm;\\n}\\n'\n str += '}'\n return str\n\n function fromMilliToMicro (str) {\n return (str.split('mm')[0] * 1000)\n }\n }\n function linesStyle (str) {\n for (let line of obj.linesData) {\n str += '.format_' + obj.name + ' > .innerBox > .line_' + line.id + ' {\\n'\n str += 'font-family: \"' + line.font + '\";\\n'\n str += 'font-size: ' + line.fontSize + 'pt;\\n'\n if (line.bold) {\n str += 'font-weight: bold;\\n'\n } else {\n str += 'font-weight: normal;\\n'\n }\n if (line.italic) {\n str += 'font-style: italic;\\n'\n } else {\n str += 'font-style: normal;\\n'\n }\n str += 'margin-left: ' + line.indent + '%;\\n'\n str += '}\\n'\n }\n return str\n }\n function lineSpace (str) {\n str += '.format_' + obj.name + ' > .innerBox > p {\\nmargin: ' + obj.lineSpace + 'px 0px ' + obj.lineSpace + 'px 0px;\\n}\\n'\n return str\n }\n function centerVer (str) {\n if (obj.centerVer) {\n str += '.format_' + obj.name + ' {\\nalign-items: center;\\n}\\n'\n str += '#toPrint.format_' + obj.name + '> .innerBox {\\nheight: ' + obj.label.height + ';\\nwidth: ' + obj.label.width + ';\\ndisplay: flex;\\njustify-content: center;\\nflex-direction: column;\\n}\\n'\n } else {\n str += '.format_' + obj.name + ' {\\nalign-items: initial;\\n}\\n'\n str += '#toPrint.format_' + obj.name + '.innerBox {\\nheight: ' + obj.label.height + ';\\nwidth: ' + obj.label.width + ';\\n}\\n'\n }\n return str\n }\n function centerHor (str) {\n if (obj.centerHor) {\n str += '.format_' + obj.name + ' {\\ntext-align: center;\\n'\n } else {\n str += '.format_' + obj.name + ' {\\ntext-align: initial;\\n'\n }\n str += 'white-space: nowrap;\\noverflow: hidden;\\n}\\n'\n return str\n }\n function label (str) {\n str += '#previewBox.format_' + obj.name + ' {\\nwidth: ' + obj.label.width + ';\\nheight: ' + obj.label.height + ';\\n}\\n'\n return str\n }\n}", "GetCss(){\n return /*html*/`\n <style>\n .CoreXActionText{font-size: var(--CoreX-font-size);}\n .CoreXActionButtonButton{\n margin: 2% 2% 2% 2%;\n padding: 1vh;\n cursor: pointer;\n border: 1px solid rgb(44,1,21);\n border-radius: 20px;\n text-align: center;\n display: inline-block;\n font-size: var(--CoreX-font-size);\n box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.7);\n color: rgb(44,1,21);\n background: white;\n outline: none;\n height: 5%;\n }\n .CoreXActionButtonButton:hover{\n box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.7);\n }\n .CoreXActionButtonImageButton{\n width:15%;\n padding: 0px;\n cursor: pointer;\n border: 2px solid transparent;\n padding:2px;\n border-radius: 10px;\n background-color: white;\n outline: none;\n }\n .CoreXActionButtonImageButton:hover{\n border-color: black;\n box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.7);\n }\n .CoreXActionMenuButton{\n position: fixed;\n top: 0px;\n font-size: 1.5vw;\n float: left;\n border-style: solid;\n border-width: 2px;\n border-radius: 10px;\n border-color: var(--CoreX-color);\n background-color: white;\n padding: 4px;\n margin: 4px;\n opacity: 0;\n transition: opacity 0.5s linear;\n cursor: pointer;\n height: 50px;\n width: 50px;\n text-align: center;\n outline: none;\n }\n \n @media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait),\n only screen and (min-device-width: 414px) and (max-device-width: 736px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: portrait),\n screen and (max-width: 700px)\n {\n .CoreXActionText{font-size: var(--CoreX-Iphone-font-size);}\n .CoreXActionButtonButton{font-size: calc(var(--CoreX-Iphone-font-size)*1.5); border-radius: 40px; height: 12VW;}\n .CoreXActionButtonImageButton{width:15%;}\n .CoreXActionMenuButton{font-size: calc(3vw * 1.5);height: 10VW; width: 10VW;}\n }\n @media screen and (min-width: 1200px)\n {\n .CoreXActionText{font-size: var(--CoreX-Max-font-size);}\n .CoreXActionButtonButton {font-size: var(--CoreX-Max-font-size); border-radius: 40px;}\n .CoreXActionButtonImageButton{width:43px;}\n .CoreXActionMenuButton {font-size: 18px;}\n }\n </style>\n `\n }", "function searchResultDisplayHtmlString(venue){\n\n \n let venue_name = venue.name?venue.name:\"\"\n let address = venue.location.formattedAddress?venue.location.formattedAddress:\"\"\n let descriptions = venue.categories?venue.categories:\"\"\n let location_description=[]\n for(let description of descriptions){\n\n location_description.push(description.name)\n\n }\n\n return `\n <style>\n .search-result p{\n\n font-family: var(--font-family-main);\n margin:10px;\n \n \n }\n \n .search-result p a{\n \n text-decoration:none;\n color:black;\n \n }\n\n .location-name-link{\n\n font-size:17px;\n\n }\n\n .address-link{\n\n font-size:15px;\n\n }\n\n .description-link{\n\n font-size:12px;\n\n }\n\n \n .line{\n \n background-image:linear-gradient(90deg,transparent, var(--primary-color),transparent);\n width:auto;\n height:2px;\n \n }\n \n </style>\n <div class=\"search-result\" onClick=\"stopCallingApi()\">\n <p>\n <a class=\"location-name-link\" href=\"#\">${venue_name}</a> \n </p>\n <p>\n <a class=\"address-link\" href=\"#\">${address.join(\" \")}</a> \n </p>\n <p>\n <a class=\"description-link\" href=\"#\">${location_description.join(\" \")}</a> \n </p>\n\n <div class=\"line\"></div>\n </div>`\n}", "function add_css$1() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-5smswp-style\";\n\tstyle.textContent = \".apple-list-reminders.svelte-5smswp{margin:0;padding:0}.apple-list-break.svelte-5smswp{margin:0}.apple-list-reminder-break-line.svelte-5smswp{margin-left:2em;margin-top:0.5em;margin-bottom:0.5em;padding:0;height:0.5px;opacity:0.2}.apple-list-top-rule.svelte-5smswp,.apple-list-bottom-rule.svelte-5smswp{opacity:0}\";\n\tappend(document.head, style);\n}", "function writeCss() { //写css\n\n\tvar cssOut,\n\t\timages = exportImageData,\n\t\tidx = images.length - 1,\n\t\thdr = exportHeader;\n\n\tcssOut = new File(hdr.outDir + '/' + hdr.cssDir + '/' + hdr.prefix + '.css');\n\tcssOut.open('w');\n\tcssOut.writeln('/* exported css for ' + hdr.psdName + ' */');\n\tcssOut.writeln('\\n');\n\tcssOut.writeln('body,html { width:100%;height:100%; }');\n\tcssOut.writeln('div>img { width:100%;height:100%; }');\n\tcssOut.writeln('\\n');\n\tcssOut.writeln('body { margin: 0px; padding:0px; background: hsl(229, 47%, 9%); }');\n\tcssOut.writeln('\\n');\n\tcssOut.writeln('.wrap {');\n\tcssOut.writeln(' position: relative;');\n\tcssOut.writeln(' width: 100%;');\n\tcssOut.writeln(' height: 100%;');\n\tcssOut.writeln(' overflow: hidden;');\n\tcssOut.writeln('}');\n\n\t// Photoshop extracts top first; put em in the css bottom first\n\n\tif (_DATA.cssUnit == '%') {\n\t\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\t\tcssOut.writeln('\\n');\n\t\t\tcssOut.writeln('.' + removeHyphen(images[idx].name) + ' {');\n\t\t\tcssOut.writeln(' position: absolute;');\n\t\t\tcssOut.writeln(' top: ' + parseFloat(parseInt((images[idx].top * 100 / hdr.psdHeight)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' left: ' + parseFloat(parseInt((images[idx].left * 100 / hdr.psdWidth)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' height: ' + parseFloat(parseInt((images[idx].height * 100 / hdr.psdHeight)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' width: ' + parseFloat(parseInt((images[idx].width * 100 / hdr.psdWidth)*100)/100) + '%;');\n\t\t\tcssOut.writeln(' background: url(../' + hdr.imgDir + '/' + images[idx].name + hdr.extension + ') no-repeat;');\n\t\t\tcssOut.writeln(' background-size: 100% 100%;');\n\t\t\tcssOut.writeln('}');\n\t\t}\n\t}\n\telse if (_DATA.cssUnit == 'rem') {\n\t\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\t\tcssOut.writeln('\\n');\n\t\t\tcssOut.writeln('.' + removeHyphen(images[idx].name) + ' {');\n\t\t\tcssOut.writeln(' position: absolute;');\n\n\t\t\t// 增加适配单位\n\t\t\tcssOut.writeln(' top: ' + parseFloat(images[idx].top) / 100 + 'rem;');\n\t\t\tcssOut.writeln(' left: ' + parseFloat(images[idx].left) / 100 + 'rem;');\n\t\t\tcssOut.writeln(' height: ' + parseFloat(images[idx].height) / 100 + 'rem;');\n\t\t\tcssOut.writeln(' width: ' + parseFloat(images[idx].width) / 100 + 'rem;');\n\n\t\t\tcssOut.writeln(' background: url(../' + hdr.imgDir + '/' + images[idx].name + hdr.extension + ') no-repeat;');\n\t\t\tcssOut.writeln(' background-size: 100% 100%;');\n\t\t\tcssOut.writeln('}');\n\t\t}\n\t} else {\n\t\tfor (idx; idx >= 0; idx -= 1) {\n\n\t\t\tcssOut.writeln('\\n');\n\t\t\tcssOut.writeln('.' + removeHyphen(images[idx].name) + ' {');\n\t\t\tcssOut.writeln(' position: absolute;');\n\n\t\t\tcssOut.writeln(' top: ' + parseInt(images[idx].top) + 'px;');\n\t\t\tcssOut.writeln(' left: ' + parseInt(images[idx].left) + 'px;');\n\t\t\tcssOut.writeln(' height: ' + parseInt(images[idx].height) + 'px;');\n\t\t\tcssOut.writeln(' width: ' + parseInt(images[idx].width) + 'px;');\n\n\t\t\tcssOut.writeln(' background: url(../' + hdr.imgDir + '/' + images[idx].name + hdr.extension + ') no-repeat;');\n\t\t\tcssOut.writeln(' background-size: 100% 100%;');\n\t\t\tcssOut.writeln('}');\n\t\t}\n\t}\n\n\tcssOut.close();\n}", "function add_css$9() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1v42ioj-style\";\n\tstyle.textContent = \".wrapper.svelte-1v42ioj{width:var(--size);height:var(--size)}.circle.svelte-1v42ioj{border-radius:100%;animation-fill-mode:both;position:absolute;opacity:0;width:var(--size);height:var(--size);background-color:var(--color);animation:svelte-1v42ioj-bounce var(--duration) linear infinite}@keyframes svelte-1v42ioj-bounce{0%{opacity:0;transform:scale(0)}5%{opacity:1}100%{opacity:0;transform:scale(1)}}\";\n\tappend(document.head, style);\n}", "renderAutowriter() {\n if (this.fixCursor) {\n return [\n core.h(\"span\", { class: \"blinking-cursor\" }),\n core.h(\"span\", { class: `display-text ${this.customStyleClass ? this.customStyleClass : ''}` }, this.displayText)\n ];\n }\n return [\n core.h(\"span\", { class: `display-text ${this.customStyleClass ? this.customStyleClass : ''}` }, this.displayText),\n core.h(\"span\", { class: \"blinking-cursor\" })\n ];\n }", "static get styles() {\n return [\n css`\n :host {\n display: block;\n --wikipedia-query-body-height: 160px;\n }\n :host [hidden] {\n display: none;\n }\n #result {\n height: var(--wikipedia-query-body-height);\n overflow: scroll;\n border: 1px grey solid;\n padding: 8px 16px;\n }\n citation-element {\n background-color: #f8f8f8;\n padding: 16px 8px;\n font-size: 12px;\n }\n `\n ];\n }", "function add_css(target) {\n\t\tappend_styles(target, \"svelte-1gtarpt\", \".hide-div.svelte-1gtarpt.svelte-1gtarpt{visibility:hidden}.fabs.svelte-1gtarpt.svelte-1gtarpt{bottom:0;position:fixed;margin:1em;right:0;z-index:998}.fab.svelte-1gtarpt.svelte-1gtarpt{display:block;width:56px;height:56px;border-radius:50%;text-align:center;color:#f0f0f0;margin:25px auto 0;box-shadow:0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28);cursor:pointer;-webkit-transition:all .1s ease-out;transition:all .1s ease-out;position:relative;z-index:998;overflow:hidden;background:#42a5f5}.fab.svelte-1gtarpt.svelte-1gtarpt:not(:last-child){width:0;height:0;margin:20px auto 0;opacity:0;visibility:hidden;line-height:40px}.fab:not(:last-child).is-visible.svelte-1gtarpt.svelte-1gtarpt{width:40px;height:40px;margin:15px auto 10;opacity:1;visibility:visible}.fab.svelte-1gtarpt.svelte-1gtarpt:nth-last-child(1){-webkit-transition-delay:25ms;transition-delay:25ms}.fab.svelte-1gtarpt.svelte-1gtarpt:not(:last-child):nth-last-child(2){-webkit-transition-delay:20ms;transition-delay:20ms}.fab.svelte-1gtarpt.svelte-1gtarpt:not(:last-child):nth-last-child(3){-webkit-transition-delay:40ms;transition-delay:40ms}.fab.svelte-1gtarpt.svelte-1gtarpt:not(:last-child):nth-last-child(4){-webkit-transition-delay:60ms;transition-delay:60ms}.fab.svelte-1gtarpt.svelte-1gtarpt:not(:last-child):nth-last-child(5){-webkit-transition-delay:80ms;transition-delay:80ms}.fab.svelte-1gtarpt.svelte-1gtarpt:active,.fab.svelte-1gtarpt.svelte-1gtarpt:focus,.fab.svelte-1gtarpt.svelte-1gtarpt:hover{box-shadow:0 0 6px rgba(0, 0, 0, .16), 0 6px 12px rgba(0, 0, 0, .32)}.chat.svelte-1gtarpt.svelte-1gtarpt{position:fixed;right:85px;bottom:20px;width:400px;font-size:12px;line-height:22px;font-family:'Roboto';font-weight:500;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;opacity:0;box-shadow:1px 1px 100px 2px rgba(0, 0, 0, 0.22);border-radius:10px;-webkit-transition:all .2s ease-out;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.chat_header.svelte-1gtarpt.svelte-1gtarpt{font-size:13px;font-family:'Roboto';font-weight:500;color:#f3f3f3;height:55px;background:#42a5f5;border-top-left-radius:10px;border-top-right-radius:10px;padding-top:8px}.chat.is-visible.svelte-1gtarpt.svelte-1gtarpt{opacity:1;-webkit-animation:svelte-1gtarpt-zoomIn .2s cubic-bezier(.42, 0, .58, 1);animation:svelte-1gtarpt-zoomIn .2s cubic-bezier(.42, 0, .58, 1)}.chat_option.svelte-1gtarpt.svelte-1gtarpt{float:left;font-size:15px;list-style:none;position:relative;height:100%;width:100%;text-align:relative;margin-right:10px;letter-spacing:0.5px;font-weight:400\\n }.chat_option.svelte-1gtarpt img.svelte-1gtarpt{border-radius:50%;width:55px;float:left;margin:-30px 20px 10px 20px;border:4px solid rgba(0, 0, 0, 0.21)}.chat_option.svelte-1gtarpt .agent.svelte-1gtarpt{font-size:12px;font-weight:300}.chat_option.svelte-1gtarpt .online.svelte-1gtarpt{opacity:0.4;font-size:11px;font-weight:300}.chat_body.svelte-1gtarpt.svelte-1gtarpt{background:#fff;width:100%;display:inline-block;text-align:center;overflow-y:auto}.chat_body.svelte-1gtarpt p.svelte-1gtarpt{padding:20px;color:#888\\n }.chat_field.svelte-1gtarpt.svelte-1gtarpt{position:relative;margin:5px 0 5px 0;width:50%;font-family:'Roboto';font-size:12px;line-height:30px;font-weight:500;color:#4b4b4b;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;border:none;outline:none;display:inline-block}.chat_field.chat_message.svelte-1gtarpt.svelte-1gtarpt{height:30px;resize:none;font-size:13px;font-weight:400}.fab_field.svelte-1gtarpt.svelte-1gtarpt{width:100%;display:inline-block;text-align:center;background:#fff;border-top:1px solid #eee;border-bottom-right-radius:10px;border-bottom-left-radius:10px}.fab_field.svelte-1gtarpt a.svelte-1gtarpt{display:inline-block;text-align:center}#fab_send.svelte-1gtarpt.svelte-1gtarpt{float:right;background:rgba(0, 0, 0, 0)}.fab_field.svelte-1gtarpt .fab.svelte-1gtarpt{width:35px;height:35px;box-shadow:none;margin:5px}.chat_converse.svelte-1gtarpt.svelte-1gtarpt{position:relative;background:#fff;margin:6px 0 0px 0;height:300px;min-height:0;font-size:12px;line-height:18px;overflow-y:auto;width:100%;float:right;padding-bottom:30px}.chat.svelte-1gtarpt .chat_converse .chat_msg_item.svelte-1gtarpt{position:relative;margin:8px 0 15px 0;padding:8px 10px;max-width:60%;display:block;word-wrap:break-word;border-radius:3px;-webkit-animation:svelte-1gtarpt-zoomIn .5s cubic-bezier(.42, 0, .58, 1);animation:svelte-1gtarpt-zoomIn .5s cubic-bezier(.42, 0, .58, 1);clear:both;z-index:999}.chat.svelte-1gtarpt .chat_converse .chat_msg_item .chat_avatar.svelte-1gtarpt{position:absolute;top:0}.chat.svelte-1gtarpt .chat_converse .chat_msg_item.chat_msg_item_admin .chat_avatar.svelte-1gtarpt{left:-52px;background:rgba(0, 0, 0, 0.03)}.chat.svelte-1gtarpt .chat_converse .chat_msg_item .chat_avatar.svelte-1gtarpt,.chat_avatar.svelte-1gtarpt img.svelte-1gtarpt{width:40px;height:40px;text-align:center;border-radius:50%}.chat.svelte-1gtarpt .chat_converse .chat_msg_item.chat_msg_item_admin.svelte-1gtarpt{margin-left:60px;float:left;background:rgba(0, 0, 0, 0.03);color:#666}.chat.svelte-1gtarpt .chat_converse .chat_msg_item.chat_msg_item_admin.svelte-1gtarpt:before{content:'';position:absolute;top:15px;left:-12px;z-index:998;border:6px solid transparent;border-right-color:rgba(255, 255, 255, .4)}input.svelte-1gtarpt.svelte-1gtarpt{position:relative;width:90%;font-family:'Roboto';font-size:12px;line-height:20px;font-weight:500;color:#4b4b4b;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;outline:none;background:#fff;display:inline-block;resize:none;padding:5px;border-radius:3px}.svelte-1gtarpt.svelte-1gtarpt::-webkit-scrollbar{width:6px}.svelte-1gtarpt.svelte-1gtarpt::-webkit-scrollbar-track{border-radius:0}.svelte-1gtarpt.svelte-1gtarpt::-webkit-scrollbar-thumb{margin:2px;border-radius:10px;background:rgba(0, 0, 0, 0.2)}.is-float.svelte-1gtarpt.svelte-1gtarpt{box-shadow:0 0 6px rgba(0, 0, 0, .16), 0 6px 12px rgba(0, 0, 0, .32)}@-webkit-keyframes svelte-1gtarpt-zoomIn{0%{-webkit-transform:scale(0);transform:scale(0);opacity:0.0}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes svelte-1gtarpt-zoomIn{0%{-webkit-transform:scale(0);transform:scale(0);opacity:0.0}100%{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes svelte-1gtarpt-load{0%{-webkit-transform:scale(0);transform:scale(0);opacity:0.0}50%{-webkit-transform:scale(1.5);transform:scale(1.5);opacity:1}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@keyframes svelte-1gtarpt-load{0%{-webkit-transform:scale(0);transform:scale(0);opacity:0.0}50%{-webkit-transform:scale(1.5);transform:scale(1.5);opacity:1}100%{-webkit-transform:scale(1);transform:scale(1);opacity:0}}@media only screen and (min-width: 300px){.chat.svelte-1gtarpt.svelte-1gtarpt{width:250px}}@media only screen and (min-width: 480px){.chat.svelte-1gtarpt.svelte-1gtarpt{width:300px}.chat_field.svelte-1gtarpt.svelte-1gtarpt{width:65%}}@media only screen and (min-width: 768px){.chat.svelte-1gtarpt.svelte-1gtarpt{width:300px}.chat_field.svelte-1gtarpt.svelte-1gtarpt{width:65%}}@media only screen and (min-width: 1024px){.chat.svelte-1gtarpt.svelte-1gtarpt{width:300px}.chat_field.svelte-1gtarpt.svelte-1gtarpt{width:65%}}@-webkit-keyframes svelte-1gtarpt-ripple{100%{opacity:0;-moz-transform:scale(5);-ms-transform:scale(5);webkit-transform:scale(5);-webkit-transform:scale(5);transform:scale(5)}}@keyframes svelte-1gtarpt-ripple{100%{opacity:0;-moz-transform:scale(5);-ms-transform:scale(5);webkit-transform:scale(5);-webkit-transform:scale(5);transform:scale(5)}}.svelte-1gtarpt.svelte-1gtarpt::-webkit-input-placeholder{color:#bbb}.svelte-1gtarpt.svelte-1gtarpt:-ms-input-placeholder{color:#bbb}.svelte-1gtarpt.svelte-1gtarpt::-moz-placeholder{color:#bbb}.svelte-1gtarpt.svelte-1gtarpt:-moz-placeholder{color:#bbb}.label-color.svelte-1gtarpt.svelte-1gtarpt{color:black}\");\n\t}", "transformToMeme(id, isFetch) {\n const trans = this.defaultTransformation();\n const imageURL = this.cl.url(id, {\n type: 'fetch',\n transformation: [\n trans.general,\n {\n overlay: `text:impact.ttf_55_stroke_center_line_spacing_-10:${encodeURIComponent(\n this.state.topText\n )}`,\n ...trans.textGeneral,\n ...trans.textTop\n },\n {\n overlay: `text:impact.ttf_55_stroke_center_line_spacing_-10:${encodeURIComponent(\n this.state.bottomText\n )}`,\n ...trans.textGeneral,\n ...trans.textBottom\n }\n ]\n });\n this.setState({ stage: 'PVR', preview: imageURL, memeReady: true });\n }", "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-10bst2e-style\";\n\tstyle.textContent = \".svelte-10bst2e.svelte-10bst2e{user-select:none}h1.svelte-10bst2e.svelte-10bst2e{text-align:center;padding-bottom:1rem}.puzzle.svelte-10bst2e.svelte-10bst2e{font-family:system-ui;width:max(375px, 50vmin);margin:auto;padding-top:3rem;padding-bottom:3rem}.grid.svelte-10bst2e.svelte-10bst2e{width:max(375px, 50vmin);height:max(375px, 50vmin);display:grid;grid-template-rows:repeat(4, 1fr);grid-template-columns:repeat(4, 1fr);grid-gap:5px;margin:auto}.grid.svelte-10bst2e>.item.svelte-10bst2e{border-radius:7px;background-color:blanchedalmond;display:flex;justify-content:center;align-items:center;font-size:2rem}.item.hidden.svelte-10bst2e.svelte-10bst2e{opacity:0}.history.svelte-10bst2e.svelte-10bst2e{display:flex;justify-content:center;flex-wrap:wrap;padding-top:2rem;padding-bottom:2rem}.history.svelte-10bst2e>.item.svelte-10bst2e{padding:4px;font-size:2rem}.history.svelte-10bst2e>.item[flag='0'].svelte-10bst2e{color:rgb(211, 211, 211)}.history.svelte-10bst2e>.item[flag='1'].svelte-10bst2e{color:rgb(63, 203, 141)}.button.svelte-10bst2e.svelte-10bst2e{padding:1rem 2rem;border:none;border-radius:8px;background-color:#e8e9e4}\";\n\tappend(document.head, style);\n}", "function generateCSS(adjustments, emPx, unitFlag) {\n var x, concatCSS, theCSS;\n theCSS = [];\n for (x in adjustments) {\n if (adjustments.hasOwnProperty(x)) {\n \tvar adj = adjustments[x]\n concatCSS = [x + \" {\", adj.to_css(unitFlag === 'em'), '}'].join('\\n');\n theCSS = theCSS + '\\n' + concatCSS;\n }\n }\n return theCSS;\n }", "htmlForAv() {\nvar html, sty;\n//--------\nsty = this.avBg != null ? `style=\\\"background: ${this.avBg};\\\" ` : \"\";\nif (typeof lggr.debug === \"function\") {\nlggr.debug(`HTMLForAvatarGUI: Style for background is: \\'${sty}\\'`);\n}\nhtml = `<div class=\"divAv av${this.ix}\" ${sty}>\n<canvas class=\"canvasAv av${this.ix}\" ></canvas>\n</div> <!--class=\"divAv av${this.ix}\"-->`;\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`HTMLForAvatarGUI: HTML:\\n${html}`);\n}\nreturn html;\n}", "getResponseHtml(heading, errors, displayBack) {\n const styles = require(\"fs\").readFileSync(\n __dirname + \"/../css/main.css\",\n \"utf-8\"\n );\n const minifyOptions = {\n collapseWhitespace: true,\n removeComments: true,\n collapseInlineTagWhitespace: true,\n minifyCSS: true\n };\n\n return minify(\n `\n <!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title></title>\n <style>${styles}</style>\n <meta name=\"robots\" content=\"noindex,nofollow\">\n </head>\n <body>\n <div class=\"wrapper\">\n <div class=\"little-box\">\n ${this.getHeadingMarkup(heading)}\n ${this.getErrorsMarkup(errors)}\n ${this.getBackMarkup(displayBack)}\n </div>\n </div>\n </body>\n </html>\n `,\n minifyOptions\n );\n }", "async function fetchStyles() {\n try {\n checkBreweryAPIConfiguration();\n\n const apiUrl = `${BREWERY_DB.API_ENDPOINT}/styles?key=${BREWERY_DB.API_KEY}`;\n\n return rp({ uri: apiUrl, json: true });\n } catch(err) {\n console.log(err);\n }\n}", "function j(a){var c=\"\",d=a.split(\";\");return b.forEach(d,function(a){var d=a.split(\":\");if(2==d.length){var e=O(b.lowercase(d[0])),a=O(b.lowercase(d[1]));((\"color\"===e||\"background-color\"===e)&&(a.match(/^rgb\\([0-9%,\\. ]*\\)$/i)||a.match(/^rgba\\([0-9%,\\. ]*\\)$/i)||a.match(/^hsl\\([0-9%,\\. ]*\\)$/i)||a.match(/^hsla\\([0-9%,\\. ]*\\)$/i)||a.match(/^#[0-9a-f]{3,6}$/i)||a.match(/^[a-z]*$/i))||\"text-align\"===e&&(\"left\"===a||\"right\"===a||\"center\"===a||\"justify\"===a)||\"text-decoration\"===e&&(\"underline\"===a||\"line-through\"===a)||\"font-weight\"===e&&\"bold\"===a||\"font-style\"===e&&\"italic\"===a||\"float\"===e&&(\"left\"===a||\"right\"===a||\"none\"===a)||\"vertical-align\"===e&&(\"baseline\"===a||\"sub\"===a||\"super\"===a||\"test-top\"===a||\"text-bottom\"===a||\"middle\"===a||\"top\"===a||\"bottom\"===a||a.match(/[0-9]*(px|em)/)||a.match(/[0-9]+?%/))||\"font-size\"===e&&(\"xx-small\"===a||\"x-small\"===a||\"small\"===a||\"medium\"===a||\"large\"===a||\"x-large\"===a||\"xx-large\"===a||\"larger\"===a||\"smaller\"===a||a.match(/[0-9]*\\.?[0-9]*(px|em|rem|mm|q|cm|in|pt|pc|%)/))||(\"width\"===e||\"height\"===e)&&a.match(/[0-9\\.]*(px|em|rem|%)/)||// Reference #520\n\"direction\"===e&&a.match(/^ltr|rtl|initial|inherit$/))&&(c+=e+\": \"+a+\";\")}}),c}", "function j(a){var c=\"\",d=a.split(\";\");return b.forEach(d,function(a){var d=a.split(\":\");if(2==d.length){var e=O(b.lowercase(d[0])),a=O(b.lowercase(d[1]));((\"color\"===e||\"background-color\"===e)&&(a.match(/^rgb\\([0-9%,\\. ]*\\)$/i)||a.match(/^rgba\\([0-9%,\\. ]*\\)$/i)||a.match(/^hsl\\([0-9%,\\. ]*\\)$/i)||a.match(/^hsla\\([0-9%,\\. ]*\\)$/i)||a.match(/^#[0-9a-f]{3,6}$/i)||a.match(/^[a-z]*$/i))||\"text-align\"===e&&(\"left\"===a||\"right\"===a||\"center\"===a||\"justify\"===a)||\"text-decoration\"===e&&(\"underline\"===a||\"line-through\"===a)||\"font-weight\"===e&&\"bold\"===a||\"font-style\"===e&&\"italic\"===a||\"float\"===e&&(\"left\"===a||\"right\"===a||\"none\"===a)||\"vertical-align\"===e&&(\"baseline\"===a||\"sub\"===a||\"super\"===a||\"test-top\"===a||\"text-bottom\"===a||\"middle\"===a||\"top\"===a||\"bottom\"===a||a.match(/[0-9]*(px|em)/)||a.match(/[0-9]+?%/))||\"font-size\"===e&&(\"xx-small\"===a||\"x-small\"===a||\"small\"===a||\"medium\"===a||\"large\"===a||\"x-large\"===a||\"xx-large\"===a||\"larger\"===a||\"smaller\"===a||a.match(/[0-9]*\\.?[0-9]*(px|em|rem|mm|q|cm|in|pt|pc|%)/))||(\"width\"===e||\"height\"===e)&&a.match(/[0-9\\.]*(px|em|rem|%)/)||// Reference #520\n\"direction\"===e&&a.match(/^ltr|rtl|initial|inherit$/))&&(c+=e+\": \"+a+\";\")}}),c}", "function add_css$7() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-w0x6cj-style\";\n\tstyle.textContent = \".wrapper.svelte-w0x6cj{height:var(--size);width:var(--size);display:inline-block;text-align:center;font-size:10px}.rect.svelte-w0x6cj{height:100%;width:10%;display:inline-block;margin-right:4px;background-color:var(--color);animation:svelte-w0x6cj-stretch var(--duration) ease-in-out infinite}@keyframes svelte-w0x6cj-stretch{0%,40%,100%{transform:scaleY(0.4)}20%{transform:scaleY(1)}}\";\n\tappend(document.head, style);\n}", "function add_css$1() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-njq4pk-style\";\n \tstyle.textContent = \".color-picker-wrapper.svelte-njq4pk{border:1px solid #ecf0f1;border-top:none;background:#FFF;box-shadow:rgba(0,0,0,.1) 0 2px 3px;width:290px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);padding:0;position:absolute;top:37px;z-index:11}.color-picker-overlay.svelte-njq4pk{position:absolute;background-color:rgba(255,255,255,.5);height:100%;width:100%;left:0;top:0;z-index:10}.color-picker-btn.svelte-njq4pk{display:block;position:relative;float:left;height:20px;width:20px;border:1px solid #333;padding:0;margin:2px;line-height:35px;text-decoration:none;background:#FFF;color:#333!important;cursor:pointer;text-align:left;font-size:15px;transition:all 150ms;line-height:20px;padding:0px 5px}.color-picker-btn.svelte-njq4pk:hover::after{content:\\\" \\\";display:block;position:absolute;top:-5px;left:-5px;height:27px;width:27px;background:inherit;border:1px solid #FFF;box-shadow:#000 0 0 2px;z-index:10}\";\n \tappend(document.head, style);\n }", "function css() { return exports.cssSyntax.extension; }", "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-f66dpe-style\";\n\tstyle.textContent = \".flex.svelte-f66dpe{display:flex}.flex-direction--row.svelte-f66dpe{flex-direction:row}.flex-direction--column.svelte-f66dpe{flex-direction:column}.flex-direction--row--reverse.svelte-f66dpe{flex-direction:row-reverse}.flex-direction--column--reverse.svelte-f66dpe{flex-direction:column-reverse}.flex-align--start.svelte-f66dpe{align-items:flex-start}.flex-align--center.svelte-f66dpe{align-items:center}.flex-align--end.svelte-f66dpe{align-items:flex-end}.flex-align--stretch.svelte-f66dpe{align-items:stretch}.flex-justify--start.svelte-f66dpe{justify-content:flex-start}.flex-justify--center.svelte-f66dpe{justify-content:center}.flex-justify--end.svelte-f66dpe{justify-content:flex-end}.flex-justify--around.svelte-f66dpe{justify-content:space-around}.flex-justify--between.svelte-f66dpe{justify-content:space-between}.flex-justify--evenly.svelte-f66dpe{justify-content:space-evenly}\";\n\tappend(document.head, style);\n}", "function addStyles() {\n /* cheatSheet */\n var style = '\\\ndiv#cheatSheet>p{line-height: 2em;}\\n\\\np#shortcut-title{font-weight:bold;}\\n\\\ncode.shortcut-key{margin: auto 0.8em;\\\n-moz-appearance:button;\\\n-webkit-appearance:button;\\\npadding:3px 7px;\\\n}\\n\\\n@media screen and (-webkit-min-device-pixel-ratio:0){\\\ndiv#cheatSheet>p{line-height: 1.7em;}\\\n}' /* CSS hack for webkit */\n\n GM_addStyle(style);\n}", "function getCSSStringFromSetting(setting) {\n let { backgroundAlpha } = setting;\n if (backgroundAlpha === 0) {\n // NOTE: background alpha 0 results total transparent\n // which will cause mouse leave event not trigger\n // correct in windows platform for lyic window if disable\n // hardware accelerate\n backgroundAlpha = 0.01;\n }\n return `div.content.lyric-content{\n font-size: ${setting.fontSize}px;\n color: ${setting.color};\n background: rgba(36, 36, 36, ${backgroundAlpha});\n }\n div.content.lyric-content span.contentTrans {\n font-size: ${setting.fontSize - 4}px;\n }\n `;\n}", "function add_css$1() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-92ktqf-style\";\n\tstyle.textContent = \".circle.svelte-92ktqf{width:var(--size);height:var(--size);box-sizing:border-box;position:relative;border:3px solid transparent;border-top-color:var(--colorOuter);border-radius:50%;animation:svelte-92ktqf-circleSpin var(--durationOuter) linear infinite}.circle.svelte-92ktqf:before,.circle.svelte-92ktqf:after{content:\\\"\\\";box-sizing:border-box;position:absolute;border:3px solid transparent;border-radius:50%}.circle.svelte-92ktqf:after{border-top-color:var(--colorInner);top:9px;left:9px;right:9px;bottom:9px;animation:svelte-92ktqf-circleSpin var(--durationInner) linear infinite}.circle.svelte-92ktqf:before{border-top-color:var(--colorCenter);top:3px;left:3px;right:3px;bottom:3px;animation:svelte-92ktqf-circleSpin var(--durationCenter) linear infinite}@keyframes svelte-92ktqf-circleSpin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}\";\n\tappend(document.head, style);\n}", "function mutateHtmlTextsOpacity() {\n // rawArticle += 'STRONG WORDS SENTENCES (filter by common words dictionary)' + ' : \\n\\n';\n // rawArticle += '------------- \\n\\n';\n\n let outputText = ''\n let elms = Array.from(document.querySelectorAll('a,b,blockquote,button,dd,del,dt,em,h1,h2,h3,h4,h5,h6,i,ins,label,li,mark,p,small,span,strong,sub,sup,td,th'))\n elms.forEach(elm => {\n let words = elm.innerText.split(/\\s/g)\n .map(x => {\n if (commonWordsDictionnary.includes(x.toLowerCase()) == true) {\n return '<span data-trigger=\"orasyo-low\" style=\"opacity:0.44;\">' + x.trim() + '</span>'\n } else {\n return '<span data-trigger=\"orasyo-high\">' + x + '</span>'\n }\n })\n\n elm.innerHTML = words.join(' ')\n\n // write in \"pre\"\n // outputText += Array.from(elm.children)\n // .filter(x => x.dataset.trigger == 'orasyo-high')\n // .map(x => x.innerText)\n // .reduce((acc, val) => {\n // if (acc.includes(val))\n // acc.push(val)\n // return acc\n // }, [])\n // .join(' ') + '\\n';\n })\n\n // rawArticle += outputText\n\n // // always display results in console\n // rawArticle += '\\n\\n' + separator + '\\n\\n';\n}", "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1fgt3j0-style\";\n\tstyle.textContent = \".circle.svelte-1fgt3j0{height:var(--size);width:var(--size);border-color:var(--color) transparent var(--color) var(--color);border-width:calc(var(--size) / 15);border-style:solid;border-image:initial;border-radius:50%;animation:var(--duration) linear 0s infinite normal none running svelte-1fgt3j0-rotate}@keyframes svelte-1fgt3j0-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}\";\n\tappend(document.head, style);\n}", "function displayKeyword() {\n\n var link = document.createElement('link');\n link.href = 'https://fonts.googleapis.com/css?family=Heebo:900|Roboto:900i';\n link.rel = 'stylesheet';\n document.getElementsByTagName('head')[0].appendChild(link);\n\n\n // background color : emotional state of article (anger, fear, joy, sadness)\n var storyHeader = document.getElementById('story-header');\n document.body.style.backgroundImage = \"-webkit-linear-gradient(left, hsl(343, \" + emotionAnger + \"%, \" + emotionAngerMinus + \"%) 25%, hsl(277, \" + emotionFear + \"%, \" + emotionFearMinus + \"%) 50%, hsl(52, \" + emotionJoy + \"%, \" + emotionJoyMinus + \"%) 75%, hsl(212, \" + emotionSadness + \"%, \" + emotionSadnessMinus + \"%) 100%)\";\n\n // remove attribute of title in link to prevent errors\n $('p a').removeAttr(\"title\");\n\n //picked font color : important keywords with sentimemt (posivite, neutral, negative)\n var keywordsKeys = Object.keys(keywordSentiment);\n for (i = 0; i < keywordsKeys.length; i++) {\n var search = keywordsKeys[i];\n var value = keywordSentiment[search];\n\n if (value == 'negative') {\n $('p:contains(' + search + ')', document.body).each(function() {\n $(this).html($(this).html().replace(\n new RegExp(search, 'gi'), '<span style=\"color: black; font-family: Roboto, sans-serif;\">' + search + '</span>'\n ));\n });\n } else if (value == 'positive') {\n $('p:contains(' + search + ')', document.body).each(function() {\n $(this).html($(this).html().replace(\n new RegExp(search, 'gi'), '<span style=\"color: white; font-family: Roboto, sans-serif;\">' + search + '</span>'\n ));\n });\n } else if (value == 'neutral') {\n $('p:contains(' + search + ')', document.body).each(function() {\n $(this).html($(this).html().replace(\n new RegExp(search, 'gi'), '<span style=\"color: #737370; font-family: Roboto, sans-serif;\">' + search + '</span>'\n ));\n });\n }\n }\n }", "function getSandboxStyle(_ref) {\n var id = _ref.id,\n ANIMATION = _ref.ANIMATION;\n return \"\\n #\" + id + \".paypal-checkout-sandbox {\\n display: block;\\n position: fixed;\\n top: 0;\\n left: 0;\\n\\n width: 100%;\\n height: 100%;\\n width: 100vw;\\n height: 100vh;\\n max-width: 100%;\\n max-height: 100%;\\n min-width: 100%;\\n min-height: 100%;\\n\\n z-index: 2147483647;\\n\\n -webkit-animation-duration: 1s;\\n animation-duration: 1s;\\n\\n animation-fill-mode:forwards;\\n animation-iteration-count: 1;\\n\\n -webkit-animation-fill-mode:forwards;\\n -webkit-animation-iteration-count: 1;\\n }\\n\\n #\" + id + \".paypal-checkout-sandbox .paypal-checkout-sandbox-iframe {\\n display: block;\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n }\\n\\n @-webkit-keyframes \" + ANIMATION.SHOW_CONTAINER + \" {\\n from {\\n opacity: 0;\\n }\\n\\n to {\\n opacity: 1;\\n }\\n }\\n\\n @keyframes \" + ANIMATION.SHOW_CONTAINER + \" {\\n from {\\n opacity: 0;\\n }\\n\\n to {\\n opacity: 1;\\n }\\n }\\n\\n @-webkit-keyframes \" + ANIMATION.HIDE_CONTAINER + \" {\\n from {\\n opacity: 1;\\n }\\n\\n 50% {\\n opacity: 1;\\n }\\n\\n to {\\n opacity: 0;\\n }\\n }\\n\\n @keyframes \" + ANIMATION.HIDE_CONTAINER + \" {\\n from {\\n opacity: 1;\\n }\\n\\n 50% {\\n opacity: 1;\\n }\\n\\n to {\\n opacity: 0;\\n }\\n }\\n \";\n}", "function add_css(target) {\n\tappend_styles(target, \"svelte-1jyh043\", \"p.svelte-1jyh043{font-size:small;color:crimson}\");\n}", "function SkypeEmos() {}", "function add_css$7(){var style=element(\"style\");style.id=\"svelte-1jezb03-style\";style.textContent=\"ul.svelte-1jezb03{display:flex;flex-flow:column nowrap;position:fixed;font-size:16px;padding:0 0.75em;margin:0;list-style-type:none;width:20em;bottom:0;right:0;font-family:\\\"Helvetica Neue\\\";max-height:100vh;overflow-y:scroll;overflow-x:hidden;color:#4a4a4a;background:transparent;scrollbar-width:none;box-sizing:border-box;height:100vh;pointer-events:none;z-index:99999999}@media only screen and (max-width: 450px){ul.svelte-1jezb03{width:100%}}.bn-notify-custom.bn-notify-dark-mode{background:#283944;color:#ffffff;background:rgba(40, 57, 68, 0.9)}.bn-notify-clickable:hover{cursor:pointer}.svelte-1jezb03::-webkit-scrollbar{display:none}li.svelte-1jezb03{position:relative;display:flex;padding:0.75em;font-size:0.889em;border-radius:10px;background:#ffffff;box-shadow:0px 2px 10px rgba(0, 0, 0, 0.1);color:inherit;transition:background 300ms ease-in-out, color 300ms ease-in-out;pointer-events:all;background:#ffffff;backdrop-filter:blur(5px);background:rgba(255, 255, 255, 0.9)}div.svelte-1jezb03{position:absolute;top:0.75em;right:0.75em;font-size:inherit}\";append(document.head,style)}", "function doGet(e) {\n return ContentService\n .createTextOutput(pit(e,getColorStuff(e)))\n .setMimeType(ContentService.MimeType.JSON); \n}", "extractStyles() {\n\t\tconst options = this.options\n\t\tlet full_code = this.full_code\n\t\tlet first = true\n\t\tlet res = ''\n\n\t\tlet styles = pregMatchAll(styleRegex, full_code)\n\t\tif (!styles.length) return ''\n\t\t\n\t\tfor (let style of styles) {\n\t\t\tres += style[1] + '\\n'\n\n\t\t\t// Style tag spacer\n\t\t\tlet spacer = options.openDelimiter + options.delimiter\n\t\t\t\t+ '// ' + style[0].replace(/\\r?\\n/g, '\\n// ')\n\t\t\t\t+ options.delimiter + options.closeDelimiter\n\t\t\t\n\t\t\t// Add <%= styles %> for the first tag\n\t\t\tif (first) {\n\t\t\t\tfirst = false\n\t\t\t\tspacer = options.openDelimiter + options.delimiter\n\t\t\t\t\t+ '- styles '\n\t\t\t\t\t+ options.delimiter + options.closeDelimiter\n\t\t\t\t\t+ spacer\n\t\t\t}\n\t\t\t\n\t\t\tfull_code = full_code.replace(style[0], spacer)\n\t\t}\n\n\t\t//TODO: Sass?\n\n\t\tthis.styles = res\n\t\tthis.full_code = full_code\n\t}", "function add_css() {\n\tvar style = (0, _shared.createElement)(\"style\");\n\tstyle.id = 'svelte-12mbumt-style';\n\tstyle.textContent = \".colab-root.svelte-12mbumt{display:inline-block;background:rgba(255, 255, 255, 0.75);padding:4px 8px;border-radius:4px;font-size:11px!important;text-decoration:none;color:#aaa;border:none;font-weight:300;border:solid 1px rgba(0, 0, 0, 0.08);border-bottom-color:rgba(0, 0, 0, 0.15);text-transform:uppercase;line-height:16px}span.svelte-12mbumt{background-image:url(images/colab.svg);background-repeat:no-repeat;background-size:20px;background-position-y:2px;display:inline-block;padding-left:24px;border-radius:4px;text-decoration:none}a.svelte-12mbumt:hover{color:#666;background:white;border-color:rgba(0, 0, 0, 0.2)}\";\n\t(0, _shared.append)(document.head, style);\n}", "function getPoceTypesWithStyling(poceObject){\n var poceTypes = \"\";\n for (var count=0;count<poceObject.types.length; count++){\n var typeName=poceObject.types[count].name;\n poceTypes+=\"<span class='\"+typeName+\"-color \"+typeName+\"-filter type-padding' >\"+typeName+\" </span>\";\n }\n return poceTypes;\n}", "function Get_CSS_by_GM_getValue(css) {\r\n Add_CSS(css);\r\n}", "function amuse_data_to_js_crossword() {\n var puzdata = JSON.parse(b64DecodeUnicode(window.rawc));\n var metadata = {\n title: puzdata.title || puzdata.srcFileName,\n author: puzdata.author,\n copyright: puzdata.copyright,\n description: puzdata.description,\n width: puzdata.w,\n height: puzdata.h,\n };\n\n /* Solution and grid */\n var cells = [];\n for (var j=0; j < puzdata.h; j++) {\n for (var i=0; i < puzdata.w; i++) {\n var letter = puzdata.box[i][j];\n var number = puzdata.clueNums[i][j];\n /* start our cell */\n var cell = {\"x\": i+1, \"y\": j+1};\n /* if there's a letter, mark it as the solution */\n if (letter == '\\u0000') {\n cell[\"type\"] = \"block\";\n }\n else {\n cell[\"solution\"] = letter;\n }\n /* if there's a number, add it */\n if (number !== 0) {\n cell[\"number\"] = number;\n }\n /* if there's a cellInfo with information about this cell, add that info */\n var cellInfos = puzdata.cellInfos || [];\n var ix = cellInfos.findIndex(e => (e.x === i && e.y === j))\n if (ix !== -1) {\n var cellInfoObj = cellInfos[ix];\n if (cellInfoObj.bgColor) {\n cell['background-color'] = cellInfoObj.bgColor;\n }\n if (cellInfoObj.isCircled) {\n cell['background-shape'] = 'circle';\n }\n if (cellInfoObj.bottomWall) {\n cell['bottom-bar'] = 'true';\n }\n if (cellInfoObj.rightWall) {\n cell['right-bar'] = 'true';\n }\n if (cellInfoObj.topWall) {\n cell['top-bar'] = 'true';\n }\n if (cellInfoObj.leftWall) {\n cell['left-bar'] = 'true';\n }\n }\n cells.push(cell);\n }\n }\n\n /* Words and clues */\n var words = [];\n var clues = [{\"title\": \"ACROSS\", \"clue\": []}, {\"title\": \"DOWN\", \"clue\": []}]\n for (var word_id in Object.keys(puzdata.placedWords)) {\n var my_obj = puzdata.placedWords[word_id];\n if (my_obj['nBoxes']) {\n var word = {\"id\": word_id};\n var clue = {\"word\": word_id};\n var word_cells = [];\n var x1 = my_obj.x + 1; var y1 = my_obj.y + 1;\n /* determine if this is an across or down clue */\n var isAcross = my_obj.acrossNotDown;\n /* take care of the cells in the word */\n for (var word_ctr = 0; word_ctr < my_obj.nBoxes; word_ctr++) {\n word_cells.push({\"x\": x1, \"y\": y1});\n if (isAcross) {\n x1 += 1;\n }\n else {\n y1 += 1;\n }\n }\n word[\"cells\"] = word_cells;\n words.push(word);\n\n /* take care of the remaining information for the clue now */\n clue[\"number\"] = my_obj.clueNum;\n clue[\"text\"] = my_obj['clue']['clue'];\n if (isAcross) {\n clues[0]['clue'].push(clue);\n }\n else {\n clues[1]['clue'].push(clue);\n }\n }\n }\n var new_crossword = new JSCrossword(metadata, cells, words, clues);\n return new_crossword;\n}", "function SetCSS()\n{\n\t$(\"head\").append($(\"<!--Start of IMDB Enhancement v\" + GM.info.script.version + \" CSS-->\"));\n\n\t/*Settings Filled icon by Icons8 */\n\t/* Customizes Settings Filled icon */\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\"div.imdbe_image {width: 40px;height: 40px;background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTEyIDUxMjsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGNpcmNsZSBzdHlsZT0iZmlsbDojRkZENDAwOyIgY3g9IjI1NiIgY3k9IjI1NiIgcj0iMjU2Ii8+DQo8cGF0aCBzdHlsZT0iZmlsbDojRkY5RjAwOyIgZD0iTTUxMiwyNTZjMC01LTAuMTU5LTkuOTYzLTAuNDQyLTE0Ljg5MkwzNjguNzI1LDk4LjI3NUwzNjIsMTE4bC0yMS4yODktMWwtNTIuOTg3LTUzTDY0LDI4Ny43MjQNCglsNTMsNTIuOTg3bDI2LjAwMyw3Mi43NDJsOTguMTA1LDk4LjEwNUMyNDYuMDM3LDUxMS44NDEsMjUxLDUxMiwyNTYsNTEyQzM5Ny4zODUsNTEyLDUxMiwzOTcuMzg1LDUxMiwyNTZ6Ii8+DQo8cGF0aCBzdHlsZT0iZmlsbDojNUE1QTVBOyIgZD0iTTQ0OCwyODcuNzI0di02My40NDlsLTUyLjA1MS0xMC4zNWMtMi45MjQtOS40NS02LjUyNS0xOC40NS0xMS4yNS0yNy4yMjVsMjkuMDI2LTQzLjQyNWwtNDUtNDUNCglMMzI1LjMsMTI3LjMwMWMtOC43NzUtNC43MjUtMTcuNzc2LTguMzI2LTI3LjIyNS0xMS4yNUwyODcuNzI0LDY0aC02My40NDlsLTEwLjM1LDUyLjA1MWMtOS40NSwyLjkyNC0xOC40NSw2LjUyNS0yNy4yMjUsMTEuMjUNCglsLTQzLjQyNS0yOS4wMjZsLTQ1LDQ1bDI5LjAyNiw0My40MjVjLTQuNzI1LDguNzc1LTguMzI2LDE3Ljc3Ni0xMS4yNSwyNy4yMjVMNjQsMjI0LjI3NnY2My40NDlsNTIuMDUxLDEwLjM1DQoJYzIuOTI0LDkuNDUsNi41MjUsMTguNDUsMTEuMjUsMjcuMjI1bC0yOS4wMjYsNDMuNDI1bDQ1LDQ1bDQzLjQyNS0yOS4wMjZjOC43NzUsNC43MjUsMTcuNzc2LDguMzI2LDI3LjIyNSwxMS4yNUwyMjQuMjc2LDQ0OA0KCWg2My40NDlsMTAuMzUtNTIuMDUxYzkuNDUtMi45MjQsMTguNDUtNi41MjUsMjcuMjI1LTExLjI1bDQzLjQyNSwyOS4wMjZsNDUtNDVMMzg0LjY5OSwzMjUuMw0KCWM0LjcyNS04Ljc3NSw4LjMyNi0xNy43NzYsMTEuMjUtMjcuMjI1TDQ0OCwyODcuNzI0eiBNMjU2LDMzNC43NWMtNDMuNDI1LDAtNzguNzUtMzUuMzI1LTc4Ljc1LTc4Ljc1czM1LjMyNS03OC43NSw3OC43NS03OC43NQ0KCXM3OC43NSwzNS4zMjUsNzguNzUsNzguNzVTMjk5LjQyNSwzMzQuNzUsMjU2LDMzNC43NXoiLz4NCjxwYXRoIHN0eWxlPSJmaWxsOiM0NDQ0NDQ7IiBkPSJNMzk1Ljk0OSwyOTguMDc1Yy0yLjkyNCw5LjQ1LTYuNTI1LDE4LjQ1LTExLjI1LDI3LjIyNWwyOS4wMjYsNDMuNDI1bC00NSw0NUwzMjUuMywzODQuNjk5DQoJYy04Ljc3NSw0LjcyNS0xNy43NzYsOC4zMjYtMjcuMjI1LDExLjI1TDI4Ny43MjQsNDQ4SDI1NlYzMzQuNzVjNDMuNDI1LDAsNzguNzUtMzUuMzI1LDc4Ljc1LTc4Ljc1cy0zNS4zMjUtNzguNzUtNzguNzUtNzguNzVWNjQNCgloMzEuNzI0bDEwLjM1LDUyLjA1MWM5LjQ1LDIuOTI0LDE4LjQ1LDYuNTI1LDI3LjIyNSwxMS4yNWw0My40MjUtMjkuMDI2bDQ1LDQ1TDM4NC42OTksMTg2LjcNCgljNC43MjUsOC43NzUsOC4zMjYsMTcuNzc2LDExLjI1LDI3LjIyNUw0NDgsMjI0LjI3NnY2My40NDlMMzk1Ljk0OSwyOTguMDc1eiIvPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPGc+DQo8L2c+DQo8Zz4NCjwvZz4NCjxnPg0KPC9nPg0KPC9zdmc+DQo=)}\"));\n\n\t/* Customizes all icons at once */\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\".icon { \\\n\tdisplay: inline-block; \\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\"#imdbe_setbutton { \\\n\tdisplay: inline-flex;\\\n\tcursor: pointer;\\\n\torder: 10;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\"#imdbe_settings { \\\n\tposition: fixed;\\\n\tz-index: 500;\\\n\tbackground: #1f1f1f;\\\n\tfont-family: Roboto,Helvetica,Arial,sans-serif;\\\n\tcolor:#dddddd;\\\n\tpadding:10px;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\".imdbe_revBarC { \\\n\tfloat:left;\\\n padding-top:11px;\\\n\tpadding-left:15px;\\\n\tpadding-bottom:0px;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\"#imdbe_field { \\\n\tpadding-left:15px;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\"#imdbe_divtrailer { \\\n\tpadding-left:20px;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\"#imdbe_popupDiv { \\\n\tbackground: #1f1f1f;\\\n\tz-index: 500;\\\n\tmax-width: 700px;\\\n\tmin-height: 200px;\\\n\tborder: 2px solid #f5c518;\\\n\tcolor:#bcbcbc;\\\n\t\tpadding:5px;\\\n\t\tdisplay: flex\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\".imdbe_mode-advanced { \\\n\tfont-size: 14px;\\\n\tpadding: 5px 10px;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\".imdbe_lister-item-image { \\\n\tdisplay: inline-block;\\\n\tvertical-align: top;\\\n\tmargin-right: 20px;\\\n}\"));\n\n\t$(\"head\").append($(\"<style type=text/css></style>\").text(\".imdbe_lister-item-content { \\\n\tmax-width: 90%;\\\n\tdisplay: inline-block;\\\n\tvertical-align: top;\\\n}\"));\n\n\t$(\"head\").append($(\"<!--End of IMDB Enhancement v\" + GM.info.script.version + \" CSS-->\"));\n}", "updateResult() {\n let borderRad = this.create.css('border-radius'),\n brColor = this.create.css('border-color'),\n bgColor = this.create.css('background-color');\n\n this.codeResultArea.text(\n 'border-radius: ' + borderRad + ';\\n' +\n 'border-color: ' + brColor + ';\\n' +\n 'background-color: ' + bgColor + ';'\n )\n\n }", "function convertColor() {\n var colorEntry = document.querySelector(\".convertValue\")\n var entryValue = colorEntry.value\n m\n .request({\n method: 'PUT',\n url: `http://localhost:8001/color/handle`,\n body: {\n \"value\": entryValue\n }\n })\n //should return hex! otherwise error\n .then((response) => {\n if (response) {\n let data = response\n console.log(\"data\", data)\n\n if (response != \"Color not supported\") {\n\n document.querySelector(\".returnText\").innerHTML = `Hex value is ` + data\n let root = document.documentElement\n\n root.style.setProperty('--color', '#' + data)\n return\n }\n document.querySelector(\".returnText\").innerHTML = `Error! ` + data\n \n }\n })\n\n\n }" ]
[ "0.56144387", "0.5477976", "0.54674333", "0.5443159", "0.542435", "0.5397282", "0.53913593", "0.53876346", "0.5385852", "0.5382102", "0.5381167", "0.53371596", "0.53367007", "0.5330744", "0.5330494", "0.53286934", "0.53247344", "0.5306069", "0.52652663", "0.526246", "0.5255722", "0.5254512", "0.5242165", "0.52397126", "0.52188164", "0.5218182", "0.5213404", "0.5204673", "0.51999736", "0.51959556", "0.5191631", "0.5182046", "0.51815736", "0.51794535", "0.51757514", "0.5170921", "0.5166656", "0.5154066", "0.51457036", "0.51457036", "0.51457036", "0.51457036", "0.51411146", "0.51390374", "0.51198757", "0.51128846", "0.5107653", "0.50929433", "0.5077216", "0.50710315", "0.5054173", "0.5053521", "0.50533", "0.50523615", "0.50520116", "0.50470144", "0.50342166", "0.5027779", "0.5026176", "0.5023502", "0.50215334", "0.50199664", "0.50174826", "0.5015076", "0.50044745", "0.49994898", "0.49981004", "0.49950045", "0.49919814", "0.49919176", "0.49850267", "0.4979586", "0.49679008", "0.49651396", "0.4963275", "0.49623072", "0.49622044", "0.49622044", "0.49617735", "0.49585348", "0.49582475", "0.49495858", "0.4941676", "0.49401507", "0.49189848", "0.49161634", "0.4913259", "0.49122134", "0.49073187", "0.48895982", "0.4881734", "0.48773915", "0.48695216", "0.4866592", "0.48639354", "0.48615098", "0.48574063", "0.48571667", "0.4855746", "0.48553932", "0.48514882" ]
0.0
-1
Takes a word as a parameter and returns a transfromed word.
function wordToPigLatin(word) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate(word)\n{\n return Language[word]\n\n}", "function convertWord(word) {\n if(word === 'rock') return 'Rock';\n if(word === 'paper') return 'Paper';\n if(word === 'scissors') return 'Scissors';\n if(word === 'lizard') return 'Lizard';\n if(word === 'spock') return 'Spock';\n}", "function translateToPigLatin(word) { //defining function to break up the word, add 1st to end and ay to end\n return word.slice(1, word.length) + word[0] + \"ay\";\n}", "function translate(str){\n\treturn str;\n}", "function reverseWord(word) {\n if (word === undefined) throw new Error(\"word is required\");\n return word.split('').reverse().join('')\n}", "function reverseWord(string){\n\n}", "function translate(phrase){\n\tvar newPhrase = \"\";\n\tfor (count=0; count<phrase.length; count++){\n\t\tnewPhrase = newPhrase + phrase[count];\n\t\tif (!isVowel(phrase[count]) && phrase[count] !== \" \"){\n\t\t\tnewPhrase = newPhrase + \"o\" + phrase[count];\n\t\t}\n\t}\n\treturn newPhrase;\n}", "function eachWord(array){\n var translatedArray = [];\n\n array.forEach(function(word) {\n translatedArray.push(translate(word));\n })\n\n var translatedString = translatedArray.join(\" \");\n translatedString = translatedString.toLowerCase();\n var returnString = translatedString.charAt(0).toUpperCase() + translatedString.substr(1);\n\n return returnString;\n}", "function myTranslatePigLatin(str) {\n const regex = /(^[b-df-hj-np-tv-z]+)(\\w*)/g;\n if (regex.test(str)){\n return str.replace(regex, '$2$1ay');\n }\n return str.concat('way');\n}", "function normalize(word) {\n var result = \"\";\n for (var i = 0; i < word.length; i++) {\n var kana = word[i];\n var target = transform[kana];\n if (target === false) {\n continue;\n }\n if (target) {\n kana = target;\n }\n result += kana;\n }\n return result;\n }", "function modifyStyle(word) {\n\n let newWord = '';\n let char;\n\n if (word != null) {\n let words = word.split(' ');\n\n for (let i = 0; i < words.length; i++) {\n\n for (let y = 0; y < words[i].length; y++) {\n\n char = words[i].charAt(y);\n\n if (y == 0) char = ' ' + char.toUpperCase();\n else char = char.toLowerCase();\n\n newWord += char;\n }\n }\n }\n\n return newWord;\n}", "function reverseWord(word) {\n return word.split('').reverse().join('');\n}", "function normalize(word) {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n let kana = word[i];\n const target = transform[kana];\n if (target === false) {\n continue;\n }\n if (target) {\n kana = target;\n }\n result += kana;\n }\n return result;\n }", "function normalize(word) {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n let kana = word[i];\n const target = transform[kana];\n if (target === false) {\n continue;\n }\n if (target) {\n kana = target;\n }\n result += kana;\n }\n return result;\n }", "function Transform(inword)\n{\n\tif (inword.length > 0) {\n\t\t// Try out each rule in turn\n\t\tfor (r = 0; r < nrul; r++) {\n\t\t\tinword = ApplyRule(inword, r);\n\t\t}\n\t}\n\n\treturn inword;\n}", "function reverseWord(word) {\n return word.split(\"\").reverse().join(\"\");\n}", "function titleizeWord(word,idx) { //idx is word's position\n var lower = word.toLowerCase();\n switch (lower) {\n\tcase 'a':\n\tcase 'the':\n\t if (idx) return lower;\n }\n var first = lower[0].toUpperCase();\n return first+lower.substr(1);\n}", "function translate(str) {\n var first_letter,\n new_str,\n consonant_check = /^[^aeiou]+/,\n counter = 0,\n split_array = str.split(''),\n len = str.length;\n /*test if first letter is a vowel\n if so, concatenate way to end of string \n */\n if (!consonant_check.test(str[counter])) {\n return str + 'way';\n } else {\n //while word starts with a consonant, shift and add first_letter +'ay' to end\n while (consonant_check.test(str[counter])) {\n first_letter = split_array.shift();\n split_array.push(first_letter);\n counter++;\n }\n new_str = split_array.join('');\n new_str += 'ay';\n return new_str;\n }\n}", "function leetify(word) {\n //get the word in all lowercase letters\n var modifiedWord = word.toLowerCase();\n\n //replace all As with the number 4\n modifiedWord = modifiedWord.replace(/a/g, '4');\n\n //replace all Es with the number 3\n modifiedWord = modifiedWord.replace(/e/g, '3');\n\n //replace all Is with the number 1\n modifiedWord = modifiedWord.replace(/i/g, '1');\n\n //replace all Os with the number 0\n modifiedWord = modifiedWord.replace(/o/g, '0');\n\n //send it back\n //console.log(modifiedWord);\n return modifiedWord;\n}", "function leetify(word) {\n //get the word in all lowercase letters\n var modifiedWord = word.toLowerCase();\n\n //replace all As with the number 4\n modifiedWord = modifiedWord.replace(/a/g, '4');\n\n //replace all Es with the number 3\n modifiedWord = modifiedWord.replace(/e/g, '3');\n\n //replace all Is with the number 1\n modifiedWord = modifiedWord.replace(/i/g, '1');\n\n //replace all Os with the number 0\n modifiedWord = modifiedWord.replace(/o/g, '0');\n\n //send it back\n //console.log(modifiedWord);\n return modifiedWord;\n}", "function capitalizeWord(word) {\n const newWord = word.substring(0, 1).toUpperCase() + word.substring(1).toLowerCase();\n return newWord;\n}", "function invertCase(word){\n newWord = \"\"\n for (let index = 0; index < word.length; index++)\n if(word[index]===word[index].toLowerCase()){\n newWord += word[index].toUpperCase()\n\n } else {\n newWord += word[index].toLowerCase()\n }\n\n return newWord\n }", "function reverse(word)\n{\n var newWord = word.charAt(1)+word.charAt(0);\n return newWord;\n}", "function translate(string) {\n return string;\n}", "function insertTranslatedWord(str, n, m){\n word = str.substring(n, m)\n\ttranslation = words[word];\n\tif (translation == null){\n\t\treturn null;\n\t};\n\treturn str.slice(0, n) + getTranslationHTML(word, translation) + str.slice(m);\n}", "function unpluralize(word) {\n if (word.match(/is\\b/g)) {\n return word;\n } else if (word.match(/ies\\b/g)) {\n return word.replace(/.{3}\\b/, 'y');\n } else if (word.match(/ses\\b|hes\\b|xes\\b|zes\\b/g)) {\n return word.replace(/.{2}\\b/, '');\n } else if (word.match(/s\\b/g)) {\n return word.replace(/.{1}\\b/, '');\n } else {\n return word;\n }\n}", "function cleanWords(word) {\n let steralize = word.toString().trim().toLowerCase();\n return steralize;\n}", "function reverse (word) {\n return word.split('').reverse().join('')\n}", "function danish(sentence) {\n \nreturn sentence.replace(/\\bapple|blueberry|cherry\\b/, 'danish');\n\n}", "function translate (inputString){\n let currentChar=\"\";\n let doubleChar =\"\";\n let newWord =\"\";\n for (i = 0; i <= inputString.length -1; i++){\n currentChar = inputString[i];\n if (currentChar !== 'a' && currentChar !== 'e' && currentChar !== 'i' &&\n currentChar !== 'o' && currentChar !== 'u'&& currentChar !== 'y' &&\n currentChar !== 'A' && currentChar !== 'E' && currentChar !== 'I' &&\n currentChar !== 'O' && currentChar !== 'U' && currentChar !== 'Y' &&\n currentChar !== ' '){\n doubleChar = currentChar + 'o' + currentChar;\n newWord = newWord + doubleChar;\n }\n else {\n newWord = newWord + currentChar;\n }\n }\n return (newWord);\n}", "function reverseWord(word) {\n var reverseWordResult = '';\n for (var i = word.length - 1; i >= 0; i--) {\n reverseWordResult += word[i];\n }\n return reverseWordResult;\n}", "function trans( string ){\n\tif( window.furasta.lang[ string ] ){\n\t\treturn window.furasta.lang[ string ];\n\t}\n\treturn string;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function sentenceCase(word) {\n return `${word[0].toUpperCase()}${word.substring(1)}`;\n}", "function flipWord(word) {\n\n //creates an empty string\n let revWord = \"\";\n\n //for every letter in the word, create a word with the letters in reverse\n for (let index = word.length - 1; index >= 0; index--) {\n let letter = word[index];\n\n revWord += letter;\n }\n\n return revWord;\n}", "function translate(str){\r\n\treturn str.replace(\"_\",\" \");\r\n}", "function capitalizeWord(word) {\n var loweredString = word.toLowerCase();\n\n if (loweredString === 'javascript') return 'JavaScript';\n\n var newString = '';\n newString = loweredString[0].toUpperCase();\n\n for (var i = 1; i < loweredString.length; i++) {\n newString += loweredString[i];\n }\n\n return newString;\n}", "function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}", "function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}", "function translatePigLatin(str) {\n return str\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n}", "function cleanWord(word) {\n return word.replace(/[^0-9a-z'-]/gi, '').toLowerCase()\n}", "function translateSentence(word, translateTarget) {\r\n return sendMessagePromise({\r\n type: 'translate',\r\n word: word,\r\n translateTarget: translateTarget\r\n });\r\n}", "function printLatinWord(word){\r\n\t// combine the word without its first letter, then the first letter, then 'ay'.\r\n\treturn word.slice(1) + word.slice(0, 1) + \"ay \";\r\n}", "function toTitle(word) {\n\t\treturn word.charAt(0).toUpperCase() + word.slice(1)\n\t}", "function convertToWord(char) {\n switch (char) {\n case \"r\":\n return \"Tosh\"\n case \"s\":\n return \"Qaychi\";\n }\n return \"Qog'oz\";\n}", "function processWord(word) {\n var optimalRecognitionposition = Math.floor(word.length / 3),\n letters = word.split('')\n return letters.map(function(letter, idx) {\n if (idx === optimalRecognitionposition)\n return '<span class=\"highlight\">' + letter + '</span>'\n return letter;\n }).join('')\n }", "function translatePigLatin(str) {\n\nlet myRegex = /^([aeiou])/\n\nreturn str\n .replace(/^[aeiou]\\w*/,\"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n\n \n}", "static translatePigLatin(str) {\n\n // the short form:\n //return str.replace(/(^[aeiou])(.*)/,\"$1$2way\").replace(/(^[^aeiou]+)(.*)/,\"$2$1ay\");\n\n // The readable form:\n function translateWordsStartingWithVowel(str) {\n return str.replace(/(^[aeiou])(.*)/,\"$1$2way\");\n }\n\n function translateWordsStartingWithConsonants(str) {\n return str.replace(/(^[^aeiou]+)(.*)/,\"$2$1ay\"); \n }\n \n return translateWordsStartingWithConsonants(translateWordsStartingWithVowel(str));\n \n }", "function translateWordsStartingWithVowel(str) {\n return str.replace(/(^[aeiou])(.*)/,\"$1$2way\");\n }", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.slice(1);\n}", "function acronym(word){\r\n //take in string and return new string with first letter of each word\r\n //\"self contained underwater breathing apparatus\"\r\n //-> \"SCUBA\"\r\n newWord = \"\";\r\n prevSpace = true;\r\n for(let i = 0; i < word.length; ++i){\r\n if(word[i] != \" \" && prevSpace){\r\n newWord += word[i].toUpperCase();\r\n prevSpace = false;\r\n }\r\n else if(word[i] == \" \"){\r\n prevSpace = true;\r\n }\r\n }\r\n \r\n return newWord;\r\n }", "function translatePigLatin2(str) {\n return str\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n}", "function capitalize(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n }", "function translate(str) {\n var q = \"\";\n str.split(\"\").map(function(p, c) {\n if(p != ' ') q += p + 'o' + p;\n else q += \" \";\n })\n\n return q;\n\n}", "function searchWord(word, str) {\n let pattern = new RegExp(`\\\\b${word}\\\\b`, 'gi'); // match whole words only\n return str.replace(pattern, `**${word.toUpperCase()}**`);\n}", "function translation(word) {\n translationDiv.innerHTML = word\n}", "function toWeirdCase(word) {\n const wordsArr = word.trim().toLowerCase().split(\" \"); // Separate words\n const lettersArr = wordsArr.map((word) => word.split(\"\")); // Separate letters\n\n // At this point lettersArr is something like [['h','i'],['y','o','u']]\n let weirdCaseWord = \"\";\n for (let i = 0; i < lettersArr.length; i++) {\n lettersArr[i].forEach(\n (letter, index) =>\n (weirdCaseWord +=\n index % 2 === 0 ? letter.toUpperCase() : letter.toLowerCase())\n );\n if (i + 1 < lettersArr.length - 1) weirdCaseWord += \" \";\n }\n\n return weirdCaseWord;\n}", "function wordToUpper(strSentence) {\r\n return strSentence.toLowerCase().replace(/\\b[a-z]/g, convertToUpper);\r\n\r\n function convertToUpper() { \r\n\t\treturn arguments[0].toUpperCase(); \r\n\t} \r\n}", "function convertToWord(letter) {\n if (letter === \"r\") return \"Rock\";\n if (letter === \"p\") return \"Paper\";\n if (letter === \"s\") return \"Scissors\";\n return \"Sponge\"\n\n }", "function toonify(accent, sentence) {\n if(accent === 'daffy') {\n return sentence.replace(/s/g, 'th');\n } else if(accent === 'elmer') {\n return sentence.replace(/r/g, 'w');\n } else if(accent === 'porky') {\n return sentence.replace(/th/g, 'th-th-th-th');\n } else {\n return sentence;\n }\n}", "function BOT_englishWordCutPlural(word) {\r\n\tif( BOT_member(BOT_pluralExceptionList, word) || word.length <= 3 ) return word;\r\n\telse return(word.replace(/(\\w+)s$/, \"$1\"));\r\n}", "function translatePigLatin(str) {\nlet consonantRegex = /^[^aeiou]+/;\nlet newConsonants = str.match(consonantRegex)\nreturn newConsonants !== null\n? str\n.replace(consonantRegex,\"\")\n.concat(newConsonants)\n.concat(\"ay\")\n: str.concat(\"way\")\n}", "function titleLize(word) {\n // 将开头字母转化为大写\n return word.replace(/^\\w/, function (match) {\n return match.toUpperCase();\n });\n }", "function capitalize(word) {\n\treturn word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "function acronym(word){\r\n //take in string and return new string with first letter of each word\r\n //\"self contained underwater breathing apparatus\"\r\n //-> \"SCUBA\"\r\n\r\n newWord = \"\";\r\n for(var i = 0; i < word.length; i++){\r\n if(i == 0 || word[i-1] == \" \"){\r\n newWord += word[i];\r\n }\r\n }\r\n\r\n return newWord;\r\n}", "function translate(inputString) {\n let result = \"\";\n\n const seperator = /\\s+/;\n // Split string by spaces between words after trimming any spaces on the ends.\n // Treats multiple spaces as one separator\n // NOT CURRENTLY WORKING CORRECTLY, TODO: needs to handle trailing spaces, and different types of spaces\n let strArray = inputString.split(seperator);\n // console.log(strArray);\n // Runs through each split word and adds a space and the translated word to the result string\n for (let i = 0; i < strArray.length; i++) {\n // Check that this isn't the first word which doesn't need a space\n if (i > 0) {\n result += \" \";\n }\n result += getPigLatin(strArray[i]);\n\n }\n return result;\n}", "function fillResponse(tpl, word) {\n return tpl\n .replaceAll('\\\\{\\\\{W\\\\}\\\\}', word.capitalize())\n .replaceAll('\\\\{\\\\{WQ\\\\}\\\\}', `¿${word.capitalize()}?`)\n .replaceAll('\\\\{\\\\{w\\\\}\\\\}', word.toLowerCase())\n .replaceAll('\\\\{\\\\{wq\\\\}\\\\}', `¿${word.toLowerCase()}?`);\n}", "function normalize(word) {\n return word.toLowerCase().replace(/[.!,//]/g, \"\");\n}", "function pigTrans(string) {\n if (typeof string !== 'string') return undefined;\n const strArr = string.split(' ');\n return strArr.map(word => {\n return word\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n }).join(' ');\n }", "function reverseWord(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function translate(str) {\n\n str = str.toLowerCase().split('');\n\n if(str[0] === \"a\" || str[0] === \"e\" || str[0] === \"i\" || str[0] === \"o\" || str[0] === \"u\"){\n str.push(\"way\");\n } else {\n while(str[0] !== \"a\" && str[0] !== \"e\" && str[0] !== \"i\" && str[0] !== \"o\" && str[0] !== \"u\"){\n var holder = str[0];\n str.push(holder);\n str.splice(0, 1);\n }\n str.push(\"ay\");\n }\n\n str = str.join('');\n\n return str;\n}", "function titleLize (word) { // 将开头字母转化为大写\n return word.replace(/^\\w/, function (match) {\n return match.toUpperCase();\n })\n }", "function _t(str) {\n return translate[str]\n}", "function convertToWord(letter) {\n if(letter === \"r\") return \"Rock\";\n if(letter === \"p\") return \"Paper\";\n if(letter === \"s\") return \"Scissor\";\n if(letter === \"l\") return \"Lizard\";\n return \"Spock\";\n}", "function upperCaseWord(word) {\n return word.toUpperCase();\n}", "makeCapital(word) {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n }", "function capitalizeWord(word) {\n let firstLetter = word.slice(0, 1).toUpperCase();\n word = word.slice(1);\n return firstLetter.concat(word);\n}", "function correct(word) {\n \n}", "function reverseWord(str) {\n\treturn str.split(' ').reverse().join(' ');\n}", "function capitalizeWord(word) {\n return word[0].toUpperCase() + word.substr(1);\n}", "function translatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n \n let myConsonants = str.match(consonantRegex);\n \n return myConsonants !== null ? str.replace(consonantRegex, \"\").concat(myConsonants).concat('ay') : str.concat('way')\n \n }", "function capitalize(word) { // capitalizes word\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n}", "function translatePigLatin(str) {\n var notCons = ['a', 'e', 'i', 'o', 'u'];\n \n if(notCons.includes(str.charAt(0))){\n return str+\"way\";\n }\n \n //This variable is used to get the first instance of a vowel within the word. It is an arbitrarily large number.\n //This is needed for words that may have multiple vowels.\n var first = 100;\n \n for(var i=0; i<notCons.length; i++){\n if(str.indexOf(notCons[i])<first && str.indexOf(notCons[i]) >= 0){\n first = str.indexOf(notCons[i]);\n }\n }\n \n var pre = str.substr(0,first);\n str = str.replace(pre,\"\");\n\n return str.concat(pre+\"ay\");\n}", "function capitalizeWord(word){\n return word.charAt(0).toUpperCase() + word.slice(1);\n}", "function CapitalizeWord(str)\n {\n return str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n }", "function capitalizeWord(word) {\n let words = word.trim().replace(/^\\w/, (c) => c.toUpperCase());\n return words;\n}", "function translatePigLatin(str) {\n // var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n // re = /^[b-z&&[^eiou]]+$/gi;\n re = /[aeiou]+/;\n if(re.test(str[0])){\n return str + \"way\";\n }\n var vowel = str.indexOf(str.match(re));\n str = str.substring(vowel,) + str.substring(0, vowel) + \"ay\";\n\n return str;\n}", "function translatePigLatin (str) {\n if (str[0].match(/[aeiou]/)) {\n return str + 'way';\n }\n let consonants = str.match(/[^aeiou]+/);\n\n return str.substring(consonants[0].length).concat(consonants, 'ay');\n}", "function reverseWordsInPlace(str){\nreturn str.split(' ').reverse('').join(' ').split('').reverse('').join('');\n}", "function toCamelCase(word) {\n return word\n .split('-')\n .map((key, index) =>\n index === 0 ? key : key.replace(/[A-Z]/i, (match) => match.toUpperCase()),\n )\n .join('');\n}", "function reverseWord(s) {\n let t = s.split('').reverse().join('');\n return t.split(' ').reverse().join(' ');\n}", "function convertToWord(letter) {\r\n if (letter === 'r') {\r\n return 'Rock';\r\n }\r\n if (letter === 'p') {\r\n return 'Paper';\r\n }\r\n if (letter === 's') {\r\n return 'Scissors';\r\n }\r\n if (letter === 'l') {\r\n return 'Lizard';\r\n }\r\n if (letter === 'sp') {\r\n return 'Spock';\r\n }\r\n}", "function captialize(word){\n\treturn word.charAt(0).toUpperCase() + word.slice(1);\n}", "function wordRev(word) {\n\treturn word.split(' ').map(word => word.length < 5 ? word : word.split('').reverse().join('')).join(' ');\n}", "function reverseWord(word){\n let newString = \"\";\n for (let i = word.length-1; i >=0; i--) {\n newString += word[i];\n }\n return newString;\n}", "function pigWord (word) {\n return word.slice(findFirstVowel(word), word.length) + '-' + word.slice( -word.length, findFirstVowel(word)) + 'ay';\n}", "function convertToScreaming(phrase){\n return `${phrase.toUpperCase()}!!!!!!!!!!!!!!!!!!!!`\n}", "function convertToWord(letter) {\r\n if (letter === \"r\") return \"Rock\";\r\n if (letter === \"p\") return \"Paper\";\r\n if (letter === \"s\") return \"Scissors\";\r\n}", "function reverseString(word){\r\n //take in string and return a new string with the characters reversed\r\n //\"did I shine my shoes today\"\r\n //-> \"yadot seohs ym enihs I did\"\r\n newWord = \"\";\r\n for(let i = word.length - 1; i >= 0; --i){\r\n newWord += word[i];\r\n }\r\n \r\n return newWord;\r\n }", "function encodeWord (s) { // eslint-disable-line no-unused-vars\n return s.replace(/T/g, '7').replace(/A/g, '4').replace(/S/g, '5').replace(/O/g, '0')\n}" ]
[ "0.72567374", "0.71669793", "0.6810853", "0.6765785", "0.6718004", "0.671184", "0.670803", "0.6661229", "0.66438144", "0.6583307", "0.6566228", "0.65311337", "0.6511276", "0.6511276", "0.64981335", "0.64792794", "0.64601904", "0.64423484", "0.6375535", "0.6375535", "0.6362439", "0.63453645", "0.63247", "0.6323353", "0.63122696", "0.6287469", "0.6283043", "0.6264821", "0.6252396", "0.62434316", "0.6234006", "0.6211461", "0.6189406", "0.6189406", "0.61784315", "0.6161263", "0.61554456", "0.6149897", "0.6149897", "0.6143675", "0.6120805", "0.611513", "0.6091655", "0.60871935", "0.60826373", "0.6080368", "0.60755366", "0.60740113", "0.6062351", "0.6050726", "0.6044154", "0.60402024", "0.6038181", "0.6028184", "0.6027415", "0.6019663", "0.60194135", "0.60124743", "0.6007344", "0.60049593", "0.6001688", "0.59941804", "0.59832", "0.59775686", "0.59712917", "0.5966244", "0.5962075", "0.59578127", "0.5949041", "0.5948322", "0.59414446", "0.5934009", "0.59218925", "0.5905929", "0.5902295", "0.58975565", "0.5888286", "0.5883952", "0.587982", "0.58750576", "0.58740044", "0.5871192", "0.58664453", "0.58565116", "0.58554673", "0.58538485", "0.5839113", "0.583607", "0.58280563", "0.5819325", "0.58166635", "0.5813513", "0.58125794", "0.5805519", "0.57986933", "0.57937276", "0.5793279", "0.57726884", "0.57619387", "0.5759188" ]
0.6539626
11
form submit delete empty file table
function delEmptyFileTable() { var arrDelNum = new Array(); var tmpSort = 0; $("[name=attanames]").each(function(i){ var attanamesId = $(this).attr("id"); var delNum = attanamesId.replace('attaname',''); var delFileInfo = ''; if(document.getElementsByName('attafiles') !=null && document.getElementsByName('attafiles')[i] != null) delFileInfo = document.getElementsByName('attafiles')[i].value; var delFileInfoPath = ''; if(document.getElementsByName('savePath') != null && document.getElementsByName('savePath')[i] != null) delFileInfoPath = document.getElementsByName('savePath')[i].value; if(delFileInfo== null || delFileInfo == '') { if(delFileInfoPath== null || delFileInfoPath == '') { arrDelNum[tmpSort] = parseInt(delNum); tmpSort++; } } }); for(var i= 0;i<arrDelNum.length;i++) { deleteRow(arrDelNum[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fileDeleted(){\n let form = this\n let file = ''\n $('#fileupload').bind('fileuploaddestroy', function (e, data) {\n // remove inputs named 'selected_files[]' that will interfere with the back end\n $(\"input[name='selected_files[]']\").remove();\n $(\"input[name='sf_ids']\").each(function(){\n $('div.fields-div').find(`input[name^='${$(this).val()}']`).remove();\n });\n //then remove yourself?\n // $(\"input[name='sf_ids']\").remove();\n });\n $('#fileupload').bind('fileuploaddestroyed', function (e, data) {\n // if student deletes uploaded primary file, we need to remove this param because the backend uses it to know when a browse-everything file is primary\n $('#be_primary_pcdm').remove();\n form.validatePDF()\n });\n\n $('#supplemental_fileupload').bind('fileuploaddestroy', function (e, data) {\n file = $(data.context).find('p.name span').text();\n });\n\n $('#supplemental_fileupload').bind('fileuploaddestroyed', function (e, data) {\n $('#supplemental_files_metadata tr').each(function(){\n if ($(this).find('td').first().text() === file) {\n $(this).remove();\n }\n });\n form.validateSupplementalFiles()\n })\n }", "function deletePerviousSubmit() {\r\n var table = document.getElementById(\"dataTable\");\r\n while (table.rows.length > 0) {\r\n table.deleteRow(0);\r\n }\r\n }", "function submitFileDeleteForm() {\r\n\r\n\tdocument.forms[\"CustomUiFileDeleteForm\"].elements[\"action\"].value = \"deleteImages\";\r\n\tdocument.forms[\"CustomUiFileDeleteForm\"].submit();\r\n}", "function emptyUpload() {\n th.empty()\n th.get(0).value = ''\n }", "function removefile(txt) {\r\n //remove the file from the post value\r\n var files = document.getElementById('FilesSelected');\r\n var tokens = files.value.split(\"#\");\r\n var newfiles = \"\";\r\n for (var i=0; i < tokens.length-1; i++) {\r\n if (tokens[i] == txt)\r\n continue;\r\n newfiles += tokens[i] + \"#\";\r\n }\r\n\r\n files.setAttribute('value', newfiles);\r\n\r\n // delete the row containing the txt from the table\r\n var filetable = document.getElementById('myfilelist');\r\n\r\n var loop = 0;\r\n for (loop = 0; loop < filetable.rows.length; loop++) {\r\n var row = filetable.rows[loop];\r\n var cell = row.cells[0];\r\n if (row.id == txt + 'id') {\r\n filetable.deleteRow(loop);\r\n loop--;\r\n break;\r\n }\r\n }\r\n\r\n colorTable('myfilebody');\r\n\r\n //Remove the entry from the table in the HTML\r\n\r\n var tbl = document.getElementById('myfilebody');\r\n if (tbl.rows.length == 0){\r\n tbl.insertRow(0);\r\n tbl.rows[0].setAttribute('id', \"nofile\");\r\n var cellLeft = tbl.rows[0].insertCell(0);\r\n cellLeft.innerHTML = \"No files have been added to the code review.\";\r\n tbl.rows[0].appendChild(cellLeft);\r\n cellLeft = tbl.rows[0].insertCell(1);\r\n cellLeft.innerHTML =\"\";\r\n tbl.rows[0].appendChild(cellLeft);\r\n cellLeft = tbl.rows[0].insertCell(2);\r\n cellLeft.innerHTML =\"\";\r\n tbl.rows[0].appendChild(cellLeft);\r\n cellLeft = tbl.rows[0].insertCell(3);\r\n cellLeft.innerHTML =\"\";\r\n tbl.rows[0].appendChild(cellLeft);\r\n }\r\n}", "function doMultiDeleteFile()\n\t{\n\t\tif(confirm(\"Do you want to delete attached file for this Timesheets?\"))\n\t\t{\n\t\t\tvar form=form=document.sheet;\n\t\t\tvar val=Number(form.rowcou.value);\n\t\t\t\n\t\t\tgetMultiTimeDataFile(val);\n\t\t\tform.action=\"edittimemulti.php\";\n\t\t\tform.acctype.value=\"filedelete\";\n\t\t\tform.submit();\n\t\t}\n\t}", "function submitUpload() {\n el(\"divRecordNotFound\").style.display = \"none\";\n if (el(\"hdnFileName\").value != '') {\n var tablename = getQStr(\"tablename\");\n if (tablename.toUpperCase() == \"TARIFF\" || tablename.toUpperCase() == \"TARIFF_CODE_DETAIL\") {\n showConfirmMessage(\"Do you really want to upload this File? This will Delete all the existing data from Database and Insert Data from the File.\",\n \"mfs().yesClickTariff();\", \"\", \"\");\n }\n else {\n hideDiv(\"btnSubmit\");\n showLayer(\"Loading..\");\n setTimeout(insertUploadTable, 0);\n }\n }\n else {\n showErrorMessage('Please Upload a file');\n el(\"divifgGrid\").style.display = \"none\";\n el(\"divlnk\").style.display = \"none\";\n }\n}", "function uploadComplete(file_id){\n var content = \"<tr class='file' name='\" + fileName + \"'lookup='\" +\n file_id + \"'><td><i class='icon-file'></i>\" +\n fileName + \"</td><td><button class='btn delete'>\"\n + \"<i class='icon-remove'></i>delete</button></td></tr>\";\n $(\"#folder_view\").append(content);\n $(\"#upload_file\").empty();\n}", "function deleteUpload(recordid){\n $('#succMsgContainer').hide();\n $('#id').val(recordid);\n $('#aws-delete-file-modal').modal('show');\n}", "function borradoElemento () {\n\t/*\n\tinit_listener_file_upload();\n\t$(\".combo_tipo_doc\").val(\"\");\n\tfileUploadPreview ();\n\t\n\t\n\t\tcloseFancy();\n\t\n\t*/\n}", "function deleteFile(record) {\n $('.deletedFile').each(function() {\n $.post('sop/delete-file.php?edoc='+$(this).val()+'&record='+record, function(data) {\n if (data.status != \"success\") {\n // failure\n alert(\"The file was not able to be deleted. \"+JSON.stringify(data));\n }\n });\n\n });\n}", "function deleteOutput(id, dir) {\n if (confirm('Are you sure you want to submit?')) {\n var rid = $('[name=rid]').val();\n var fd = new FormData();\n fd.append('delete', dir);\n\n $('#' + rid).find('.' + id).remove();\n\n submit(fd, '/delete');\n }\n}", "function deleteFile(file, elem) {\n var order = 'filename=' + file;\n\n // POST request\n $.post(\"delete.php\", order, function(response, status, xhr) {\n if (status == \"success\") {\n console.log(response);\n }\n else if (status == \"error\") {\n alert('File could not be deleted.'); \n }\n });\n\n // Remove file row\n $(elem).closest(\"tr\").remove();\n}", "function clearUploadFile() {\n file = null;\n $(\"#btn-upload\").prop(\"disabled\",true);\n $(\"#file-upload\").empty();\n $(\"#file-name\").empty();\n $(\"#file-size\").empty();\n $(\"#file-type\").empty();\n $(\"#upload-status\").html(\"&nbsp;Upload Status: NO FILE SELECTED&nbsp;\");\n $(\"#upload-data #pagination ul\").empty();\n var listData = $(\"#upload-data table thead\");\n listData.find(\"tr\").empty();\n var scope = listData.scope();\n scope.dataListUpl = [];\n scope.$apply();\n }", "function deleteThisFile () {\n // only hide the file\n $thisFile.hide();\n // trigger a file deletion operations\n self.emit('_deleteFile', $thisFile.find(ps).text(), function(err) {\n // show back the file on error or remove on success\n if (err) {\n $thisFile.fadeIn();\n } else {\n $thisFile.remove();\n }\n });\n }", "function deletePhoto(td) {\n\n // remove <td> element from table row\n var row = document.getElementById(\"more-photos\");\n\n for (var i = 0; i < row.children.length; i++) {\n if (row.children[i] === td) { row.deleteCell(i); }\n }\n\n // remove photo from resizedImages array\n var selectedPhoto = td.children[0].id;\n\n for (var j = 0; j < resizedImages.length; j++ ) {\n if (resizedImages[j].filename === selectedPhoto) { delete resizedImages[j]; }\n }\n\n // filter undefined element from array if photo element deleted\n resizedImages = resizedImages.filter(function(k) { return k != undefined }); \n\n // hide Upload button and remove message if last photo element deleted\n if ($(\"#photo_table tr td\").length === 0) {\n\n uploadBtnClasses.add('btnHide');\n document.getElementById('hide_upload_status').style.display = \"none\";\n }\n}", "function removeFile(name)\r\n{\r\n\t$('#' + name).parent().remove();\r\n\t\r\n\t// Disable the upload button if no files are selected\r\n\tif ($('.file-item').length < 1) {\r\n\t\t$('#submit-button').attr('disabled', 'disabled');\r\n\t}\r\n}", "function eventDeleteAll(e){\n\t\te.preventDefault();\n\t\tlet filas = document.querySelectorAll(\".btn-delete\");\n\t\tfor (let i = 0; i < filas.length-1; i++) {\n\t\t\tdel(filas[i], false);\n\t\t}\n\t\tdel(filas[filas.length-1], true);\t//suponiendo que los del() no se ejecutan antes por asincronismo\n\t\t/*get();*/\n\t}", "function delete_all(){\n\n $('#file_div').on(\"click\", \"#delete\", function(){\n // get data from form fields\n var supplier_name = $(\"#supplier option:selected\").text();\n var supplierid = $(\"#supplier\").val();\n\n // console.log(supplier_name);\n // console.log(supplierid);\n // console.log(pricelist_filename);\n // importExcelPricelist(true,supplier_name, supplierid, pricelist_filename, $(this));\n var type = \"delete\";\n var title = \"Are you want to delete?\";\n var message = supplier_name + \"'s pricelist files.\";\n\n confirmAction(type, title, message, null, supplier_name, supplierid, null, null, null, $(this));\n // we return false to prevent page reloading\n return false;\n });\n\n}", "function fileDelete($href){\n $.post(\"/souche/\"+($(\"#ref\")[0].innerHTML)+\"/suppr/file\", // send HTTP POST request to a page and get the answer\n {\n _token: $('input[name=_token]').val(), // send data\n href:$href\n },\n function(data, status){ //retreive response\n console.log(\"Data: \" + data + \"\\nStatus: \" + status);\n if(status === \"success\"){\n //alerteInfo(data[0].alert, status, data);\n window.location.reload()\n //TODO : décommenter\n }\n else{\n window.location.reload()\n alerteInfo('info', status, data);\n }\n });\n}", "function delete_file (file_name, reload_flag, media_id)\n{\n var params = {};\n params ['file'] = file_name;\n if (media_id !== undefined)\n params ['media_id'] = media_id; \n $.ajax ({url: '/admin/index/remove',type: 'POST', data: params,\n complete : function (response, status) {if (reload_flag === true) {$.fancybox.close ();reload_list ();}} \n }); \n}", "function delete_all() {\n\n $(document).on('click', '.del_all', function() {\n $('#form_data').submit();\n });\n \n\n $(document).on('click', '.delBtn', function() {\n var item_checked = $('input[class=\"item_checkbox\"]:checkbox').filter(':checked').length;\n if ( item_checked > 0 ) {\n\n $('.notEmptyRecord').removeClass('hidden') ;\n $('.record_count').text(item_checked);\n $('.emptyRecord').addClass('hidden') ;\n } else {\n $('.emptyRecord').removeClass('hidden') ;\n $('.notEmptyRecord').addClass('hidden') ;\n }\n $('#multipleDelete').modal('show');\n //alert('done');\n });\n}", "function dataResolutionDeleteUpload() {\r\n\t// If any hidden input doc_id's already exist, they must be deleted, so keep them but mark them for deletion\r\n\t$('#drw_upload_file_container input.drw_upload_doc_id').attr('delete','yes');\r\n\t// Show \"add new document\" link\r\n\t$('#drw_upload_new_container').show();\r\n\t// Hide \"remove document\" link\r\n\t$('#drw_upload_remove_doc').hide();\r\n\t// Hide doc_name link\r\n\t$('#dc-upload_doc_id-label').html('').hide();\r\n}", "function deleteImage(key){\n\tformid = 'form'+key;\n\tmpdeleteid = 'mpdelete'+key;\n\tdocument.getElementById(mpdeleteid).value = '1';\n\tdocument.getElementById(formid).submit();\n}", "function delpic(filename)\n{\n\tvar radioid\t= filename.replace('|@SEP@|', '');\n\tvar radiolength\t= $('input[name=rdo_main_pic]').length;\n\tvar selectedIndex\t= $('input[name=rdo_main_pic]:checked').index('input[name=rdo_main_pic]') ;\n\t\n\tif(radiolength > 1)\n\t{\n\t\tif(selectedIndex==0)\n\t\t{\n\t\t\tselectedIndex\t=\t1;\n\t\t}\n\t\telse\n\t\t\tselectedIndex\t= selectedIndex-1;\n\t}\n\t\n\tvar status\t= $('#status');\n\tvar btnuplad = $('#btn_upload');\n\tvar delAJAXurl = base_url +'newsfeed/delete_tmp_image_AJAX/'+ filename.replace('|@SEP@|', '/') + '/extraparam/';\n\t\n\t$.get(delAJAXurl, function(msg){\n\t\t\t\t\t\t\t \n\t\tif(msg === 'ok')\n\t\t{\n\t\t\t//selectedIndex\t= selectedIndex-1;\n\t\t\tif(selectedIndex!= -1)\n\t\t\t{\n\t\t\t\t$('input[name=rdo_main_pic]:eq('+selectedIndex+')').attr('checked', 'checked');\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#div\"+filename.replace('|@SEP@|','')).remove();\t\n\t\t\t$(\"#hid_\"+filename.replace('|@SEP@|','')).remove();\n\t\t\t\n\t\t\t//search_for_other();\n\t\t\t\n\t\t\tstatus.html('<div class=\"ok_msg\">Image deleted successfully ...</div>');\n\t\t\tbtnuplad.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstatus.attr('class', 'ok');\n\t\t\tstatus.html('<div class=\"err_msg\">Image cannot be deleted!</div>');\n\t\t}\n\t});\n}", "function fn_eliminarArchivo(id) {\n var eliminar = $(\"#total-documentos\").data(\"eliminarfile\") + id + \",\";\n $(\"#total-documentos\").data(\"eliminarfile\", eliminar);\n var cantidad = $(\"#total-documentos\").data(\"cantidad\") - 1;\n $(\"#total-documentos\").data(\"cantidad\", cantidad);\n $(\"#total-documentos\").html($(\"#total-documentos\").data(\"cantidad\") + storedFiles.length);\n $(\"#eliminar-\" + id).remove();\n}", "function deletePhotos() {\n $('#photoTable :checkbox:checked').parent().parent().remove();\n deleteButton.attr('disabled', true);\n }", "_controlUploadFile(event) {\n let file = event.target.files[0];\n let fileName = file.name;\n let fileType = fileName.split(\".\")[fileName.split(\".\").length - 1];\n\n if(this.options.tableRender) {\n let table = this._componentRoot.querySelector('[data-component=\"table-custom\"]');\n\n if(table) {\n this._inputData = [];\n table.parentNode.removeChild(table);\n }\n\n this.options.tableRender = false;\n }\n\n let chooseFields = this._componentRoot.querySelector(\"#chooseFields\");\n\n if (chooseFields) {\n chooseFields.parentNode.removeChild(chooseFields);\n }\n\n if(fileType !== 'csv') {\n\n noty({\n text: 'Файл ' + fileName + ' некорректный, выберите корректный файл, формата csv.',\n type: 'error',\n timeout: 3000\n });\n\n return;\n\n } else {\n\n noty({\n text: 'Был выбран файл ' + fileName + '.',\n type: 'success',\n timeout: 3000\n });\n }\n\n this._parseCSV(event, file);\n }", "deleteForm (event) {\n\n\n // Delete link\n\n let deleteLink = event.currentTarget;\n\n\n // Fetch elt child and retrive the form related\n\n let childs = deleteLink.childNodes;\n\n let form;\n\n childs.forEach(function(e) {\n\n if(e.tagName === \"FORM\")\n\n form = e;\n\n });\n\n\n\n // Submit form\n\n if ( confirm('Confirmer la suppression ?') )\n\n form.submit();\n\n\n }", "function filesDivPageAction(){\n if ($('#fileActionSelect').val() == 'MCUImg') {\n if (gFileBrowser) {\n gFileBrowser.uploadMCUImage(project.header.DeviceType == 'CC3220FS');\n }\n } else if ($('#fileActionSelect').val() == 'Remove') {\n gFileBrowser.removeSelected();\n }\n \n return;\n\t//action is delete\n\tif ($('#fileActionSelect').val()=='Remove')\n\t{\n\t\tvar toDelete=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tfor (var i=0;i<toDelete.length;i++){\n\t\t\tvar folderarray=toDelete[i].id.replace(\"//FileSelect\", \"\").replace(/---/g, ' ').split(\"//\").reverse();\n\t\t\t//get the first element\n\t\t\tvar elementToDelete=folderarray.pop();\n\t\t\tif(folderarray.length===0){ //is root\n\t\t\t\tif (project.userFiles )\n\t\t\t\t{\n\t\t\t\t\tfor(var j=0;j<project.userFiles.length;j++){\n\t\t\t\t\t\tif(project.userFiles[j].id==elementToDelete){\n\t\t\t\t\t\t\tif(project.userFiles[j].type==\"file\"){ //if it a file\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tproject.userFiles.splice(j,1);\n\t\t\t\t\t\t\t\tvar objectToSend={\n\t\t\t\t\t\t\t\t\t'name':projectName,\n\t\t\t\t\t\t\t\t\t'source':\"/\"+elementToDelete\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t//delete from API\n\t\t\t\t\t\t\t\t$.post(\"/api/1/flash/deleteProjectFsFile\", \n\t\t\t\t\t\t\t\t\tobjectToSend,\n\t\t\t\t\t\t\t\t\tfunction(data,status){\n\t\t\t\t\t\t\t\t\t\tif(status=='success' && data.ok){\n\t\t\t\t\t\t\t\t\t\t\t//save project\n\t\t\t\t\t\t\t\t\t\t\tsaveProjectAPI();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if(data.err){\n\t\t\t\t\t\t\t\t\t\t\talert(\"Error deleteing the file\"+data.err);\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);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{ //is a folder delete for Project only\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tproject.userFiles.splice(j,1);\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\telse{\n\t\t\t\tvar folderPath=findFolder(folderarray,project.userFiles);\n\t\t\t\t//now go to all object until find and delete;\n\t\t\t\tif( folderPath && folderPath.object){\n\t\t\t\t\tfor(var j=0;j<folderPath.object.length;j++){\n\t\t\t\t\t\tif(folderPath.object[j].id==elementToDelete){\n\t\t\t\t\t\t\tif(folderPath.object[j].type==\"file\"){ //if it a file\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tfolderPath.object.splice(j,1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar objectToSend={\n\t\t\t\t\t\t\t\t\t'name':projectName,\n\t\t\t\t\t\t\t\t\t'source':\"/\"+folderarray.join(\"/\")+\"/\"+elementToDelete\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t//delete from API\n\t\t\t\t\t\t\t\t$.post(\"/api/1/flash/deleteProjectFsFile\", \n\t\t\t\t\t\t\t\t\tobjectToSend,\n\t\t\t\t\t\t\t\t\tfunction(data,status){\n\t\t\t\t\t\t\t\t\t\tif(status=='success' && data.ok){\n\t\t\t\t\t\t\t\t\t\t\t//save project\n\t\t\t\t\t\t\t\t\t\t\tsaveProjectAPI();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if(data.err){\n\t\t\t\t\t\t\t\t\t\t\talert(\"Error delete the file\"+data.err);\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\telse{\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tfolderPath.object.splice(j,1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//erase elements on display\n\t\t$('#fileSysDiplayPageDiv').html(\"\");\n\t\t//redo menus and files\n\t\tbuild_files(project.userFiles,'#fileSysDiplayPageDiv','','');\n \n saveProjectAPI();\n\t}\n\telse if($('#fileActionSelect').val()=='NewFolder'){\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length===0){\n\t\t\tfolderCreate(toAction);\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type!=\"folder\"){\n\t\t\t\t\t\talert (\"Can't create a folder in a a file\")\n\t\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tfolderCreate(toAction);\n\t\t}\n\t}\n\telse if($('#fileActionSelect').val()=='Upload'){\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>1){\n\t\t\talert (\"Please select only one folder!\");\n\t\t\treturn;\n\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type!=\"folder\"){\n\t\t\t\t\talert (\"File can not be uploaded into a file!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t//if here display the browser\n $('#fileElement').click();\n\t}\n\telse if($('#fileActionSelect').val()=='Rename'){\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>1){\n\t\t\talert (\"Please select only one folder!\");\n\t\t\treturn;\n\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type!=\"folder\"){\n\t\t\t\t\talert (\"File can not be uploaded into a file!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t//rename\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>0)\n\t\t{\n\t\t\tfoldername=$(toAction[0]).attr(\"id\").replace('//FileSelect','').replace(/---/g, ' ');\n\t\t\t//rename\n\t\t\tfolderRename(foldername);\n\t\t}\n\t\t\n\t}\n else if($('#fileActionSelect').val()=='MCUImg'){ //Select MCU Img\n $('#MCUImg').val(\"\");\n $('#MCUImg').click();\n //displayFileProperties('/sys/mcuimg.bin');\n }\n\telse if($('#fileActionSelect').val()=='Properties'){ //files properties\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>1 ){\n\t\t\talert (\"Please select only one file!\");\n\t\t\treturn;\n\n\t\t}\n\t\telse if(toAction.length===0){\n\t\t\talert (\"Please select a file!\");\n\t\t\treturn;\t\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type==\"folder\"){\n\t\t\t\t\talert (\"Please select files only!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tdisplayFileProperties($(toAction[0]).attr(\"id\").replace(\"//FileSelect\",\"\").split(\"//\").reverse().join(\"/\"));\n\t\t\n\t}\n}", "function eliminarMateriaTabla(){\n\tvar auxDel = 0;\n\t$(this).closest('tr').remove();\n\n\t//Verificamos si elemento exeiste, si no, quitamos boton\n\tif ( $(\"#keyInput\").length ) {\n\n\t}\n\telse{\n\t\t$('#contenedor-save-btn').css('display', 'none');\n\t}\n\n}", "function deletefile(value,id)\n{\nvar xmlhttp;\nif (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\nelse\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\nxmlhttp.onreadystatechange=function()\n {\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n {\n// alert(xmlhttp.responseText);\n }\n }\nxmlhttp.open(\"POST\",\"/sell/delete.php?name=\"+value+\"&iID=\"+id,true);\nxmlhttp.send();\n}", "function deleteCallback(v,m,f){\n\tif(v == '1'){\n\t\t document.getElementById('deleteSlideshowForm').submit(); \n\t}\n}", "function deleted(numero){\n \n //console.log(numero);\n Eliminarcore(numero);\n cargarTablaRecibidos();\n cargarTablaPrincipal();\n \n}", "function deleteFile(fid) {\n\t// Get the modal\n\tvar modalFile = document.getElementById('myModalDeleteFile');\n\n\t// Get the element that deletes the file\n\tvar proceed = document.getElementById(\"modalDelFileBtn\");\n\t// Get the element that closes the modal\n\tvar cancel = document.getElementById(\"cancelModalDelFileBtn\");\n\n\t// When the user clicks the button, open the modal \n\tmodalFile.style.display = \"block\";\n\n\tfileID = fid;\n}", "delete() {\n\n // propmt the user to confirm before deleting\n if( ! confirm(\"Are you sure you want to delete?\") ){\n return;\n }\n\n // remove the row from the table\n table.deleteRow( this.order.getRowIndex() + 1 );\n orders.splice( this.order.getRowIndex(), 1);\n \n // clear the form and selected order\n this.cancel();\n }", "function onDelete() {\n setFileURL(false)\n console.log(\"delete file\");\n }", "function remove_file (file_name)\n{ \n $('#upload_info').after ('<input type=\"file\" name=\"image\" id=\"image\" onchange=\"upload (this);\">');\n $('#file_name').val ('');\n $('#file_name_orig').val ('');\n $('#upload_info').remove ();\n delete_file (file_name);\n}", "function eliminar_img_foto(tab,camp)\n{\n\t$1('image_'+camp+'_controles1');\n\t$0('image_'+camp+'_copiando');\n\t$1('image_'+camp+'_default');\n\t$('image_'+camp+'_img').src=USU_IMG_DEFAULT;\n\t$('form_'+camp).reset();\n\t$0('image_'+camp+'_img_cerrar');\n\t$('upload_in_'+camp).value='eliminar';\n\n}", "function filesDivAction()\n{\n\t//action is delete\n\tif ($('#filesDivActionSelect').val()=='Delete')\n\t{\n\t\tvar toDelete=$('.fsLine>.fs1>i.fa-check-square-o');\n\t\tfor (var i=0;i<toDelete.length;i++){\n\t\t\tvar folderarray=toDelete[i].id.replace(\"//FileSelect\", \"\").split(\"//\").reverse();\n\t\t\t//get the first element\n\t\t\tvar elementToDelete=folderarray.pop();\n\t\t\tvar folderPath=findFolder(folderarray,project.userFiles);\n\t\t\t//now go to all object untill find and delete;\n\t\t\tif( folderPath && folderPath.object){\n\t\t\t\tfor(var j=0;j<folderPath.object.length;j++){\n\t\t\t\t\tif(folderPath.object[j].id==elementToDelete){\n\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\tfolderPath.object.splice(j,1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//erase elements on display\n\t\t$('#fileSysDiplayDiv .fsLine').remove();\n\t\t//rebuild\n\t\t//rebuild\n\t\tbuild_files(project.userFiles,'#fileSysDiplayDiv','','');\n\t}\n\t\n}", "function deleteField(event){\n //console.log(event)\n //excluir um por vez, de baixo para cima, deixando pelo menos o último\n const span = event.currentTarget;\n const fieldsContainer = document.querySelectorAll('.new-upload');\n if(fieldsContainer.length <= 1){\n //limpa o valor do campo\n span.parentNode.children[0].value = \"\"\n return\n }\n //deletar campo\n span.parentNode.remove();\n\n\n}", "function uniPrograms_Clear_FromData()\r\n{\r\n\tclearFields(\"uniProgram_form\");\r\n\t//remove Delete Button\r\n\tremove_child_Elements('uniPrograms-delete-btn');\r\n\taddValidationClass('uniProgram_form', 'uni_program_data_upload_file', 'validate-required');\r\n}", "function eliminar_fichas(id) {\n\t\tbootbox.confirm(\"ESTA SEGURO DE ELIMINAR LA FICHA?\", function(result) {\n\t\t\tif(result) {\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: 'data/programas/app.php',\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\tdataType:'json',\n\t\t\t\t\tdata: {eliminar_fichas:'asjkef', id: id},\n\t\t\t\t\tsuccess: function (data) {\n\t\t\t\t\t\t$.gritter.add({\n\t\t\t\t\t\t\ttitle: 'Registro Eliminado',\n\t\t\t\t\t\t\tclass_name: 'gritter-success',\n\t\t\t\t\t\t\ttime:2000\n\t\t\t\t\t\t});\n\t\t\t\t\t\tllenar_tabla_fichas()\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function removeFile(id) {\n let uri = \"admin_deletePhoto.php\"\n let xhr = new XMLHttpRequest()\n\n let fd = new FormData()\n\n xhr.open(\"POST\", uri, true)\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == 200) {\n // Handle response.\n xhr.responseText ? alert(xhr.responseText) : null\n xhr.responseText === \"La photo a été supprimée du serveur\" ? window.location.href = \"../index.php\" : null\n }\n }\n\n fd.append('photo_Id', id)\n // Initiate a multipart/form-data upload\n xhr.send(fd)\n }", "function delete_all(filelist,class_name,lang_confirm,lang_error,url_del,url_back){\n\t$('a.'+class_name).click(function(event){\n\t\tevent.preventDefault();\n\t\tvar listall = [];\n\t\t$('input.'+filelist+':checked').each(function(){\n\t\t\tlistall.push($(this).val());\n\t\t});\n\t\tif (listall.length<1){\n\t\t\talert(lang_error);\n\t\t\treturn false;\n\t\t}\n\t\tif (confirm(lang_confirm))\n\t\t{\n\t\t\t$.ajax({\t\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: url_del,\n\t\t\t\tdata:'listall='+listall,\n\t\t\t\tsuccess: function(data){\t\n\t\t\t\t\twindow.location=url_back;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}", "function del (e) {\r\n var parent = $(e.target).parent();\r\n var id = parent.attr('id');\r\n parent.remove();\r\n $.ajax({\r\n url: \"core/delete.php\",\r\n type: \"POST\",\r\n dataType: \"text\",\r\n data: \"id=\" + id\r\n });\r\n}", "function deleteList() {\n $('#custom-form').attr('action', '/delete-customlist/');\n $('#custom-form').submit();\n $('#delete-list').button('loading');\n}", "function DeleteContenido() {\n //Usado para seleccionar la fila\n var oTt = TableTools.fnGetInstance(\"tbl\"); // Get Table instance\n var sRow = oTt.fnGetSelected(); // Get Selected Item From Table\n /*\n //Colocar los valores para ser editados en caso sea necesario\n $('#ItemName').val($.trim(sRow[0].cells[0].innerHTML.toString()));\n $('#Qty').val(jQuery.trim(sRow[0].cells[1].innerHTML.toString()));\n $('#UnitPrice').val($.trim(sRow[0].cells[2].innerHTML.toString()));\n */\n if (sRow && sRow[0]) {\n $(\".tbl\").dataTable().fnDeleteRow(sRow[0]);\n }\n}", "function deleteImageFile(event) {\n\n let filename = event.target.getAttribute('data-filename');\n let ok = confirm('Are you sure you want to delete ' + filename + '?');\n\n if (ok === true) {\n\n let formData = new FormData();\n formData.append('filename', filename);\n\n fetch('/image/delete', {method: 'post', body: formData})\n .then(response => response.json())\n .then(data => {\n\n console.log(data.error);\n if (data.hasOwnProperty('error')) {\n alert(data.error);\n } else {\n loadImages();\n }\n }\n );\n }\n\n}", "function perform_deletion(value_passed){\nlet current_id=document.getElementsByClassName('hidden_value')[value_passed].value;\nlet confirmation=confirm(\"Are you sure?\");\nif (confirmation===true){\n$.ajax({\nmethod: \"DELETE\",\nurl: \"http://localhost:3000/user/\"+current_id,\n\n})\n.done(function( msg ) {\n //console.log(msg);\n alert( \"User file successfully Deleted\" );\n location.reload();\n});\n\n}\n}", "function del(){\r\n var table = document.getElementById(\"tables\");\r\n table.deleteRow(-1);\r\n }", "function view_delete_confirm(id_table, id_form, rules, url) {\n $(`#${id_table} tbody`).on('click', '.btn-danger', function() {\n const id = $(this).data('id');\n $('#modal_delete').modal('show');\n document.getElementById('id_delete').value = id;\n $(`#${id_form}`).validate({\n rules: rules,\n ignore: '',\n submitHandler: function() {\n const data = serializarForm(id_form);\n const response = post(url, 'DELETE', data, id_form);\n load_preloader_container(id_form, 10);\n response.then((res) => {\n stop_preloader(id_form, 500);\n $('#modal_delete').modal('hide');\n if (res.status) {\n show_alert('Enhorabuena!!!', res.message, 'success');\n $(`#${res.table}`).DataTable().ajax.reload();\n } else {\n show_alert('Ops!!!', res.message, 'error');\n }\n }).catch((err) => {\n stop_preloader(id_form, 500);\n show_alert('Ops!!!', err.message, 'error');\n });\n }\n });\n });\n}", "function btn_delete_onclick(hdn_item_id_list){\n var f = document.frmMain;\n var v_item_id = \"0\";\n var v_item_id_list = \"\";\n var error_message = 'Chưa có đối tượng nào được chọn!';\n\n if (typeof(f.chk) == 'undefined' ){\n alert(error_message);\n return;\n }\n\n v_item_id_list = get_all_checked_checkbox(f.chk,\",\");\n if (v_item_id_list == \"\"){\n alert(error_message);\n return;\n }\n\n if (confirm('Bạn chắc chắn xoá các đối tượng đã chọn?')){\n f.hdn_item_id_list.value = v_item_id_list;\n m = $(\"#controller\").val() + f.hdn_delete_method.value;\n $(\"#frmMain\").attr(\"action\", m);\n f.submit();\n }\n}", "function clearsongs() {\n fileinput.value = null;\n}", "function onDeleteSelectedImageButtonClick() {\n let res = confirm('You are about to delete the currently selected image. This action is not reversible');\n if (!res) return;\n\n let form = new FormData();\n let id = $('#selectProjectImages').val();\n form.append('action', 'deleteProjectImage');\n form.append('projectId', $('#projectId').val());\n form.append('imageId', id);\n\n api.post('/project-images.php', form, true)\n .then(res => {\n $(`option[id=${id}]`).remove();\n initializeImagePicker();\n snackbar(res.message, 'success');\n $('#labelImageFile').text('Choose a new file to upload');\n $('#projectImagePreview').attr('src', '');\n if ($('#selectProjectImages option').length == 0) {\n $('#btnDeleteSelectedImage').hide();\n }\n })\n .catch(err => {\n snackbar(err.message, 'error');\n });\n}", "function limpiarTabla() {\n $(\"#my_file_output > tbody \").empty();\n}", "function del(codigo,div,url)\r\n{ if(confirm(\"¿Está seguro que desea eliminar el usuario?\"))\r\n\t{ var ruta_imagenes=document.getElementById('ruta_imagenes').value;\r\n\t\tdocument.getElementById( div ).innerHTML='<br><div align=\"center\" style=\"height:100%;\"><i style=\"font-size:large;color:darkred;\" class=\"fa fa-cog fa-spin\"></i></div>';\r\n\t\tvar data = new FormData();\r\n\t\tdata.append('event', 'delete');\r\n\t\tdata.append('codigo', codigo);\t\r\n\t\tvar xhr = new XMLHttpRequest();\r\n\t\txhr.open('POST', url , true);\r\n\t\txhr.onreadystatechange=function()\r\n\t\t{ if (xhr.readyState==4 && xhr.status==200)\r\n\t\t\t{ busca(\"\",div,url)\r\n\t\t\t} \r\n\t\t};\r\n\t\txhr.send(data);\r\n\t}\r\n}", "function filesDivPageAction2(){\n\t//action is delete\n\tif ($('#fileActionSelect').val()=='Remove')\n\t{\n\t\tvar toDelete=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tfor (var i=0;i<toDelete.length;i++){\n\t\t\tvar folderarray=toDelete[i].id.replace(\"//FileSelect\", \"\").replace(/---/g, ' ').split(\"//\").reverse();\n\t\t\t//get the first element\n\t\t\tvar elementToDelete=folderarray.pop();\n\t\t\tif(folderarray.length===0){ //is root\n\t\t\t\tif (project.userFiles )\n\t\t\t\t{\n\t\t\t\t\tfor(var j=0;j<project.userFiles.length;j++){\n\t\t\t\t\t\tif(project.userFiles[j].id==elementToDelete){\n\t\t\t\t\t\t\tif(project.userFiles[j].type==\"file\"){ //if it a file\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tproject.userFiles.splice(j,1);\n\t\t\t\t\t\t\t\tvar objectToSend={\n\t\t\t\t\t\t\t\t\t'name':projectName,\n\t\t\t\t\t\t\t\t\t'source':\"/\"+elementToDelete\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t//delete from API\n\t\t\t\t\t\t\t\t$.post(\"/api/1/flash/deleteProjectFsFile\", \n\t\t\t\t\t\t\t\t\tobjectToSend,\n\t\t\t\t\t\t\t\t\tfunction(data,status){\n\t\t\t\t\t\t\t\t\t\tif(status=='success' && data.ok){\n\t\t\t\t\t\t\t\t\t\t\t//save project\n\t\t\t\t\t\t\t\t\t\t\tsaveProjectAPI();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if(data.err){\n\t\t\t\t\t\t\t\t\t\t\talert(\"Error deleteing the file\"+data.err);\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);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{ //is a folder delete for Project only\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tproject.userFiles.splice(j,1);\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\telse{\n\t\t\t\tvar folderPath=findFolder(folderarray,project.userFiles);\n\t\t\t\t//now go to all object until find and delete;\n\t\t\t\tif( folderPath && folderPath.object){\n\t\t\t\t\tfor(var j=0;j<folderPath.object.length;j++){\n\t\t\t\t\t\tif(folderPath.object[j].id==elementToDelete){\n\t\t\t\t\t\t\tif(folderPath.object[j].type==\"file\"){ //if it a file\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tfolderPath.object.splice(j,1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar objectToSend={\n\t\t\t\t\t\t\t\t\t'name':projectName,\n\t\t\t\t\t\t\t\t\t'source':\"/\"+folderarray.join(\"/\")+\"/\"+elementToDelete\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t//delete from API\n\t\t\t\t\t\t\t\t$.post(\"/api/1/flash/deleteProjectFsFile\", \n\t\t\t\t\t\t\t\t\tobjectToSend,\n\t\t\t\t\t\t\t\t\tfunction(data,status){\n\t\t\t\t\t\t\t\t\t\tif(status=='success' && data.ok){\n\t\t\t\t\t\t\t\t\t\t\t//save project\n\t\t\t\t\t\t\t\t\t\t\tsaveProjectAPI();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse if(data.err){\n\t\t\t\t\t\t\t\t\t\t\talert(\"Error delete the file\"+data.err);\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\telse{\n\t\t\t\t\t\t\t\t//remove the items\n\t\t\t\t\t\t\t\tfolderPath.object.splice(j,1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//erase elements on display\n\t\t$('#fileSysDiplayPageDiv').html(\"\");\n\t\t//redo menus and files\n\t\tbuild_files(project.userFiles,'#fileSysDiplayPageDiv','','');\n \n saveProjectAPI();\n\t}\n\telse if($('#fileActionSelect').val()=='NewFolder'){\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length===0){\n\t\t\tfolderCreate(toAction);\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type!=\"folder\"){\n\t\t\t\t\t\talert (\"Can't create a folder in a a file\")\n\t\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tfolderCreate(toAction);\n\t\t}\n\t}\n\telse if($('#fileActionSelect').val()=='Upload'){\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>1){\n\t\t\talert (\"Please select only one folder!\");\n\t\t\treturn;\n\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type!=\"folder\"){\n\t\t\t\t\talert (\"File can not be uploaded into a file!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t//if here display the browser\n $('#fileElement').click();\n\t}\n\telse if($('#fileActionSelect').val()=='Rename'){\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>1){\n\t\t\talert (\"Please select only one folder!\");\n\t\t\treturn;\n\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type!=\"folder\"){\n\t\t\t\t\talert (\"File can not be uploaded into a file!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t//rename\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>0)\n\t\t{\n\t\t\tfoldername=$(toAction[0]).attr(\"id\").replace('//FileSelect','').replace(/---/g, ' ');\n\t\t\t//rename\n\t\t\tfolderRename(foldername);\n\t\t}\n\t\t\n\t}\n else if($('#fileActionSelect').val()=='MCUImg'){ //Select MCU Img\n $('#MCUImg').val(\"\");\n $('#MCUImg').click();\n //displayFileProperties('/sys/mcuimg.bin');\n }\n\telse if($('#fileActionSelect').val()=='Properties'){ //files properties\n\t\tvar toAction=$('#fileSysDiplayPageDiv .fsLine>.fs1>i.fa-check-square-o');\n\t\tif(toAction.length>1 ){\n\t\t\talert (\"Please select only one file!\");\n\t\t\treturn;\n\n\t\t}\n\t\telse if(toAction.length===0){\n\t\t\talert (\"Please select a file!\");\n\t\t\treturn;\t\n\t\t}\n\t\telse{\n\t\t\t//check if there is a file selected\n\t\t\tfor (var i=0;i<toAction.length;i++){\n\t\t\t\tvar type=$(toAction[i]).attr(\"data-type\");\n\t\t\t\tif(type==\"folder\"){\n\t\t\t\t\talert (\"Please select files only!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tdisplayFileProperties($(toAction[0]).attr(\"id\").replace(\"//FileSelect\",\"\").split(\"//\").reverse().join(\"/\"));\n\t\t\n\t}\n}", "function deleteFile(file_id, utente_id){\n $.ajax({\n url: \"php/query.php\",\n data: {\n \"command\": 'deleteFile',\n \"file_id\": file_id\n },\n cache:false,\n type: \"GET\"\n }).always(function() {\n getFiles(utente_id);\n alert('File eliminato con successo.');\n });\n}", "function supprimerFamille(){\n var request = new XMLHttpRequest();\n var id = document.getElementById(\"txtfamId\").value;\n var url = \"/tfamille/\"+id ;\n request.open(\"DELETE\", url, true);\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n if (request.status === 200) {\n ramplirtabFam();\n // bootbox.alert(\"Suppression réussi\");\n document.getElementById(\"txtfamCode\").focus();\n }\n else {bootbox.alert(\"Erreur lors de la suppression\");}\n }\n };\n request.send();\n} // end supprimer", "function onDeleteAll() {\n\t\t$.get(url, function (response) {\n\t\t\tresponse.forEach(function (record) {\n\t\t\t\tvar newUrl = url + record._id;\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: newUrl,\n\t\t\t\t\tmethod: 'DELETE'\n\t\t\t\t});\n\t\t\t});\n\t\t}, 'json');\n\t\t$imageUrl.val('');\n\t\t$imageCaption.val('');\n\t\t$gallery.html('');\n\t\t$gallery.hide();\n\t}", "function deleteImage(element, event, method=\"post\") {\n event.stopPropagation();\n var result = confirm(\"Want to delete?\")\n if (result) {\n const form = document.createElement('form');\n form.method = method;\n form.action = \"/album/delete\" + element.split(\".\")[0];\n const hiddenField = document.createElement('input');\n hiddenField.type = \"hidden\";\n hiddenField.name = \"path\";\n hiddenField.value = element;\n form.appendChild(hiddenField);\n document.body.appendChild(form);\n form.submit();\n } \n}", "function del() {\n\t\tif( $( '#img' ).data( 'pngPath' ) !== undefined ) {\n\t\t\t$.post( \"delete.php\", { path: $( '#img' ).data( 'path' ), pngPath : $( '#img' ).data( 'pngPath' ) } ); \n\t\t}\n\t\telse {\n\t\t\t$.post( \"delete.php\", { path: $( '#img' ).data( 'path' ) } ); \n\t\t}\n\t}", "function deleteTemplateElement(req){\n deleteElement(dataTable_templates,'#template_'+req.request.data);\n updateTemplateSelect();\n}", "function delete_video_notrack(){\n\n\t\t$('#delete').on('click', function (e) {\n $('.close').click();\n e.preventDefault();\n $(\"#sitem-table tbody\").html('');\n $(\"#csv_export button\").attr('disabled','disabled').css('cursor','not-allowed');\n\n\t\t\treturn false;\n\t\t});\n\t}", "function deleteOprIns(doc_ins_id) {\n ActionModule.confirmDelete({\n msg: 'Do you want to delete this operation attachment? Please confirm.',\n data: {\n action: 'delete_operation_attachment',\n doc_ins_id: doc_ins_id,\n },\n loader: 'content_loader',\n callback: function () {\n hideFullLoader('content_loader');\n $(\".attachment_\" + doc_ins_id).remove();\n }\n });\n }", "function deleteFileFromForm(fileId) {\n setFormState(prevFormState => {\n const newFormState = _cloneDeep(prevFormState)\n newFormState.files = newFormState.files.filter(f => f._id != fileId)\n return newFormState\n })\n }", "function deleteFilesFromFormData(elementId) {\n formData.forEach((fileObj, key) => {\n if (key === elementId) {\n formData.delete(key);\n }\n });\n }", "function deleteRecord(record_id){\n $(\"#deleteform input[name=student_id]\").val(record_id);\n $(\"#deleteform\").submit();\n }", "function department_Clear_FromData()\r\n{\r\n\r\n\tclearFields(\"department_form\");\r\n\t\r\n\t//remove Delete Button\r\n\tremove_child_Elements('department-delete-btn');\r\n\taddValidationClass('department_form', 'department_data_upload_file', 'validate-required');\r\n\t\r\n}", "function removeFile() {\r\n\t\tvar listbox = document.getElementById('mySavedFiles2');\r\n\t\tvar otherlistbox = document.getElementById('mySavedFiles');\r\n\t\tvar fileName = undefined;\r\n\t\tfor (var i = 0; i < listbox.options.length; i++) {\r\n\t\t if (listbox.options[i].selected) fileName = listbox.options[i].text; // selected file \r\n\t\t}\r\n\t\tif (fileName !== undefined) {\r\n\t\t // verify deleting \r\n\t\t var verify = confirm(\"Are you sure you want to delete \" + fileName + \"?\");\r\n\t\t if (verify == false) return; \r\n\t\t // removes file from local storage\r\n\t\t localStorage.removeItem(fileName);\r\n\t\t // removes file from listboxes\r\n\t\t var optionToRemove = listbox.options.selectedIndex;\r\n\t\t listbox.remove(optionToRemove);\r\n\t\t otherlistbox.remove(optionToRemove);\r\n\t\t // hides the remove HTML element\r\n\t\t var removeDocument = document.getElementById(\"removeDocument\");\r\n\t\t removeDocument.style.visibility = \"hidden\";\r\n\t\t}\r\n\t }", "function deleteSuccess(itemsdata) {\n tbl.clear();\n redrawTable(tbl, itemsdata);\n buttonEvents(); // after redrawing the table, we must wire the new buttons\n $(\"#editDiv\").hide();\n swal(\"נמחק בהצלחה!\", \"הפעולה בוצעה\", \"success\");\n mode = \"\";\n }", "'click .js-media-delete-button'( e, t ) {\n e.preventDefault();\n\n let cur = $( '#cb-current' ).val()\n , idx = P.indexOf( `${cur}` );\n\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-media-toolbar' ).hide();\n $('#frameBorder').remove();\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\n\n //console.log( pp.find({}).fetch() );\n }", "function removeFileFromUploadList(file_id) {\n var fileList = $('.addImg-ul').children('li');\n // $('.addImg-ul').remove(file_id);\n\n // Set user to select..\n for(var i = 0; i < fileList.length; i++) {\n var oneFile = fileList.get(i);\n if(oneFile.id == file_id) {\n outConsole(\"Remove item\", oneFile);\n uploadFiles.splice(i, 1);\n break;\n }\n }\n\n outConsole(\"upload Files\", uploadFiles);\n refreshUpdateList();\n}", "function assignmentsRemoveFile() {\n\tvar idx = assignmentsGetCurrentIdx();\n\tif (idx == -1) return;\n\t\n\tvar filesSelect = document.getElementById(\"filesSelect\");\n\tif (filesSelect.selectedIndex == -1) return;\n\t\n\tvar currentFile = filesSelect.options[filesSelect.selectedIndex].value;\n\t\n\tvar ok = confirm(\"Are you sure you want to delete file \"+currentFile+\"?\\n\\nThis operation can not be undone.\");\n\tif (!ok) return;\n\t\n\tfor (var j=0; j<assignments[idx].files.length; j++) {\n\t\tif (assignments[idx].files[j].filename == currentFile) {\n\t\t\tassignments[idx].files.splice(j,1);\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfilesSelect.remove(filesSelect.selectedIndex);\n\tassignmentsUpdate();\n}", "function deleteGroupFilesDetails(jobId,row) {\r\n\t\t\t\t\tblockUI();\r\n\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\ttype : \"GET\",\r\n\t\t\t\t\t\turl : 'deleteGroupDownloadFiles.do',\r\n\t\t\t\t\t\tdata : \"jobId=\"+jobId,\r\n\t\t\t\t\t\tdataType: 'html',\r\n\t\t\t\t\t\tcache:false,\r\n\t\t\t\t\t\tsuccess : function(data) {\r\n\t\t\t\t\t\t\tvar obj = jQuery.parseJSON(data);\r\n\t\t\t\t\t\t\tif(obj.status == 'Success') {\r\n\t\t\t\t\t\t\t\t$.modal.alert(strings['msg.jobDeleted']);\r\n\t\t\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t\t\t\t//deleteRowValues(row);//this method is present in manageUser.js\r\n\t\t\t\t\t\t\t\trow.closest(\"tr\").remove();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$.modal.alert(strings['msg.fileDeleteError']);\r\n\t\t\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\terror : function(data) {\r\n\t\t\t\t\t\t\t$.modal.alert(strings['msg.fileDeleteError']);\r\n\t\t\t\t\t\t\tunblockUI();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}", "function deleteFile(response,request)\n{\n if(request.method== \"POST\")\n {\n var body = '';\n\n request.on('data', function (data) {\n body += data;\n });\n request.on('end', function ()\n {\n body = qs.parse(body);\n\n console.log(\"jarayyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyjajaaaaaaaaaaaaaaaaaaaaaaa \"+ body.task);\n\n delete_File.file_removal(body.file, response);\n\n });\n }\n\n\n}", "function onDelete(td) {\n if (confirm(\"Are you sure to delete this record ?\")) {\n row = td.parentElement.parentElement;\n document.getElementById(\"demo\").deleteRow(row.rowIndex);\n resetForm();\n }\n}", "function removeUploadingfile(filename, index) {\n\t\t\tvar dropzoneQueued = self.dailydropzoneObj.getAcceptedFiles();\n\t\t\tvar filetoremove = _.find(dropzoneQueued, { name: filename });\n\t\t\tself.dailydropzoneObj.cancelUpload(filetoremove);\n\n\t\t\tif (self.multiFilesdata[index].error != '') {\n\t\t\t\tself.multiuploadError = parseInt(self.multiuploadError) - parseInt(1);\n\t\t\t\t//$scope.$apply();\n\t\t\t}\n\t\t\tself.multiFilesdata.splice(index, 1);\n\n\t\t\tself.multidocCount = self.multiFilesdata.length;\n\n\t\t\tif (self.multidocCount == 0) {\n\t\t\t\tnotificationService.success(\"There is no document in queue to upload.\");\n\t\t\t\tself.fileUpload = false;\n\t\t\t\tself.cancelfileUpload = false;\n\t\t\t}\n\t\t}", "function BtnDelete() {\n transacionAjax_D_elete(\"D_elete\");\n}", "function deleteTable(e){\n var node_id = JSON.parse(localStorage.getItem(\"from\"))[0]\n var label = JSON.parse(localStorage.getItem('tables'))[parseInt(JSON.parse(localStorage.getItem(\"id\")))].nodes[parseInt(node_id)].label\n //var table_aux = label = JSON.parse(localStorage.getItem('tables'))[parseInt(JSON.parse(localStorage.getItem(\"id\")))]\n var table_aux = JSON.parse(localStorage.getItem('tables'))\n table_aux[parseInt(JSON.parse(localStorage.getItem(\"id\")))].nodes.splice(parseInt(node_id),1)\n arrayTable[0].nodes.splice(parseInt(node_id),1)\n //localStorage.setItem('tables',JSON.table_aux)\n //console.log(table_aux.nodes[parseInt(node_id)])\n //console.log(\"a editar a \"+label + \"vou passar a \" + editedValue)\n console.log(table_aux[parseInt(JSON.parse(localStorage.getItem(\"id\")))])\n var new_table = JSON.stringify(table_aux)\n localStorage.setItem('tables',new_table)\n localStorage.setItem(\"from\",'')\n var new_id = parseInt(JSON.parse(localStorage.getItem(\"id\"))) - 1\n localStorage.setItem(\"id\",new_id)\n \n // temos de desabilitar os botoes de editar e eliminar\n editbutton = true\n editFlag = 0\n label =''\n deletebutton = true\n createbutton = false\n var arr=[]\n hookeditButtonState(editButtonState.concat(arr))\n }", "async __confirmDeleteButtonClicked() {\n try {\n await this.clicked();\n\n const files = this.$.fileDropZone.getFiles();\n const fileToDelete = files.find(file => file.newName === this._itemToDelete.name);\n\n if (fileToDelete) { // cancel upload and remove file from dropzone list\n this.$.fileDropZone.removeFile(fileToDelete);\n }\n\n const {name, path} = this._itemToDelete;\n const getDeletePath = () => {\n if (path) {\n return path;\n }\n if (this._itemsUploadData[name]) {\n return this._itemsUploadData[name].path;\n }\n };\n\n const deletePath = getDeletePath();\n\n if (deletePath) {\n await this.$.spinner.show(`Deleting ${this.type} file...`);\n delete this._itemsUploadData[name];\n await services.deleteFile(deletePath);\n await services.deleteField({coll: this._path, doc: this.target, field: name});\n }\n }\n catch (error) {\n if (error === 'click disabled') { return; }\n console.error(error);\n }\n finally {\n const elements = this.selectAll('.sortable');\n const element = elements.find(element => element.item.name === this._itemToDelete.name);\n element.classList.remove('sortable');\n element.style.display = 'none';\n this._targetToDelete.style.opacity = '1';\n await this.$.deleteConfirmModal.close();\n this._targetToDelete = undefined;\n this._itemToDelete = undefined;\n this.$.spinner.hide();\n }\n }", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function massDelete() {\n\tvar button = $(this),\n\ttype = button.attr('data-type'),\n\tid = button.attr('data-id'),\n\tname = button.attr('data-name'),\n\ttable = $('#searchResults'),\n\tcheckboxes = table.find($('.selection')),\n\tcnt = 0;\n\t// Check if there are selections.\n\tcheckboxes.each(function () {\n\t\tvar checkbox = $(this),\n\t\tchecked = checkbox.prop('checked');\n\t\tif (checked) {\n\t\t\tcnt++;\n\t\t}\n\t});\n\t// User selected at least one.\n\tif (cnt > 0) {\n\t\tif (type == 'site') {\n\t\t\topenMassDeleteSiteDialog(id, name);\n\t\t} else {\n\t\t\topenMassDeleteUserDialog(id, name);\n\t\t}\n\t}\n}", "function delBtnHdlr() {\n\tvar tblFlds = {};\n\tvar delAlert = ( _sessLang == SESS_LANG_CHN ) ? '刪除的資料將無法恢復,請確認!'\n\t\t\t\t\t\t\t\t\t\t\t\t : 'A deleted row cannot be undone, please confirm!';\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\tif ( !confirm( delAlert ) ) return;\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_ajaxData = {}; _dbInfo = {};\n\tthisRow = $(this).closest(\"tr\");\n\ttblFlds [ thisRow.attr(\"data-keyn\") ] = thisRow.attr(\"id\");\n\t_dbInfo[ 'tblName' ] = _tblName;\n\t_dbInfo[ 'tblFlds' ] = tblFlds;\n\t_dbInfo[ 'pwRqstr' ] = ( _icoName != null ) ? _icoName : _sessUsr;\n\t_ajaxData [ 'dbReq' ] = 'dbDEL';\n\t_ajaxData [ 'dbInfo' ] = JSON.stringify ( _dbInfo );\n\t$.ajax({\n\t\turl: \"./ajax-pwDB.php\",\n\t\tmethod: 'POST',\n\t\tdata:\t_ajaxData,\n\t\tsuccess: function( rsp ) { // Success Handler\n\t\t\tvar rspV = JSON.parse ( rsp );\n\t\t\tfor ( var X in rspV ) {\n\t\t\t\tswitch ( X ) {\n\t\t\t\tcase 'URL':\n\t\t\t\t\tlocation.replace( rspV[ X ] );\n\t\t\t\t\treturn;\n\t\t\t\tcase 'delSUCCESS':\n\t\t\t\t\talert( rspV [ X ] );\n\t\t\t\t\tthisRow.remove();\n\t\t\t\t\treturn;\n\t\t\t\tcase 'errCount':\n\t\t\t\t\tx = rspV [ X ];\n\t\t\t\t\teMSG = '';\n\t\t\t\t\tfor ( i=0; i < x; i++ ) {\n\t\t\t\t\t\teMSG += rspV [ 'errRec' ][i] + \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\talert( eMSG );\n\t\t\t\t\treturn;\n\t\t\t\t} // switch()\n\t\t\t} // for loop\n\t\t}, // End of Success Handler\n\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\talert( \"delBtnHdlr()\\tError Status:\\t\"+textStatus+\"\\t\\tMessage:\\t\\t\"+errorThrown+\"\\n\" );\n\t\t} // End of ERROR Handler\t\n\t});\t// AJAX Call\n}", "function deleteButtonPressed(flashcard) {\n db.remove(flashcard);\n }", "function deleteSelectedFiles(){\r\n\t\t\r\n\t\tvar arrFiles = getArrSelectedFiles();\r\n\t\t\r\n\t\tif(arrFiles.length == 0){\r\n\t\t\talert(\"No Files Chosen\");\r\n\t\t\treturn(false);\r\n\t\t}\r\n\t\t\r\n\t\tvar numFiles = arrFiles.length;\r\n\t\t\r\n\t\tvar message = \"Do you sure you want to delete \"+ numFiles+ \" files?\";\r\n\t\tif(confirm(message) == false)\r\n\t\t\treturn(false);\r\n\t\t\r\n\t\t//mark selected files with \"deleting class\"\r\n\t\tvar selectedItems = g_objFileList.find(\".uc-filelist-item-selected\");\r\n\t\t\r\n\t\tselectedItems.addClass(\"uc-filelist-item-deleting\");\r\n\t\tselectedItems.removeClass(\"uc-filelist-item-selected\");\r\n\t\t\r\n\t\tg_objWrapper.find(\".uc-button-delete-file\").hide();\r\n\t\tg_objWrapper.find(\".uc-preloader-deleting\").show();\r\n\t\t\r\n\t\tassetsAjaxRequest(\"assets_delete_files\", {arrFiles: arrFiles, path: g_activePath, pathkey:g_pathKey}, function(response){\r\n\t\t\t\r\n\t\t\tvar htmlList = response.html;\r\n\t\t\tg_objFileList.html(htmlList);\r\n\t\t\t\r\n\t\t\tg_objWrapper.find(\".uc-preloader-deleting\").hide();\r\n\t\t\tg_objWrapper.find(\".uc-button-delete-file\").show().addClass(\"button-disabled\");\r\n\t\t\t\r\n\t\t\ttriggerEvent(events.CHANGE_FILELIST);\r\n\t\t\ttriggerEvent(events.UPDATE_FILES);\r\n\t\t});\r\n\t\r\n\t}", "function getFileInput(can_delete) {\n\t\tvar\n\t\t\tdiv = document.createElement('div'),\n\t\t\tdelete_control = document.createElement('span'),\n\t\t\tclear = document.createElement('div')\n\t\t;\n\t\t// Apply properties to elements\n\t\tdelete_control.className = 'icon del';\n\t\tdelete_control.setAttribute('title', msg.delFieldTitle);\n\t\taddEvent(delete_control, 'click', function() {delete_control.parentNode.parentNode.removeChild(delete_control.parentNode);});\n\n\t\tdiv.className = 'input';\n\t\tclear.className = 'clear';\n\n\t\t// Build\n\t\tdiv.innerHTML = '<label>' + msg.fileNameTitle + ':</label><input type=\"file\" name=\"file[' + (++file_input_field_num) + ']\" />';\n\t\tif (can_delete) {\n\t\t\tdiv.appendChild(delete_control);\n\t\t}\n\t\tdiv.appendChild(clear);\n\t\treturn div;\n\t}", "function fnDeleteImage()\n{\n\nvar appImage=document.forms[0];\n\nflag = false;\nhideErrors();\nvar index;\nsecchecked = false;\n\nvar desc=appImage.imageSeqNo;\n\nvar len=appImage.imageSeqNo.length;\n\n\nvar description;\nif(desc.length!=undefined){\n\nfor(var i=0; i<len; i++){\n\n\t\tif(appImage.imageSeqNo[i].checked){\n\t\t\t\n\t\t\tindex = i;\n\t\t\tflag = true;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n}\nelse{\n\n\tif(desc.checked){\n\t\tflag=true;\n\t}\n}\nif(!flag){\n\n\tvar id = '781';\n hideErrors();\n addMsgNum(id);\n\tshowScrollErrors(\"imageSeqNo\",-1);\n\treturn false;\n\t\n}\nvar del=confirm(\"Are you sure to delete the Appendix Image ?\");\n\n\tif(del)\n\t{\n\t\tdocument.forms[0].action=\"AppendixAction.do?method=deleteImage\";\n\t\tdocument.forms[0].submit();\n\t}else{\n\n\t}\n}", "function borrarElementoTabla(e){\n var valor = confirm(\"Estas Seguro de Borrar Este Integrante?\");\n if(valor == true){\n\n const data = new FormData();\n data.append('borrarFamiliar', 'true');\n data.append('idFamiliar', e);\n fetch('../controller/grupoFamiliarController.php', {\n method: 'POST',\n body: data\n })\n .then(res => res.text())\n .then(data => {\n alert(data);\n cargarTabla();\n })\n }\n}", "function testSubmitNoFile() {\n file = null;\n onSubmit();\n}", "function deleteUploaded(selectedUpDoc, selectedData) {\n\t\t\tif (utils.isNotEmptyVal(self.display.uploaded.filterText) && allUploadedSelected()) {\n\t\t\t\tselectedUpDoc = selectedData;\n\t\t\t}\n\n\n\t\t\tvar modalOptions = {\n\t\t\t\tcloseButtonText: 'Cancel',\n\t\t\t\tactionButtonText: 'Delete',\n\t\t\t\theaderText: 'Delete ?',\n\t\t\t\tbodyText: 'Are you sure you want to delete ?'\n\t\t\t};\n\n\t\t\t// confirm before delete\n\t\t\tmodalService.showModal({}, modalOptions).then(function () {\n\t\t\t\tvar docdata = {};\n\t\t\t\tif (self.activeTab == 'uploadeddailymail') {\n\n\t\t\t\t\tdocdata['docID'] = _.pluck(selectedUpDoc, 'id');\n\n\t\t\t\t\tvar promesa = dailyMailScanDataService.deleteUploadedDocument(docdata);\n\t\t\t\t\tpromesa.then(function (data) {\n\t\t\t\t\t\tnotificationService.success('Documents deleted successfully');\n\t\t\t\t\t\tangular.forEach(docdata['docID'], function (datavalue, datakey) {\n\t\t\t\t\t\t\tvar index = _.findIndex(self.uploadedList.data, { id: datavalue });\n\t\t\t\t\t\t\tself.uploadedList.data.splice(index, 1);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.uploadedGridOptions.selectAll = false;\n\t\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = [];\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tnotificationService.error('Unable to delete documents');\n\t\t\t\t\t});\n\n\t\t\t\t} else if (self.activeTab == 'unindexeddailymail') {\n\n\t\t\t\t\tdocdata['docID'] = _.pluck(self.unindexedGridOptions.unindexedSelectedItems, 'id');\n\n\t\t\t\t\tvar promesa = dailyMailScanDataService.deleteUnindexedDocument(docdata);\n\t\t\t\t\tpromesa.then(function (data) {\n\t\t\t\t\t\tnotificationService.success('Documents deleted successfully');\n\t\t\t\t\t\tangular.forEach(docdata['docID'], function (datavalue, datakey) {\n\t\t\t\t\t\t\tvar index = _.findIndex(self.unindexedList.data, { id: datavalue });\n\t\t\t\t\t\t\tself.unindexedList.data.splice(index, 1);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tself.unindexedGridOptions.selectAll = false;\n\t\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = [];\n\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tnotificationService.error('Unable to delete documents');\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function closeUpload() {\n document.getElementById(\"uploadForm\").style.display = \"none\";\n document.getElementById(\"delete\").disabled = false;\n document.getElementById(\"add\").disabled = false;\n document.getElementById(\"upload\").disabled = false;\n}", "function removeRefDoc()\n { \n var isOK = confirm(\"Please click OK to continue removing the selected Reference Document.\");\n if (isOK == true) //ok to submit\n submitDesignate(\"removeRefDoc\");\n }", "function deleteFile(){\n var fileInput = document.getElementById('fileupload');\n var fileFind = false;\n \n $.ajax({\n url: 'http://lst-demo.univ-lemans.fr:8000/api/v1.1/files',\n type:'GET',\n\n dataType: 'json',\n enctype: 'application/json',\n processData: false,\n contentType: false,\n\n headers: {\n \"Authentication-Token\": token,\n },\n\n success: function(resultat){\n for(var i=0; i<resultat.length; i++){\n if(fileInput.files[0].name == resultat[i].filename){\n del(resultat[i].id);\n fileFind = true;\n }\n }\n if(!fileFind){\n console.log('DelFile: Fichier Inexistant')\n }\n },\n error: function(resultat){\n console.log('DelFile: Error')\n },\n });\n}", "function deleteFile()\n{\n var filePath = $(this).closest(\"tr\").attr(\"path\");\n var url = \"https://api.dropbox.com/1/fileops/delete\";\n var headers = {\n Authorization: 'Bearer ' + getAccessToken(),\n };\n var args = {\n url: url,\n headers: headers,\n crossDomain: true,\n crossOrigin: true,\n type: 'POST',\n data : {\n root: 'auto',\n path: filePath\n },\n dataType: 'json',\n success: function(data)\n {\n var oReq = new XMLHttpRequest();\n var request_data ={\n \"filePath\":filePath,\n \"owner\":user_id,\n };\n oReq.open(\"POST\",CLOUD_SERVER+'delete_file_meta', true);\n oReq.responseType = \"json\";\n oReq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n oReq.onload = function(oEvent)\n {\n getMetadata(filePath.substring(0,filePath.lastIndexOf('/')),createFolderViews);\n };\n oReq.send(JSON.stringify(request_data));\n },\n error: function(jqXHR)\n {\n console.log(jqXHR);\n }\n };\n $.ajax(args); \n}", "function UpdateApproveRequestOrdeTable() {\n // Update order data from csv \n approve_order_request_table.rows().remove();\n upload_approve_order_request_table();\n }", "function remove_btn(){\n\t\t// submit dugmad koja treba da se sklone\n\t\tvar pogledaj_savet = document.querySelectorAll('input[value=\"pogledaj_savet\"]');\n\t\t// dugme na koje treba da se klikne\n\t\tvar link = document.getElementsByClassName('klik');\n\t\tfor (var i = 0; i < pogledaj_savet.length; i++) {\n\t\t\tpogledaj_savet[i].style.display = 'none';\n\t\t\tlink[i].onclick = function(event){\n\t\t\t\tvar dugme = event.target;\n\t\t\t\tvar forma = dugme.parentElement;\n\t\t\t\tforma.submit();\n\t\t\t}\n\t\t}\n\t}", "function supprimerCarrousel(){\n var request = new XMLHttpRequest();\n var id = document.getElementById(\"txtcarId\").value;\n var url = \"/tcarrousel/\"+id ;\n request.open(\"DELETE\", url, true);\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n if (request.status === 200) {\n ramplirtabCar();\n // bootbox.alert(\"Suppression réussi\");\n bootbox.alert(\"Suppression réussi\");\n document.getElementById(\"txtcarNom\").focus();\n }\n else {bootbox.alert(\"Erreur lors de la suppression\");}\n }\n };\n request.send();\n} // end supprimer", "static deleteEntry(path) {\n Databases.fileMetaDataDb.remove({path: path}, (err, numDeleted) => {\n if (err) {\n console.log(err);\n }\n });\n }" ]
[ "0.7204416", "0.6918951", "0.6832437", "0.6826155", "0.67882264", "0.67180246", "0.6670666", "0.66552645", "0.6595723", "0.6572796", "0.6497151", "0.64416236", "0.6421615", "0.63921726", "0.638505", "0.6349582", "0.63241607", "0.6256853", "0.62384754", "0.6091419", "0.6085645", "0.6056951", "0.60472596", "0.6039109", "0.6028296", "0.6016555", "0.6002385", "0.5986312", "0.59771085", "0.59735435", "0.59689736", "0.5949386", "0.5914568", "0.5900335", "0.5895915", "0.5894497", "0.5877874", "0.58727264", "0.58688295", "0.58663595", "0.58658546", "0.5856313", "0.58493483", "0.5842311", "0.5834369", "0.580979", "0.5805188", "0.5800672", "0.5796604", "0.5794117", "0.5789881", "0.5787349", "0.57812715", "0.5780584", "0.57792723", "0.5776926", "0.57667124", "0.57643896", "0.57497907", "0.57442284", "0.57434434", "0.57397616", "0.57379186", "0.57361877", "0.57319033", "0.572625", "0.5719745", "0.5710783", "0.5709293", "0.57011646", "0.5698498", "0.5696273", "0.56942916", "0.5690654", "0.5689482", "0.5686221", "0.5677368", "0.56759644", "0.56679684", "0.566578", "0.5661397", "0.5653983", "0.56528634", "0.56514883", "0.5648496", "0.56475705", "0.5647258", "0.56471026", "0.56448233", "0.56415963", "0.563869", "0.56304085", "0.5627948", "0.56270367", "0.5621066", "0.561556", "0.56120276", "0.5610659", "0.5610594", "0.56104326" ]
0.7063793
1